We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bddda90 commit 1d7f748Copy full SHA for 1d7f748
packages/agents-openai/src/openaiChatCompletionsConverter.ts
@@ -159,12 +159,14 @@ export function itemsToMessages(
159
...providerData,
160
};
161
162
- const audio = content.find((c) => c.type === 'audio');
163
- if (audio) {
164
- assistant.audio = {
165
- id: '', // setting this to empty ID and expecting that the user sets providerData.id
166
- ...audio.providerData,
167
- };
+ if (Array.isArray(content)) {
+ const audio = content.find((c) => c.type === 'audio');
+ if (audio) {
+ assistant.audio = {
+ id: '', // setting this to empty ID and expecting that the user sets providerData.id
+ ...audio.providerData,
168
+ };
169
+ }
170
}
171
172
result.push(assistant);
0 commit comments