From 08b3101218abaeea93fe4fc1c860bc219ba625c9 Mon Sep 17 00:00:00 2001 From: Sam Becker Date: Fri, 18 Apr 2025 11:20:34 -0500 Subject: [PATCH] Improve AI error detection --- src/photo/ai/useAiImageQuery.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/photo/ai/useAiImageQuery.ts b/src/photo/ai/useAiImageQuery.ts index fcb8e10e..311d20dc 100644 --- a/src/photo/ai/useAiImageQuery.ts +++ b/src/photo/ai/useAiImageQuery.ts @@ -38,7 +38,7 @@ export default function useAiImageQuery( }, []); // Withhold streaming text if it's a null response - const isTextError = text.toLocaleLowerCase().startsWith('sorry'); + const isTextError = /^(I'*m )*sorry/i.test(text); return [ request,