summaryrefslogtreecommitdiff
path: root/libpanto/src/file_system_jsonl_store.zig
diff options
context:
space:
mode:
Diffstat (limited to 'libpanto/src/file_system_jsonl_store.zig')
-rw-r--r--libpanto/src/file_system_jsonl_store.zig11
1 files changed, 10 insertions, 1 deletions
diff --git a/libpanto/src/file_system_jsonl_store.zig b/libpanto/src/file_system_jsonl_store.zig
index c77d7d2..979b35e 100644
--- a/libpanto/src/file_system_jsonl_store.zig
+++ b/libpanto/src/file_system_jsonl_store.zig
@@ -1435,6 +1435,15 @@ fn anStamp() session_mod.WireStamp {
return .{ .api_style = .anthropic_messages, .base_url = "https://api.anthropic.com", .model = "claude-sonnet-4-20250514" };
}
+/// Test helper: append a single-text user message (see the `addUserMessage`
+/// signature change to a block slice).
+fn addUserText(conv: *conversation_mod.Conversation, text: []const u8) !void {
+ const tb = try conversation_mod.textualBlockFromSlice(conv.allocator, text);
+ var block: conversation_mod.ContentBlock = .{ .Text = tb };
+ errdefer block.deinit(conv.allocator);
+ try conv.addUserMessage(&.{block});
+}
+
test "newUuidV7: produces 36-char hyphenated string with version 7" {
const io = testing.io;
const id = try newUuidV7(testing.allocator, io);
@@ -2058,7 +2067,7 @@ test "FileSystemJSONLStore catalog: create → append → load round-trips" {
// messages owned here).
var conv = conversation_mod.Conversation.init(testing.allocator);
defer conv.deinit();
- try conv.addUserMessage("ping");
+ try addUserText(&conv, "ping");
try conv.addAssistantMessage(&.{}, null);
const id: session_store_mod.WireIdentity = .{ .api_style = .openai_chat, .base_url = "u", .model = "m" };