(feat) add cost tracking stable diffusion 3 on Bedrock (#6676)

* add cost tracking for sd3

* test_image_generation_bedrock

* fix get model info for image cost

* add cost_calculator for stability 1 models

* add unit testing for bedrock image cost calc

* test_cost_calculator_with_no_optional_params

* add test_cost_calculator_basic

* correctly allow size Optional

* fix cost_calculator

* sd3 unit tests cost calc
This commit is contained in:
Ishaan Jaff 2024-11-11 20:21:44 -08:00 committed by GitHub
parent e5051a93a8
commit 25bae4cc23
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 146 additions and 8 deletions

View file

@ -253,6 +253,9 @@ def test_image_generation_bedrock(model):
)
print(f"response: {response}")
print("response hidden params", response._hidden_params)
assert response._hidden_params["response_cost"] is not None
from openai.types.images_response import ImagesResponse
ImagesResponse.model_validate(response.model_dump())