mirror of
https://github.com/mii443/openai-api-rs.git
synced 2025-12-03 11:08:23 +00:00
Add function call type
This commit is contained in:
@@ -13,6 +13,13 @@ pub const GPT4_32K: &str = "gpt-4-32k";
|
||||
pub const GPT4_32K_0314: &str = "gpt-4-32k-0314";
|
||||
pub const GPT4_0613: &str = "gpt-4-0613";
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
#[allow(non_camel_case_types)]
|
||||
pub enum FunctionCallType {
|
||||
auto,
|
||||
function { name: String },
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
pub struct ChatCompletionRequest {
|
||||
pub model: String,
|
||||
@@ -20,7 +27,7 @@ pub struct ChatCompletionRequest {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub functions: Option<Vec<Function>>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub function_call: Option<String>,
|
||||
pub function_call: Option<FunctionCallType>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub temperature: Option<f64>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
|
||||
Reference in New Issue
Block a user