Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 1 addition & 46 deletions tasks/hivemind/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down