CompletionModelDyn

Trait CompletionModelDyn 

Source
pub trait CompletionModelDyn: WasmCompatSend + WasmCompatSync {
    // Required methods
    fn completion(
        &self,
        request: CompletionRequest,
    ) -> Pin<Box<dyn Future<Output = Result<CompletionResponse<()>, CompletionError>> + Send + '_>>;
    fn stream(
        &self,
        request: CompletionRequest,
    ) -> Pin<Box<dyn Future<Output = Result<StreamingCompletionResponse<FinalCompletionResponse>, CompletionError>> + Send + '_>>;
    fn completion_request(
        &self,
        prompt: Message,
    ) -> CompletionRequestBuilder<CompletionModelHandle<'_>>;
}
👎Deprecated since 0.25.0: DynClientBuilder and related features have been deprecated and will be removed in a future release. In this case, use CompletionModel instead.

Required Methods§

Source

fn completion( &self, request: CompletionRequest, ) -> Pin<Box<dyn Future<Output = Result<CompletionResponse<()>, CompletionError>> + Send + '_>>

👎Deprecated since 0.25.0: DynClientBuilder and related features have been deprecated and will be removed in a future release. In this case, use CompletionModel instead.
Source

fn stream( &self, request: CompletionRequest, ) -> Pin<Box<dyn Future<Output = Result<StreamingCompletionResponse<FinalCompletionResponse>, CompletionError>> + Send + '_>>

👎Deprecated since 0.25.0: DynClientBuilder and related features have been deprecated and will be removed in a future release. In this case, use CompletionModel instead.
Source

fn completion_request( &self, prompt: Message, ) -> CompletionRequestBuilder<CompletionModelHandle<'_>>

👎Deprecated since 0.25.0: DynClientBuilder and related features have been deprecated and will be removed in a future release. In this case, use CompletionModel instead.

Implementors§

Source§

impl<T, R> CompletionModelDyn for T
where T: CompletionModel<StreamingResponse = R>, R: Clone + Unpin + GetTokenUsage + 'static,