diff options
Diffstat (limited to 'libpanto/src/session_manager.zig')
| -rw-r--r-- | libpanto/src/session_manager.zig | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libpanto/src/session_manager.zig b/libpanto/src/session_manager.zig index c6256e0..bbc996b 100644 --- a/libpanto/src/session_manager.zig +++ b/libpanto/src/session_manager.zig @@ -1518,9 +1518,11 @@ test "SessionManager: tool-use round-trip — assistant w/ ToolUse, user w/ Tool // Tool-result user message. const tr = try testing.allocator.alloc(DiskContentBlock, 1); + const trp = try testing.allocator.alloc(session_mod.DiskResultPart, 1); + trp[0] = .{ .text = try testing.allocator.dupe(u8, "a.txt\nb.txt") }; tr[0] = .{ .tool_result = .{ .tool_use_id = try testing.allocator.dupe(u8, "tool_abc"), - .content = try testing.allocator.dupe(u8, "a.txt\nb.txt"), + .parts = trp, } }; _ = try mgr.appendMessage(.{ .role = .user, .content = tr }, "openai", "gpt-4o"); @@ -1551,7 +1553,7 @@ test "SessionManager: tool-use round-trip — assistant w/ ToolUse, user w/ Tool try testing.expectEqualStrings("openai", entries[2].message.provider.?); try testing.expect(entries[2].message.message.content[0] == .tool_result); try testing.expectEqualStrings("tool_abc", entries[2].message.message.content[0].tool_result.tool_use_id); - try testing.expectEqualStrings("a.txt\nb.txt", entries[2].message.message.content[0].tool_result.content); + try testing.expectEqualStrings("a.txt\nb.txt", entries[2].message.message.content[0].tool_result.parts[0].text); // Conversation rebuild yields the same shape. var conv = try resumed.rebuildConversation(); |
