From b42e301adb24043520e4ce440df0f33fd173e269 Mon Sep 17 00:00:00 2001 From: "maple@max" Date: Mon, 20 Nov 2023 14:17:32 +0800 Subject: [PATCH] add names --- async-openai/src/types/types.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/async-openai/src/types/types.rs b/async-openai/src/types/types.rs index fcb734f8..dcb6715e 100644 --- a/async-openai/src/types/types.rs +++ b/async-openai/src/types/types.rs @@ -1104,6 +1104,9 @@ pub struct ChatCompletionRequestSystemMessage { /// The role of the messages author, in this case `system`. #[builder(default = "Role::System")] pub role: Role, + /// An optional name for the participant. Provides the model information to differentiate between participants of the same role. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, } #[derive(Debug, Serialize, Deserialize, Default, Clone, Builder, PartialEq)] @@ -1182,6 +1185,9 @@ pub struct ChatCompletionRequestUserMessage { /// The role of the messages author, in this case `user`. #[builder(default = "Role::User")] pub role: Role, + /// An optional name for the participant. Provides the model information to differentiate between participants of the same role. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, } #[derive(Debug, Serialize, Deserialize, Default, Clone, Builder, PartialEq)] @@ -1196,6 +1202,9 @@ pub struct ChatCompletionRequestAssistantMessage { /// The role of the messages author, in this case `assistant`. #[builder(default = "Role::Assistant")] pub role: Role, + /// An optional name for the participant. Provides the model information to differentiate between participants of the same role. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, #[serde(skip_serializing_if = "Option::is_none")] pub tool_calls: Option>, /// Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.