From 813af5a1084e92bde23a5c2deae067c20b65639e Mon Sep 17 00:00:00 2001 From: Mohammad Amin Date: Tue, 1 Jul 2025 14:38:14 +0330 Subject: [PATCH] feat: remove unused codes & making the tool pass the original query! --- tasks/hivemind/agent.py | 47 +---------------------------------------- 1 file changed, 1 insertion(+), 46 deletions(-) diff --git a/tasks/hivemind/agent.py b/tasks/hivemind/agent.py index 0735218..d5e546e 100644 --- a/tasks/hivemind/agent.py +++ b/tasks/hivemind/agent.py @@ -156,57 +156,12 @@ def detect_question_type(self) -> str: @router("rag") def do_rag_query(self) -> str: - # query_data_source_tool = RAGPipelineTool.setup_tools( - # community_id=self.community_id, - # enable_answer_skipping=self.enable_answer_skipping, - # workflow_id=self.workflow_id, - # ) - - # q_a_bot_agent = Agent( - # role="Q&A Bot", - # goal=( - # "You decide when to rely on your internal knowledge and when to retrieve real-time data. " - # "For queries that are not specific to community data, answer using your own LLM knowledge. " - # "Your final response must not exceed 250 words." - # ), - # backstory=( - # "You are an intelligent agent capable of giving concise answers to questions." - # ), - # allow_delegation=True, - # llm=LLM(model="gpt-4o-mini-2024-07-18"), - # ) - # rag_task = Task( - # description=( - # "Answer the following query using a maximum of 250 words. " - # "If the query is specific to community data, use the tool to retrieve updated information; " - # f"otherwise, answer using your internal knowledge.\n\nQuery: {self.state.user_query}" - # ), - # expected_output="A clear, well-structured answer under 250 words that directly addresses the query using appropriate information sources", - # agent=q_a_bot_agent, - # tools=[ - # query_data_source_tool(result_as_answer=True), - # ], - # ) - - # crew = Crew( - # agents=[q_a_bot_agent], - # tasks=[rag_task], - # process=Process.hierarchical, - # manager_llm=LLM(model="gpt-4o-mini-2024-07-18"), - # verbose=True, - # ) - - # crew_output = crew.kickoff() - - # Store the latest crew output and increment retry count - # self.state.last_answer = crew_output - llm = ChatOpenAI(model="gpt-4o-mini-2024-07-18") rag_tool = make_rag_tool(self.enable_answer_skipping, self.community_id, self.workflow_id) tools = [rag_tool] SYSTEM_INSTRUCTIONS = """\ - You are a helpful assistant. + You are a helpful assistant. Pass the incoming queries without changing it. """ prompt = ChatPromptTemplate.from_messages(