Skip to content

Commit

Permalink
Merge pull request #41 from draftoai/draftoai/add-response-format-to-…
Browse files Browse the repository at this point in the history
…chat-completions

Add "response_format" to allow for json_object responses in chat completions
  • Loading branch information
Dongri Jin committed Nov 8, 2023
2 parents 7217809 + 45f5ef5 commit 3535d13
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/v1/chat_completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ pub struct ChatCompletionRequest {
#[serde(skip_serializing_if = "Option::is_none")]
pub n: Option<i64>,
#[serde(skip_serializing_if = "Option::is_none")]
pub response_format: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub stream: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub stop: Option<Vec<String>>,
Expand All @@ -75,6 +77,7 @@ impl ChatCompletionRequest {
top_p: None,
stream: None,
n: None,
response_format: None,
stop: None,
max_tokens: None,
presence_penalty: None,
Expand All @@ -92,6 +95,7 @@ impl_builder_methods!(
temperature: f64,
top_p: f64,
n: i64,
response_format: String,
stream: bool,
stop: Vec<String>,
max_tokens: i64,
Expand Down

0 comments on commit 3535d13

Please sign in to comment.