feat: add CORS middleware and SSE streaming endpoint

Add CORS support for frontend development with configurable origins via
CORS_ORIGINS environment variable. Add /chat/stream endpoint for
Server-Sent Events streaming with true streaming support for OpenAI
adapter and fallback single-chunk behavior for other adapters.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Danny
2026-01-16 12:43:21 -06:00
parent f497fde153
commit 6c1cf0655a
5 changed files with 192 additions and 1 deletions
+3
View File
@@ -1,6 +1,9 @@
# LLM Mode: "local", "remote", "openai", or "asksage"
LLM_MODE=local
# CORS Configuration (comma-separated origins for frontend access)
CORS_ORIGINS=http://localhost:3000
# Remote LLM Configuration (required if LLM_MODE=remote)
LLM_REMOTE_URL=https://your-llm-service.com/generate
LLM_REMOTE_TOKEN=