8474d8b21ce101fa74b3d2dbd0e872f6192a389f
Add production-ready async HTTP client for Ollama API communication with proper error handling and dependency injection. Ollama Client (src/ollama/client.py): - Async context manager for connection lifecycle - Non-streaming chat endpoint - Streaming chat endpoint with async generator - Model listing endpoint - Health check endpoint - Timeout configuration per request - Comprehensive error handling with custom exceptions - FastAPI dependency injection support Ollama Schemas (src/ollama/schemas.py): - OllamaMessage: Chat message format - OllamaChatRequest: Request with model, messages, options - OllamaChatResponse: Complete chat response - OllamaModelInfo: Model metadata - OllamaModelsResponse: Model list response Features: - Async/await throughout for non-blocking I/O - Connection pooling via httpx.AsyncClient - Configurable timeouts (default: 120s) - Proper exception mapping (connection errors, timeouts) - Ready for integration (currently not connected to routes) Following Best Practices: - Async context manager pattern - Dependency injection for FastAPI routes - Separation of concerns (client vs schemas) - Type hints throughout - Comprehensive logging Status: Ready for integration (mock responses used in routes currently) 🤖 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%