pub trait LlmDriver:
Send
+ Sync
+ 'static {
// Required method
fn complete<'life0, 'async_trait>(
&'life0 self,
request: CompletionRequest,
) -> Pin<Box<dyn Future<Output = PunchResult<CompletionResponse>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn stream_complete<'life0, 'async_trait>(
&'life0 self,
request: CompletionRequest,
) -> Pin<Box<dyn Future<Output = PunchResult<CompletionResponse>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn stream_complete_with_callback<'life0, 'async_trait>(
&'life0 self,
request: CompletionRequest,
callback: StreamCallback,
) -> Pin<Box<dyn Future<Output = PunchResult<CompletionResponse>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
Abstraction over LLM providers.
Required Methods§
Sourcefn complete<'life0, 'async_trait>(
&'life0 self,
request: CompletionRequest,
) -> Pin<Box<dyn Future<Output = PunchResult<CompletionResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn complete<'life0, 'async_trait>(
&'life0 self,
request: CompletionRequest,
) -> Pin<Box<dyn Future<Output = PunchResult<CompletionResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Send a completion request and return the response.
Provided Methods§
Sourcefn stream_complete<'life0, 'async_trait>(
&'life0 self,
request: CompletionRequest,
) -> Pin<Box<dyn Future<Output = PunchResult<CompletionResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stream_complete<'life0, 'async_trait>(
&'life0 self,
request: CompletionRequest,
) -> Pin<Box<dyn Future<Output = PunchResult<CompletionResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Streaming variant. Default implementation falls back to complete.
Sourcefn stream_complete_with_callback<'life0, 'async_trait>(
&'life0 self,
request: CompletionRequest,
callback: StreamCallback,
) -> Pin<Box<dyn Future<Output = PunchResult<CompletionResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stream_complete_with_callback<'life0, 'async_trait>(
&'life0 self,
request: CompletionRequest,
callback: StreamCallback,
) -> Pin<Box<dyn Future<Output = PunchResult<CompletionResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Streaming completion with per-chunk callback.
Returns the final assembled CompletionResponse.