Skip to main content

RunRequest

Struct RunRequest 

Source
pub struct RunRequest {
Show 19 fields pub messages: Vec<Message>, pub messages_already_persisted: bool, pub thread_id: String, pub agent_id: Option<String>, pub overrides: Option<InferenceOverride>, pub decisions: Vec<(String, ToolCallResume)>, pub frontend_tools: Vec<ToolDescriptor>, pub origin: RunRequestOrigin, pub run_mode: RunMode, pub adapter: AdapterKind, pub parent_run_id: Option<String>, pub parent_thread_id: Option<String>, pub continue_run_id: Option<String>, pub run_id_hint: Option<String>, pub dispatch_id_hint: Option<String>, pub dispatch_id: Option<String>, pub session_id: Option<String>, pub transport_request_id: Option<String>, pub run_inbox: Option<RunInbox>,
}
Expand description

Unified request for starting or resuming a run.

Fields§

§messages: Vec<Message>

New messages to append before running.

§messages_already_persisted: bool

True when messages already exist in the thread message log.

Mailbox-backed dispatch reconstructs new input messages from RunRecord.request and the thread log, so the runtime must use them as the current turn without appending a duplicate copy.

§thread_id: String

Thread ID. Existing → load history; new → create.

§agent_id: Option<String>

Target agent ID. None = infer from latest thread state/run record, fallback to default.

§overrides: Option<InferenceOverride>

Runtime parameter overrides for this run.

§decisions: Vec<(String, ToolCallResume)>

Resume decisions for suspended tool calls. Empty = fresh run.

§frontend_tools: Vec<ToolDescriptor>

Frontend-defined tools for this run.

§origin: RunRequestOrigin

Where this request originated.

§run_mode: RunMode

Execution mode used by framework-level policy hooks.

§adapter: AdapterKind

Protocol or adapter that submitted this request.

§parent_run_id: Option<String>

Parent run ID for child run linkage (tracing/lineage).

§parent_thread_id: Option<String>

Parent thread ID for message routing back to parent.

§continue_run_id: Option<String>

Continue a previous run instead of creating a new one.

§run_id_hint: Option<String>

Optional canonical run ID preallocated by the caller.

§dispatch_id_hint: Option<String>

Optional transport dispatch/task ID that should be used as the run ID.

§dispatch_id: Option<String>

Queue dispatch that delivered this run request, if any.

§session_id: Option<String>

External session/dispatch identifier associated with this run.

§transport_request_id: Option<String>

Transport request identifier associated with this run.

§run_inbox: Option<RunInbox>

Optional in-process inbox pair for background-task notifications.

Implementations§

Source§

impl RunRequest

Source

pub fn new(thread_id: impl Into<String>, messages: Vec<Message>) -> Self

Build a message-first request with default options.

Source

pub fn with_agent_id(self, agent_id: impl Into<String>) -> Self

Source

pub fn with_overrides(self, overrides: InferenceOverride) -> Self

Source

pub fn with_decisions(self, decisions: Vec<(String, ToolCallResume)>) -> Self

Source

pub fn with_frontend_tools(self, tools: Vec<ToolDescriptor>) -> Self

Source

pub fn with_origin(self, origin: RunRequestOrigin) -> Self

Source

pub fn with_run_mode(self, run_mode: RunMode) -> Self

Source

pub fn with_adapter(self, adapter: AdapterKind) -> Self

Source

pub fn with_parent_run_id(self, parent_run_id: impl Into<String>) -> Self

Source

pub fn with_parent_thread_id(self, parent_thread_id: impl Into<String>) -> Self

Source

pub fn with_continue_run_id(self, continue_run_id: impl Into<String>) -> Self

Source

pub fn with_run_id_hint(self, run_id_hint: impl Into<String>) -> Self

Source

pub fn with_dispatch_id_hint(self, dispatch_id_hint: impl Into<String>) -> Self

Source

pub fn with_trace_dispatch_id(self, dispatch_id: impl Into<String>) -> Self

Source

pub fn with_dispatch_id(self, dispatch_id: impl Into<String>) -> Self

Source

pub fn with_session_id(self, session_id: impl Into<String>) -> Self

Source

pub fn with_transport_request_id( self, transport_request_id: impl Into<String>, ) -> Self

Source

pub fn with_inbox(self, sender: InboxSender, receiver: InboxReceiver) -> Self

Source

pub fn with_messages_already_persisted(self, value: bool) -> Self

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more