pub struct Turn {
pub role: String,
pub content: String,
pub tool_calls: Vec<ToolCall>,
pub reasoning: Option<String>,
pub tool_call_id: Option<String>,
pub tool_name: Option<String>,
pub tool_responses: Vec<(String, Val)>,
}Expand description
One chat turn for the tools-capable renderer (apply_chat_template_tools).
The reasoning/tool_call_id/tool_name/tool_responses fields are read ONLY by the
gemma4 arm; the qwen/step arms use role/content/tool_calls and leave the rest default.
Fields§
§role: String§content: String§tool_calls: Vec<ToolCall>§reasoning: Option<String>gemma4: assistant reasoning re-rendered as a <|channel>thought span (only for a
tool_calls-carrying assistant after the last user message — the template’s guard).
tool_call_id: Option<String>gemma4: on a role:“tool” turn, the OpenAI tool_call_id used to resolve the response
name against the preceding assistant’s tool_calls[].id.
tool_name: Option<String>gemma4: on a role:“tool” turn, the message’s own name field (fallback when the id
does not resolve).
tool_responses: Vec<(String, Val)>gemma4 native (Google) responses embedded on an assistant turn: (name, response value). OpenAI histories leave this empty and use role:“tool” turns instead.