P3: llama-swap capabilities deklariert + Plugin lernt Tool-Namen (Hermes-0.18-API)
- deploy-Config: capabilities (in/out/tools/context) je Modell — /v1/models informiert Clients korrekt; context = nutzbarer Kontext pro Request (c/parallel) - mc2-memory: sync_turn nutzt messages aus Hermes >=0.18 — nur Tool-NAMEN (Ergebnisse bleiben draussen: untrusted/Poisoning-Vektor); deployt, Postcheck gruen - Mem0 v3-Algorithmus auf der Box verifiziert (BM25/Entity/Hybrid in 2.0.8 aktiv) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -150,6 +150,18 @@ class MC2MemoryProvider(MemoryProvider):
|
||||
return
|
||||
msgs: List[Dict[str, str]] = [{"role": "user", "content": u}]
|
||||
a = (assistant_content or "").strip()
|
||||
# Hermes ≥0.18 liefert optional den vollen Turn-Kontext (`messages`, inkl. Tool-Calls).
|
||||
# Bewusst NUR die Tool-NAMEN mitlernen ("hat X per Tool Y geprüft") — Tool-ERGEBNISSE
|
||||
# sind untrusted (Web-Inhalte!) und wären ein Poisoning-Vektor am Junk-Guard vorbei.
|
||||
if messages:
|
||||
tools = []
|
||||
for m in messages:
|
||||
for tc in (m.get("tool_calls") or []):
|
||||
name = ((tc.get("function") or {}).get("name") or "").strip()
|
||||
if name and name not in tools:
|
||||
tools.append(name)
|
||||
if tools:
|
||||
a = (a + f"\n[genutzte Tools: {', '.join(tools[:6])}]").strip()
|
||||
if a:
|
||||
msgs.append({"role": "assistant", "content": a[:4000]})
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user