From 45f5ef5033547b55dd8620031a2a2841365dcdca Mon Sep 17 00:00:00 2001 From: Tom Date: Tue, 7 Nov 2023 13:06:35 +0000 Subject: [PATCH] Add response_format to allow for json_object responses --- src/v1/chat_completion.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/v1/chat_completion.rs b/src/v1/chat_completion.rs index ff321b1..9a558f9 100644 --- a/src/v1/chat_completion.rs +++ b/src/v1/chat_completion.rs @@ -49,6 +49,8 @@ pub struct ChatCompletionRequest { #[serde(skip_serializing_if = "Option::is_none")] pub n: Option, #[serde(skip_serializing_if = "Option::is_none")] + pub response_format: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub stream: Option, #[serde(skip_serializing_if = "Option::is_none")] pub stop: Option>, @@ -75,6 +77,7 @@ impl ChatCompletionRequest { top_p: None, stream: None, n: None, + response_format: None, stop: None, max_tokens: None, presence_penalty: None, @@ -92,6 +95,7 @@ impl_builder_methods!( temperature: f64, top_p: f64, n: i64, + response_format: String, stream: bool, stop: Vec, max_tokens: i64,