pub enum Message {
Developer {
content: MessageContent,
name: Option<String>,
},
System {
content: MessageContent,
name: Option<String>,
},
User {
content: MessageContent,
name: Option<String>,
},
Assistant {
audio: Option<MessageAudio>,
content: Option<MessageContent>,
function_call: Option<FunctionCall>,
name: Option<String>,
refusal: Option<String>,
tool_calls: Option<Vec<ToolCall>>,
},
Tool {
content: MessageContent,
tool_call_id: String,
},
Function {
content: Option<String>,
name: String,
},
}Expand description
Developer-provided instructions that the model should follow, regardless of
messages sent by the user. With o1 models and newer, developer messages
replace the previous system messages.
Variants§
Developer
The role of the messages author, in this case developer.
Fields
content: MessageContentThe contents of the developer message.
System
Developer-provided instructions that the model should follow, regardless of
messages sent by the user. With o1 models and newer, use developer messages
for this purpose instead.
Fields
content: MessageContentThe contents of the system message.
User
Messages sent by an end user, containing prompts or additional context information.
Fields
content: MessageContentThe contents of the user message.
Assistant
Messages sent by the model in response to user messages.
Fields
audio: Option<MessageAudio>Data about a previous audio response from the model. Learn more.
content: Option<MessageContent>The contents of the assistant message. Required unless tool_calls or
function_call is specified.
function_call: Option<FunctionCall>@deprecated Deprecated and replaced by tool_calls. The name and arguments of a
function that should be called, as generated by the model.
Tool
A call to a function tool created by the model.
Fields
content: MessageContentThe contents of the tool message.
Function
@deprecated