mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-27 11:43:54 +00:00
fix(proxy/utils.py): prisma client fix get data to handle list return
This commit is contained in:
parent
9849513081
commit
1365e9d3ae
1 changed files with 8 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
||||||
from typing import Optional, List, Any, Literal, Union
|
from typing import Optional, List, Any, Literal, Union
|
||||||
import os, subprocess, hashlib, importlib, asyncio, copy, json, aiohttp, httpx
|
import os, subprocess, hashlib, importlib, asyncio, copy, json, aiohttp, httpx
|
||||||
import litellm, backoff
|
import litellm, backoff
|
||||||
from litellm.proxy._types import UserAPIKeyAuth, DynamoDBArgs
|
from litellm.proxy._types import UserAPIKeyAuth, DynamoDBArgs, LiteLLM_VerificationToken
|
||||||
from litellm.caching import DualCache
|
from litellm.caching import DualCache
|
||||||
from litellm.proxy.hooks.parallel_request_limiter import MaxParallelRequestsHandler
|
from litellm.proxy.hooks.parallel_request_limiter import MaxParallelRequestsHandler
|
||||||
from litellm.proxy.hooks.max_budget_limiter import MaxBudgetLimiter
|
from litellm.proxy.hooks.max_budget_limiter import MaxBudgetLimiter
|
||||||
|
@ -376,10 +376,13 @@ class PrismaClient:
|
||||||
)
|
)
|
||||||
print_verbose(f"PrismaClient: response={response}")
|
print_verbose(f"PrismaClient: response={response}")
|
||||||
if response is not None:
|
if response is not None:
|
||||||
# for prisma we need to cast the expires time to str
|
if isinstance(response, LiteLLM_VerificationToken):
|
||||||
if isinstance(response.expires, datetime):
|
# for prisma we need to cast the expires time to str
|
||||||
response.expires = response.expires.isoformat()
|
if isinstance(response.expires, datetime):
|
||||||
return response
|
response.expires = response.expires.isoformat()
|
||||||
|
return response
|
||||||
|
else:
|
||||||
|
return response
|
||||||
else:
|
else:
|
||||||
# Token does not exist.
|
# Token does not exist.
|
||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue