Files
Portfolio/src/app/api/chat
damjan_savicandClaude Opus 4.5 858d53fd2d auto-claude: subtask-4-5 - Create chatbot API route handler with streaming responses
Implemented Next.js API route at /api/chat with:
- POST endpoint for sending messages with streaming responses (SSE)
- GET endpoint for retrieving chat history
- OPTIONS endpoint for CORS preflight
- Integration with Deepseek API via createStreamingChatCompletion
- Session management via getOrCreateChatSession (24h continuity)
- Message persistence to Supabase (user + assistant messages)
- Context management with 20-message history limit
- Error handling for API key/database issues
- Request validation for required fields (message, visitorId)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-25 00:56:19 +01:00
..