This commit is contained in:
1 parent
23b1cb2966
commit
e9532e8878
30 files changed
+1835
-542
No files matched your search
@@ -1,21 +1,62 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
scripts/ollama_tool_runner.py — Minimaler Tool-Caller für Ollama + mindnet
|
||||
FILE: scripts/ollama_tool_runner.py
|
||||
VERSION: 2.1.0 (2025-12-15)
|
||||
STATUS: Active
|
||||
COMPATIBILITY: v2.9.1 (Post-WP14/WP-15b)
|
||||
|
||||
Zweck:
|
||||
Führt den Tool-Call-Loop für mindnet_query / mindnet_subgraph aus.
|
||||
Nutzt /tools/ollama (Schema) und deine FastAPI (/query, /graph).
|
||||
ENV:
|
||||
OLLAMA=http://127.0.0.1:11434
|
||||
API_BASE=http://127.0.0.1:8000
|
||||
MODEL=llama3.1
|
||||
Nutzung:
|
||||
python3 scripts/ollama_tool_runner.py "Frage an den Agenten"
|
||||
Version:
|
||||
0.1.0 (Erstanlage)
|
||||
Stand:
|
||||
2025-10-07
|
||||
-------
|
||||
Minimaler Tool-Caller für Ollama mit mindnet-Tools.
|
||||
Führt Tool-Call-Loop für mindnet_query und mindnet_subgraph aus.
|
||||
|
||||
Funktionsweise:
|
||||
---------------
|
||||
1. Lädt Tool-Schema von /tools/ollama Endpoint
|
||||
2. Sendet Query an Ollama mit Tool-Definitionen
|
||||
3. Ollama entscheidet, welche Tools aufzurufen sind
|
||||
4. Führt Tool-Calls aus:
|
||||
- mindnet_query: Ruft /query Endpoint auf
|
||||
- mindnet_subgraph: Ruft /graph Endpoint auf
|
||||
5. Wiederholt bis keine weiteren Tool-Calls nötig sind
|
||||
|
||||
Ergebnis-Interpretation:
|
||||
------------------------
|
||||
- Ausgabe: Konversations-Verlauf mit Tool-Calls und Antworten
|
||||
- Exit-Code 0: Erfolgreich
|
||||
- Exit-Code 1: Fehler (z.B. API nicht erreichbar)
|
||||
|
||||
Verwendung:
|
||||
-----------
|
||||
- Testing von Tool-Integration
|
||||
- Demo der Agent-Funktionalität
|
||||
- Entwicklung neuer Tools
|
||||
|
||||
Hinweise:
|
||||
---------
|
||||
- Nutzt Ollama als LLM-Backend
|
||||
- Tool-Schema wird von mindnet API bereitgestellt
|
||||
- Unterstützt mehrere Tool-Calls in einer Konversation
|
||||
|
||||
Aufruf:
|
||||
-------
|
||||
python3 scripts/ollama_tool_runner.py "Frage an den Agenten"
|
||||
|
||||
Parameter:
|
||||
----------
|
||||
Keine CLI-Parameter. Query als erstes Argument.
|
||||
|
||||
Umgebungsvariablen:
|
||||
-------------------
|
||||
OLLAMA (Default: http://127.0.0.1:11434)
|
||||
API_BASE (Default: http://127.0.0.1:8000)
|
||||
MODEL (Default: llama3.1)
|
||||
|
||||
Änderungen:
|
||||
-----------
|
||||
v2.1.0 (2025-12-15): Dokumentation aktualisiert
|
||||
v0.1.0 (2025-10-07): Initial Release
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
Reference in new issue
Block a user