symposium 2.2.0 → 2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Models/OpenAIModel.js +27 -6
- package/package.json +1 -1
package/Models/OpenAIModel.js
CHANGED
|
@@ -114,6 +114,24 @@ export default class OpenAIModel extends Model {
|
|
|
114
114
|
message_content.push({type: 'text', content: text});
|
|
115
115
|
break;
|
|
116
116
|
|
|
117
|
+
case 'image_generation_call':
|
|
118
|
+
const mime = output.output_format === 'png' ? 'image/png' : 'image/jpeg';
|
|
119
|
+
message_content.push({
|
|
120
|
+
type: 'image',
|
|
121
|
+
source: {
|
|
122
|
+
type: 'base64',
|
|
123
|
+
media_type: mime,
|
|
124
|
+
data: output.result,
|
|
125
|
+
},
|
|
126
|
+
meta: {
|
|
127
|
+
id: output.id,
|
|
128
|
+
status: output.status,
|
|
129
|
+
prompt: output.revised_prompt,
|
|
130
|
+
size: output.size,
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
break;
|
|
134
|
+
|
|
117
135
|
case 'function_call':
|
|
118
136
|
message_content.push({
|
|
119
137
|
type: 'function',
|
|
@@ -173,12 +191,15 @@ export default class OpenAIModel extends Model {
|
|
|
173
191
|
messages.push({
|
|
174
192
|
role,
|
|
175
193
|
content: [
|
|
176
|
-
{
|
|
177
|
-
type: '
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
194
|
+
c.meta.id ? {
|
|
195
|
+
type: 'image_generation_call',
|
|
196
|
+
id: c.meta.id,
|
|
197
|
+
result: c.source.data,
|
|
198
|
+
status: c.meta.status,
|
|
199
|
+
} : {
|
|
200
|
+
type: 'input_image',
|
|
201
|
+
image_url: c.content.type === 'base64' ? 'data:' + c.content.mime + ';base64,' + c.content.data : c.content.data,
|
|
202
|
+
detail: c.content.detail || 'auto',
|
|
182
203
|
},
|
|
183
204
|
],
|
|
184
205
|
});
|