mirror of
https://github.com/R0m1k3/Loki.git
synced 2026-10-11 17:26:57 +02:00
Keep Ollama chat streams alive
This commit is contained in:
1 parent
e9c83e3a0d
commit
cdbb5f03fa
2 files changed
+51
-15
No files matched your search
@@ -190,8 +190,11 @@ export async function streamChat(
|
||||
body: JSON.stringify(body),
|
||||
});
|
||||
} catch (err) {
|
||||
const raw = err instanceof Error ? err.message : "serveur Loki injoignable";
|
||||
handlers.onError(
|
||||
err instanceof Error ? err.message : "serveur Loki injoignable"
|
||||
/network error|failed to fetch/i.test(raw)
|
||||
? "Serveur Loki injoignable. Vérifiez le reverse proxy et le conteneur."
|
||||
: raw
|
||||
);
|
||||
return;
|
||||
}
|
||||
@@ -271,8 +274,11 @@ export async function streamChat(
|
||||
} catch (err) {
|
||||
if (!failed) {
|
||||
failed = true;
|
||||
const raw = err instanceof Error ? err.message : "connexion interrompue";
|
||||
handlers.onError(
|
||||
err instanceof Error ? err.message : "connexion au chat interrompue"
|
||||
/network error|failed to fetch/i.test(raw)
|
||||
? "Connexion interrompue pendant le chargement du modèle. Vérifiez OLLAMA_HOST et le délai du reverse proxy."
|
||||
: raw
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user