Solver Outputs
GroupedSolverOutput
Properties
solver_outputs array[SingleSolverOutput], object required
Solver Outputs
GroupedSolverTrace
Grouped solver output using Open Responses types.
Produced when GroupedSingleTurnSolver runs with message_format="open_responses". Each element of solver_outputs corresponds to one sub-call made during solving.
Properties
solver_outputs array[SolverTrace], object required
Solver Outputs
ModelResponse
A useful container for a model response that contains the raw model output as well as the trace items derived from that model output.
Properties
raw_output OpenResponsesModelOutput, RAGCompletionOutput, ChatCompletionModelOutput, EmbeddingsModelOutput, Any required
Raw Output
items array[Message, FunctionCall, FunctionCallOutput, CustomTaskInputMessage, CustomTaskOutputMessage] required
Items
Computed Properties
text str
Text content of the last assistant message.
Raises: ValueError: If no assistant message is present in items.
SingleSolverOutput
Properties
messages array[ChatCompletionInputMessage, Any, array[string], ChatCompletionOutputMessage, array[array[number]]] required
Messages
output OpenResponsesModelOutput, RAGCompletionOutput, ChatCompletionModelOutput, EmbeddingsModelOutput, Any required
Output
direct_ios array[DirectModelIO]
Direct Ios
Default: []
Methods
from_input_and_output classmethod
from_input_and_output(model_input: LFModelInput, model_output: LFModelOutput, direct_model_input: ModelEndpointInput | None = None, direct_model_output: ModelEndpointOutput | None = None) -> SingleSolverOutputSolverTrace
Solver output using Open Responses types with structured trace.
Produced when the solver’s message_format is "open_responses". Wraps a full :class:Trace and preserves the raw model outputs for each model.predict() call made during solving.
Properties
trace Trace required
raw_outputs array[OpenResponsesModelOutput, RAGCompletionOutput, ChatCompletionModelOutput, EmbeddingsModelOutput, Any] required
Raw Outputs
direct_ios array[DirectModelIO]
Direct Ios
Default: []
Computed Properties
items list[TraceItem]
Shorthand for self.trace.items.
messages list[LFMessage]
Legacy SingleSolverOutput-style view of the trace as LFMessages.
output LFModelOutput | None
Legacy SingleSolverOutput-style view of the last raw output.
Methods
add_model_response method
add_model_response(response: ModelResponse) -> NoneRecord a model response: extend the trace items and append the raw output.
append method
append(item: TraceItem) -> NoneAppend a single item to the trace.
append_custom_task_input_message method
append_custom_task_input_message(content: Any) -> NoneAppend a custom task input item with an opaque payload.
append_system_message method
append_system_message(content: str) -> NoneAppend a system message with plain text content.
append_user_message method
append_user_message(content: str) -> NoneAppend a user message with plain text content.
extend method
extend(items: list[TraceItem]) -> NoneExtend the trace with a list of items.