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(…) 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 into_input(self) -> RunAgentInput
pub fn into_input(self) -> RunAgentInput
The request this describes.
Trait Implementations§
Source§impl From<RunAgentInput> for RunParams
impl From<RunAgentInput> for RunParams
Source§fn from(input: RunAgentInput) -> Self
fn from(input: RunAgentInput) -> Self
Converts to this type from the input type.
Source§impl From<RunParams> for RunAgentInput
impl From<RunParams> for RunAgentInput
impl StructuralPartialEq for RunParams
Auto Trait Implementations§
impl Freeze for RunParams
impl RefUnwindSafe for RunParams
impl Send for RunParams
impl Sync for RunParams
impl Unpin for RunParams
impl UnsafeUnpin for RunParams
impl UnwindSafe for RunParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more