pub struct InferenceRequest {
pub id: RequestId,
pub prompt: String,
pub model_id: ModelId,
pub sampling_params: SamplingParams,
pub stream: bool,
pub priority: Priority,
pub client_id: Option<ClientId>,
pub session_id: Option<SessionId>,
pub created_at: DateTime<Utc>,
pub api_request: Option<ApiRequest>,
pub evidence_request: InferenceEvidenceRequest,
pub metadata: HashMap<String, Value>,
}Expand description
Inference request
Fields§
§id: RequestIdUnique request identifier
prompt: StringInput prompt text
model_id: ModelIdModel to use for inference
sampling_params: SamplingParamsSampling parameters
stream: boolWhether to stream response
priority: PriorityRequest priority
client_id: Option<ClientId>Client identifier
session_id: Option<SessionId>Session identifier for stateful interactions
created_at: DateTime<Utc>Request creation timestamp
api_request: Option<ApiRequest>Structured product/API request context. prompt remains the rendered
model input for current engines; this carries the original semantic
request boundary for API features such as tools and response formats.
evidence_request: InferenceEvidenceRequestExplicitly requested execution evidence. Disabled by default so normal inference does not retain or copy prompt token IDs after completion.
metadata: HashMap<String, Value>Additional metadata
Implementations§
Source§impl InferenceRequest
impl InferenceRequest
Sourcepub fn new(
prompt: impl Into<String>,
model_id: impl Into<ModelId>,
) -> InferenceRequest
pub fn new( prompt: impl Into<String>, model_id: impl Into<ModelId>, ) -> InferenceRequest
Create a new inference request
Sourcepub fn with_sampling_params(self, params: SamplingParams) -> InferenceRequest
pub fn with_sampling_params(self, params: SamplingParams) -> InferenceRequest
Set sampling parameters
Sourcepub fn with_stream(self, stream: bool) -> InferenceRequest
pub fn with_stream(self, stream: bool) -> InferenceRequest
Enable streaming
Sourcepub fn with_priority(self, priority: Priority) -> InferenceRequest
pub fn with_priority(self, priority: Priority) -> InferenceRequest
Set priority
Sourcepub fn with_client_id(self, client_id: impl Into<ClientId>) -> InferenceRequest
pub fn with_client_id(self, client_id: impl Into<ClientId>) -> InferenceRequest
Set client ID
Sourcepub fn with_session_id(self, session_id: SessionId) -> InferenceRequest
pub fn with_session_id(self, session_id: SessionId) -> InferenceRequest
Set session ID
Sourcepub fn with_api_request(self, api_request: ApiRequest) -> InferenceRequest
pub fn with_api_request(self, api_request: ApiRequest) -> InferenceRequest
Set structured product/API request context.
Sourcepub fn with_prompt_token_evidence(self) -> InferenceRequest
pub fn with_prompt_token_evidence(self) -> InferenceRequest
Request prompt-token evidence from the execution boundary.
Sourcepub fn with_engine_token_timing_evidence(self) -> InferenceRequest
pub fn with_engine_token_timing_evidence(self) -> InferenceRequest
Request engine token-commit timing evidence.
Sourcepub fn with_metadata(
self,
key: impl Into<String>,
value: Value,
) -> InferenceRequest
pub fn with_metadata( self, key: impl Into<String>, value: Value, ) -> InferenceRequest
Add metadata
Trait Implementations§
Source§impl Clone for InferenceRequest
impl Clone for InferenceRequest
Source§fn clone(&self) -> InferenceRequest
fn clone(&self) -> InferenceRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more