Struct aleph_alpha_client::TaskCompletion
source · [−]pub struct TaskCompletion<'a> {
pub prompt: Prompt<'a>,
pub stopping: Stopping<'a>,
pub sampling: Sampling,
}
Expand description
Completes a prompt. E.g. continues a text.
Fields
prompt: Prompt<'a>
The prompt (usually text) to be completed. Unconditional completion can be started with an empty string. The prompt may contain a zero shot or few shot task.
stopping: Stopping<'a>
Controls in which circumstances the model will stop generating new tokens.
sampling: Sampling
Sampling controls how the tokens (“words”) are selected for the completion.
Implementations
Trait Implementations
sourceimpl Task for TaskCompletion<'_>
impl Task for TaskCompletion<'_>
type Output = CompletionOutput
type Output = CompletionOutput
Output returned by
Client::execute
type ResponseBody = ResponseCompletion
type ResponseBody = ResponseCompletion
Expected answer of the Aleph Alpha API
sourcefn build_request(&self, client: &Client, base: &str, model: &str) -> RequestBuilder
fn build_request(&self, client: &Client, base: &str, model: &str) -> RequestBuilder
Prepare the request for the Aleph Alpha API. Authentication headers can be assumed to be
already set. Read more
sourcefn body_to_output(&self, response: Self::ResponseBody) -> Self::Output
fn body_to_output(&self, response: Self::ResponseBody) -> Self::Output
Parses the response of the server into higher level structs for the user.
Auto Trait Implementations
impl<'a> RefUnwindSafe for TaskCompletion<'a>
impl<'a> Send for TaskCompletion<'a>
impl<'a> Sync for TaskCompletion<'a>
impl<'a> Unpin for TaskCompletion<'a>
impl<'a> UnwindSafe for TaskCompletion<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more