chore: temporarily fix response (#11574)

This commit is contained in:
darkskygit
2025-04-09 12:44:38 +00:00
parent 34b6e7ef88
commit a1b518c6f4

View File

@@ -237,7 +237,8 @@ export class GeminiProvider
abortSignal: options.signal,
experimental_repairText: async ({ text, error }) => {
if (error instanceof JSONParseError) {
const ret = text.trim();
// strange fixed response, temporarily replace it
const ret = text.replaceAll(/^ny\n/g, ' ').trim();
if (ret.startsWith('```') || ret.endsWith('```')) {
return ret
.replace(/```[\w\s]+\n/g, '')