Skip to navigation

Struct Annotated LlmRequest

View as Markdown

Generated from cargo doc --no-deps -p nemo-relay-builtins -p nemo-relay-diagnostics -p nemo-relay-logging -p nemo-relay-plugin-host -p nemo-relay-codecs -p nemo-relay -p nemo-relay-runtime -p nemo-relay-model-pricing -p nemo-relay-resource-metrics -p nemo-relay-observability -p nemo-relay-adaptive -p nemo-relay-pii-redaction -p nemo-relay-ffi -p nemo-relay-types -p nemo-relay-plugin -p nemo-relay-worker-proto -p nemo-relay-worker.

pub struct AnnotatedLlmRequest {Show 21 fields
    pub messages: Vec<LlmMessage>,
    pub instructions: Option<MessageContent>,
    pub model: Option<String>,
    pub params: Option<GenerationParams>,
    pub tools: Option<ToolDefinitionList>,
    pub tool_choice: Option<ToolChoice>,
    pub store: Option<bool>,
    pub previous_response_id: Option<String>,
    pub truncation: Option<JsonValue>,
    pub reasoning: Option<JsonValue>,
    pub include: Option<JsonValue>,
    pub user: Option<String>,
    pub metadata: Option<JsonValue>,
    pub service_tier: Option<String>,
    pub parallel_tool_calls: Option<bool>,
    pub max_output_tokens: Option<u64>,
    pub max_tool_calls: Option<u64>,
    pub top_logprobs: Option<u64>,
    pub stream: Option<bool>,
    pub api_specific: Option<JsonValue>,
    pub extra: HashMap<String, JsonValue>,
}

Normalized request structure with explicit provider-specific and extension fields.

Fields

messages: Vec<LlmMessage>

Parsed conversation messages.

instructions: Option<MessageContent>

Provider-level instructions that are not part of the conversation array. Anthropic encodes this as system; OpenAI Responses uses instructions.

model: Option<String>

Model identifier (e.g., "gpt-4", "claude-sonnet-4-20250514").

params: Option<GenerationParams>

Common generation parameters, normalized.

tools: Option<ToolDefinitionList>

Tool definitions (function schemas) available to the model.

tool_choice: Option<ToolChoice>

Tool choice control.

store: Option<bool>

OpenAI Responses: whether to persist response state server-side.

previous_response_id: Option<String>

OpenAI Responses: prior response to continue from.

truncation: Option<JsonValue>

OpenAI Responses: context truncation behavior.

reasoning: Option<JsonValue>

OpenAI Responses: reasoning configuration object.

include: Option<JsonValue>

OpenAI Responses: include filter for additional output/state items.

user: Option<String>

OpenAI user identifier.

metadata: Option<JsonValue>

OpenAI metadata map/object.

service_tier: Option<String>

OpenAI service tier preference.

parallel_tool_calls: Option<bool>

OpenAI tool parallelism toggle.

max_output_tokens: Option<u64>

OpenAI Responses max output token limit.

max_tool_calls: Option<u64>

OpenAI Responses max tool calls.

top_logprobs: Option<u64>

OpenAI logprob fanout count.

stream: Option<bool>

OpenAI streaming toggle.

api_specific: Option<JsonValue>

Codec-owned request data; preserved as JSON and validated by the selected codec.

extra: HashMap<String, JsonValue>

Unknown provider fields, excluding modeled field names.

Implementations

impl AnnotatedLlmRequest

impl AnnotatedLlmRequest

model

pub fn model(&self) -> &str

Returns the value of model, or the default value if model is unset.

store

pub fn store(&self) -> bool

Returns the value of store, or the default value if store is unset.

previous_response_id

pub fn previous_response_id(&self) -> &str

Returns the value of previous_response_id, or the default value if previous_response_id is unset.

user

pub fn user(&self) -> &str

Returns the value of user, or the default value if user is unset.

service_tier

pub fn service_tier(&self) -> &str

Returns the value of service_tier, or the default value if service_tier is unset.

parallel_tool_calls

pub fn parallel_tool_calls(&self) -> bool

Returns the value of parallel_tool_calls, or the default value if parallel_tool_calls is unset.

max_output_tokens

pub fn max_output_tokens(&self) -> u64

Returns the value of max_output_tokens, or the default value if max_output_tokens is unset.

max_tool_calls

pub fn max_tool_calls(&self) -> u64

Returns the value of max_tool_calls, or the default value if max_tool_calls is unset.

top_logprobs

pub fn top_logprobs(&self) -> u64

Returns the value of top_logprobs, or the default value if top_logprobs is unset.

stream

pub fn stream(&self) -> bool

Returns the value of stream, or the default value if stream is unset.

Trait Implementations

impl Clone for AnnotatedLlmRequest

impl Clone for AnnotatedLlmRequest

clone

fn clone(&self) -> AnnotatedLlmRequest

clone_from

fn clone_from(&mut self, source: &Self)

impl Debug for AnnotatedLlmRequest

impl Debug for AnnotatedLlmRequest

fmt

fn fmt(&self, f: &mut Formatter<'_>) -> Result

impl Default for AnnotatedLlmRequest

impl Default for AnnotatedLlmRequest

default

fn default() -> Self

impl Message for AnnotatedLlmRequest

impl Message for AnnotatedLlmRequest

encoded_len

fn encoded_len(&self) -> usize

clear

fn clear(&mut self)

encode

fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
    Self: Sized,

encode_to_vec

fn encode_to_vec(&self) -> Vec<u8> where
    Self: Sized,

encode_length_delimited

fn encode_length_delimited(
    &self,
    buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
    Self: Sized,

encode_length_delimited_to_vec

fn encode_length_delimited_to_vec(&self) -> Vec<u8> where
    Self: Sized,

decode

fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
    Self: Default,

decode_length_delimited

fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
    Self: Default,

merge

fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
    Self: Sized,

merge_length_delimited

fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
    Self: Sized,

impl Name for AnnotatedLlmRequest

impl Name for AnnotatedLlmRequest

NAME

const NAME: &'static str = "AnnotatedLlmRequest"

PACKAGE

const PACKAGE: &'static str = "nvidia.nemo.relay.worker.v1"

full_name

fn full_name() -> String

type_url

fn type_url() -> String

impl PartialEq for AnnotatedLlmRequest

impl PartialEq for AnnotatedLlmRequest

eq

fn eq(&self, other: &AnnotatedLlmRequest) -> bool

ne

fn ne(&self, other: &Rhs) -> bool

impl WireValue<AnnotatedLlmRequest> for AnnotatedLlmRequest

impl WireValue<AnnotatedLlmRequest> for AnnotatedLlmRequest

to_wire

fn to_wire(self) -> Result<AnnotatedLlmRequest>

from_wire

fn from_wire(value: AnnotatedLlmRequest) -> Result<Self>

impl StructuralPartialEq for AnnotatedLlmRequest

impl StructuralPartialEq for AnnotatedLlmRequest