Agent class description, visible in UI
This commit is contained in:
1 parent
e9ebb1378a
commit
6530ff0a24
4 files changed
+49
-1
No files matched your search
+11
-1
@@ -155,12 +155,22 @@ class App:
|
||||
"id": agent.id,
|
||||
"name": agent.name,
|
||||
"description": agent.description,
|
||||
"picture": agent.picture
|
||||
"picture": agent.picture,
|
||||
"kind": agent.kind,
|
||||
} for agent in agents]
|
||||
|
||||
def get_agent_kinds(self):
|
||||
return [kind.identifier for kind in self.agent_classes]
|
||||
|
||||
def get_agent_kind_info(self, kind):
|
||||
agent_class = next((it for it in self.agent_classes if it.identifier == kind), None)
|
||||
if agent_class is None:
|
||||
raise Exception(f"invalid agent kind: {kind}")
|
||||
return {
|
||||
"name": agent_class.identifier,
|
||||
"description": getattr(agent_class, 'description', None),
|
||||
}
|
||||
|
||||
def delete_chat(self, chat_id):
|
||||
with self.sql_session() as session:
|
||||
session.execute(db.Membership.__table__.delete().where(db.Membership.chat_id == chat_id))
|
||||
|
||||
Reference in new issue
Block a user