feat(frontend): agent resource sections
This commit is contained in:
1 parent
a10224d21e
commit
6134c026a6
3 files changed
+82
-80
No files matched your search
+7
-3
@@ -285,9 +285,13 @@ class App(ChatMixin):
|
||||
|
||||
# --- Resource Management ---
|
||||
|
||||
async def get_agent_resource(self, agent_id, kind, key):
|
||||
resource = await db.AgentResource.get_or_none(agent_id=agent_id, kind=kind, key=key)
|
||||
return resource.value if resource else None
|
||||
async def get_agent_resources(self, agent_id, kind=None, key=None):
|
||||
filter = {"agent_id": agent_id}
|
||||
if kind: filter['kind'] = kind
|
||||
if key: filter['key'] = key
|
||||
|
||||
values = await db.AgentResource.filter(**filter)
|
||||
return values
|
||||
|
||||
async def save_agent_resource(self, agent_id, kind, key, value):
|
||||
await db.AgentResource.update_or_create(
|
||||
|
||||
Reference in new issue
Block a user