diff options
| author | t <t@tjp.lol> | 2026-06-03 09:11:36 -0600 |
|---|---|---|
| committer | t <t@tjp.lol> | 2026-06-03 12:34:13 -0600 |
| commit | ac5c4898dfa0a9e57424336774893dfc72b132e9 (patch) | |
| tree | 03eb8e32a001845dbaec163dfd4905ffc23d9fa6 /libpanto/src/tool_source.zig | |
| parent | 2416a308c0e467f8dbdbe09942aa903bca751c0e (diff) | |
image uploads
Diffstat (limited to 'libpanto/src/tool_source.zig')
| -rw-r--r-- | libpanto/src/tool_source.zig | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/libpanto/src/tool_source.zig b/libpanto/src/tool_source.zig index bb109d8..4b9e104 100644 --- a/libpanto/src/tool_source.zig +++ b/libpanto/src/tool_source.zig @@ -29,16 +29,13 @@ const std = @import("std"); const Allocator = std.mem.Allocator; +const tool = @import("tool.zig"); -/// Tool metadata: everything the LLM-facing wire needs (name, -/// description, schema) without an invocation vtable. `ToolSource`s -/// declare their tools this way because they share a single dispatch -/// path. -pub const ToolDecl = struct { - name: []const u8, - description: []const u8, - schema_json: []const u8, -}; +/// Tool metadata: re-exported from `tool.zig`, which owns the more atomic +/// type. `ToolSource`s declare their tools this way because they share a +/// single dispatch path. +pub const ToolDecl = tool.ToolDecl; +pub const ResultPart = tool.ResultPart; /// One pending invocation passed to `invoke_batch`. Slices borrowed from /// the caller for the duration of the call. @@ -52,9 +49,9 @@ pub const Call = struct { /// Result for a single call. Mirrors the success/error split of /// `Tool.invoke`'s return shape. Owned by the caller-supplied allocator. pub const CallResult = union(enum) { - /// Owned bytes, freed by libpanto after assembling the ToolResult - /// block. - ok: []u8, + /// Owned parts (slice + each part's bytes), freed by libpanto after + /// assembling the ToolResult block (see `tool.freeResultParts`). + ok: []ResultPart, err: anyerror, }; |
