Skip to content

Conversation

@mahiro72
Copy link

@mahiro72 mahiro72 commented Dec 5, 2025

Summary

  • Add provider_url field to ModelResponse to store the provider's API endpoint URL
  • Pass provider_url to calc_price() as provider_api_url for more accurate pricing calculations
  • Add provider_url abstract property to StreamedResponse and implement it in all subclasses

Closes #3608

@mahiro72 mahiro72 marked this pull request as ready for review December 7, 2025 16:32
@DouweM DouweM requested a review from alexmojaki December 9, 2025 22:06
usage=IsInstance(RequestUsage),
model_name='gemini-2.0-flash',
timestamp=IsDatetime(),
provider_url=IsStr(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why IsStr?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, IsStr() was too permissive since the URL is deterministic. I've replaced it with the concrete URL in the following commit.
fix: replace IsStr with actual provider_url

@mahiro72 mahiro72 requested a review from alexmojaki December 11, 2025 10:34
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.

Add provider_url to ModelResponse and use it in cost()

2 participants