pub enum Message {
System {
content: String,
name: Option<String>,
},
User {
content: MessageContent,
name: Option<String>,
},
Assistant {
content: Option<String>,
audio: Option<AssistantAudio>,
refusal: Option<String>,
name: Option<String>,
tool_calls: Option<Vec<AssistantToolCall>>,
},
Tool {
content: String,
tool_call_id: String,
},
Function {
content: String,
name: String,
},
Developer {
content: String,
name: Option<String>,
},
}Variants§
System
In this case, the role of the message author is system.
The field { role = "system" } is added automatically.
Fields
User
In this case, the role of the message author is user.
The field { role = "user" } is added automatically.
Fields
content: MessageContentThe contents of the user message: plain text, or an array of
multimodal content parts (text, image_url, input_audio,
file).
Assistant
In this case, the role of the message author is assistant.
The field { role = "assistant" } is added automatically.
Fields
content: Option<String>The contents of the assistant message. Required unless tool_calls
or function_call is specified. (Note that function_call is deprecated
in favour of tool_calls.)
audio: Option<AssistantAudio>Data about a previous audio response from the model. Required for multi-turn audio conversations.
tool_calls: Option<Vec<AssistantToolCall>>The tool calls generated by the model, such as function calls.
Tool
In this case, the role of the message author is assistant.
The field { role = "tool" } is added automatically.
Fields
Function
In this case, the role of the message author is function.
The field { role = "function" } is added automatically.
Fields
Developer
In this case, the role of the message author is developer.
The field { role = "developer" } is added automatically.