mirror of
https://github.com/tiennm99/litellm.git
synced 2026-07-11 13:04:17 +00:00
Merge pull request #18239 from BerriAI/litellm_fix_sdk_import_error
fix:No module named 'fastapi'
This commit is contained in:
@@ -2,13 +2,13 @@ import base64
|
||||
import mimetypes
|
||||
import re
|
||||
from dataclasses import dataclass, field
|
||||
from typing import List, Literal, Optional, Union
|
||||
from typing import TYPE_CHECKING, List, Literal, Optional, Union
|
||||
|
||||
from fastapi import Request
|
||||
|
||||
from litellm.proxy.common_utils.http_parsing_utils import _read_request_body
|
||||
from litellm.types.utils import SpecialEnums
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from fastapi import Request
|
||||
|
||||
|
||||
def _is_base64_encoded_unified_file_id(b64_uid: str) -> Union[str, Literal[False]]:
|
||||
# Ensure b64_uid is a string and not a mock object
|
||||
@@ -554,7 +554,7 @@ class FileCreationParams:
|
||||
|
||||
|
||||
async def extract_file_creation_params(
|
||||
request: Request,
|
||||
request: "Request",
|
||||
request_body: Optional[dict] = None,
|
||||
target_model_names_form: Optional[str] = None,
|
||||
target_storage_form: Optional[str] = None,
|
||||
@@ -571,6 +571,8 @@ async def extract_file_creation_params(
|
||||
Returns:
|
||||
FileCreationParams: Structured parameters extracted from the request
|
||||
"""
|
||||
from litellm.proxy.common_utils.http_parsing_utils import _read_request_body
|
||||
|
||||
if request_body is None:
|
||||
request_body = await _read_request_body(request=request) or {}
|
||||
|
||||
@@ -621,7 +623,7 @@ def _extract_target_model_names_simple(target_model_names_form: Optional[str] =
|
||||
return []
|
||||
|
||||
|
||||
def _extract_model_param(request: Request, request_body: dict) -> Optional[str]:
|
||||
def _extract_model_param(request: "Request", request_body: dict) -> Optional[str]:
|
||||
"""
|
||||
Extract model parameter from request.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user