Mila
Deep Neural Network Library
Loading...
Searching...
No Matches
Dnn.Components.GemmaProtocol Module Reference

Classes

struct  Mila::Dnn::Gemma::GemmaToolCall
 A tool call parsed out of the model's native <|tool_call> emission. More...

Functions

std::string Mila::Dnn::Gemma::formatToolCall (std::string_view name, std::string_view arguments_json)
 Render an assistant tool call back into Gemma's native call grammar.
std::string Mila::Dnn::Gemma::formatToolResponse (std::string_view name, std::string_view result_json)
 Render a client-executed tool result into Gemma's <|tool_response> grammar.
std::optional< GemmaToolCallMila::Dnn::Gemma::parseToolCall (std::string_view text)
 Parse the most recent native Gemma tool call out of accumulated model output, once generation has stopped right after <tool_call|>.

Variables

constexpr std::string_view Mila::Dnn::Gemma::kBos = "<bos>"
constexpr std::string_view Mila::Dnn::Gemma::kChannelClose = "<channel|>"
constexpr std::string_view Mila::Dnn::Gemma::kChannelOpen = "<|channel>"
constexpr std::string_view Mila::Dnn::Gemma::kEos = "<eos>"
constexpr std::string_view Mila::Dnn::Gemma::kPad = "<pad>"
constexpr std::string_view Mila::Dnn::Gemma::kStringDelimiter = "<|\"|>"
constexpr std::string_view Mila::Dnn::Gemma::kThink = "<|think|>"
constexpr std::string_view Mila::Dnn::Gemma::kToolCallClose = "<tool_call|>"
constexpr std::string_view Mila::Dnn::Gemma::kToolCallOpen = "<|tool_call>"
constexpr std::string_view Mila::Dnn::Gemma::kToolClose = "<tool|>"
constexpr std::string_view Mila::Dnn::Gemma::kToolOpen = "<|tool>"
constexpr std::string_view Mila::Dnn::Gemma::kToolResponseClose = "<tool_response|>"
constexpr std::string_view Mila::Dnn::Gemma::kToolResponseOpen = "<|tool_response>"
constexpr std::string_view Mila::Dnn::Gemma::kTurnClose = "<turn|>"
constexpr std::string_view Mila::Dnn::Gemma::kTurnOpen = "<|turn>"

Files

file  Mila/Src/Dnn/Components/Transformers/Gemma/Gemma.Protocol.ixx
 Canonical Gemma 4 native token grammar: parse/format for the model's registered turn / channel / tool-call / tool-response vocabulary.