Skip to content

Commit

Permalink
CompletionResponse docs on fields (run-llama#8120)
Browse files Browse the repository at this point in the history
* Documented Fields in CompletionResponse

* Documented text and additional_kwargs
  • Loading branch information
jamesbraza authored Oct 13, 2023
1 parent 50530df commit 92967b7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion llama_index/llms/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,17 @@ def __str__(self) -> str:

# ===== Generic Model Output - Completion =====
class CompletionResponse(BaseModel):
"""Completion response."""
"""
Completion response.
Fields:
text: Text content of the response if not streaming, or if streaming,
the current extent of streamed text.
additional_kwargs: Additional information on the response(i.e. token
counts, function calling information).
raw: Optional raw JSON that was parsed to populate text, if relevant.
delta: New text that just streamed in (only relevant when streaming).
"""

text: str
additional_kwargs: dict = Field(default_factory=dict)
Expand Down

0 comments on commit 92967b7

Please sign in to comment.