-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
Description
Initial Checks
- I confirm that I'm using the latest version of Pydantic AI
- I confirm that I searched for my issue in https://github.com/pydantic/pydantic-ai/issues before opening this issue
Description
trying to generate a summary based on token count instead of number of messages. I can see the token count for each message but the ctx.usage.total_tokens is always 0.
> history.py(57)summary_processor()
(Pdb) p ctx.usage.total_tokens
0
(Pdb) p messages[1].usage
RequestUsage(input_tokens=24, output_tokens=11, details={'accepted_prediction_tokens': 0, 'audio_tokens': 0, 'reasoning_tokens': 0, 'rejected_prediction_tokens': 0})
Example Code
Python, Pydantic AI & LLM client version
pydantic-ai==1.0.10