pub trait LanguageModel: Send + Sync {
// Required method
fn chat<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>(
&'life0 self,
messages: &'life1 [ChatMessage],
tools: Option<&'life2 [ToolSpec]>,
response_schema: Option<&'life3 Value>,
strict: bool,
params: &'life4 Value,
trace: &'life5 TraceContext,
) -> Pin<Box<dyn Future<Output = Result<ModelResponse>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait;
// Provided method
fn complete<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
prompt: &'life1 str,
params: &'life2 Value,
trace: &'life3 TraceContext,
) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait { ... }
}Expand description
Minimal LLM contract; concrete providers live in adapter modules.