mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-03 02:22:24 +00:00
fix(proxy): correct stale image_generation route label, drop inert type:ignore
ROUTE_ENDPOINT_MAPPING has mapped aimage_generation to the singular /image/generations since 2024, but every registered route is plural (/v1/images/generations, /images/generations, .../images/generations). The new missing-prompt guard surfaced this stale label for the first time, so correct it to /images/generations. Also drop two # type: ignore[override] comments added in the new image_generation regression test: basedpyright's enableTypeIgnoreComments is false here, so they suppressed nothing.
This commit is contained in:
parent
00fc80b704
commit
590142afa6
3 changed files with 5 additions and 5 deletions
|
|
@ -77,7 +77,7 @@ ROUTE_ENDPOINT_MAPPING: Final = {
|
|||
"acompletion": "/chat/completions",
|
||||
"atext_completion": "/completions",
|
||||
"aembedding": "/embeddings",
|
||||
"aimage_generation": "/image/generations",
|
||||
"aimage_generation": "/images/generations",
|
||||
"aspeech": "/audio/speech",
|
||||
"atranscription": "/audio/transcriptions",
|
||||
"amoderation": "/moderations",
|
||||
|
|
|
|||
|
|
@ -129,14 +129,14 @@ async def test_image_generation__missing_required_param_is_400(monkeypatch):
|
|||
async def fake_add_litellm_data_to_request(**kwargs):
|
||||
return kwargs["data"]
|
||||
|
||||
async def fake_pre_call_hook(*, user_api_key_dict, data, call_type): # type: ignore[override]
|
||||
async def fake_pre_call_hook(*, user_api_key_dict, data, call_type):
|
||||
return data
|
||||
|
||||
async def fake_post_call_failure_hook(**_: Any) -> None:
|
||||
return None
|
||||
|
||||
async def fake_route_request(*, data, **kwargs): # type: ignore[override]
|
||||
raise ProxyMissingRequiredParamError(route="/image/generations", param="prompt")
|
||||
async def fake_route_request(*, data, **kwargs):
|
||||
raise ProxyMissingRequiredParamError(route="/images/generations", param="prompt")
|
||||
|
||||
fake_proxy_logger = SimpleNamespace(
|
||||
pre_call_hook=fake_pre_call_hook,
|
||||
|
|
|
|||
|
|
@ -1048,7 +1048,7 @@ async def test_route_request_override_enable_tag_filtering_beats_body_value():
|
|||
("acreate_batch", "input_file_id", "/batches"),
|
||||
("aspeech", "input", "/audio/speech"),
|
||||
("amoderation", "input", "/moderations"),
|
||||
("aimage_generation", "prompt", "/image/generations"),
|
||||
("aimage_generation", "prompt", "/images/generations"),
|
||||
],
|
||||
)
|
||||
@pytest.mark.parametrize(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue