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: &str) -> TaskTokenization<'_>
fn from(prompt: &str) -> TaskTokenization<'_>
Converts to this type from the input type.
Source§impl Task for TaskTokenization<'_>
impl Task for TaskTokenization<'_>
Source§type Output = TokenizationOutput
type Output = TokenizationOutput
Output returned by
crate::Client::output_of
Source§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