mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 14:16:12 +00:00
feat(ai): UI-configurable response timeout, local streaming, dedicated OCR provider
Add three per-user AI settings, all configured in the app (no new env vars), behind one migration (0198): - Response timeout (seconds). A per-user upstream timeout threaded onto the provider call. A local/self-hosted backend can take more than the legacy 60 s default to load a model on the first request, which timed the Coach out before the first token. Defaults to a generous ~180 s when unset; validated to 10–600 s. - True token streaming for the local OpenAI-compatible client. The client now POSTs with stream:true and parses the SSE delta chunks, emitting tokens as they arrive, with a per-idle-gap timeout instead of a whole-call ceiling and a graceful fallback to the buffered path when a server cannot stream. The Coach route runs the provider call inside the response stream behind a keepalive heartbeat so a reverse proxy no longer idle-drops the connection during model load or generation. Grounding, refusal, and sentinel-stripping still run on the complete reply before any token reaches the client. - Dedicated document-scan (Lab-OCR) provider. Off by default — the OCR path uses the main provider chain. When enabled, lab-report processing resolves a separate provider/model/key, with a hint when the chosen model is not vision-capable. The new key column is AES-256-GCM at rest and registered in the encrypted-columns registry and the rotation script. i18n: EN + DE translations for the new Settings → AI strings (other locales carry interim copies to keep locale parity green).
This commit is contained in:
1 parent
3b74b108a1
commit
b91649d6de
30 files changed
+2281
-569
No files matched your search
@@ -191,6 +191,7 @@ async function main() {
|
||||
"aiAnthropicKeyEncrypted",
|
||||
"aiLocalKeyEncrypted",
|
||||
"aiOpenaiKeyEncrypted",
|
||||
"aiOcrKeyEncrypted",
|
||||
"insuranceNumberEncrypted",
|
||||
];
|
||||
for (const field of userFields) {
|
||||
|
||||
Reference in new issue
Block a user