Good evening, the API is having an issue using client.chat.parse with a responseFormat for a structured output.
Yet, a few hours ago, it still worked.
Is anyone else experiencing this issue?
**Code : **
const { z } = require('zod');
const Book = z.object({
name: z.string(),
authors: z.array(z.string()),
});
const apiKey = "...";
const client = new Mistral({ apiKey: apiKey });
(async () => {
const chatResponse = await client.chat.parse({
model: "ministral-8b-latest",
messages: [
{
role: "system",
content: "Extract the books information.",
},
{
role: "user",
content: "I recently read 'To Kill a Mockingbird' by Harper Lee.",
},
],
responseFormat: Book,
maxTokens: 256,
temperature: 0,
});
console.log(chatResponse);
})();
**Output : **
SyntaxError: Unexpected token '`', "`\\`\\`json
{
"... is not valid JSON
at JSON.parse (<anonymous>)
at convertToParsedChatCompletionResponse (<...>\node_modules\@mistralai\mistralai\extra\structChat.js:34:63)
at Chat.parse (<...>\node_modules\@mistralai\mistralai\sdk\chat.js:24:91)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async <...>\app.js:305:24
