智能体配置

This commit is contained in:
吉鑫升 committed 2026-05-13 20:04:06 +08:00
1 parent 83d7fa26fe
commit 31abad86d5
12 files changed
+1127 -752

No files matched your search

@@ -107,6 +107,19 @@ class AgentRepository(AgentStore):
await session.refresh(row)
return _row_to_dict(row)
async def update_builtin(self, agent_id: str, data: dict[str, Any]) -> dict[str, Any] | None:
async with self._sf() as session:
row = await session.get(AgentRow, agent_id)
if row is None or row.user_id is not None:
return None
for key in ("name", "description", "published"):
if key in data:
setattr(row, key, data[key])
row.updated_at = datetime.now(UTC)
await session.commit()
await session.refresh(row)
return _row_to_dict(row)
async def delete(self, agent_id: str, user_id: str) -> bool:
async with self._sf() as session:
row = await session.get(AgentRow, agent_id)