OutputTokenDetails Class — langchain Architecture
Architecture documentation for the OutputTokenDetails class in ai.py from the langchain codebase.
Entity Profile
Dependency Diagram
graph TD c45b823e_5666_dd14_af7c_06a06e294c89["OutputTokenDetails"] 49c04e35_a53c_8d1b_eb09_1203ad7cdacf["ai.py"] c45b823e_5666_dd14_af7c_06a06e294c89 -->|defined in| 49c04e35_a53c_8d1b_eb09_1203ad7cdacf
Relationship Graph
Source Code
libs/core/langchain_core/messages/ai.py lines 74–101
class OutputTokenDetails(TypedDict, total=False):
"""Breakdown of output token counts.
Does *not* need to sum to full output token count. Does *not* need to have all keys.
Example:
```python
{
"audio": 10,
"reasoning": 200,
}
```
May also hold extra provider-specific keys.
!!! version-added "Added in `langchain-core` 0.3.9"
"""
audio: int
"""Audio output tokens."""
reasoning: int
"""Reasoning output tokens.
Tokens generated by the model in a chain of thought process (i.e. by OpenAI's o1
models) that are not returned as part of model output.
"""
Defined In
Source
Frequently Asked Questions
What is the OutputTokenDetails class?
OutputTokenDetails is a class in the langchain codebase, defined in libs/core/langchain_core/messages/ai.py.
Where is OutputTokenDetails defined?
OutputTokenDetails is defined in libs/core/langchain_core/messages/ai.py at line 74.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free