Files
portainer-core/services/core-ai/requirements.txt
T
jpmschweitzerandClaude a6249e6cd0 feat(core-ai): add OllamaNativeAgent with native Ollama tool calling
Implement native Ollama agent that bypasses OpenAI-compatible API and uses
Ollama's native /api/chat endpoint for improved tool calling reliability.

Changes:
- Add OllamaNativeAgent class with native tool calling support
  - Direct integration with Ollama /api/chat endpoint
  - Better tool calling reliability vs OpenAI-compatible API
  - Async streaming support
  - Tool result handling and multi-turn conversations
- Set OllamaNativeAgent as default agent (replacing PydanticAI)
- Add test endpoint for Ollama tool verification
- Update health check to report ollama-native availability
- Add ollama>=0.4.0 to requirements for native library support

Technical Details:
- Uses Ollama's native tool format (not OpenAI functions)
- Handles tool execution and response synthesis
- Maintains conversation context across tool calls
- Model: mistral-nemo:latest (primary reasoning model)

Motivation:
PydanticAI uses Ollama's OpenAI-compatible endpoint which has less
reliable tool calling. The native API provides better tool support
and more consistent behavior.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-02 18:35:16 +01:00

25 lines
584 B
Plaintext

# PydanticAI and dependencies (slim to reduce bloat)
pydantic-ai-slim # Minimal library - Ollama uses OpenAI-compatible API
pydantic>=2.10.3 # Let pydantic-ai determine the compatible version
pydantic-settings==2.6.1
ollama>=0.4.0 # Native Ollama Python library with tool calling support
# LiteLLM (for simple agent fallback)
litellm==1.80.5
# Core dependencies
aiohttp==3.10.1
aiohttp-cors==0.7.0
python-dotenv>=1.1.0
httpx==0.28.1
# Memory system
qdrant-client>=1.12.0 # Vector database client
# Timezone support
pytz>=2025.2
# Testing
pytest==8.3.4
pytest-asyncio==0.24.0