OAIChatLikeRequest

Trait OAIChatLikeRequest 

Source
pub trait OAIChatLikeRequest {
    // Required methods
    fn model(&self) -> String;
    fn messages(&self) -> Value;
    fn should_add_generation_prompt(&self) -> bool;

    // Provided methods
    fn tools(&self) -> Option<Value> { ... }
    fn tool_choice(&self) -> Option<Value> { ... }
    fn chat_template_args(&self) -> Option<&HashMap<String, Value>> { ... }
    fn prompt_input_type(&self) -> PromptInput { ... }
    fn extract_tokens(&self) -> Option<TokenInput> { ... }
    fn extract_text(&self) -> Option<TextInput> { ... }
}
Expand description

Trait that defines a request that can map to an OpenAI-like request.

Required Methods§

Provided Methods§

Source

fn tools(&self) -> Option<Value>

Source

fn tool_choice(&self) -> Option<Value>

Source

fn chat_template_args(&self) -> Option<&HashMap<String, Value>>

Optional additional args to merge into the chat template context

Source

fn prompt_input_type(&self) -> PromptInput

Returns the type of input for the prompt. Default is Text.

Source

fn extract_tokens(&self) -> Option<TokenInput>

Extract tokens if the input is pre-tokenized

Source

fn extract_text(&self) -> Option<TextInput>

Implementors§