Skip to content

Commit

Permalink
Feat: Added the "seed" param to ChatCompletionRequest. "seed" is a Be…
Browse files Browse the repository at this point in the history
…ta feature.
  • Loading branch information
avastmick committed Nov 28, 2023
1 parent db33a8e commit 9941dee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/v1/chat_completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ pub struct ChatCompletionRequest {
pub logit_bias: Option<HashMap<String, i32>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub user: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub seed: Option<i64>,
}

impl ChatCompletionRequest {
Expand All @@ -64,6 +66,7 @@ impl ChatCompletionRequest {
frequency_penalty: None,
logit_bias: None,
user: None,
seed: None,
}
}
}
Expand All @@ -82,7 +85,8 @@ impl_builder_methods!(
presence_penalty: f64,
frequency_penalty: f64,
logit_bias: HashMap<String, i32>,
user: String
user: String,
seed: i64
);

#[derive(Debug, Serialize, Deserialize, Clone)]
Expand Down

0 comments on commit 9941dee

Please sign in to comment.