pub struct RunParams { /* private fields */ }Expand description
What to send when starting a run.
A builder over RunAgentInput: the two ids are required, everything else
has a sensible empty default. agent.run_events(…) takes anything that converts
into the input, so a hand-built RunAgentInput works just as well.
Implementations§
Source§impl RunParams
impl RunParams
Sourcepub fn new(thread_id: impl Into<ThreadId>, run_id: impl Into<RunId>) -> Self
pub fn new(thread_id: impl Into<ThreadId>, run_id: impl Into<RunId>) -> Self
A run in thread_id, identified by run_id.
Sourcepub fn messages(self, messages: impl Into<Vec<Message>>) -> Self
pub fn messages(self, messages: impl Into<Vec<Message>>) -> Self
Sets the conversation history, oldest first.
Sourcepub fn user(
self,
id: impl Into<MessageId>,
content: impl Into<UserContent>,
) -> Self
pub fn user( self, id: impl Into<MessageId>, content: impl Into<UserContent>, ) -> Self
Appends a user message — the common case, spelled short.
Sourcepub fn state(self, state: impl Into<Value>) -> Self
pub fn state(self, state: impl Into<Value>) -> Self
Sets the shared state the agent starts from.
Sourcepub fn context(self, context: impl Into<Vec<Context>>) -> Self
pub fn context(self, context: impl Into<Vec<Context>>) -> Self
Sets the ambient context entries.
Sourcepub fn forwarded_props(self, props: impl Into<Value>) -> Self
pub fn forwarded_props(self, props: impl Into<Value>) -> Self
Sets the passthrough properties, which the protocol never interprets.
Sourcepub fn resume(self, entries: impl Into<Vec<ResumeEntry>>) -> Self
pub fn resume(self, entries: impl Into<Vec<ResumeEntry>>) -> Self
Answers the interrupts a previous run paused on. See
crate::client::interrupts.
Sourcepub fn parent_run_id(self, run_id: impl Into<RunId>) -> Self
pub fn parent_run_id(self, run_id: impl Into<RunId>) -> Self
Records the run that spawned this one, for nested agents.
Sourcepub fn protocol_version(self, version: Option<String>) -> Self
pub fn protocol_version(self, version: Option<String>) -> Self
Declares the version sent in the run input. Pass None for a known
legacy peer whose request parser cannot accept protocolVersion.
Sourcepub fn into_input(self) -> RunAgentInput
pub fn into_input(self) -> RunAgentInput
The request this describes.