| GenerateResult | R Documentation |
Result object returned by model generation.
This class uses lock_objects = FALSE to allow dynamic field addition.
This enables the ReAct loop and other components to attach additional
metadata (like steps, all_tool_calls) without modifying the class.
For models that support reasoning/thinking (like OpenAI o1/o3, DeepSeek, Claude with extended thinking),
the reasoning field contains the model's chain-of-thought content.
For Responses API models, response_id contains the server-side response ID
which can be used for multi-turn conversations without sending full history.
textThe generated text content.
usageToken usage information.
finish_reasonReason the model stopped generating.
warningsAny warnings from the model.
raw_responseThe raw response from the provider API.
tool_callsList of tool calls requested by the model.
stepsNumber of ReAct loop steps taken.
all_tool_callsAccumulated list of all tool calls across steps.
reasoningOptional chain-of-thought or reasoning content.
response_idServer-side response ID for Responses-style APIs.
new()Initialize a GenerateResult object.
GenerateResult$new( text = NULL, usage = NULL, finish_reason = NULL, warnings = NULL, raw_response = NULL, tool_calls = NULL, steps = NULL, all_tool_calls = NULL, reasoning = NULL, response_id = NULL )
textGenerated text.
usageToken usage.
finish_reasonReason for stopping.
warningsWarnings.
raw_responseRaw API response.
tool_callsTool calls requested by the model.
stepsNumber of ReAct steps taken.
all_tool_callsAll tool calls across steps.
reasoningChain-of-thought content.
response_idServer-side response ID for Responses-style APIs.
print()Print method for GenerateResult.
GenerateResult$print()
clone()The objects of this class are cloneable with this method.
GenerateResult$clone(deep = FALSE)
deepWhether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.