pub struct AgentRunOptions {
pub chat_options: Option<ChatOptions>,
pub additional_tools: Vec<ToolDefinition>,
}Expand description
Per-run option overrides for a single SupportsAgentRun::run_with_options /
SupportsAgentRun::run_stream call, merged over the agent’s build-time defaults.
Mirrors upstream run/run_stream per-call keyword arguments and .NET
AgentRunOptions: the per-run ChatOptions take precedence over the
agent’s defaults (via ChatOptions::merge, matching Python’s
run_chat_options & ChatOptions(...)), and
additional_tools are appended to the tool list
for that call only.
Fields§
§chat_options: Option<ChatOptions>Chat-option overrides merged over the agent’s defaults (per-run wins).
additional_tools: Vec<ToolDefinition>Extra tools available only for this run, appended to the agent’s tools.
Declaration-only tools (no executor) surface their calls back to the caller instead of being executed locally — this is how a hosting frontend injects client-side tools (see the AG-UI router).
Implementations§
Source§impl AgentRunOptions
impl AgentRunOptions
Sourcepub fn new() -> AgentRunOptions
pub fn new() -> AgentRunOptions
Empty options (no overrides).
Sourcepub fn with_chat_options(self, options: ChatOptions) -> AgentRunOptions
pub fn with_chat_options(self, options: ChatOptions) -> AgentRunOptions
Set the per-run chat-option overrides (merged over the agent defaults, per-run winning).
Sourcepub fn with_tool(self, tool: ToolDefinition) -> AgentRunOptions
pub fn with_tool(self, tool: ToolDefinition) -> AgentRunOptions
Append a tool available only for this run.
Sourcepub fn with_tools(
self,
tools: impl IntoIterator<Item = ToolDefinition>,
) -> AgentRunOptions
pub fn with_tools( self, tools: impl IntoIterator<Item = ToolDefinition>, ) -> AgentRunOptions
Append multiple tools available only for this run.
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether these options carry no overrides at all. Used by the default
SupportsAgentRun::run_with_options to decide whether to warn about ignoring
options it cannot honor.
Trait Implementations§
Source§impl Clone for AgentRunOptions
impl Clone for AgentRunOptions
Source§fn clone(&self) -> AgentRunOptions
fn clone(&self) -> AgentRunOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more