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§
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>
Sourcefn chat_template_args(&self) -> Option<&HashMap<String, Value>>
fn chat_template_args(&self) -> Option<&HashMap<String, Value>>
Optional additional args to merge into the chat template context
Sourcefn prompt_input_type(&self) -> PromptInput
fn prompt_input_type(&self) -> PromptInput
Returns the type of input for the prompt. Default is Text.
Sourcefn extract_tokens(&self) -> Option<TokenInput>
fn extract_tokens(&self) -> Option<TokenInput>
Extract tokens if the input is pre-tokenized