pub struct RenderOptions {
pub add_generation_prompt: bool,
pub bos_token: Option<String>,
pub eos_token: Option<String>,
pub tools: Vec<Value>,
pub extra: Map<String, Value>,
}Expand description
Everything a template can read besides messages.
extra is the OpenAI-extension chat_template_kwargs passthrough:
whatever the client puts there becomes a top-level template variable,
which is how enable_thinking (Qwen3, gemma-4), thinking
(DeepSeek), and preserve_thinking are actually driven. Values in
extra never shadow messages/tools/add_generation_prompt.
Fields§
§add_generation_prompt: bool§bos_token: Option<String>The vocabulary’s BOS text (<s>, <|begin_of_text|>, <bos>).
Templates that print {{ bos_token }} own BOS insertion; see
ferrox-server’s generate for why that does not double-add.
eos_token: Option<String>§tools: Vec<Value>OpenAI tools array, verbatim. Passed to every template; only
templates that mention tools do anything with it (see
ChatTemplate::handles_tools).
extra: Map<String, Value>Trait Implementations§
Source§impl Clone for RenderOptions
impl Clone for RenderOptions
Source§fn clone(&self) -> RenderOptions
fn clone(&self) -> RenderOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RenderOptions
impl Debug for RenderOptions
Source§impl Default for RenderOptions
impl Default for RenderOptions
Source§fn default() -> RenderOptions
fn default() -> RenderOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RenderOptions
impl RefUnwindSafe for RenderOptions
impl Send for RenderOptions
impl Sync for RenderOptions
impl Unpin for RenderOptions
impl UnsafeUnpin for RenderOptions
impl UnwindSafe for RenderOptions
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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