pub struct EmitRequest {
pub provider: ProviderId,
pub model: ModelName,
pub input: String,
pub session_id: Option<Uuid>,
pub client_request_id: Option<String>,
pub metadata: Value,
}Expand description
Transport-neutral request for a single runtime invocation.
Converts to RunRequest via EmitRequest::into_run_request. The
invocation layer deliberately omits tool_choice and run_id: callers
needing fine-grained control over those should construct a RunRequest
directly and call AgentRuntime::run.
Fields§
§provider: ProviderIdProvider used for model calls.
model: ModelNameModel used for generation.
input: StringUser input message.
session_id: Option<Uuid>Optional session id. When None, the runtime creates a new session.
client_request_id: Option<String>Optional client-provided idempotency key.
metadata: ValueArbitrary metadata attached to the run. Defaults to Value::Null.
Implementations§
Source§impl EmitRequest
impl EmitRequest
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 emit request with no session, no client id, and null metadata.
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_client_request_id(self, id: impl Into<String>) -> Self
pub fn with_client_request_id(self, id: impl Into<String>) -> Self
Sets the client-provided idempotency key.
Sourcepub fn with_metadata(self, metadata: Value) -> Self
pub fn with_metadata(self, metadata: Value) -> Self
Sets the metadata payload.
Sourcepub fn into_run_request(self) -> RunRequest
pub fn into_run_request(self) -> RunRequest
Converts this request into a RunRequest consumed by the runtime.
tool_choice defaults to ToolChoice::Auto and run_id is left
unset so the runtime allocates one.
Trait Implementations§
Source§impl Clone for EmitRequest
impl Clone for EmitRequest
Source§fn clone(&self) -> EmitRequest
fn clone(&self) -> EmitRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more