summaryrefslogtreecommitdiff
path: root/libpanto/src/openai_chat_json.zig
diff options
context:
space:
mode:
authorT <t@tjp.lol>2026-05-25 21:50:43 -0600
committerT <t@tjp.lol>2026-05-25 22:19:44 -0600
commitf026bb81ae68f516910d0eb4f23c9344dd36b62b (patch)
treee091d1a870cc75dc92e6cee785ee78ff4d6f088f /libpanto/src/openai_chat_json.zig
parentdf2edee86eec2a8deb0ad57b5d20552199c12b65 (diff)
phase 2 done
Diffstat (limited to 'libpanto/src/openai_chat_json.zig')
-rw-r--r--libpanto/src/openai_chat_json.zig7
1 files changed, 3 insertions, 4 deletions
diff --git a/libpanto/src/openai_chat_json.zig b/libpanto/src/openai_chat_json.zig
index 79cccac..465d951 100644
--- a/libpanto/src/openai_chat_json.zig
+++ b/libpanto/src/openai_chat_json.zig
@@ -28,7 +28,7 @@ pub const StreamDelta = struct {
/// The caller owns the returned slice (allocated with `allocator`).
pub fn serializeRequest(
allocator: Allocator,
- cfg: *const config_mod.Config,
+ cfg: *const config_mod.OpenAIChatConfig,
conv: *const conversation.Conversation,
) ![]u8 {
var aw: Writer.Allocating = .init(allocator);
@@ -164,9 +164,8 @@ pub fn parseStreamEvent(allocator: Allocator, payload: []const u8) !ParsedDelta
const testing = std.testing;
-fn testConfig(model: []const u8) config_mod.Config {
+fn testConfig(model: []const u8) config_mod.OpenAIChatConfig {
return .{
- .api_style = .openai_chat,
.api_key = "k",
.base_url = "u",
.model = model,
@@ -210,7 +209,7 @@ test "serializeRequest - assistant Thinking blocks are stripped from outbound hi
defer conv.deinit();
try conv.addAssistantMessage(&.{
- .{ .Thinking = try conversation.textualBlockFromSlice(allocator, "thinking step") },
+ .{ .Thinking = .{ .text = try conversation.textualBlockFromSlice(allocator, "thinking step") } },
.{ .Text = try conversation.textualBlockFromSlice(allocator, "answer here") },
});