pub struct ChatTemplateParams<'a> {
pub add_generation_prompt: bool,
pub tools: Option<&'a [Value]>,
pub documents: Option<&'a [Value]>,
pub template_kwargs: Option<&'a HashMap<String, Value>>,
pub special_tokens: Option<&'a SpecialTokens>,
}Expand description
Parameters for chat template application
Fields§
§add_generation_prompt: bool§tools: Option<&'a [Value]>§documents: Option<&'a [Value]>§template_kwargs: Option<&'a HashMap<String, Value>>§special_tokens: Option<&'a SpecialTokens>Special tokens to inject into the template context.
Many templates reference {{ bos_token }}, {{ eos_token }}, etc.
Trait Implementations§
Source§impl<'a> Default for ChatTemplateParams<'a>
impl<'a> Default for ChatTemplateParams<'a>
Source§fn default() -> ChatTemplateParams<'a>
fn default() -> ChatTemplateParams<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'a> Freeze for ChatTemplateParams<'a>
impl<'a> RefUnwindSafe for ChatTemplateParams<'a>
impl<'a> Send for ChatTemplateParams<'a>
impl<'a> Sync for ChatTemplateParams<'a>
impl<'a> Unpin for ChatTemplateParams<'a>
impl<'a> UnsafeUnpin for ChatTemplateParams<'a>
impl<'a> UnwindSafe for ChatTemplateParams<'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