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 9b75f86 commit a74e4cfCopy full SHA for a74e4cf
components/openai/actions/chat/chat.mjs
@@ -161,7 +161,11 @@ export default {
161
162
if (this.responseFormat === constants.CHAT_RESPONSE_FORMAT.JSON_SCHEMA.value) {
163
for (const choice of response.choices) {
164
- choice.message.content = JSON.parse(choice.message.content);
+ try {
165
+ choice.message.content = JSON.parse(choice.message.content);
166
+ } catch {
167
+ console.log(`Unable to parse JSON: ${choice.message.content}`);
168
+ }
169
}
170
171
0 commit comments