LLM output
This module defines data models that are standardized across different LLM providers.FinishReasonType module-attribute
LLMCompletion
Bases:BaseModel
A single completion from an LLM.
Attributes:
docent/_llm_util/data_models/llm_output.py
docent/_llm_util/data_models/llm_output.py
no_text property
LLMOutput dataclass
Container for LLM output, potentially with multiple completions.
Aggregates completions from an LLM along with metadata and error information.
Attributes:
docent/_llm_util/data_models/llm_output.py
docent/_llm_util/data_models/llm_output.py
non_empty property
first property
first_text property
did_error property
ToolCallPartial dataclass
Partial representation of a tool call before full processing.
Used as an intermediate format before finalizing into a complete ToolCall.
Parameters:
docent/_llm_util/data_models/llm_output.py
docent/_llm_util/data_models/llm_output.py
LLMCompletionPartial
Bases:LLMCompletion
Partial representation of an LLM completion before finalization.
Extends LLMCompletion but with tool_calls being a list of ToolCallPartial.
This is used during the processing stage before tool calls are fully parsed.
Attributes:
docent/_llm_util/data_models/llm_output.py
docent/_llm_util/data_models/llm_output.py
no_text property
LLMOutputPartial dataclass
Bases: LLMOutput
Partial representation of LLM output before finalization.
Extends LLMOutput but with completions being a list of LLMCompletionPartial.
Used as an intermediate format during processing.
Attributes:
docent/_llm_util/data_models/llm_output.py
docent/_llm_util/data_models/llm_output.py
non_empty property
first property
first_text property
did_error property
AsyncLLMOutputStreamingCallback
Bases:Protocol
Protocol for asynchronous streaming callbacks with batch index.
Defines the expected signature for callbacks that handle streaming output
with a batch index.
Parameters:
docent/_llm_util/data_models/llm_output.py
docent/_llm_util/data_models/llm_output.py
AsyncSingleLLMOutputStreamingCallback
Bases:Protocol
Protocol for asynchronous streaming callbacks without batch indexing.
Defines the expected signature for callbacks that handle streaming output
without batch indexing.
Parameters:
docent/_llm_util/data_models/llm_output.py
docent/_llm_util/data_models/llm_output.py
AsyncEmbeddingStreamingCallback
Bases:Protocol
Protocol for sending progress updates for embedding generation.
docent/_llm_util/data_models/llm_output.py
docent/_llm_util/data_models/llm_output.py
finalize_llm_output_partial
Returns:
Raises:
docent/_llm_util/data_models/llm_output.py
docent/_llm_util/data_models/llm_output.py

