Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions async-openai/src/types/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<String>,
}

#[derive(Debug, Serialize, Deserialize, Default, Clone, Builder, PartialEq)]
Expand Down Expand Up @@ -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<String>,
}

#[derive(Debug, Serialize, Deserialize, Default, Clone, Builder, PartialEq)]
Expand All @@ -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<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tool_calls: Option<Vec<ChatCompletionMessageToolCall>>,
/// Deprecated and replaced by `tool_calls`. The name and arguments of a function that should be called, as generated by the model.
Expand Down