From 88091998eb0d3842d800987c18cf373217c3d0b0 Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 8 Nov 2023 12:19:02 +0000 Subject: [PATCH] Switch to serde_json::Value for the response_format type --- src/v1/chat_completion.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/v1/chat_completion.rs b/src/v1/chat_completion.rs index 9a558f9..fa4259b 100644 --- a/src/v1/chat_completion.rs +++ b/src/v1/chat_completion.rs @@ -1,5 +1,6 @@ use serde::ser::SerializeMap; use serde::{Deserialize, Serialize, Serializer}; +use serde_json::Value; use std::collections::HashMap; use crate::impl_builder_methods; @@ -49,7 +50,7 @@ pub struct ChatCompletionRequest { #[serde(skip_serializing_if = "Option::is_none")] pub n: Option, #[serde(skip_serializing_if = "Option::is_none")] - pub response_format: Option, + pub response_format: Option, #[serde(skip_serializing_if = "Option::is_none")] pub stream: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -95,7 +96,7 @@ impl_builder_methods!( temperature: f64, top_p: f64, n: i64, - response_format: String, + response_format: Value, stream: bool, stop: Vec, max_tokens: i64,