Agents
Update Agent
Retrieve Agent
Export Agent
Import Agent
Recompile Agent
ModelsExpand Collapse
class AgentState: …
Representation of an agent’s state. This is the state of the agent at a given time, and is persisted in the DB backend. The state has all the information needed to recreate a persisted agent.
Deprecated: Use model field instead. The LLM configuration used by the agent.
model_endpoint_type: Literal["openai", "anthropic", "google_ai", 27 more]
The endpoint type for the model.
enable_reasoner: Optional[bool]
Whether or not the model should use extended thinking if it is a ‘reasoning’ style model
frequency_penalty: Optional[float]
Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model’s likelihood to repeat the same line verbatim. From OpenAI: Number between -2.0 and 2.0.
max_reasoning_tokens: Optional[int]
Configurable thinking budget for extended thinking. Used for enable_reasoner and also for Google Vertex models like Gemini 2.5 Flash. Minimum value is 1024 when used with enable_reasoner.
max_tokens: Optional[int]
The maximum number of tokens to generate. If not set, the model will use its default value.
Deprecatedparallel_tool_calls: Optional[bool]
Deprecated: Use model_settings to configure parallel tool calls instead. If set to True, enables parallel tool calling. Defaults to False.
put_inner_thoughts_in_kwargs: Optional[bool]
Puts ‘inner_thoughts’ as a kwarg in the function call if this is set to True. This helps with function calling performance and also the generation of inner thoughts.
response_format: Optional[ResponseFormat]
return_logprobs: Optional[bool]
Whether to return log probabilities of the output tokens. Useful for RL training.
return_token_ids: Optional[bool]
Whether to return token IDs for all LLM generations via SGLang native endpoint. Required for multi-turn RL training with loss masking. Only works with SGLang provider.
strict: Optional[bool]
Enable strict mode for tool calling. When true, tool schemas include strict: true and additionalProperties: false, guaranteeing tool outputs match JSON schemas.
temperature: Optional[float]
The temperature to use when generating text with the model. A higher temperature will result in more random text.
tool_call_parser: Optional[str]
SGLang tool call parser name (e.g. ‘glm47’, ‘qwen25’, ‘hermes’). Used by the SGLang native adapter to parse tool calls from raw model output.
Deprecatedmemory: Memory
Deprecated: Use blocks field instead. The in-context memory of the agent.
file_blocks: Optional[List[MemoryFileBlock]]
Deprecatedsources: List[Source]
The tools used by the agent.
default_requires_approval: Optional[bool]
Default value for whether or not executing this tool requires approval.
enable_parallel_execution: Optional[bool]
If set to True, then this tool will potentially be executed concurrently with other tools. Default False.
compaction_settings: Optional[CompactionSettings]
Configuration for conversation compaction / summarization.
Per-model settings (temperature, max tokens, etc.) are derived from the default configuration for that handle.
clip_chars: Optional[int]
The maximum length of the summary in characters. If none, no clipping is performed.
model: Optional[str]
Model handle to use for sliding_window/all summarization (format: provider/model-name). If None, uses lightweight provider-specific defaults.
model_settings: Optional[CompactionSettingsModelSettings]
Optional model settings used to override defaults for the summarizer model.
class OpenAIModelSettings: …
response_format: Optional[ResponseFormat]
class CompactionSettingsModelSettingsSgLangModelSettings: …
SGLang model configuration (OpenAI-compatible runtime with SGLang-specific parsing).
response_format: Optional[CompactionSettingsModelSettingsSgLangModelSettingsResponseFormat]
class AnthropicModelSettings: …
response_format: Optional[ResponseFormat]
strict: Optional[bool]
Enable strict mode for tool calling. When true, tool outputs are guaranteed to match JSON schemas.
class GoogleAIModelSettings: …
class GoogleVertexModelSettings: …
class AzureModelSettings: …
class XaiModelSettings: …
class CompactionSettingsModelSettingsMoonshotModelSettings: …
Moonshot/Kimi model configuration (OpenAI-compatible).
response_format: Optional[CompactionSettingsModelSettingsMoonshotModelSettingsResponseFormat]
class CompactionSettingsModelSettingsZaiModelSettings: …
Z.ai (ZhipuAI) model configuration (OpenAI-compatible).
class CompactionSettingsModelSettingsMoonshotCodingModelSettings: …
Kimi Code model configuration (Anthropic-compatible).
response_format: Optional[CompactionSettingsModelSettingsMoonshotCodingModelSettingsResponseFormat]
strict: Optional[bool]
Enable strict mode for tool calling. When true, tool outputs are guaranteed to match JSON schemas.
class GroqModelSettings: …
class DeepseekModelSettings: …
class TogetherModelSettings: …
class BedrockModelSettings: …
class CompactionSettingsModelSettingsBasetenModelSettings: …
Baseten model configuration (OpenAI-compatible).
class CompactionSettingsModelSettingsOpenRouterModelSettings: …
Deprecatedembedding_config: Optional[EmbeddingConfig]
enable_sleeptime: Optional[bool]
If set to True, memory management will move to a background agent thread.
identities: Optional[List[Identity]]
Deprecatedidentity_ids: Optional[List[str]]
Deprecated: Use identities field instead. The ids of the identities associated with this agent.
last_run_completion: Optional[datetime]
The timestamp when the agent last completed a run.
managed_group: Optional[ManagedGroup]
The multi-agent group that this agent manages
max_message_buffer_length: Optional[int]
The desired maximum length of messages in the context window of the convo agent. This is a best effort, and may be off slightly due to user/assistant interleaving.
max_files_open: Optional[int]
Maximum number of files that can be open at once for this agent. Setting this too high may exceed the context window, which will break the agent.
message_buffer_autoclear: Optional[bool]
If set to True, the agent will not remember previous messages (though the agent will still retain state via core memory blocks and archival/recall memory). Not recommended unless you have an advanced use case.
model_settings: Optional[ModelSettings]
The model settings used by the agent.
class OpenAIModelSettings: …
response_format: Optional[ResponseFormat]
class ModelSettingsSgLangModelSettings: …
SGLang model configuration (OpenAI-compatible runtime with SGLang-specific parsing).
response_format: Optional[ModelSettingsSgLangModelSettingsResponseFormat]
class AnthropicModelSettings: …
response_format: Optional[ResponseFormat]
strict: Optional[bool]
Enable strict mode for tool calling. When true, tool outputs are guaranteed to match JSON schemas.
class GoogleAIModelSettings: …
class GoogleVertexModelSettings: …
class AzureModelSettings: …
class XaiModelSettings: …
class ModelSettingsMoonshotModelSettings: …
Moonshot/Kimi model configuration (OpenAI-compatible).
response_format: Optional[ModelSettingsMoonshotModelSettingsResponseFormat]
class ModelSettingsZaiModelSettings: …
class ModelSettingsMoonshotCodingModelSettings: …
Kimi Code model configuration (Anthropic-compatible).
response_format: Optional[ModelSettingsMoonshotCodingModelSettingsResponseFormat]
strict: Optional[bool]
Enable strict mode for tool calling. When true, tool outputs are guaranteed to match JSON schemas.
class GroqModelSettings: …
class DeepseekModelSettings: …
class TogetherModelSettings: …
class BedrockModelSettings: …
class ModelSettingsOpenRouterModelSettings: …
Deprecatedmulti_agent_group: Optional[MultiAgentGroup]
Deprecated: Use managed_group field instead. The multi-agent group that this agent manages.
max_message_buffer_length: Optional[int]
The desired maximum length of messages in the context window of the convo agent. This is a best effort, and may be off slightly due to user/assistant interleaving.
pending_approval: Optional[ApprovalRequestMessage]
A message representing a request for approval to call a tool (generated by the LLM to trigger tool execution).
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message tool_call (ToolCall): The tool call
otid: Optional[str]
The offline threading id (OTID). Set by the client to deduplicate requests. Used for idempotency in background streaming mode — each message in a request must have a unique OTID. Retries of the same request should reuse the same OTIDs.
tool_calls: Optional[ToolCalls]
The tool calls that have been requested by the llm to run, which are pending approval
List[ToolCall]
per_file_view_window_char_limit: Optional[int]
The per-file view window character limit for this agent. Setting this too high may exceed the context window, which will break the agent.
response_format: Optional[ResponseFormat]
tool_rules: Optional[List[ToolRule]]
The list of tool rules.
class ChildToolRule: …
class InitToolRule: …
Represents the initial tool rule configuration.
args: Optional[Dict[str, object]]
Optional prefilled arguments for this tool. When present, these values will override any LLM-provided arguments with the same keys during invocation. Keys must match the tool’s parameter names and values must satisfy the tool’s JSON schema. Supports partial prefill; non-overlapping parameters are left to the model.
class ConditionalToolRule: …
A ToolRule that conditionally maps to different child tools based on the output.
class RequiredBeforeExitToolRule: …
Represents a tool rule configuration where this tool must be called before the agent loop can exit.
class MaxCountPerStepToolRule: …
class ParentToolRule: …
A ToolRule that only allows a child tool to be called if the parent has been called.
class AnthropicModelSettings: …
response_format: Optional[ResponseFormat]
strict: Optional[bool]
Enable strict mode for tool calling. When true, tool outputs are guaranteed to match JSON schemas.
class InitToolRule: …
Represents the initial tool rule configuration.
args: Optional[Dict[str, object]]
Optional prefilled arguments for this tool. When present, these values will override any LLM-provided arguments with the same keys during invocation. Keys must match the tool’s parameter names and values must satisfy the tool’s JSON schema. Supports partial prefill; non-overlapping parameters are left to the model.
Sent via the Anthropic Messages API
class ImageContent: …
class ToolCallContent: …
class ReasoningContent: …
class MessageCreate: …
Request to create a message
The content of the message.
List[LettaMessageContentUnion]
class ImageContent: …
class ToolCallContent: …
class ReasoningContent: …
class OpenAIModelSettings: …
response_format: Optional[ResponseFormat]
AgentsMessages
List Messages
Create Message
Create Message Streaming
Cancel Message
Create Message Async
Reset Messages
Summarize Messages
ModelsExpand Collapse
class ApprovalCreate: …
Input to approve or deny a tool call request
approvals: Optional[List[Approval]]
The list of approval responses
class ToolReturn: …
tool_return: Union[List[ToolReturnUnionMember0], str]
The tool return value - either a string or list of content parts (text/image)
List[ToolReturnUnionMember0]
class ApprovalRequestMessage: …
A message representing a request for approval to call a tool (generated by the LLM to trigger tool execution).
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message tool_call (ToolCall): The tool call
otid: Optional[str]
The offline threading id (OTID). Set by the client to deduplicate requests. Used for idempotency in background streaming mode — each message in a request must have a unique OTID. Retries of the same request should reuse the same OTIDs.
tool_calls: Optional[ToolCalls]
The tool calls that have been requested by the llm to run, which are pending approval
List[ToolCall]
class ApprovalResponseMessage: …
A message representing a response form the user indicating whether a tool has been approved to run.
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message approve: (bool) Whether the tool has been approved approval_request_id: The ID of the approval request reason: (Optional[str]) An optional explanation for the provided approval status
approvals: Optional[List[Approval]]
The list of approval responses
class ToolReturn: …
tool_return: Union[List[ToolReturnUnionMember0], str]
The tool return value - either a string or list of content parts (text/image)
List[ToolReturnUnionMember0]
class AssistantMessage: …
A message sent by the LLM in response to user input. Used in the LLM context.
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message content (Union[str, List[LettaAssistantMessageContentUnion]]): The message content sent by the agent (can be a string or an array of content parts)
class EventMessage: …
A message for notifying the developer that an event that has occured (e.g. a compaction). Events are NOT part of the context window.
class HiddenReasoningMessage: …
Representation of an agent’s internal reasoning where reasoning content has been hidden from the response.
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message state (Literal[“redacted”, “omitted”]): Whether the reasoning content was redacted by the provider or simply omitted by the API hidden_reasoning (Optional[str]): The internal reasoning of the agent
class InternalMessage: …
Letta's internal representation of a message. Includes methods to convert to/from LLM provider formats.
Attributes:
id (str): The unique identifier of the message.
role (MessageRole): The role of the participant.
text (str): The text of the message.
user_id (str): The unique identifier of the user.
agent_id (str): The unique identifier of the agent.
model (str): The model used to make the function call.
name (str): The name of the participant.
created_at (datetime): The time the message was created.
tool_calls (List[OpenAIToolCall,]): The list of tool calls requested.
tool_call_id (str): The id of the tool call.
step_id (str): The id of the step that this message was created in.
otid (str): The offline threading id associated with this message.
tool_returns (List[ToolReturn]): The list of tool returns requested.
group_id (str): The multi-agent group that the message was sent in.
sender_id (str): The id of the sender of the message, can be an identity id or agent id.
conversation_id (str): The conversation this message belongs to.
t
approval_request_id: Optional[str]
The id of the approval request if this message is associated with a tool call request.
approvals: Optional[List[Approval]]
The list of approvals for this message.
class ApprovalLettaSchemasMessageToolReturnOutput: …
func_response: Optional[Union[str, List[ApprovalLettaSchemasMessageToolReturnOutputFuncResponseUnionMember1], null]]
The function response - either a string or list of content parts (text/image)
List[ApprovalLettaSchemasMessageToolReturnOutputFuncResponseUnionMember1]
content: Optional[List[Content]]
The content of the message.
class ImageContent: …
class ToolCallContent: …
class ReasoningContent: …
is_err: Optional[bool]
Whether this message is part of an error step. Used only for debugging purposes.
name: Optional[str]
For role user/assistant: the (optional) name of the participant. For role tool/function: the name of the function called.
tool_returns: Optional[List[ToolReturn]]
Tool execution return information for prior tool calls
func_response: Optional[Union[str, List[ToolReturnFuncResponseUnionMember1], null]]
The function response - either a string or list of content parts (text/image)
List[ToolReturnFuncResponseUnionMember1]
class LettaRequest: …
Deprecatedassistant_message_tool_kwarg: Optional[str]
The name of the message argument in the designated message tool. Still supported for legacy agent types, but deprecated for letta_v1_agent onward.
Deprecatedassistant_message_tool_name: Optional[str]
The name of the designated message tool. Still supported for legacy agent types, but deprecated for letta_v1_agent onward.
client_skills: Optional[List[ClientSkill]]
Client-side skills available in the environment. These are rendered in the system prompt’s available skills section alongside agent-scoped skills from MemFS.
client_tools: Optional[List[ClientTool]]
Client-side tools that the agent can call. When the agent calls a client-side tool, execution pauses and returns control to the client to execute the tool and provide the result via a ToolReturn.
Deprecatedenable_thinking: Optional[str]
If set to True, enables reasoning before responses or tool calls from the agent.
include_compaction_messages: Optional[bool]
If True, compaction events emit structured SummaryMessage and EventMessage types. If False (default), compaction messages are not included in the response.
input: Optional[Union[str, List[InputUnionMember1], null]]
Syntactic sugar for a single user message. Equivalent to messages=[{‘role’: ‘user’, ‘content’: input}].
List[InputUnionMember1]
class ImageContent: …
class ToolCallContent: …
class ReasoningContent: …
messages: Optional[List[Message]]
The messages to be sent to the agent.
class MessageCreate: …
Request to create a message
The content of the message.
List[LettaMessageContentUnion]
class ImageContent: …
class ToolCallContent: …
class ReasoningContent: …
class ApprovalCreate: …
Input to approve or deny a tool call request
approvals: Optional[List[Approval]]
The list of approval responses
class ToolReturn: …
tool_return: Union[List[ToolReturnUnionMember0], str]
The tool return value - either a string or list of content parts (text/image)
List[ToolReturnUnionMember0]
class MessageToolReturnCreate: …
Submit tool return(s) from client-side tool execution.
This is the preferred way to send tool results back to the agent after client-side tool execution. It is equivalent to sending an ApprovalCreate with tool return approvals, but provides a cleaner API for the common case.
List of tool returns from client-side execution
tool_return: Union[List[ToolReturnUnionMember0], str]
The tool return value - either a string or list of content parts (text/image)
List[ToolReturnUnionMember0]
override_model: Optional[str]
Model handle to use for this request instead of the agent’s default model. This allows sending a message to a different model without changing the agent’s configuration.
override_system: Optional[str]
Optional per-request system prompt override. When set, this is passed directly to the underlying LLM request and bypasses the persisted/compiled system message for that request.
return_logprobs: Optional[bool]
If True, returns log probabilities of the output tokens in the response. Useful for RL training. Only supported for OpenAI-compatible providers (including SGLang).
return_token_ids: Optional[bool]
If True, returns token IDs and logprobs for ALL LLM generations in the agent step, not just the last one. Uses SGLang native /generate endpoint. Returns ‘turns’ field with TurnTokenData for each assistant/tool turn. Required for proper multi-turn RL training with loss masking.
class LettaResponse: …
Response object from an agent interaction, consisting of the new messages generated by the agent and usage statistics.
The type of the returned messages can be either Message or LettaMessage, depending on what was specified in the request.
Attributes: messages (List[Union[Message, LettaMessage]]): The messages returned by the agent. usage (LettaUsageStatistics): The usage statistics
The messages returned by the agent.
class SystemMessage: …
A message generated by the system. Never streamed back on a response, only used for cursor pagination.
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message content (str): The message content sent by the system
class UserMessage: …
A message sent by the user. Never streamed back on a response, only used for cursor pagination.
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message content (Union[str, List[LettaUserMessageContentUnion]]): The message content sent by the user (can be a string or an array of multi-modal content parts)
The message content sent by the user (can be a string or an array of multi-modal content parts)
class ReasoningMessage: …
Representation of an agent’s internal reasoning.
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message source (Literal[“reasoner_model”, “non_reasoner_model”]): Whether the reasoning content was generated natively by a reasoner model or derived via prompting reasoning (str): The internal reasoning of the agent signature (Optional[str]): The model-generated signature of the reasoning step
otid: Optional[str]
The offline threading id (OTID). Set by the client to deduplicate requests. Used for idempotency in background streaming mode — each message in a request must have a unique OTID. Retries of the same request should reuse the same OTIDs.
class HiddenReasoningMessage: …
Representation of an agent’s internal reasoning where reasoning content has been hidden from the response.
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message state (Literal[“redacted”, “omitted”]): Whether the reasoning content was redacted by the provider or simply omitted by the API hidden_reasoning (Optional[str]): The internal reasoning of the agent
class ToolCallMessage: …
A message representing a request to call a tool (generated by the LLM to trigger tool execution).
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message tool_call (Union[ToolCall, ToolCallDelta]): The tool call
otid: Optional[str]
The offline threading id (OTID). Set by the client to deduplicate requests. Used for idempotency in background streaming mode — each message in a request must have a unique OTID. Retries of the same request should reuse the same OTIDs.
tool_calls: Optional[ToolCalls]
List[ToolCall]
class ToolReturnMessage: …
A message representing the return value of a tool call (generated by Letta executing the requested tool).
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message tool_return (str): The return value of the tool (deprecated, use tool_returns) status (Literal[“success”, “error”]): The status of the tool call (deprecated, use tool_returns) tool_call_id (str): A unique identifier for the tool call that generated this message (deprecated, use tool_returns) stdout (Optional[List(str)]): Captured stdout (e.g. prints, logs) from the tool invocation (deprecated, use tool_returns) stderr (Optional[List(str)]): Captured stderr from the tool invocation (deprecated, use tool_returns) tool_returns (Optional[List[ToolReturn]]): List of tool returns for multi-tool support
otid: Optional[str]
The offline threading id (OTID). Set by the client to deduplicate requests. Used for idempotency in background streaming mode — each message in a request must have a unique OTID. Retries of the same request should reuse the same OTIDs.
tool_return: Union[List[ToolReturnUnionMember0], str]
The tool return value - either a string or list of content parts (text/image)
List[ToolReturnUnionMember0]
class AssistantMessage: …
A message sent by the LLM in response to user input. Used in the LLM context.
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message content (Union[str, List[LettaAssistantMessageContentUnion]]): The message content sent by the agent (can be a string or an array of content parts)
class ApprovalRequestMessage: …
A message representing a request for approval to call a tool (generated by the LLM to trigger tool execution).
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message tool_call (ToolCall): The tool call
otid: Optional[str]
The offline threading id (OTID). Set by the client to deduplicate requests. Used for idempotency in background streaming mode — each message in a request must have a unique OTID. Retries of the same request should reuse the same OTIDs.
tool_calls: Optional[ToolCalls]
The tool calls that have been requested by the llm to run, which are pending approval
List[ToolCall]
class ApprovalResponseMessage: …
A message representing a response form the user indicating whether a tool has been approved to run.
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message approve: (bool) Whether the tool has been approved approval_request_id: The ID of the approval request reason: (Optional[str]) An optional explanation for the provided approval status
approvals: Optional[List[Approval]]
The list of approval responses
class ToolReturn: …
tool_return: Union[List[ToolReturnUnionMember0], str]
The tool return value - either a string or list of content parts (text/image)
List[ToolReturnUnionMember0]
class SummaryMessage: …
A message representing a summary of the conversation. Sent to the LLM as a user or system message depending on the provider.
compaction_stats: Optional[CompactionStats]
class EventMessage: …
A message for notifying the developer that an event that has occured (e.g. a compaction). Events are NOT part of the context window.
usage: Usage
The usage statistics of the agent.
cache_write_tokens: Optional[int]
The number of input tokens written to cache (Anthropic only). None if not reported by provider.
cached_input_tokens: Optional[int]
The number of input tokens served from cache. None if not reported by provider.
logprobs: Optional[Logprobs]
turns: Optional[List[Turn]]
Token data for all LLM generations in multi-turn agent interaction. Includes token IDs and logprobs for each assistant turn, plus tool result content. Only present if return_token_ids was enabled. Used for RL training with loss masking.
class LettaStreamingRequest: …
Deprecatedassistant_message_tool_kwarg: Optional[str]
The name of the message argument in the designated message tool. Still supported for legacy agent types, but deprecated for letta_v1_agent onward.
Deprecatedassistant_message_tool_name: Optional[str]
The name of the designated message tool. Still supported for legacy agent types, but deprecated for letta_v1_agent onward.
background: Optional[bool]
Whether to process the request in the background (only used when streaming=true).
client_skills: Optional[List[ClientSkill]]
Client-side skills available in the environment. These are rendered in the system prompt’s available skills section alongside agent-scoped skills from MemFS.
client_tools: Optional[List[ClientTool]]
Client-side tools that the agent can call. When the agent calls a client-side tool, execution pauses and returns control to the client to execute the tool and provide the result via a ToolReturn.
Deprecatedenable_thinking: Optional[str]
If set to True, enables reasoning before responses or tool calls from the agent.
include_compaction_messages: Optional[bool]
If True, compaction events emit structured SummaryMessage and EventMessage types. If False (default), compaction messages are not included in the response.
include_pings: Optional[bool]
Whether to include periodic keepalive ping messages in the stream to prevent connection timeouts (only used when streaming=true).
input: Optional[Union[str, List[InputUnionMember1], null]]
Syntactic sugar for a single user message. Equivalent to messages=[{‘role’: ‘user’, ‘content’: input}].
List[InputUnionMember1]
class ImageContent: …
class ToolCallContent: …
class ReasoningContent: …
messages: Optional[List[Message]]
The messages to be sent to the agent.
class MessageCreate: …
Request to create a message
The content of the message.
List[LettaMessageContentUnion]
class ImageContent: …
class ToolCallContent: …
class ReasoningContent: …
class ApprovalCreate: …
Input to approve or deny a tool call request
approvals: Optional[List[Approval]]
The list of approval responses
class ToolReturn: …
tool_return: Union[List[ToolReturnUnionMember0], str]
The tool return value - either a string or list of content parts (text/image)
List[ToolReturnUnionMember0]
class MessageToolReturnCreate: …
Submit tool return(s) from client-side tool execution.
This is the preferred way to send tool results back to the agent after client-side tool execution. It is equivalent to sending an ApprovalCreate with tool return approvals, but provides a cleaner API for the common case.
List of tool returns from client-side execution
tool_return: Union[List[ToolReturnUnionMember0], str]
The tool return value - either a string or list of content parts (text/image)
List[ToolReturnUnionMember0]
override_model: Optional[str]
Model handle to use for this request instead of the agent’s default model. This allows sending a message to a different model without changing the agent’s configuration.
override_system: Optional[str]
Optional per-request system prompt override. When set, this is passed directly to the underlying LLM request and bypasses the persisted/compiled system message for that request.
return_logprobs: Optional[bool]
If True, returns log probabilities of the output tokens in the response. Useful for RL training. Only supported for OpenAI-compatible providers (including SGLang).
return_token_ids: Optional[bool]
If True, returns token IDs and logprobs for ALL LLM generations in the agent step, not just the last one. Uses SGLang native /generate endpoint. Returns ‘turns’ field with TurnTokenData for each assistant/tool turn. Required for proper multi-turn RL training with loss masking.
stream_tokens: Optional[bool]
Flag to determine if individual tokens should be streamed, rather than streaming per step (only used when streaming=true).
streaming: Optional[bool]
If True, returns a streaming response (Server-Sent Events). If False (default), returns a complete response.
Streaming response type for Server-Sent Events (SSE) endpoints. Each event in the stream will be one of these types.
class SystemMessage: …
A message generated by the system. Never streamed back on a response, only used for cursor pagination.
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message content (str): The message content sent by the system
class UserMessage: …
A message sent by the user. Never streamed back on a response, only used for cursor pagination.
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message content (Union[str, List[LettaUserMessageContentUnion]]): The message content sent by the user (can be a string or an array of multi-modal content parts)
The message content sent by the user (can be a string or an array of multi-modal content parts)
class ReasoningMessage: …
Representation of an agent’s internal reasoning.
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message source (Literal[“reasoner_model”, “non_reasoner_model”]): Whether the reasoning content was generated natively by a reasoner model or derived via prompting reasoning (str): The internal reasoning of the agent signature (Optional[str]): The model-generated signature of the reasoning step
otid: Optional[str]
The offline threading id (OTID). Set by the client to deduplicate requests. Used for idempotency in background streaming mode — each message in a request must have a unique OTID. Retries of the same request should reuse the same OTIDs.
class HiddenReasoningMessage: …
Representation of an agent’s internal reasoning where reasoning content has been hidden from the response.
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message state (Literal[“redacted”, “omitted”]): Whether the reasoning content was redacted by the provider or simply omitted by the API hidden_reasoning (Optional[str]): The internal reasoning of the agent
class ToolCallMessage: …
A message representing a request to call a tool (generated by the LLM to trigger tool execution).
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message tool_call (Union[ToolCall, ToolCallDelta]): The tool call
otid: Optional[str]
The offline threading id (OTID). Set by the client to deduplicate requests. Used for idempotency in background streaming mode — each message in a request must have a unique OTID. Retries of the same request should reuse the same OTIDs.
tool_calls: Optional[ToolCalls]
List[ToolCall]
class ToolReturnMessage: …
A message representing the return value of a tool call (generated by Letta executing the requested tool).
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message tool_return (str): The return value of the tool (deprecated, use tool_returns) status (Literal[“success”, “error”]): The status of the tool call (deprecated, use tool_returns) tool_call_id (str): A unique identifier for the tool call that generated this message (deprecated, use tool_returns) stdout (Optional[List(str)]): Captured stdout (e.g. prints, logs) from the tool invocation (deprecated, use tool_returns) stderr (Optional[List(str)]): Captured stderr from the tool invocation (deprecated, use tool_returns) tool_returns (Optional[List[ToolReturn]]): List of tool returns for multi-tool support
otid: Optional[str]
The offline threading id (OTID). Set by the client to deduplicate requests. Used for idempotency in background streaming mode — each message in a request must have a unique OTID. Retries of the same request should reuse the same OTIDs.
tool_return: Union[List[ToolReturnUnionMember0], str]
The tool return value - either a string or list of content parts (text/image)
List[ToolReturnUnionMember0]
class AssistantMessage: …
A message sent by the LLM in response to user input. Used in the LLM context.
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message content (Union[str, List[LettaAssistantMessageContentUnion]]): The message content sent by the agent (can be a string or an array of content parts)
class ApprovalRequestMessage: …
A message representing a request for approval to call a tool (generated by the LLM to trigger tool execution).
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message tool_call (ToolCall): The tool call
otid: Optional[str]
The offline threading id (OTID). Set by the client to deduplicate requests. Used for idempotency in background streaming mode — each message in a request must have a unique OTID. Retries of the same request should reuse the same OTIDs.
tool_calls: Optional[ToolCalls]
The tool calls that have been requested by the llm to run, which are pending approval
List[ToolCall]
class ApprovalResponseMessage: …
A message representing a response form the user indicating whether a tool has been approved to run.
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message approve: (bool) Whether the tool has been approved approval_request_id: The ID of the approval request reason: (Optional[str]) An optional explanation for the provided approval status
approvals: Optional[List[Approval]]
The list of approval responses
class ToolReturn: …
tool_return: Union[List[ToolReturnUnionMember0], str]
The tool return value - either a string or list of content parts (text/image)
List[ToolReturnUnionMember0]
class LettaPing: …
A ping message used as a keepalive to prevent SSE streams from timing out during long running requests.
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format
message_type: Optional[Literal["ping"]]
The type of the message. Ping messages are a keep-alive to prevent SSE streams from timing out during long running requests.
class LettaErrorMessage: …
Error messages are used to notify the client of an error that occurred during the agent’s execution.
class LettaUsageStatistics: …
Usage statistics for the agent interaction.
Attributes: completion_tokens (int): The number of tokens generated by the agent. prompt_tokens (int): The number of tokens in the prompt. total_tokens (int): The total number of tokens processed by the agent. step_count (int): The number of steps taken by the agent. cached_input_tokens (Optional[int]): The number of input tokens served from cache. None if not reported. cache_write_tokens (Optional[int]): The number of input tokens written to cache. None if not reported. reasoning_tokens (Optional[int]): The number of reasoning/thinking tokens generated. None if not reported.
cache_write_tokens: Optional[int]
The number of input tokens written to cache (Anthropic only). None if not reported by provider.
cached_input_tokens: Optional[int]
The number of input tokens served from cache. None if not reported by provider.
A message generated by the system. Never streamed back on a response, only used for cursor pagination.
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message content (str): The message content sent by the system
class SystemMessage: …
A message generated by the system. Never streamed back on a response, only used for cursor pagination.
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message content (str): The message content sent by the system
class UserMessage: …
A message sent by the user. Never streamed back on a response, only used for cursor pagination.
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message content (Union[str, List[LettaUserMessageContentUnion]]): The message content sent by the user (can be a string or an array of multi-modal content parts)
The message content sent by the user (can be a string or an array of multi-modal content parts)
class ReasoningMessage: …
Representation of an agent’s internal reasoning.
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message source (Literal[“reasoner_model”, “non_reasoner_model”]): Whether the reasoning content was generated natively by a reasoner model or derived via prompting reasoning (str): The internal reasoning of the agent signature (Optional[str]): The model-generated signature of the reasoning step
otid: Optional[str]
The offline threading id (OTID). Set by the client to deduplicate requests. Used for idempotency in background streaming mode — each message in a request must have a unique OTID. Retries of the same request should reuse the same OTIDs.
class HiddenReasoningMessage: …
Representation of an agent’s internal reasoning where reasoning content has been hidden from the response.
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message state (Literal[“redacted”, “omitted”]): Whether the reasoning content was redacted by the provider or simply omitted by the API hidden_reasoning (Optional[str]): The internal reasoning of the agent
class ToolCallMessage: …
A message representing a request to call a tool (generated by the LLM to trigger tool execution).
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message tool_call (Union[ToolCall, ToolCallDelta]): The tool call
otid: Optional[str]
The offline threading id (OTID). Set by the client to deduplicate requests. Used for idempotency in background streaming mode — each message in a request must have a unique OTID. Retries of the same request should reuse the same OTIDs.
tool_calls: Optional[ToolCalls]
List[ToolCall]
class ToolReturnMessage: …
A message representing the return value of a tool call (generated by Letta executing the requested tool).
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message tool_return (str): The return value of the tool (deprecated, use tool_returns) status (Literal[“success”, “error”]): The status of the tool call (deprecated, use tool_returns) tool_call_id (str): A unique identifier for the tool call that generated this message (deprecated, use tool_returns) stdout (Optional[List(str)]): Captured stdout (e.g. prints, logs) from the tool invocation (deprecated, use tool_returns) stderr (Optional[List(str)]): Captured stderr from the tool invocation (deprecated, use tool_returns) tool_returns (Optional[List[ToolReturn]]): List of tool returns for multi-tool support
otid: Optional[str]
The offline threading id (OTID). Set by the client to deduplicate requests. Used for idempotency in background streaming mode — each message in a request must have a unique OTID. Retries of the same request should reuse the same OTIDs.
tool_return: Union[List[ToolReturnUnionMember0], str]
The tool return value - either a string or list of content parts (text/image)
List[ToolReturnUnionMember0]
class AssistantMessage: …
A message sent by the LLM in response to user input. Used in the LLM context.
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message content (Union[str, List[LettaAssistantMessageContentUnion]]): The message content sent by the agent (can be a string or an array of content parts)
class ApprovalRequestMessage: …
A message representing a request for approval to call a tool (generated by the LLM to trigger tool execution).
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message tool_call (ToolCall): The tool call
otid: Optional[str]
The offline threading id (OTID). Set by the client to deduplicate requests. Used for idempotency in background streaming mode — each message in a request must have a unique OTID. Retries of the same request should reuse the same OTIDs.
tool_calls: Optional[ToolCalls]
The tool calls that have been requested by the llm to run, which are pending approval
List[ToolCall]
class ApprovalResponseMessage: …
A message representing a response form the user indicating whether a tool has been approved to run.
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message approve: (bool) Whether the tool has been approved approval_request_id: The ID of the approval request reason: (Optional[str]) An optional explanation for the provided approval status
approvals: Optional[List[Approval]]
The list of approval responses
class ToolReturn: …
tool_return: Union[List[ToolReturnUnionMember0], str]
The tool return value - either a string or list of content parts (text/image)
List[ToolReturnUnionMember0]
class SummaryMessage: …
A message representing a summary of the conversation. Sent to the LLM as a user or system message depending on the provider.
compaction_stats: Optional[CompactionStats]
class EventMessage: …
A message for notifying the developer that an event that has occured (e.g. a compaction). Events are NOT part of the context window.
class ReasoningMessage: …
Representation of an agent’s internal reasoning.
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message source (Literal[“reasoner_model”, “non_reasoner_model”]): Whether the reasoning content was generated natively by a reasoner model or derived via prompting reasoning (str): The internal reasoning of the agent signature (Optional[str]): The model-generated signature of the reasoning step
otid: Optional[str]
The offline threading id (OTID). Set by the client to deduplicate requests. Used for idempotency in background streaming mode — each message in a request must have a unique OTID. Retries of the same request should reuse the same OTIDs.
class Run: …
Representation of a run - a conversation or processing session for an agent. Runs track when agents process messages and maintain the relationship between agents, steps, and messages.
request_config: Optional[RequestConfig]
class SummaryMessage: …
A message representing a summary of the conversation. Sent to the LLM as a user or system message depending on the provider.
compaction_stats: Optional[CompactionStats]
class SystemMessage: …
A message generated by the system. Never streamed back on a response, only used for cursor pagination.
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message content (str): The message content sent by the system
class ToolCallMessage: …
A message representing a request to call a tool (generated by the LLM to trigger tool execution).
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message tool_call (Union[ToolCall, ToolCallDelta]): The tool call
otid: Optional[str]
The offline threading id (OTID). Set by the client to deduplicate requests. Used for idempotency in background streaming mode — each message in a request must have a unique OTID. Retries of the same request should reuse the same OTIDs.
tool_calls: Optional[ToolCalls]
List[ToolCall]
class ToolReturn: …
tool_return: Union[List[ToolReturnUnionMember0], str]
The tool return value - either a string or list of content parts (text/image)
List[ToolReturnUnionMember0]
class UpdateUserMessage: …
The message content sent by the user (can be a string or an array of multi-modal content parts)
class UserMessage: …
A message sent by the user. Never streamed back on a response, only used for cursor pagination.
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message content (Union[str, List[LettaUserMessageContentUnion]]): The message content sent by the user (can be a string or an array of multi-modal content parts)
The message content sent by the user (can be a string or an array of multi-modal content parts)
AgentsSchedule
Schedule Agent Message
List Scheduled Agent Messages
Retrieve Scheduled Agent Message
Delete Scheduled Agent Message
ModelsExpand Collapse
class ScheduleListResponse: …
scheduled_messages: List[ScheduledMessage]
message: ScheduledMessageMessage
messages: List[ScheduledMessageMessageMessage]
class ScheduleRetrieveResponse: …
message: Message
messages: List[MessageMessage]
AgentsBlocks
Retrieve Block For Agent
Update Block For Agent
List Blocks For Agent
Attach Block To Agent
Detach Block From Agent
AgentsTools
List Tools For Agent
Attach Tool To Agent
Detach Tool From Agent
Update Approval For Tool
Run Tool For Agent
ModelsExpand Collapse
class ToolExecutionResult: …
Deprecatedagent_state: Optional[AgentState]
Representation of an agent’s state. This is the state of the agent at a given time, and is persisted in the DB backend. The state has all the information needed to recreate a persisted agent.
Deprecated: Use model field instead. The LLM configuration used by the agent.
model_endpoint_type: Literal["openai", "anthropic", "google_ai", 27 more]
The endpoint type for the model.
enable_reasoner: Optional[bool]
Whether or not the model should use extended thinking if it is a ‘reasoning’ style model
frequency_penalty: Optional[float]
Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model’s likelihood to repeat the same line verbatim. From OpenAI: Number between -2.0 and 2.0.
max_reasoning_tokens: Optional[int]
Configurable thinking budget for extended thinking. Used for enable_reasoner and also for Google Vertex models like Gemini 2.5 Flash. Minimum value is 1024 when used with enable_reasoner.
max_tokens: Optional[int]
The maximum number of tokens to generate. If not set, the model will use its default value.
Deprecatedparallel_tool_calls: Optional[bool]
Deprecated: Use model_settings to configure parallel tool calls instead. If set to True, enables parallel tool calling. Defaults to False.
put_inner_thoughts_in_kwargs: Optional[bool]
Puts ‘inner_thoughts’ as a kwarg in the function call if this is set to True. This helps with function calling performance and also the generation of inner thoughts.
response_format: Optional[ResponseFormat]
return_logprobs: Optional[bool]
Whether to return log probabilities of the output tokens. Useful for RL training.
return_token_ids: Optional[bool]
Whether to return token IDs for all LLM generations via SGLang native endpoint. Required for multi-turn RL training with loss masking. Only works with SGLang provider.
strict: Optional[bool]
Enable strict mode for tool calling. When true, tool schemas include strict: true and additionalProperties: false, guaranteeing tool outputs match JSON schemas.
temperature: Optional[float]
The temperature to use when generating text with the model. A higher temperature will result in more random text.
tool_call_parser: Optional[str]
SGLang tool call parser name (e.g. ‘glm47’, ‘qwen25’, ‘hermes’). Used by the SGLang native adapter to parse tool calls from raw model output.
Deprecatedmemory: Memory
Deprecated: Use blocks field instead. The in-context memory of the agent.
file_blocks: Optional[List[MemoryFileBlock]]
Deprecatedsources: List[Source]
The tools used by the agent.
default_requires_approval: Optional[bool]
Default value for whether or not executing this tool requires approval.
enable_parallel_execution: Optional[bool]
If set to True, then this tool will potentially be executed concurrently with other tools. Default False.
compaction_settings: Optional[CompactionSettings]
Configuration for conversation compaction / summarization.
Per-model settings (temperature, max tokens, etc.) are derived from the default configuration for that handle.
clip_chars: Optional[int]
The maximum length of the summary in characters. If none, no clipping is performed.
model: Optional[str]
Model handle to use for sliding_window/all summarization (format: provider/model-name). If None, uses lightweight provider-specific defaults.
model_settings: Optional[CompactionSettingsModelSettings]
Optional model settings used to override defaults for the summarizer model.
class OpenAIModelSettings: …
response_format: Optional[ResponseFormat]
class CompactionSettingsModelSettingsSgLangModelSettings: …
SGLang model configuration (OpenAI-compatible runtime with SGLang-specific parsing).
response_format: Optional[CompactionSettingsModelSettingsSgLangModelSettingsResponseFormat]
class AnthropicModelSettings: …
response_format: Optional[ResponseFormat]
strict: Optional[bool]
Enable strict mode for tool calling. When true, tool outputs are guaranteed to match JSON schemas.
class GoogleAIModelSettings: …
class GoogleVertexModelSettings: …
class AzureModelSettings: …
class XaiModelSettings: …
class CompactionSettingsModelSettingsMoonshotModelSettings: …
Moonshot/Kimi model configuration (OpenAI-compatible).
response_format: Optional[CompactionSettingsModelSettingsMoonshotModelSettingsResponseFormat]
class CompactionSettingsModelSettingsZaiModelSettings: …
Z.ai (ZhipuAI) model configuration (OpenAI-compatible).
class CompactionSettingsModelSettingsMoonshotCodingModelSettings: …
Kimi Code model configuration (Anthropic-compatible).
response_format: Optional[CompactionSettingsModelSettingsMoonshotCodingModelSettingsResponseFormat]
strict: Optional[bool]
Enable strict mode for tool calling. When true, tool outputs are guaranteed to match JSON schemas.
class GroqModelSettings: …
class DeepseekModelSettings: …
class TogetherModelSettings: …
class BedrockModelSettings: …
class CompactionSettingsModelSettingsBasetenModelSettings: …
Baseten model configuration (OpenAI-compatible).
class CompactionSettingsModelSettingsOpenRouterModelSettings: …
Deprecatedembedding_config: Optional[EmbeddingConfig]
enable_sleeptime: Optional[bool]
If set to True, memory management will move to a background agent thread.
identities: Optional[List[Identity]]
Deprecatedidentity_ids: Optional[List[str]]
Deprecated: Use identities field instead. The ids of the identities associated with this agent.
last_run_completion: Optional[datetime]
The timestamp when the agent last completed a run.
managed_group: Optional[ManagedGroup]
The multi-agent group that this agent manages
max_message_buffer_length: Optional[int]
The desired maximum length of messages in the context window of the convo agent. This is a best effort, and may be off slightly due to user/assistant interleaving.
max_files_open: Optional[int]
Maximum number of files that can be open at once for this agent. Setting this too high may exceed the context window, which will break the agent.
message_buffer_autoclear: Optional[bool]
If set to True, the agent will not remember previous messages (though the agent will still retain state via core memory blocks and archival/recall memory). Not recommended unless you have an advanced use case.
model_settings: Optional[ModelSettings]
The model settings used by the agent.
class OpenAIModelSettings: …
response_format: Optional[ResponseFormat]
class ModelSettingsSgLangModelSettings: …
SGLang model configuration (OpenAI-compatible runtime with SGLang-specific parsing).
response_format: Optional[ModelSettingsSgLangModelSettingsResponseFormat]
class AnthropicModelSettings: …
response_format: Optional[ResponseFormat]
strict: Optional[bool]
Enable strict mode for tool calling. When true, tool outputs are guaranteed to match JSON schemas.
class GoogleAIModelSettings: …
class GoogleVertexModelSettings: …
class AzureModelSettings: …
class XaiModelSettings: …
class ModelSettingsMoonshotModelSettings: …
Moonshot/Kimi model configuration (OpenAI-compatible).
response_format: Optional[ModelSettingsMoonshotModelSettingsResponseFormat]
class ModelSettingsZaiModelSettings: …
class ModelSettingsMoonshotCodingModelSettings: …
Kimi Code model configuration (Anthropic-compatible).
response_format: Optional[ModelSettingsMoonshotCodingModelSettingsResponseFormat]
strict: Optional[bool]
Enable strict mode for tool calling. When true, tool outputs are guaranteed to match JSON schemas.
class GroqModelSettings: …
class DeepseekModelSettings: …
class TogetherModelSettings: …
class BedrockModelSettings: …
class ModelSettingsOpenRouterModelSettings: …
Deprecatedmulti_agent_group: Optional[MultiAgentGroup]
Deprecated: Use managed_group field instead. The multi-agent group that this agent manages.
max_message_buffer_length: Optional[int]
The desired maximum length of messages in the context window of the convo agent. This is a best effort, and may be off slightly due to user/assistant interleaving.
pending_approval: Optional[ApprovalRequestMessage]
A message representing a request for approval to call a tool (generated by the LLM to trigger tool execution).
Args: id (str): The ID of the message date (datetime): The date the message was created in ISO format name (Optional[str]): The name of the sender of the message tool_call (ToolCall): The tool call
otid: Optional[str]
The offline threading id (OTID). Set by the client to deduplicate requests. Used for idempotency in background streaming mode — each message in a request must have a unique OTID. Retries of the same request should reuse the same OTIDs.
tool_calls: Optional[ToolCalls]
The tool calls that have been requested by the llm to run, which are pending approval
List[ToolCall]
per_file_view_window_char_limit: Optional[int]
The per-file view window character limit for this agent. Setting this too high may exceed the context window, which will break the agent.
response_format: Optional[ResponseFormat]
tool_rules: Optional[List[ToolRule]]
The list of tool rules.
class ChildToolRule: …
class InitToolRule: …
Represents the initial tool rule configuration.
args: Optional[Dict[str, object]]
Optional prefilled arguments for this tool. When present, these values will override any LLM-provided arguments with the same keys during invocation. Keys must match the tool’s parameter names and values must satisfy the tool’s JSON schema. Supports partial prefill; non-overlapping parameters are left to the model.
class ConditionalToolRule: …
A ToolRule that conditionally maps to different child tools based on the output.
class RequiredBeforeExitToolRule: …
Represents a tool rule configuration where this tool must be called before the agent loop can exit.
class MaxCountPerStepToolRule: …
class ParentToolRule: …
A ToolRule that only allows a child tool to be called if the parent has been called.
Skip to content