pub trait ChatCompletion:
Send
+ Sync
+ DynClone {
// Required method
fn complete<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatCompletionResponse, LanguageModelError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided method
fn complete_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = ChatCompletionStream> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
}
Required Methods§
fn complete<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatCompletionResponse, LanguageModelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Provided Methods§
Sourcefn complete_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = ChatCompletionStream> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn complete_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = ChatCompletionStream> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Stream the completion response. If it’s not supported, it will return a single response
Trait Implementations§
Source§impl ChatCompletion for &dyn ChatCompletion
impl ChatCompletion for &dyn ChatCompletion
fn complete<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatCompletionResponse, LanguageModelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn complete_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = ChatCompletionStream> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn complete_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = ChatCompletionStream> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Stream the completion response. If it’s not supported, it will return a single
response
Source§impl ChatCompletion for Box<dyn ChatCompletion>
impl ChatCompletion for Box<dyn ChatCompletion>
fn complete<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatCompletionResponse, LanguageModelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn complete_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = ChatCompletionStream> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn complete_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = ChatCompletionStream> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Stream the completion response. If it’s not supported, it will return a single
response
Implementations on Foreign Types§
Source§impl ChatCompletion for Box<dyn ChatCompletion>
impl ChatCompletion for Box<dyn ChatCompletion>
fn complete<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatCompletionResponse, LanguageModelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn complete_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = ChatCompletionStream> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl<T> ChatCompletion for &Twhere
T: ChatCompletion + Clone + 'static,
impl<T> ChatCompletion for &Twhere
T: ChatCompletion + Clone + 'static,
fn complete<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = Result<ChatCompletionResponse, LanguageModelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn complete_stream<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ChatCompletionRequest,
) -> Pin<Box<dyn Future<Output = ChatCompletionStream> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Implementors§
impl ChatCompletion for &dyn ChatCompletion
impl ChatCompletion for MockChatCompletion
Available on crate feature
test-utils
only.