Skip to main content

Completion

Trait Completion 

Source
pub trait Completion: Send + Sync {
    // Required method
    fn complete(
        &self,
        request: CompletionRequest,
    ) -> BoxFuture<Result<ModelDecision, ActorError>>;

    // Provided method
    fn reported_prompt_tokens(&self) -> Option<u64> { ... }
}

Required Methods§

Provided Methods§

Source

fn reported_prompt_tokens(&self) -> Option<u64>

Provider-reported prompt tokens for the completion that just returned. None when the provider omitted usage. The infer transition copies this onto the model.turn fact so a later fold can compact from it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§