feat(agents): seed initial table agents (upsert, migre depuis AGENT_SCOPES code en dur)
This commit is contained in:
+16
-1
@@ -1,7 +1,7 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import os
|
import os
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
from app.models import init_db, set_rule, add_api_key, add_port
|
from app.models import init_db, set_rule, add_api_key, add_port, add_agent
|
||||||
import aiosqlite
|
import aiosqlite
|
||||||
|
|
||||||
load_dotenv()
|
load_dotenv()
|
||||||
@@ -110,6 +110,21 @@ async def seed_data():
|
|||||||
else:
|
else:
|
||||||
print(f"Warning: API_KEY_{agent} absent du .env")
|
print(f"Warning: API_KEY_{agent} absent du .env")
|
||||||
|
|
||||||
|
# Agents : seed initial (upsert -- source de verite migree ici depuis
|
||||||
|
# AGENT_SCOPES code en dur ; ajouter un agent ensuite = add_agent() via API,
|
||||||
|
# pas de redeploiement necessaire)
|
||||||
|
default_agents = {
|
||||||
|
"CLAUDE": (["infra", "llm", "nyora", "perso", "tt", "coding"], "claude-code"),
|
||||||
|
"HERMES_TT": (["infra", "llm", "tt"], "hermes"),
|
||||||
|
"HERMES_NYORA": (["infra", "llm", "nyora"], "hermes"),
|
||||||
|
"HERMES_PERSO": (["infra", "llm", "nyora", "perso"], "hermes"),
|
||||||
|
"GEMINI": (["infra", "llm", "nyora", "coding"], "antigravity"),
|
||||||
|
"NABIL": (["infra", "llm", "nyora", "perso", "tt", "coding"], "human"),
|
||||||
|
}
|
||||||
|
for agent_name, (scopes, agent_type) in default_agents.items():
|
||||||
|
await add_agent(agent_name, scopes, agent_type=agent_type)
|
||||||
|
print("Agents seeded (upsert).")
|
||||||
|
|
||||||
print("Seed complete.")
|
print("Seed complete.")
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user