pub struct RunAgentInput {
pub thread_id: String,
pub run_id: String,
pub messages: Vec<Message>,
pub tools: Vec<Tool>,
pub context: Vec<Context>,
pub state: Option<Value>,
pub parent_run_id: Option<String>,
pub parent_thread_id: Option<String>,
pub model: Option<String>,
pub system_prompt: Option<String>,
pub config: Option<Value>,
pub forwarded_props: Option<Value>,
}Expand description
Request to run an AG-UI agent.
Fields§
§thread_id: StringThread identifier.
run_id: StringRun identifier.
messages: Vec<Message>Conversation messages.
tools: Vec<Tool>Available tools.
context: Vec<Context>Frontend readable context entries.
state: Option<Value>Initial state.
parent_run_id: Option<String>Parent run ID (for sub-runs).
parent_thread_id: Option<String>Parent thread ID (for delegated/sub-agent lineage).
model: Option<String>Model to use.
system_prompt: Option<String>System prompt.
config: Option<Value>Additional configuration.
forwarded_props: Option<Value>Additional forwarded properties from AG-UI client runtimes.
Implementations§
Source§impl RunAgentInput
impl RunAgentInput
Sourcepub fn new(thread_id: impl Into<String>, run_id: impl Into<String>) -> Self
pub fn new(thread_id: impl Into<String>, run_id: impl Into<String>) -> Self
Create a new request with minimal required fields.
Sourcepub fn with_message(self, message: Message) -> Self
pub fn with_message(self, message: Message) -> Self
Add a message.
Sourcepub fn with_messages(self, messages: Vec<Message>) -> Self
pub fn with_messages(self, messages: Vec<Message>) -> Self
Add messages.
Sourcepub fn with_state(self, state: Value) -> Self
pub fn with_state(self, state: Value) -> Self
Set initial state.
Sourcepub fn with_parent_thread_id(self, parent_thread_id: impl Into<String>) -> Self
pub fn with_parent_thread_id(self, parent_thread_id: impl Into<String>) -> Self
Set parent thread ID.
Sourcepub fn with_model(self, model: impl Into<String>) -> Self
pub fn with_model(self, model: impl Into<String>) -> Self
Set model.
Sourcepub fn with_system_prompt(self, prompt: impl Into<String>) -> Self
pub fn with_system_prompt(self, prompt: impl Into<String>) -> Self
Set system prompt.
Sourcepub fn with_forwarded_props(self, forwarded_props: Value) -> Self
pub fn with_forwarded_props(self, forwarded_props: Value) -> Self
Set forwarded props.
Sourcepub fn validate(&self) -> Result<(), RequestError>
pub fn validate(&self) -> Result<(), RequestError>
Validate the request.
Sourcepub fn frontend_tools(&self) -> Vec<&Tool>
pub fn frontend_tools(&self) -> Vec<&Tool>
Get frontend tools from the request.
Sourcepub fn has_any_interaction_responses(&self) -> bool
pub fn has_any_interaction_responses(&self) -> bool
Check if any interaction responses exist in this request.
Sourcepub fn has_any_suspension_decisions(&self) -> bool
pub fn has_any_suspension_decisions(&self) -> bool
Check if any suspension decisions exist in this request.
Sourcepub fn has_user_input(&self) -> bool
pub fn has_user_input(&self) -> bool
Check if this request contains non-empty user input.
Sourcepub fn into_runtime_run_request(self, agent_id: String) -> RunRequest
pub fn into_runtime_run_request(self, agent_id: String) -> RunRequest
Convert this AG-UI request to the internal runtime request.
Mapping rules:
thread_id,run_id,parent_run_id,stateare forwarded directly.messagesare converted viaconvert_agui_messages(assistant/activity/reasoning inbound messages are intentionally skipped at runtime input boundary).resource_idis not provided by AG-UI and remainsNone.
Sourcepub fn interaction_responses(&self) -> Vec<SuspensionResponse>
pub fn interaction_responses(&self) -> Vec<SuspensionResponse>
Extract all interaction responses from tool messages.
Sourcepub fn suspension_decisions(&self) -> Vec<ToolCallDecision>
pub fn suspension_decisions(&self) -> Vec<ToolCallDecision>
Extract all suspension decisions from tool messages.
Sourcepub fn approved_target_ids(&self) -> Vec<String>
pub fn approved_target_ids(&self) -> Vec<String>
Get all approved interaction IDs.
Sourcepub fn denied_target_ids(&self) -> Vec<String>
pub fn denied_target_ids(&self) -> Vec<String>
Get all denied interaction IDs.
Trait Implementations§
Source§impl Clone for RunAgentInput
impl Clone for RunAgentInput
Source§fn clone(&self) -> RunAgentInput
fn clone(&self) -> RunAgentInput
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more