You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Sources/OpenAI/Public/Parameters/Chat/ChatCompletionParameters.swift
+22-2
Original file line number
Diff line number
Diff line change
@@ -90,12 +90,16 @@ public struct ChatCompletionParameters: Encodable {
90
90
91
91
publicstructMessage:Encodable{
92
92
93
-
/// The role of the messages author. One of system, user, assistant, or tool message.
94
-
publicletrole:String
95
93
/// The contents of the message. content is required for all messages, and may be null for assistant messages with function calls.
96
94
publicletcontent:ContentType
95
+
/// The refusal message by the assistant.
96
+
publicletrefusal:String?
97
+
/// The role of the messages author. One of system, user, assistant, or tool message.
98
+
publicletrole:String
97
99
/// The name of the author of this message. name is required if role is function, and it should be the name of the function whose response is in the content. May contain a-z, A-Z, 0-9, and underscores, with a maximum length of 64 characters.
98
100
publicletname:String?
101
+
/// Data about a previous audio response from the model. [Learn more.](https://platform.openai.com/docs/guides/audio)
102
+
publicletaudio:Audio?
99
103
/// The name and arguments of a function that should be called, as generated by the model.
100
104
@available(*, deprecated, message:"Deprecated and replaced by `tool_calls`")
101
105
letfunctionCall:FunctionCall?
@@ -222,10 +226,22 @@ public struct ChatCompletionParameters: Encodable {
222
226
case tool // content, role, tool_call_id
223
227
}
224
228
229
+
publicstructAudio:Encodable{
230
+
231
+
/// Unique identifier for a previous audio response from the model.
232
+
publicletid:String
233
+
234
+
publicinit(id:String){
235
+
self.id = id
236
+
}
237
+
}
238
+
225
239
enumCodingKeys:String,CodingKey{
226
240
case role
227
241
case content
242
+
case refusal
228
243
case name
244
+
case audio
229
245
case functionCall ="function_call"
230
246
case toolCalls ="tool_calls"
231
247
case toolCallID ="tool_call_id"
@@ -234,14 +250,18 @@ public struct ChatCompletionParameters: Encodable {
0 commit comments