pub struct RequestV2 {
pub id: String,
pub messages: Vec<MessageV2>,
pub attachments: Vec<Attachment>,
pub tools: Vec<Tool>,
pub temperature: Option<f64>,
pub top_p: Option<f64>,
pub top_k: Option<u32>,
pub max_tokens: Option<u32>,
pub stream: Option<bool>,
}Expand description
Re-exports of the v2 wire types per ADR 0015. v2 is shipped as
part of inferd-client 0.2 so consumers building against v2 can
reach the proto types without a separate inferd-proto dep.
The v2 request envelope sent by clients.
Default is intentionally available for ..Default::default()
shorthand; callers must populate id and messages before
sending.
Fields§
§id: StringCaller-assigned correlation id; echoed on every response frame.
messages: Vec<MessageV2>Conversation history in chronological order. Must be non-empty.
attachments: Vec<Attachment>Binary attachments referenced by attachment_id from content
blocks. Empty when the request is text-only.
tools: Vec<Tool>Tool definitions the model may call. Empty when no tools are in scope for this request.
temperature: Option<f64>Sampling temperature; daemon applies engine default if absent.
top_p: Option<f64>Nucleus sampling probability; daemon applies engine default if absent.
top_k: Option<u32>Top-k sampling cutoff; daemon applies engine default if absent.
max_tokens: Option<u32>Maximum tokens to generate; daemon applies engine default if absent.
stream: Option<bool>Stream tokens vs return one final done; daemon defaults to streaming.
Implementations§
Source§impl RequestV2
impl RequestV2
Sourcepub fn resolve(self) -> Result<ResolvedV2, ProtoError>
pub fn resolve(self) -> Result<ResolvedV2, ProtoError>
Validate the request envelope. Resolves attachment-id references,
checks uniqueness of attachment ids and tool names, and
rejects empty messages / empty content arrays.
Does NOT apply sampling defaults — those are backend-specific
in v2 (cloud backends and llamacpp pick different sensible
defaults). Backends fill them in at generate_v2 time.