mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-25 04:56:02 +08:00
chore: temporarily fix response (#11574)
This commit is contained in:
@@ -237,7 +237,8 @@ export class GeminiProvider
|
|||||||
abortSignal: options.signal,
|
abortSignal: options.signal,
|
||||||
experimental_repairText: async ({ text, error }) => {
|
experimental_repairText: async ({ text, error }) => {
|
||||||
if (error instanceof JSONParseError) {
|
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('```')) {
|
if (ret.startsWith('```') || ret.endsWith('```')) {
|
||||||
return ret
|
return ret
|
||||||
.replace(/```[\w\s]+\n/g, '')
|
.replace(/```[\w\s]+\n/g, '')
|
||||||
|
|||||||
Reference in New Issue
Block a user