pub struct RunRequest {
pub session_id: Option<Uuid>,
pub run_id: Option<RunId>,
pub provider: ProviderId,
pub model: ModelName,
pub input: String,
pub metadata: Value,
pub tool_choice: ToolChoice,
pub client_request_id: Option<String>,
}Expand description
Request to start a new agent run.
Fields§
§session_id: Option<Uuid>Optional session ID. If None, a new session will be created.
run_id: Option<RunId>Optional pre-allocated run ID. If None, a new RunId will be generated.
provider: ProviderIdProvider to use for model calls.
model: ModelNameModel to use for generation.
input: StringUser input message.
metadata: ValueOptional metadata for the run.
tool_choice: ToolChoiceTool choice strategy.
client_request_id: Option<String>Optional client-provided idempotency key.
Implementations§
Source§impl RunRequest
impl RunRequest
Sourcepub fn new(
provider: ProviderId,
model: ModelName,
input: impl Into<String>,
) -> Self
pub fn new( provider: ProviderId, model: ModelName, input: impl Into<String>, ) -> Self
Creates a new run request.
Sourcepub fn with_session_id(self, session_id: Uuid) -> Self
pub fn with_session_id(self, session_id: Uuid) -> Self
Sets the session ID.
Sourcepub fn with_metadata(self, metadata: Value) -> Self
pub fn with_metadata(self, metadata: Value) -> Self
Sets the metadata.
Sourcepub fn with_tool_choice(self, tool_choice: ToolChoice) -> Self
pub fn with_tool_choice(self, tool_choice: ToolChoice) -> Self
Sets the tool choice strategy.
Sourcepub fn with_run_id(self, run_id: RunId) -> Self
pub fn with_run_id(self, run_id: RunId) -> Self
Sets a pre-allocated run ID.
Sourcepub fn with_client_request_id(self, id: String) -> Self
pub fn with_client_request_id(self, id: String) -> Self
Sets the client-provided idempotency key.
Trait Implementations§
Source§impl Clone for RunRequest
impl Clone for RunRequest
Source§fn clone(&self) -> RunRequest
fn clone(&self) -> RunRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RunRequest
impl Debug for RunRequest
Source§impl<'de> Deserialize<'de> for RunRequest
impl<'de> Deserialize<'de> for RunRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RunRequest
impl RefUnwindSafe for RunRequest
impl Send for RunRequest
impl Sync for RunRequest
impl Unpin for RunRequest
impl UnsafeUnpin for RunRequest
impl UnwindSafe for RunRequest
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