fix(proxy_server.py): add logging around /key/generate

This commit is contained in:
Krrish Dholakia 2023-12-09 10:25:30 -08:00
parent c8eca35015
commit c482c399ff
2 changed files with 4 additions and 2 deletions

View file

@ -1128,7 +1128,9 @@ async def generate_key_fn(request: Request, data: GenerateKeyRequest, Authorizat
- user_id: (str) Unique user id - used for tracking spend across multiple keys for same user id.
"""
# data = await request.json()
data_json = data.model_dump() # type: ignore
print(f"type of object: {type(data)}")
data_json = json.loads(data.model_dump_json()) # type: ignore
print(f"data_json: {data_json}")
response = await generate_key_helper_fn(**data_json)
return GenerateKeyResponse(key=response["token"], expires=response["expires"], user_id=response["user_id"])