Last updated: 2026-11-17
Vulkan Runtime
Gemma Tools
Gemma 4's native function-call grammar.
Strings use raw <|"|> delimiters; JSON escaping, braces and newlines inside them are ordinary string bytes.
10 exports shown
constant
call_open
pub const call_open = "<|tool_call>" No public doc comment yet.
constant
call_close
pub const call_close = "<tool_call|>" No public doc comment yet.
constant
string_delimiter
pub const string_delimiter = "<|\"|>" No public doc comment yet.
struct
Call
pub const Call = struct name: []const u8, arguments: std.json.Value } No public doc comment yet.
Methods
1method
Call.visibleText
pub fn visibleText(text: []const u8) []const u8 Hide only an initial thought channel.
Markers inside native string arguments are source data and must never be rewritten or trimmed.
function
findClose
pub fn findClose(text: []const u8, start: usize) ?usize No public doc comment yet.
function
parse
pub fn parse(inner: []const u8, allocator: std.mem.Allocator) !?Call Allocations belong to the supplied arena.
Incomplete/invalid calls are never repaired into executable requests. The top-level arguments must be an object.
function
appendValue
pub fn appendValue(buf: *std.ArrayList(u8), a: std.mem.Allocator, value: std.json.Value, depth: u8) anyerror!void No public doc comment yet.
function
appendDefinition
pub fn appendDefinition(buf: *std.ArrayList(u8), a: std.mem.Allocator, name: []const u8, description: []const u8, parameters: []const u8) !void No public doc comment yet.
function
appendCall
pub fn appendCall(buf: *std.ArrayList(u8), a: std.mem.Allocator, name: []const u8, arguments: []const u8) !void No public doc comment yet.
function
appendResult
pub fn appendResult(buf: *std.ArrayList(u8), a: std.mem.Allocator, name: []const u8, content: []const u8) !void No public doc comment yet.