From ac5c4898dfa0a9e57424336774893dfc72b132e9 Mon Sep 17 00:00:00 2001 From: t Date: Wed, 3 Jun 2026 09:11:36 -0600 Subject: image uploads --- libpanto/src/tool_source.zig | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'libpanto/src/tool_source.zig') 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, }; -- cgit v1.3