diff --git a/README.md b/README.md index cf440d4..fb08872 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,7 @@ let req = ChatCompletionRequest::new( content: chat_completion::Content::Text(String::from("What is bitcoin?")), name: None, tool_calls: None, + tool_call_id: None, }], ); ``` diff --git a/examples/chat_completion.rs b/examples/chat_completion.rs index 6ef5035..7a31241 100644 --- a/examples/chat_completion.rs +++ b/examples/chat_completion.rs @@ -14,6 +14,7 @@ async fn main() -> Result<(), Box> { content: chat_completion::Content::Text(String::from("What is bitcoin?")), name: None, tool_calls: None, + tool_call_id: None, }], ); diff --git a/examples/function_call.rs b/examples/function_call.rs index d2ce8cb..ddf1d3d 100644 --- a/examples/function_call.rs +++ b/examples/function_call.rs @@ -35,6 +35,7 @@ async fn main() -> Result<(), Box> { content: chat_completion::Content::Text(String::from("What is the price of Ethereum?")), name: None, tool_calls: None, + tool_call_id: None, }], ) .tools(vec![chat_completion::Tool { diff --git a/examples/function_call_role.rs b/examples/function_call_role.rs index a6bf064..38463a5 100644 --- a/examples/function_call_role.rs +++ b/examples/function_call_role.rs @@ -35,6 +35,7 @@ async fn main() -> Result<(), Box> { content: chat_completion::Content::Text(String::from("What is the price of Ethereum?")), name: None, tool_calls: None, + tool_call_id: None, }], ) .tools(vec![chat_completion::Tool { @@ -89,6 +90,8 @@ async fn main() -> Result<(), Box> { "What is the price of Ethereum?", )), name: None, + tool_calls: None, + tool_call_id: None, }, chat_completion::ChatCompletionMessage { role: chat_completion::MessageRole::function, @@ -97,6 +100,8 @@ async fn main() -> Result<(), Box> { format!("{{\"price\": {}}}", price) }), name: Some(String::from("get_coin_price")), + tool_calls: None, + tool_call_id: None, }, ], ); diff --git a/examples/vision.rs b/examples/vision.rs index 056feef..57397ae 100644 --- a/examples/vision.rs +++ b/examples/vision.rs @@ -29,6 +29,7 @@ async fn main() -> Result<(), Box> { ]), name: None, tool_calls: None, + tool_call_id: None, }], ); diff --git a/src/v1/chat_completion.rs b/src/v1/chat_completion.rs index 1536f9d..28284be 100644 --- a/src/v1/chat_completion.rs +++ b/src/v1/chat_completion.rs @@ -101,6 +101,7 @@ pub enum MessageRole { system, assistant, function, + tool, } #[derive(Debug, Deserialize, Clone, PartialEq, Eq)] @@ -158,6 +159,8 @@ pub struct ChatCompletionMessage { pub name: Option, #[serde(skip_serializing_if = "Option::is_none")] pub tool_calls: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub tool_call_id: Option, } #[derive(Debug, Deserialize, Serialize)]