Add sanitizeAiResponse function call in App.tsx

This commit is contained in:
2026-03-14 00:33:21 +01:00
parent cb814d94fa
commit 5db45375f3

View File

@@ -1212,7 +1212,8 @@ export default function App() {
throw new Error(`Ollama responded with ${response.status}`); throw new Error(`Ollama responded with ${response.status}`);
} }
const data = await response.json(); const data = await response.json();
const resultText = typeof data?.response === "string" ? data.response.trim() : ""; const resultText =
typeof data?.response === "string" ? sanitizeAiResponse(data.response) : "";
if (!resultText) { if (!resultText) {
throw new Error("Ollama returned an empty response."); throw new Error("Ollama returned an empty response.");
} }