Skip to content

Qwen3-coder usage Error caused by non numeric data in the return value #2632

@tianshangwuyun

Description

@tianshangwuyun

Initial Checks

Description

my current version v0.4.4

I checked the latest version of the usage code and it also makes mistakes

Qwen3-coder "usage":{"completion_tokens":66,"prompt_tokens":22,"total_tokens":88,"completion_tokens_details":null,"prompt_tokens_details":{"audio_tokens":null,"cached_tokens":0,"cache_type":"implicit"}}

"cache_type":"implicit" Causing errors Usage.py incr function

this line

for key, value in incr_usage.details.items():
              self.details[key] = self.details.get(key, 0) + value

Example Code

Python, Pydantic AI & LLM client version

my current version v0.4.4 
I checked the latest version of the usage code and it also makes mistakes

model Qwen3-coder
LLM client openai

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions