Add sanitizeAiResponse function call in App.tsx
This commit is contained in:
@@ -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.");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user