Major Changes: - Replace Google ADK with PydanticAI framework for agent orchestration - Implement OpenAI-compatible API endpoint for Ollama integration - Fix streaming response to send deltas instead of cumulative text - Add /chat/completions route alias for Open-WebUI compatibility - Enable tool calling with 5 local tools (calculate, date/time utilities) Architecture: - Core-AI service: Standalone Python service with PydanticAI agent - PydanticAI: Uses OpenAI-compatible Ollama API at /v1 endpoint - Tool Registry: Shared tool system between core-ai and core-api - Streaming: Fixed async context issues and delta calculation Verified Working: ✅ Chat completion (streaming & non-streaming) ✅ Tool calling with mistral-nemo and mistral-tools models ✅ Open-WebUI integration via core-ai:8086 ✅ 5 tools: calculate, get_current_time, get_current_date, calculate_date_difference, add_days_to_date ✅ Proper streaming deltas (no repetition) Technical Details: - PydanticAI 1.25.0+ with full Ollama support - Async context manager issue resolved via chunk collection - Delta calculation: chunk[len(previous):] to extract new content only - Routes: /v1/chat/completions and /chat/completions (Open-WebUI compat) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
22 lines
657 B
YAML
22 lines
657 B
YAML
services:
|
|
core-ai:
|
|
build:
|
|
context: ../services/core-ai
|
|
dockerfile: Dockerfile
|
|
container_name: core-ai
|
|
restart: unless-stopped
|
|
ports:
|
|
- "8086:8086" # Expose the Core AI service port
|
|
environment:
|
|
- HOST=0.0.0.0
|
|
- PORT=8086
|
|
- OLLAMA_BASE_URL=http://ollama:11434 # Ensure it can find Ollama
|
|
- CORE_API_BASE_URL=http://core-api:8083/v1 # Ensure it can find Core API
|
|
- AGENT_MODEL=mistral-nemo:latest # Better tool calling support
|
|
- SYSTEM_PROMPT_VARIANT=minimal_agent # Match prompts.py definition
|
|
networks:
|
|
- docker-dataplane
|
|
|
|
networks:
|
|
docker-dataplane:
|
|
external: true |