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

def base_url(self) -> str:
assert self._url is not None, 'URL not initialized' # pragma: no cover
return self._url # pragma: no cover
assert self._url is not None, 'URL not initialized'
Copy link
Author

Choose a reason for hiding this comment

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

[note]
This change now calls this property to retrieve provider_url, so it's now covered by tests.
Removing # pragma: no cover.

@mahiro72 mahiro72 marked this pull request as ready for review December 7, 2025 16:32
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()

1 participant