From 1372210004f5b6685af849af14f15ff84d62beb0 Mon Sep 17 00:00:00 2001 From: Siddhant Rai Date: Wed, 2 Jul 2025 10:37:32 +0530 Subject: [PATCH] refactor: update user tools dict to use enumeration based key --- application/agents/base.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/application/agents/base.py b/application/agents/base.py index c9cc579d..509afb89 100644 --- a/application/agents/base.py +++ b/application/agents/base.py @@ -91,8 +91,8 @@ class BaseAgent(ABC): user_tools_collection = db["user_tools"] user_tools = user_tools_collection.find({"user": user, "status": True}) user_tools = list(user_tools) - tools_by_id = {str(tool["_id"]): tool for tool in user_tools} - return tools_by_id + + return {str(i): tool for i, tool in enumerate(user_tools)} def _build_tool_parameters(self, action): params = {"type": "object", "properties": {}, "required": []} @@ -313,7 +313,6 @@ class BaseAgent(ABC): if hasattr(response, "message") and getattr(response.message, "content", None): yield {"answer": response.message.content} return - processed_response_gen = self._llm_handler( response, tools_dict, messages, log_context, self.attachments )