@@ -78,6 +78,46 @@ components:
78
78
$ref : ' #/components/schemas/ChatMessage'
79
79
80
80
SingleChatMessage :
81
+ type : object
82
+ oneOf :
83
+ - $ref : ' #/components/schemas/ChatCompletionRequestSystemMessage'
84
+ - $ref : ' #/components/schemas/ChatCompletionRequestUserMessage'
85
+ - $ref : ' #/components/schemas/ChatCompletionRequestAssistantMessage'
86
+ - $ref : ' #/components/schemas/ChatCompletionRequestToolMessage'
87
+
88
+ ChatCompletionRequestSystemMessage :
89
+ type : object
90
+ required :
91
+ - role
92
+ - content
93
+ additionalProperties : false
94
+ properties :
95
+ role :
96
+ type : string
97
+ enum : [system]
98
+ example : system
99
+ content :
100
+ type : string
101
+ ChatCompletionRequestAssistantMessage :
102
+ type : object
103
+ required :
104
+ - role
105
+ additionalProperties : false
106
+ properties :
107
+ role :
108
+ type : string
109
+ enum : [assistant]
110
+ example : assistant
111
+ content :
112
+ type : string
113
+ nullable : true
114
+ refusal :
115
+ type : string
116
+ nullable : true
117
+ tool_calls :
118
+ nullable : true
119
+ $ref : ' #/components/schemas/ResponseMessageToolCalls'
120
+ ChatCompletionRequestUserMessage :
81
121
type : object
82
122
required :
83
123
- role
@@ -86,21 +126,47 @@ components:
86
126
properties :
87
127
role :
88
128
type : string
129
+ enum : [user]
89
130
example : user
90
131
content :
91
132
type : string
133
+ ChatCompletionRequestToolMessage :
134
+ type : object
135
+ required :
136
+ - role
137
+ - content
138
+ - tool_call_id
139
+ additionalProperties : false
140
+ properties :
141
+ role :
142
+ type : string
143
+ enum : [tool]
144
+ example : tool
145
+ tool_call_id :
146
+ type : string
147
+ nullable : true
148
+ content :
149
+ type : string
150
+ nullable : true
92
151
93
152
ResponseChatMessage :
94
- allOf :
95
- - $ref : ' #/components/schemas/SingleChatMessage'
96
- - type : object
97
- additionalProperties : false
98
- properties :
99
- refusal :
100
- type : string
101
- example : " I'm sorry, I can't answer that question."
102
- tool_calls :
103
- $ref : ' #/components/schemas/ResponseMessageToolCalls'
153
+ type : object
154
+ additionalProperties : false
155
+ properties :
156
+ role :
157
+ type : string
158
+ enum : [assistant]
159
+ example : assistant
160
+ content :
161
+ type : string
162
+ nullable : true
163
+ refusal :
164
+ type : string
165
+ example : " I'm sorry, I can't answer that question."
166
+ nullable : true
167
+ tool_calls :
168
+ nullable : true
169
+ $ref : ' #/components/schemas/ResponseMessageToolCalls'
104
170
# below tool message definitions are copied from openai spec: https://github.com/openai/openai-openapi/blob/e0cb2d721753e13e69e918465795d6e9f87ab15a/openapi.yaml#L11007
105
171
# only renaming them to differentiate them from the openai python classes
106
172
ResponseMessageToolCalls :
@@ -156,6 +222,15 @@ components:
156
222
type : array
157
223
items :
158
224
$ref : ' #/components/schemas/MultiChatMessageContent'
225
+ tool_calls :
226
+ nullable : true
227
+ $ref : ' #/components/schemas/ResponseMessageToolCalls'
228
+ refusal :
229
+ type : string
230
+ nullable : true
231
+ tool_call_id :
232
+ type : string
233
+ nullable : true
159
234
160
235
MultiChatMessageContent :
161
236
oneOf :
@@ -206,9 +281,10 @@ components:
206
281
type : string
207
282
content :
208
283
type : string
209
- default : ' '
284
+ nullable : true
210
285
refusal :
211
286
type : string
287
+ nullable : true
212
288
description : The refusal message generated by the model.
213
289
tool_calls :
214
290
type : array
0 commit comments