mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 03:04:13 +00:00
v0 use token_in /key_generate
This commit is contained in:
parent
afd81f1609
commit
15685a8f53
2 changed files with 5 additions and 1 deletions
|
@ -306,6 +306,7 @@ class GenerateKeyResponse(GenerateKeyRequest):
|
|||
key_name: Optional[str] = None
|
||||
expires: Optional[datetime]
|
||||
user_id: Optional[str] = None
|
||||
token_id: Optional[str] = None
|
||||
|
||||
@root_validator(pre=True)
|
||||
def set_model_info(cls, values):
|
||||
|
|
|
@ -2563,7 +2563,10 @@ async def generate_key_helper_fn(
|
|||
|
||||
## CREATE KEY
|
||||
verbose_proxy_logger.debug("prisma_client: Creating Key= %s", key_data)
|
||||
await prisma_client.insert_data(data=key_data, table_name="key")
|
||||
create_key_response = await prisma_client.insert_data(
|
||||
data=key_data, table_name="key"
|
||||
)
|
||||
key_data["token_id"] = create_key_response.token
|
||||
elif custom_db_client is not None:
|
||||
if table_name is None or table_name == "user":
|
||||
## CREATE USER (If necessary)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue