forked from phoenix/litellm-mirror
fix(litellm_pre_call_utils.py): handle no query params in request
This commit is contained in:
parent
1170b3a510
commit
a85a932e25
2 changed files with 8 additions and 4 deletions
|
@ -171,10 +171,12 @@ async def add_litellm_data_to_request(
|
|||
}
|
||||
|
||||
## Dynamic api version (Azure OpenAI endpoints) ##
|
||||
query_params = request.query_params
|
||||
|
||||
# Convert query parameters to a dictionary (optional)
|
||||
query_dict = dict(query_params)
|
||||
try:
|
||||
query_params = request.query_params
|
||||
# Convert query parameters to a dictionary (optional)
|
||||
query_dict = dict(query_params)
|
||||
except KeyError:
|
||||
query_dict = {}
|
||||
|
||||
## check for api version in query params
|
||||
dynamic_api_version: Optional[str] = query_dict.get("api-version")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue