From 4a66f17467840ba4f3e8105423b78ac89fff986b Mon Sep 17 00:00:00 2001 From: James Braza Date: Tue, 12 Mar 2024 17:38:50 -0700 Subject: [PATCH] Documented LLMResult fields --- paperqa/types.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/paperqa/types.py b/paperqa/types.py index fd203589f..d0255acac 100644 --- a/paperqa/types.py +++ b/paperqa/types.py @@ -34,14 +34,21 @@ class LLMResult(BaseModel): id: UUID = Field(default_factory=uuid4) answer_id: UUID | None = None name: str | None = None - prompt: str | list[dict] | None = None + prompt: str | list[dict] | None = Field( + default=None, + description="Optional prompt (str) or list of serialized prompts (list[dict]).", + ) text: str = "" prompt_count: int = 0 completion_count: int = 0 model: str date: str - seconds_to_first_token: float = 0 - seconds_to_last_token: float = 0 + seconds_to_first_token: float = Field( + default=0.0, description="Delta time (sec) to first response token's arrival." + ) + seconds_to_last_token: float = Field( + default=0.0, description="Delta time (sec) to last response token's arrival." + ) def __str__(self): return self.text