mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-25 10:44:24 +00:00
feat(proxy_server.py): new /user/export endpoint
This commit is contained in:
parent
f4c5c56638
commit
a739b03e8b
2 changed files with 59 additions and 6 deletions
|
@ -386,12 +386,21 @@ class PrismaClient:
|
|||
status_code=status.HTTP_401_UNAUTHORIZED,
|
||||
detail="Authentication Error: invalid user key - token does not exist",
|
||||
)
|
||||
elif user_id is not None:
|
||||
response = await self.db.litellm_usertable.find_unique( # type: ignore
|
||||
where={
|
||||
"user_id": user_id,
|
||||
}
|
||||
)
|
||||
elif user_id is not None or (
|
||||
table_name is not None and table_name == "user"
|
||||
):
|
||||
if user_id is not None and query_type == "find_unique":
|
||||
response = await self.db.litellm_usertable.find_unique( # type: ignore
|
||||
where={
|
||||
"user_id": user_id,
|
||||
}
|
||||
)
|
||||
elif query_type == "find_all" and user_id is not None:
|
||||
response = await self.db.litellm_usertable.find_many(
|
||||
where={"user_id": user_id}
|
||||
)
|
||||
elif query_type == "find_all":
|
||||
response = await self.db.litellm_usertable.find_many()
|
||||
return response
|
||||
except Exception as e:
|
||||
print_verbose(f"LiteLLM Prisma Client Exception: {e}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue