diff --git a/CHANGELOG.md b/CHANGELOG.md index b076d3a..d06164a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,24 +8,96 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added -- Initial project structure with domain-based organization -- OpenAI-compatible `/v1/chat/completions` endpoint with streaming support -- OpenAI-compatible `/v1/models` endpoint -- Health check and root endpoints -- Comprehensive test suite with 62% coverage -- Security-focused dependency management with CVE checking -- FastAPI best practices implementation -- SSE streaming with 20-second timeout protection -- Custom Pydantic base models for consistent serialization -- Application factory pattern for testability -- Async Ollama client (ready for integration) -- Complete documentation (README, AGENTS.md) + +#### Agent Interface (Phase 1) +- Abstract `AgentInterface` base class for model abstraction +- `LoremTesterAgent`: Full-featured mock agent with realistic behavior + - Configurable reasoning effort levels (none, minimal, low, medium, high, xhigh) + - Random tool/function call generation for testing + - Error triggers: rate_limit, context_overflow, invalid_tool + - Temperature-based response variation +- `TatlockAgent`: Placeholder for future PydanticAI integration +- `ModelRegistry`: Centralized model management and discovery +- 18 agent tests with comprehensive coverage + +#### Responses API (Phases 2, 3, 6) +- OpenAI Responses API format with structured output (`/v1/responses`) + - Reasoning items (thinking summaries with configurable effort) + - Function call items (tool execution simulation) + - Message items (assistant responses with output_text) + - Streaming and non-streaming modes +- Real-time streaming with SSE-Starlette +- Conversation history management (Phase 3): + - Hybrid client/server approach (client maintains state, server tracks) + - Auto-generated deterministic conversation IDs from message hash + - Configurable max turns with automatic trimming (default: 20) + - Context window management with approximate token counting + - Token usage statistics + - Placeholder for future vector memory (Qdrant) +- Advanced features (Phase 6): + - Parameter validation with Pydantic field validators + - Temperature: 0.0-2.0 range enforcement + - Reasoning effort: 6 levels validation + - Max output tokens: positive integer enforcement + - Stop sequences: up to 4, non-empty strings + - Real-time stop sequence detection during streaming + - Real-time max tokens enforcement with token counting +- 45 Responses API tests (router, error handling, history, advanced features) + +#### Chat Completions Wrapper (Phase 5) +- OpenAI Chat Completions compatibility layer (`/v1/chat/completions`) +- Single source of truth architecture (wraps Responses API) +- Automatic reasoning generation +- Converts reasoning items to `` tags for Open WebUI +- Pipeline prefix preservation +- System message support +- Enhanced error types (RateLimitError, ContextLengthError) +- 12 Chat Completions tests (router + streaming wrapper) + +#### Application Infrastructure +- FastAPI application factory pattern +- CORS middleware with configurable origins +- Global exception handlers: + - AppException handler for custom errors + - RequestValidationError handler for Pydantic validation + - General exception handler for unexpected errors +- Lifespan management for startup/shutdown +- OpenAPI schema with interactive documentation +- 16 main application tests + +#### Testing Infrastructure +- Comprehensive test suite: 95 tests, 78.95% coverage (up from 62%) +- Async test support with pytest-asyncio +- Test fixtures for sync and async clients +- Integration tests for all API endpoints +- Streaming functionality tests +- Parameter validation tests +- Error handling tests +- Conversation history tests + +#### Documentation +- Complete README.md rewrite with hybrid architecture +- Architecture diagrams and decision documentation +- AGENTS.md with technical implementation details +- API usage examples for all endpoints +- Conversation history guide +- Open WebUI integration instructions +- Troubleshooting section +- Implementation planning documents + +### Changed +- Hybrid architecture with Responses API as primary endpoint +- Chat Completions now wraps Responses API (no duplicate logic) +- Enhanced error handling with OpenAI-compatible format +- Improved streaming with word-by-word delivery +- Better test organization with domain-based structure ### Security - Minor version locking for all dependencies - All packages CVE-checked (as of 2025-12-06) - Environment variable protection via .gitignore - No known vulnerabilities in dependency tree +- Input validation on all API endpoints ## [0.1.0] - 2025-12-06