Enum Finish Reason

View as Markdown

Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-ffi.

pub enum FinishReason {
    Complete,
    Length,
    ToolUse,
    ContentFilter,
    Unknown(String),
}

Normalized reason why the model stopped generating.

Maps from provider-specific stop reasons:

  • Complete: OpenAI Chat "stop", Anthropic "end_turn", Responses "completed"
  • Length: OpenAI Chat "length", Anthropic "max_tokens", Responses incomplete+max_output_tokens
  • ToolUse: OpenAI Chat "tool_calls", Anthropic "tool_use"
  • ContentFilter: OpenAI Chat "content_filter", Responses incomplete+content_filter
  • Unknown: Forward-compatible catch-all for unrecognized reasons

Variants

Complete

Complete

Model naturally completed its response.

Length

Length

Maximum token limit reached.

ToolUse

ToolUse

Model requested a tool call.

ContentFilter

ContentFilter

Content was filtered by safety systems.

Unknown(String)

Unknown(String)

Unknown or forward-compatible reason.

Implementations

impl FinishReason

impl FinishReason

is_complete

pub fn is_complete(&self) -> bool

Returns true if the model naturally completed its response.

Only the FinishReason::Complete variant returns true.

Trait Implementations

impl Clone for FinishReason

impl Clone for FinishReason

clone

fn clone(&self) -> FinishReason

clone_from

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

impl Debug for FinishReason

impl Debug for FinishReason

fmt

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

impl<'de> Deserialize<'de> for FinishReason

impl<'de> Deserialize<'de> for FinishReason

deserialize

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

impl PartialEq for FinishReason

impl PartialEq for FinishReason

eq

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

ne

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

impl Serialize for FinishReason

impl Serialize for FinishReason

serialize

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

impl Eq for FinishReason

impl Eq for FinishReason

impl StructuralPartialEq for FinishReason

impl StructuralPartialEq for FinishReason