Skip to content

feat(sdk): type reasoning token usage - #42

Open
KillerQueen-Z wants to merge 1 commit into
BlockRunAI:mainfrom
KillerQueen-Z:feat/reasoning-token-usage
Open

feat(sdk): type reasoning token usage#42
KillerQueen-Z wants to merge 1 commit into
BlockRunAI:mainfrom
KillerQueen-Z:feat/reasoning-token-usage

Conversation

@KillerQueen-Z

Copy link
Copy Markdown
Contributor

What changed

  • Add typed prompt_tokens_details and completion_tokens_details fields to ChatUsage.
  • Expose a convenience reasoning_tokens property.
  • Document that reasoning tokens are already included in completion/output totals.
  • Add unit coverage for populated and absent reasoning breakdowns.

Why

The SDK previously preserved these fields only as untyped Pydantic extras, which made downstream integrations fragile and easy to drop.

Validation

  • 2 SDK unit tests passed.
  • Python bytecode compilation passed.
  • git diff --check passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant