Skip to content

Commit

Permalink
get toolkit_id and compare name instead of id (TransformerOptimus#1333)
Browse files Browse the repository at this point in the history
  • Loading branch information
masquerade-06 authored Oct 10, 2023
1 parent 95df3b6 commit 9e5e729
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion superagi/apm/call_log_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ def fetch_data(self, model: str):
agent_id_name_map = {agent.id: agent.name for agent in agents}
tools_used = [run.tool_used for run in runs]
toolkit_ids_allowed = self.session.query(Toolkit.id).filter(Toolkit.organisation_id == self.organisation_id).all()
tools = self.session.query(Tool).filter(Tool.id.in_(tools_used), Tool.toolkit_id.in_(toolkit_ids_allowed))\
toolkit_ids_allowed = [toolkit_id[0] for toolkit_id in toolkit_ids_allowed]
tools = self.session.query(Tool).filter(Tool.name.in_(tools_used), Tool.toolkit_id.in_(toolkit_ids_allowed))\
.all()
tools_name_toolkit_id_map = {tool.name: tool.toolkit_id for tool in tools}

Expand Down

0 comments on commit 9e5e729

Please sign in to comment.