pub trait LLMClient: Send + Sync {
// Required method
fn chat<'life0, 'life1, 'async_trait>(
&'life0 self,
messages: Vec<Message>,
tools: Vec<ToolDefinition>,
model: Option<&'life1 str>,
json_mode: bool,
) -> Pin<Box<dyn Future<Output = GentResult<LLMResponse>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Trait for LLM clients
Required Methods§
Sourcefn chat<'life0, 'life1, 'async_trait>(
&'life0 self,
messages: Vec<Message>,
tools: Vec<ToolDefinition>,
model: Option<&'life1 str>,
json_mode: bool,
) -> Pin<Box<dyn Future<Output = GentResult<LLMResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn chat<'life0, 'life1, 'async_trait>(
&'life0 self,
messages: Vec<Message>,
tools: Vec<ToolDefinition>,
model: Option<&'life1 str>,
json_mode: bool,
) -> Pin<Box<dyn Future<Output = GentResult<LLMResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Send a chat request to the LLM
§Arguments
messages- The conversation historytools- Available tool definitionsmodel- Optional model override (uses client default if None)json_mode- Enable JSON mode (response_format: json_object)