cf6aa9a5e7c52517a233c77992dfa7578a0959de
Add OpenAI-compatible chat completions endpoint with streaming support. Currently returns mock lorem ipsum responses (Ollama integration pending). Chat Router (src/chat/router.py): - POST /v1/chat/completions endpoint - Streaming and non-streaming support - SSE format with EventSourceResponse - 20-second timeout protection - OpenAI-compatible response format Chat Schemas (src/chat/schemas.py): - ChatMessage, ChatCompletionRequest - ChatCompletionResponse, ChatCompletionChoice - ChatCompletionChunk for streaming - Full OpenAI API compatibility Chat Service (src/chat/service.py): - create_chat_completion() - non-streaming - create_chat_completion_stream() - streaming word-by-word - Mock lorem ipsum responses - Token usage calculation Chat Constants (src/chat/constants.py): - OpenAI API constants for consistency - Object types, roles, finish reasons Following Best Practices: - Business logic in service layer - Router only handles HTTP concerns - Async generators for streaming - Type hints throughout Model: mistral-nemo:latest Status: Mock implementation (ready for Ollama integration) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Description
No description provided
1.3 MiB
Releases
5
Release v2.4.3
Latest
Languages
Python
95.3%
HTML
3.7%
Shell
0.6%
Makefile
0.4%