pub struct RenderInput {
pub messages: Vec<Message>,
pub tools: Vec<Value>,
pub documents: Vec<Value>,
pub add_generation_prompt: bool,
pub extra: Map<String, Value>,
}Expand description
Everything a chat template renders from: the conversation plus optional tools/documents
and the generation-prompt flag. Unmodeled keys land in extra and
are passed to the Jinja context verbatim.
Fields§
§messages: Vec<Message>The conversation, in order.
tools: Vec<Value>Tool/function definitions (JSON-schema), serialized by templates via tools | tojson.
Left as raw JSON because the schema shape is open-ended and key order matters.
documents: Vec<Value>RAG documents for grounded-generation templates (e.g. Command-R).
add_generation_prompt: boolWhether to append the assistant generation prefix. The template branches on this; we never synthesize the prefix ourselves.
extra: Map<String, Value>Arbitrary extra template kwargs some models read (enable_thinking, builtin_tools,
…). Flattened into the top-level Jinja context. Order-preserving.
Trait Implementations§
Source§impl Clone for RenderInput
impl Clone for RenderInput
Source§fn clone(&self) -> RenderInput
fn clone(&self) -> RenderInput
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 RenderInput
impl Debug for RenderInput
Source§impl Default for RenderInput
impl Default for RenderInput
Source§fn default() -> RenderInput
fn default() -> RenderInput
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for RenderInput
impl<'de> Deserialize<'de> for RenderInput
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RenderInput
impl RefUnwindSafe for RenderInput
impl Send for RenderInput
impl Sync for RenderInput
impl Unpin for RenderInput
impl UnsafeUnpin for RenderInput
impl UnwindSafe for RenderInput
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