1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//! v2 tool definitions and tool-call-id strong type.
//!
//! Per ADR 0015 ยง"v2 Tool definition". Mirrors Anthropic's tool-use
//! shape: name + free-form description + JSON Schema input
//! descriptor. The daemon's chat-templating layer wraps these into
//! whatever per-engine sequence the model expects (Gemma 4's
//! `<|tool_call>...<tool_call|>` sequence in the v0.2 default
//! adapter).
use ;
use Value;
/// Strong type around the string id that pairs an `assistant`-emitted
/// `tool_use` block with the matching `tool_result` block in the
/// consumer's follow-up request. Wrapping it lets the daemon ensure
/// the round-trip uses the same id and lets middleware authors avoid
/// passing raw `String` for ids.
;
/// Free-form JSON object representing a tool's invocation arguments.
///
/// Type-aliased to `serde_json::Value` deliberately: the daemon does
/// not enforce the consumer's `Tool::input_schema` (that's the
/// consumer's responsibility before executing the tool). The daemon
/// guarantees only that the model's emitted JSON parses; semantic
/// validation lives in the consumer.
pub type ToolUseInput = Value;
/// One tool definition in the request's top-level `tools[]` table.
///
/// `name` must be unique within a request. The model can emit a
/// `tool_use` content block referencing exactly this name; the
/// daemon's chat-templating layer is responsible for shaping the
/// definition into the format the active engine expects.