summaryrefslogtreecommitdiff
path: root/libpanto/src/openai_chat_json.zig
diff options
context:
space:
mode:
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") },
});