mirror of
https://github.com/SrIzan10/echospace.git
synced 2026-06-06 00:56:54 +00:00
fix: remove json codeblock
This commit is contained in:
@@ -31,10 +31,9 @@ export default async function fill(message: string) {
|
||||
content: message,
|
||||
},
|
||||
],
|
||||
response_format: { type: 'json_object' },
|
||||
});
|
||||
|
||||
const aiMsg = aiResponse.choices[0].message.content!;
|
||||
const aiMsg = aiResponse.choices[0].message.content!.replace('```json', '').replace('```', '');
|
||||
const zod = fillSchema.safeParse(JSON.parse(aiMsg));
|
||||
if (!zod.success) {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user