pub struct StepOverrides {
pub model: Option<LanguageModelRef>,
pub tool_choice: Option<ToolChoice>,
pub active_tools: Option<Vec<ToolName>>,
pub tool_order: Option<Vec<ToolName>>,
pub instructions: Option<Instructions>,
pub messages: Option<Vec<Message>>,
pub tools_context: Option<JsonValue>,
pub runtime_context: Option<JsonValue>,
pub sandbox: Option<Arc<dyn Sandbox>>,
pub settings: Option<CallSettings>,
}Expand description
Overrides returned by a PrepareStep callback. Unset fields keep the
prior state for messages, instructions and contexts; other fields keep call defaults.
Fields§
§model: Option<LanguageModelRef>Model for this step.
tool_choice: Option<ToolChoice>Tool choice for this step.
active_tools: Option<Vec<ToolName>>Active tools for this step.
tool_order: Option<Vec<ToolName>>Tool order for this step.
instructions: Option<Instructions>Instructions for this and subsequent steps.
messages: Option<Vec<Message>>Messages for this and subsequent steps (new responses are appended).
tools_context: Option<JsonValue>Tools context for this and subsequent steps.
runtime_context: Option<JsonValue>Application state for this and subsequent steps (None preserves the prior value).
sandbox: Option<Arc<dyn Sandbox>>Sandbox for this step only; an unset value uses the invocation sandbox.
settings: Option<CallSettings>Sampling settings overlaid on the call settings.
Implementations§
Source§impl StepOverrides
impl StepOverrides
Sourcepub fn with_model(self, model: impl Into<LanguageModelRef>) -> Self
pub fn with_model(self, model: impl Into<LanguageModelRef>) -> Self
Overrides the model.
Sourcepub fn with_tool_choice(self, tool_choice: ToolChoice) -> Self
pub fn with_tool_choice(self, tool_choice: ToolChoice) -> Self
Overrides the tool choice.
Sourcepub fn with_active_tools(
self,
names: impl IntoIterator<Item = impl Into<ToolName>>,
) -> Self
pub fn with_active_tools( self, names: impl IntoIterator<Item = impl Into<ToolName>>, ) -> Self
Overrides the active tools.
Sourcepub fn with_tool_order(
self,
names: impl IntoIterator<Item = impl Into<ToolName>>,
) -> Self
pub fn with_tool_order( self, names: impl IntoIterator<Item = impl Into<ToolName>>, ) -> Self
Overrides the tool order.
Sourcepub fn with_instructions(self, instructions: impl Into<Instructions>) -> Self
pub fn with_instructions(self, instructions: impl Into<Instructions>) -> Self
Overrides the instructions.
Sourcepub fn with_messages(self, messages: impl IntoIterator<Item = Message>) -> Self
pub fn with_messages(self, messages: impl IntoIterator<Item = Message>) -> Self
Overrides the messages.
Sourcepub fn with_tools_context(self, context: JsonValue) -> Self
pub fn with_tools_context(self, context: JsonValue) -> Self
Overrides the tools context.
Sourcepub fn with_runtime_context(self, context: JsonValue) -> Self
pub fn with_runtime_context(self, context: JsonValue) -> Self
Replaces application state for this and subsequent steps.
Sourcepub fn with_sandbox(self, sandbox: Arc<dyn Sandbox>) -> Self
pub fn with_sandbox(self, sandbox: Arc<dyn Sandbox>) -> Self
Uses a sandbox for this step only.
Sourcepub fn with_settings(self, settings: CallSettings) -> Self
pub fn with_settings(self, settings: CallSettings) -> Self
Overlays sampling settings.