Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -55,7 +55,7 @@ def divide(a: int, b: int) -> float:
|
|
| 55 |
"""
|
| 56 |
return a / b
|
| 57 |
|
| 58 |
-
|
| 59 |
class BasicAgent:
|
| 60 |
def __init__(self):
|
| 61 |
print("BasicAgent initialized.")
|
|
@@ -66,7 +66,8 @@ class BasicAgent:
|
|
| 66 |
|
| 67 |
self.agent = CodeAgent(
|
| 68 |
tools=[add,subtract,multiply,divide,DuckDuckGoSearchTool()],
|
| 69 |
-
model=llm
|
|
|
|
| 70 |
)
|
| 71 |
def __call__(self, question: str) -> str:
|
| 72 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
|
|
|
| 55 |
"""
|
| 56 |
return a / b
|
| 57 |
|
| 58 |
+
prompt = "You are a general AI assistant. I will ask you a question. Report your thoughts, and finish your answer with the following template: FINAL ANSWER: [YOUR FINAL ANSWER]. YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated list of numbers and/or strings. If you are asked for a number, don't use comma to write your number neither use units such as $ or percent sign unless specified otherwise. If you are asked for a string, don't use articles, neither abbreviations (e.g. for cities), and write the digits in plain text unless specified otherwise. If you are asked for a comma separated list, apply the above rules depending of whether the element to be put in the list is a number or a string."
|
| 59 |
class BasicAgent:
|
| 60 |
def __init__(self):
|
| 61 |
print("BasicAgent initialized.")
|
|
|
|
| 66 |
|
| 67 |
self.agent = CodeAgent(
|
| 68 |
tools=[add,subtract,multiply,divide,DuckDuckGoSearchTool()],
|
| 69 |
+
model=llm,
|
| 70 |
+
prompt_templates=prompt
|
| 71 |
)
|
| 72 |
def __call__(self, question: str) -> str:
|
| 73 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|