From 3ec652cd0ad12dd17a18464ace7507a6fa6ca560 Mon Sep 17 00:00:00 2001 From: Gregory Horvath Date: Mon, 29 Apr 2024 17:25:29 -0400 Subject: [PATCH] fixing Usage convention --- src/leapfrogai_api/backend/types.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/leapfrogai_api/backend/types.py b/src/leapfrogai_api/backend/types.py index ebf2a32d8..7b35239b4 100644 --- a/src/leapfrogai_api/backend/types.py +++ b/src/leapfrogai_api/backend/types.py @@ -11,6 +11,8 @@ class Usage(BaseModel): + """Usage object.""" + prompt_tokens: int completion_tokens: int | None = None total_tokens: int @@ -22,7 +24,7 @@ class Usage(BaseModel): class ModelResponseModel(BaseModel): - """Model object for model response.""" + """Response object for models.""" id: str object: str = "model" @@ -69,7 +71,7 @@ class CompletionResponse(BaseModel): created: int = 0 model: str = "" choices: list[CompletionChoice] - usage: Usage + usage: Usage | None = None ##########