mirror of
https://github.com/R0m1k3/Loki.git
synced 2026-10-23 15:08:16 +02:00
feat(skills): 5 méthodes expertes auto-injectées (routeur lexical)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
afe0a837d4
commit
31dce6036b
9 files changed
+159
-1
No files matched your search
@@ -18,7 +18,8 @@ from fastapi import APIRouter, HTTPException
|
||||
from fastapi.responses import StreamingResponse
|
||||
from pydantic import BaseModel
|
||||
|
||||
from .. import agent_config, coder, db, enhance, memory, rag, router as msg_router
|
||||
from .. import agent_config, coder, db, enhance, memory, rag, skills
|
||||
from .. import router as msg_router
|
||||
from ..tools import check_html, _safe_path
|
||||
from ..agent import run_agent
|
||||
from ..config import settings
|
||||
@@ -237,6 +238,18 @@ async def chat(req: ChatRequest) -> StreamingResponse:
|
||||
+ "\n---\n".join(memories),
|
||||
})
|
||||
|
||||
# Skill : méthode experte injectée pour ce tour (jamais persistée).
|
||||
if cfg.get("skills_enabled", True):
|
||||
skill = skills.pick_skill(req.content)
|
||||
if skill:
|
||||
convo.insert(1, {
|
||||
"role": "system",
|
||||
"content": (
|
||||
"Méthode à suivre pour cette tâche :\n" + skill["body"]
|
||||
),
|
||||
})
|
||||
yield _sse("notice", {"message": f"📘 Méthode : {skill['title']}"})
|
||||
|
||||
if plan:
|
||||
yield _sse("plan", {"steps": plan})
|
||||
|
||||
|
||||
Reference in new issue
Block a user