summaryrefslogtreecommitdiff
path: root/libpanto/src/tool_source.zig
diff options
context:
space:
mode:
Diffstat (limited to 'libpanto/src/tool_source.zig')
-rw-r--r--libpanto/src/tool_source.zig21
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,
};