Struct aleph_alpha_client::TaskTokenization
source · pub struct TaskTokenization<'a> {
pub prompt: &'a str,
pub tokens: bool,
pub token_ids: bool,
}
Expand description
Input for a crate::Client::tokenize request.
Fields§
§prompt: &'a str
The text prompt which should be converted into tokens
tokens: bool
Specify true
to return text-tokens.
token_ids: bool
Specify true
to return numeric token-ids.
Implementations§
source§impl TaskTokenization<'_>
impl TaskTokenization<'_>
Trait Implementations§
source§impl<'a> From<&'a str> for TaskTokenization<'a>
impl<'a> From<&'a str> for TaskTokenization<'a>
source§fn from(prompt: &'a str) -> TaskTokenization<'_>
fn from(prompt: &'a str) -> TaskTokenization<'_>
Converts to this type from the input type.
source§impl Task for TaskTokenization<'_>
impl Task for TaskTokenization<'_>
§type Output = TokenizationOutput
type Output = TokenizationOutput
Output returned by
crate::Client::output_of
§type ResponseBody = ResponseTokenization
type ResponseBody = ResponseTokenization
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.
Auto Trait Implementations§
impl<'a> Freeze for TaskTokenization<'a>
impl<'a> RefUnwindSafe for TaskTokenization<'a>
impl<'a> Send for TaskTokenization<'a>
impl<'a> Sync for TaskTokenization<'a>
impl<'a> Unpin for TaskTokenization<'a>
impl<'a> UnwindSafe for TaskTokenization<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more