Skip to content

Commit

Permalink
Documented LLMResult fields
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesbraza committed Mar 13, 2024
1 parent 6613386 commit 4a66f17
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions paperqa/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4a66f17

Please sign in to comment.