mirror of
https://github.com/tiennm99/litellm.git
synced 2026-08-07 16:21:45 +00:00
fix(proxy): change check_file_size_under_limit to accept Collection[str]
Fixes mypy type error where router_model_names (a set) was incompatible with List[str] parameter type. Changed check_file_size_under_limit to accept Collection[str] instead of List[str] since the parameter is only used for membership checks, making it more flexible and avoiding unnecessary type conversions. Resolves: proxy/proxy_server.py:5107 arg-type error
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import json
|
||||
import re
|
||||
from typing import Any, Dict, List, Optional
|
||||
from typing import Any, Collection, Dict, List, Optional
|
||||
|
||||
import orjson
|
||||
from fastapi import Request, UploadFile, status
|
||||
@@ -149,7 +149,7 @@ def _safe_get_request_headers(request: Optional[Request]) -> dict:
|
||||
def check_file_size_under_limit(
|
||||
request_data: dict,
|
||||
file: UploadFile,
|
||||
router_model_names: List[str],
|
||||
router_model_names: Collection[str],
|
||||
) -> bool:
|
||||
"""
|
||||
Check if any files passed in request are under max_file_size_mb
|
||||
|
||||
Reference in New Issue
Block a user