CompletionResponse

Trait CompletionResponse 

Source
pub trait CompletionResponse: Send + Sync {
    // Required methods
    fn text(&self) -> String;
    fn usage(&self) -> Option<Usage>;
    fn finish_reason(&self) -> Option<FinishReason>;
    fn metadata(&self) -> Metadata;
}
Expand description

Trait for completion response types.

Required Methods§

Source

fn text(&self) -> String

Get the completion text

Source

fn usage(&self) -> Option<Usage>

Get usage statistics if available

Source

fn finish_reason(&self) -> Option<FinishReason>

Get the reason why generation finished

Source

fn metadata(&self) -> Metadata

Get response metadata

Implementors§