feat: instrument analysis

This commit is contained in:
OpenSquared
2026-06-28 16:36:28 +02:00
parent 0693d41d91
commit e4e17330b4
6 changed files with 715 additions and 649 deletions

View File

@@ -5176,6 +5176,28 @@ def upsert_ai_desk(desk: Dict[str, Any]) -> int:
conn.close()
def update_ai_desk_by_id(desk_id: int, desk: Dict[str, Any]) -> bool:
conn = get_conn()
try:
instr = desk.get("instruments", [])
cfg = desk.get("config", {})
if isinstance(instr, list):
instr = json.dumps(instr)
if isinstance(cfg, dict):
cfg = json.dumps(cfg)
conn.execute("""
UPDATE ai_desks SET
name=?, type=?, active=?, system_prompt=?,
instruments=?, config=?, updated_at=datetime('now')
WHERE id=?
""", (desk["name"], desk["type"], int(desk.get("active", 1)),
desk.get("system_prompt", ""), instr, cfg, desk_id))
conn.commit()
return True
finally:
conn.close()
def delete_ai_desk(name: str) -> bool:
conn = get_conn()
try: