pub struct ApplyChatTemplateArgs<'a, I, R = Role, T = String>{
pub conversations: I,
pub tools: Option<&'a [Value]>,
pub documents: Option<&'a [Document]>,
pub model_id: &'a str,
pub chat_template_id: Option<&'a str>,
pub add_generation_prompt: Option<bool>,
pub continue_final_message: Option<bool>,
pub template_kwargs: Option<&'a Map<String, Value>>,
}Expand description
Inputs for rendering one or more conversations with a chat template.
Fields§
§conversations: IConversations to render.
tools: Option<&'a [Value]>Tool definitions exposed to the template.
documents: Option<&'a [Document]>Documents exposed to the template.
model_id: &'a strStable model identifier used to cache the compiled template.
chat_template_id: Option<&'a str>Identifier of a template already registered in the environment.
add_generation_prompt: Option<bool>Whether to ask the template to append its generation prompt.
continue_final_message: Option<bool>Whether to trim the rendering after the final input message.
template_kwargs: Option<&'a Map<String, Value>>Additional variables exposed to the template.
Trait Implementations§
Auto Trait Implementations§
impl<'a, I, R, T> Freeze for ApplyChatTemplateArgs<'a, I, R, T>where
I: Freeze,
impl<'a, I, R, T> RefUnwindSafe for ApplyChatTemplateArgs<'a, I, R, T>where
I: RefUnwindSafe,
impl<'a, I, R, T> Send for ApplyChatTemplateArgs<'a, I, R, T>where
I: Send,
impl<'a, I, R, T> Sync for ApplyChatTemplateArgs<'a, I, R, T>where
I: Sync,
impl<'a, I, R, T> Unpin for ApplyChatTemplateArgs<'a, I, R, T>where
I: Unpin,
impl<'a, I, R, T> UnsafeUnpin for ApplyChatTemplateArgs<'a, I, R, T>where
I: UnsafeUnpin,
impl<'a, I, R, T> UnwindSafe for ApplyChatTemplateArgs<'a, I, R, T>where
I: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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