diff options
Diffstat (limited to 'libpanto/src/conversation.zig')
| -rw-r--r-- | libpanto/src/conversation.zig | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libpanto/src/conversation.zig b/libpanto/src/conversation.zig index f0c822d..1fc5016 100644 --- a/libpanto/src/conversation.zig +++ b/libpanto/src/conversation.zig @@ -209,6 +209,13 @@ pub const Message = struct { /// null on user/system messages and when the provider emitted no usage. /// Used by compaction to size the retention window. usage: ?Usage = null, + /// Opaque per-message metadata bag. `libpanto` never interprets these + /// bytes; the documented contract is that, when present, they are valid + /// JSON (so a store may keep them as a JSON column and tools may + /// deserialize them). Round-trips through persistence: set before a turn + /// commits, read back off the `Message` after `load`. Borrowed; owned by + /// whoever set it (the conversation's allocator on the replay path). + metadata: ?[]const u8 = null, pub fn deinit(self: *Message, alloc: Allocator) void { for (self.content.items) |*block| { |
