Commit Graph

3 Commits

Author SHA1 Message Date
ccurme
fbfed65fb1
core, partners: add token usage attribute to AIMessage (#21944)
```python
class UsageMetadata(TypedDict):
    """Usage metadata for a message, such as token counts.

    Attributes:
        input_tokens: (int) count of input (or prompt) tokens
        output_tokens: (int) count of output (or completion) tokens
        total_tokens: (int) total token count
    """

    input_tokens: int
    output_tokens: int
    total_tokens: int
```
```python
class AIMessage(BaseMessage):
    ...
    usage_metadata: Optional[UsageMetadata] = None
    """If provided, token usage information associated with the message."""
    ...
```
2024-05-23 14:21:58 -04:00
ccurme
9ec7151317
fireworks: fix integration tests (#20973) 2024-04-27 19:49:46 +00:00
Erick Friis
e6806a08d4
multiple: standard chat model tests (#20359) 2024-04-11 18:23:13 -07:00