Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -10,7 +10,7 @@ from typing import TypedDict, Optional
|
|
| 10 |
tools = [add, multiply, divide, subtract, search_wikipedia, duckduckgo_search, search_papers]
|
| 11 |
|
| 12 |
def build_agent():
|
| 13 |
-
llm = ChatGroq(model="deepseek-r1-distill-llama-70b
|
| 14 |
chat_with_tools = llm.bind_tools(tools)
|
| 15 |
|
| 16 |
def assistant(state: MessagesState):
|
|
@@ -23,7 +23,7 @@ def build_agent():
|
|
| 23 |
system_prompt = """You are a reasoning assistant that can answer complex questions using external tools. You must follow a structured reasoning format and always output a final answer.
|
| 24 |
Always follow this step-by-step structure:
|
| 25 |
- Thought: Describe your reasoning.
|
| 26 |
-
- Action:
|
| 27 |
If not, use your reasoning for answering the question, using this format → Action: reasoning.
|
| 28 |
- Observation: Describe what the tool returned.
|
| 29 |
- Repeat Thought → Action → Observation as needed until you are SURE you can answer.
|
|
|
|
| 10 |
tools = [add, multiply, divide, subtract, search_wikipedia, duckduckgo_search, search_papers]
|
| 11 |
|
| 12 |
def build_agent():
|
| 13 |
+
llm = ChatGroq(model="llama3-70b-8192", temperature=0) # deepseek-r1-distill-llama-70b
|
| 14 |
chat_with_tools = llm.bind_tools(tools)
|
| 15 |
|
| 16 |
def assistant(state: MessagesState):
|
|
|
|
| 23 |
system_prompt = """You are a reasoning assistant that can answer complex questions using external tools. You must follow a structured reasoning format and always output a final answer.
|
| 24 |
Always follow this step-by-step structure:
|
| 25 |
- Thought: Describe your reasoning.
|
| 26 |
+
- Action: Whenever necessary or recommended, call a tool, using this format → Action: tool_name(input).
|
| 27 |
If not, use your reasoning for answering the question, using this format → Action: reasoning.
|
| 28 |
- Observation: Describe what the tool returned.
|
| 29 |
- Repeat Thought → Action → Observation as needed until you are SURE you can answer.
|