mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-15 23:31:29 +00:00
fix(together_ai): pass legacy standard image params through verbatim
This commit is contained in:
parent
08d36eb6ed
commit
ea64cd5d15
2 changed files with 12 additions and 2 deletions
|
|
@ -29,7 +29,7 @@ else:
|
|||
|
||||
class TogetherAIImageGenerationConfig(BaseImageGenerationConfig):
|
||||
def get_supported_openai_params(self, model: str) -> list[OpenAIImageGenerationOptionalParams]:
|
||||
return ["n", "size", "response_format"]
|
||||
return ["n", "size", "response_format", "quality", "style", "user"]
|
||||
|
||||
def map_openai_params(
|
||||
self,
|
||||
|
|
|
|||
|
|
@ -1,4 +1,3 @@
|
|||
import json
|
||||
from typing import Optional
|
||||
|
||||
import httpx
|
||||
|
|
@ -68,6 +67,17 @@ def test_map_openai_params_maps_size_to_width_height():
|
|||
assert mapped == {"width": 1792, "height": 1024, "n": 2}
|
||||
|
||||
|
||||
def test_map_openai_params_passes_unmapped_supported_params_verbatim():
|
||||
config = TogetherAIImageGenerationConfig()
|
||||
mapped = config.map_openai_params(
|
||||
non_default_params={"quality": "hd", "style": "vivid", "user": "user-123"},
|
||||
optional_params={},
|
||||
model="black-forest-labs/FLUX.1-kontext-pro",
|
||||
drop_params=False,
|
||||
)
|
||||
assert mapped == {"quality": "hd", "style": "vivid", "user": "user-123"}
|
||||
|
||||
|
||||
def test_map_openai_params_maps_b64_json_response_format_to_base64():
|
||||
config = TogetherAIImageGenerationConfig()
|
||||
mapped = config.map_openai_params(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue