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§
source§impl 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
source§fn 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.
source§fn 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.