Skip to navigation

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 AnnotatedLlmResponse {
pub id: Option<String>,
pub model: Option<String>,
pub message: Option<MessageContent>,
pub reasoning_parts: Vec<ReasoningPart>,
pub tool_calls: Option<Vec<ResponseToolCall>>,
pub finish_reason: Option<FinishReason>,
pub usage: Option<Usage>,
pub optimization_summary: Option<LlmOptimizationSummary>,
pub api_specific: Option<ApiSpecificResponse>,
pub extra: Map<String, Value>,
}

Referenced types: Option, String, Vec, LlmOptimizationSummary, Map, Value

Structured view of an LLM response, produced by a response codec from raw JSON API output.

The extra field captures any top-level keys not modeled by the known fields, ensuring lossless round-trip through serde.

Fields

id: Option<String>

Response ID from the API (e.g., “chatcmpl-abc123”, “resp_abc123”, “msg_abc123”).

model: Option<String>

The model that actually served the request (may differ from requested model).

message: Option<MessageContent>

The assistant’s response content, reusing [MessageContent] from request types.

reasoning_parts: Vec<ReasoningPart>

Ordered disclosed reasoning and summaries. The separate wire name preserves historical provider extras named reasoning.

tool_calls: Option<Vec<ResponseToolCall>>

Tool calls requested by the model, normalized across APIs.

Uses [ResponseToolCall] (arguments as Json) NOT the request-side ToolCall (arguments as String).

finish_reason: Option<FinishReason>

Why generation stopped, normalized across APIs.

usage: Option<Usage>

Token usage statistics.

optimization_summary: Option<LlmOptimizationSummary>

Plugin-neutral optimization accounting computed by Relay at LLM close.

api_specific: Option<ApiSpecificResponse>

API-specific response data that cannot be normalized across providers.

extra: Map<String, Value>

Catch-all for unmodeled top-level fields, ensuring lossless round-trip.

Implementations

impl AnnotatedLlmResponse

impl AnnotatedLlmResponse

Referenced types: AnnotatedLlmResponse

output

pub fn output(&self) -> MessageView<'_>

Inspect current normalized content followed by separate tool calls.

This does not reconstruct provider ordering between those fields.

response_text

pub fn response_text(&self) -> Option<Cow<'_, str>>

Referenced types: Option, Cow, str

Join all explicit text/refusals in the current output, excluding tools.

has_tool_calls

pub fn has_tool_calls(&self) -> bool

Referenced types: bool

Check if the response contains any tool calls.

Returns true if tool_calls is Some with at least one element.

Trait Implementations

impl Clone for AnnotatedLlmResponse

impl Clone for AnnotatedLlmResponse

Referenced types: Clone, AnnotatedLlmResponse

clone

fn clone(&self) -> AnnotatedLlmResponse

Referenced types: clone, AnnotatedLlmResponse

clone_from

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

Referenced types: clone_from

impl Debug for AnnotatedLlmResponse

impl Debug for AnnotatedLlmResponse

Referenced types: Debug, AnnotatedLlmResponse

fmt

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

Referenced types: fmt, Formatter, Result, (), Error

impl Default for AnnotatedLlmResponse

impl Default for AnnotatedLlmResponse

Referenced types: Default, AnnotatedLlmResponse

default

fn default() -> AnnotatedLlmResponse

Referenced types: default, AnnotatedLlmResponse

impl<'de> Deserialize<'de> for AnnotatedLlmResponse

impl<'de> Deserialize<'de> for AnnotatedLlmResponse

Referenced types: Deserialize, AnnotatedLlmResponse

deserialize

fn deserialize<__D>(
__deserializer: __D,
) -> Result<AnnotatedLlmResponse, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,

Referenced types: deserialize, Result, AnnotatedLlmResponse, Deserializer, Error

impl PartialEq for AnnotatedLlmResponse

impl PartialEq for AnnotatedLlmResponse

Referenced types: PartialEq, AnnotatedLlmResponse

eq

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

Referenced types: eq, AnnotatedLlmResponse, bool

ne

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

Referenced types: ne, &Rhs, bool

impl Serialize for AnnotatedLlmResponse

impl Serialize for AnnotatedLlmResponse

Referenced types: Serialize, AnnotatedLlmResponse

serialize

fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,

Referenced types: serialize, Result, Serializer, Ok, Error

impl WireValue<AnnotatedLlmResponse> for AnnotatedLlmResponse

impl WireValue<AnnotatedLlmResponse> for AnnotatedLlmResponse

Referenced types: AnnotatedLlmResponse

to_wire

fn to_wire(self) -> Result<AnnotatedLlmResponse, ConversionError>

Referenced types: Result

from_wire

fn from_wire(
value: AnnotatedLlmResponse,
) -> Result<AnnotatedLlmResponse, ConversionError>

Referenced types: Result, AnnotatedLlmResponse

impl WireValue<Box<AnnotatedLlmResponse>> for AnnotatedLlmResponse

impl WireValue<Box<AnnotatedLlmResponse>> for AnnotatedLlmResponse

Referenced types: Box, AnnotatedLlmResponse

to_wire

fn to_wire(self) -> Result<Box<AnnotatedLlmResponse>, ConversionError>

Referenced types: Result, Box

from_wire

fn from_wire(
value: Box<AnnotatedLlmResponse>,
) -> Result<AnnotatedLlmResponse, ConversionError>

Referenced types: Box, Result, AnnotatedLlmResponse

impl StructuralPartialEq for AnnotatedLlmResponse

impl StructuralPartialEq for AnnotatedLlmResponse

Referenced types: StructuralPartialEq, AnnotatedLlmResponse