Skip to content

chore(pydantic_ai): pin compatible genai-prices - #636

Merged
Abhijeet Prasad (AbhiPrasad) merged 1 commit into
mainfrom
abhi-fix-pin-pydantic-ai-genai-prices
Jul 30, 2026
Merged

chore(pydantic_ai): pin compatible genai-prices#636
Abhijeet Prasad (AbhiPrasad) merged 1 commit into
mainfrom
abhi-fix-pin-pydantic-ai-genai-prices

Conversation

@AbhiPrasad

Copy link
Copy Markdown
Member

Summary

  • pin genai-prices==0.0.73 in the compatibility constraints for older Pydantic AI versions
  • prevent genai-prices 0.1's expanded usage fields from causing Pydantic AI 1.x to silently return zero token usage
  • refresh py/uv.lock with the compatible release

genai-prices==0.1.0 introduced fields such as output_reasoning_tokens. Pydantic AI 1.10's RequestUsage cannot accept those fields, catches the resulting TypeError, and returns empty usage. This caused test_pydantic_ai_integration(1.10.0) to fail across the CI OS/Python matrix.

Test plan

  • cd py && nox -s "test_pydantic_ai_integration(1.10.0)"
  • cd py && nox -s "test_pydantic_ai_wrap_openai(1.0.1)"
  • cd py && nox -s "test_pydantic_ai_wrap_openai(0.1.9)"
  • mise exec -- pre-commit run --files py/pyproject.toml py/uv.lock

Constrain older Pydantic AI test environments to genai-prices 0.0.73. Version 0.1 emits expanded usage fields that Pydantic AI 1.x cannot deserialize, causing token metrics to fall back to zero.
@AbhiPrasad Abhijeet Prasad (AbhiPrasad) changed the title fix(pydantic_ai): pin compatible genai-prices chore(pydantic_ai): pin compatible genai-prices Jul 30, 2026
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) merged commit fa219f7 into main Jul 30, 2026
82 checks passed
@AbhiPrasad
Abhijeet Prasad (AbhiPrasad) deleted the abhi-fix-pin-pydantic-ai-genai-prices branch July 30, 2026 14:53
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