mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-29 02:21:04 +00:00
fix(mypy): sync route_type Literals, fix BFL params and signatures
Task 1: Sync route_type Literal definitions in common_request_processing.py - Make base_process_llm_request and common_processing_pre_call_logic Literals identical - Add missing vector store CRUD route types to base_process_llm_request - Fix data dict type annotation in vector_store_endpoints/endpoints.py Task 2: Add BFL provider-specific params to OpenAIImageGenerationOptionalParams - Add seed, safety_tolerance, prompt_upsampling, raw, num_images, image_url, image_prompt_strength, aspect_ratio Task 3: Fix BFL override signatures to match base class - image_generation: Replace **kwargs with explicit params - image_edit: Make prompt and image Optional to match superclass Co-authored-by: yuneng-jiang <yuneng-jiang@users.noreply.github.com>
This commit is contained in:
co-authored by
yuneng-jiang
parent
976f1a0115
commit
a0f1c8a18a
@@ -230,8 +230,8 @@ class BlackForestLabsImageEditConfig(BaseImageEditConfig):
|
||||
def transform_image_edit_request(
|
||||
self,
|
||||
model: str,
|
||||
prompt: str,
|
||||
image: FileTypes,
|
||||
prompt: Optional[str],
|
||||
image: Optional[FileTypes],
|
||||
image_edit_optional_request_params: Dict,
|
||||
litellm_params: GenericLiteLLMParams,
|
||||
headers: dict,
|
||||
|
||||
@@ -259,7 +259,12 @@ class BlackForestLabsImageGenerationConfig(BaseImageGenerationConfig):
|
||||
raw_response: httpx.Response,
|
||||
model_response: ImageResponse,
|
||||
logging_obj: LiteLLMLoggingObj,
|
||||
**kwargs,
|
||||
request_data: dict,
|
||||
optional_params: dict,
|
||||
litellm_params: dict,
|
||||
encoding: Any,
|
||||
api_key: Optional[str] = None,
|
||||
json_mode: Optional[bool] = None,
|
||||
) -> ImageResponse:
|
||||
"""
|
||||
Transform Black Forest Labs response to OpenAI-compatible ImageResponse.
|
||||
|
||||
@@ -530,6 +530,8 @@ class ProxyBaseLLMRequestProcessing:
|
||||
"aresponses",
|
||||
"_arealtime",
|
||||
"_aresponses_websocket",
|
||||
"acreate_realtime_client_secret",
|
||||
"arealtime_calls",
|
||||
"aget_responses",
|
||||
"adelete_responses",
|
||||
"acancel_responses",
|
||||
@@ -553,6 +555,10 @@ class ProxyBaseLLMRequestProcessing:
|
||||
"allm_passthrough_route",
|
||||
"avector_store_search",
|
||||
"avector_store_create",
|
||||
"avector_store_retrieve",
|
||||
"avector_store_list",
|
||||
"avector_store_update",
|
||||
"avector_store_delete",
|
||||
"avector_store_file_create",
|
||||
"avector_store_file_list",
|
||||
"avector_store_file_retrieve",
|
||||
@@ -774,20 +780,36 @@ class ProxyBaseLLMRequestProcessing:
|
||||
"aembedding",
|
||||
"aresponses",
|
||||
"_arealtime",
|
||||
"_aresponses_websocket",
|
||||
"acreate_realtime_client_secret",
|
||||
"arealtime_calls",
|
||||
"aget_responses",
|
||||
"adelete_responses",
|
||||
"acancel_responses",
|
||||
"acompact_responses",
|
||||
"acreate_batch",
|
||||
"aretrieve_batch",
|
||||
"alist_batches",
|
||||
"acancel_batch",
|
||||
"afile_content",
|
||||
"afile_retrieve",
|
||||
"afile_delete",
|
||||
"atext_completion",
|
||||
"aimage_edit",
|
||||
"acreate_fine_tuning_job",
|
||||
"acancel_fine_tuning_job",
|
||||
"alist_fine_tuning_jobs",
|
||||
"aretrieve_fine_tuning_job",
|
||||
"alist_input_items",
|
||||
"aimage_edit",
|
||||
"agenerate_content",
|
||||
"agenerate_content_stream",
|
||||
"allm_passthrough_route",
|
||||
"avector_store_search",
|
||||
"avector_store_create",
|
||||
"avector_store_retrieve",
|
||||
"avector_store_list",
|
||||
"avector_store_update",
|
||||
"avector_store_delete",
|
||||
"avector_store_file_create",
|
||||
"avector_store_file_list",
|
||||
"avector_store_file_retrieve",
|
||||
@@ -815,8 +837,8 @@ class ProxyBaseLLMRequestProcessing:
|
||||
"aget_interaction",
|
||||
"adelete_interaction",
|
||||
"acancel_interaction",
|
||||
"acancel_batch",
|
||||
"afile_delete",
|
||||
"asend_message",
|
||||
"call_mcp_tool",
|
||||
"acreate_eval",
|
||||
"alist_evals",
|
||||
"aget_eval",
|
||||
|
||||
@@ -386,7 +386,7 @@ async def vector_store_list(
|
||||
version,
|
||||
)
|
||||
|
||||
data = {}
|
||||
data: dict = {}
|
||||
if after is not None:
|
||||
data["after"] = after
|
||||
if before is not None:
|
||||
|
||||
@@ -1052,6 +1052,14 @@ OpenAIImageGenerationOptionalParams = Literal[
|
||||
"size",
|
||||
"style",
|
||||
"user",
|
||||
"seed",
|
||||
"safety_tolerance",
|
||||
"prompt_upsampling",
|
||||
"raw",
|
||||
"num_images",
|
||||
"image_url",
|
||||
"image_prompt_strength",
|
||||
"aspect_ratio",
|
||||
]
|
||||
|
||||
OpenAIImageEditOptionalParams = Literal[
|
||||
|
||||
Reference in New Issue
Block a user