Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
|
@@ -212,7 +212,7 @@ class TestAgent:
|
|
| 212 |
# )
|
| 213 |
#youtube_tools = MCPServerTool(server_params=server_parameters)
|
| 214 |
|
| 215 |
-
model = OpenAIServerModel(model_id="gpt-
|
| 216 |
#model = InferenceClientModel("Qwen/Qwen2.5-Coder-32B-Instruct")
|
| 217 |
# Instantiate the agent
|
| 218 |
self.agent = CodeAgent(
|
|
@@ -231,7 +231,7 @@ class TestAgent:
|
|
| 231 |
model=model,
|
| 232 |
max_steps=6, # V3 increase steps
|
| 233 |
planning_interval=3, # V3 add structure
|
| 234 |
-
verbosity_level=
|
| 235 |
use_structured_outputs_internally=True # V3. Adds structure
|
| 236 |
)
|
| 237 |
# V3. add Guidance
|
|
@@ -240,7 +240,7 @@ class TestAgent:
|
|
| 240 |
|
| 241 |
# V4. use prompt from the paper as guidance
|
| 242 |
prompt = """\n\n
|
| 243 |
-
|
| 244 |
finish your answer with the following template: FINAL ANSWER: [YOUR FINAL ANSWER].
|
| 245 |
YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated
|
| 246 |
list of numbers and/or strings.
|
|
@@ -250,8 +250,10 @@ class TestAgent:
|
|
| 250 |
digits in plain text unless specified otherwise.
|
| 251 |
If you are asked for a comma separated list, apply the above rules depending of whether the element
|
| 252 |
to be put in the list is a number or a string.
|
|
|
|
|
|
|
| 253 |
"""
|
| 254 |
-
self.agent.prompt_templates['system_prompt'] = prompt
|
| 255 |
|
| 256 |
|
| 257 |
def __call__(self, question: str) -> str:
|
|
|
|
| 212 |
# )
|
| 213 |
#youtube_tools = MCPServerTool(server_params=server_parameters)
|
| 214 |
|
| 215 |
+
model = OpenAIServerModel(model_id="gpt-4.1")
|
| 216 |
#model = InferenceClientModel("Qwen/Qwen2.5-Coder-32B-Instruct")
|
| 217 |
# Instantiate the agent
|
| 218 |
self.agent = CodeAgent(
|
|
|
|
| 231 |
model=model,
|
| 232 |
max_steps=6, # V3 increase steps
|
| 233 |
planning_interval=3, # V3 add structure
|
| 234 |
+
verbosity_level=0,
|
| 235 |
use_structured_outputs_internally=True # V3. Adds structure
|
| 236 |
)
|
| 237 |
# V3. add Guidance
|
|
|
|
| 240 |
|
| 241 |
# V4. use prompt from the paper as guidance
|
| 242 |
prompt = """\n\n
|
| 243 |
+
It is very important to remember the foillowing: You are a general AI assistant. I will ask you a question. Report your thoughts, and
|
| 244 |
finish your answer with the following template: FINAL ANSWER: [YOUR FINAL ANSWER].
|
| 245 |
YOUR FINAL ANSWER should be a number OR as few words as possible OR a comma separated
|
| 246 |
list of numbers and/or strings.
|
|
|
|
| 250 |
digits in plain text unless specified otherwise.
|
| 251 |
If you are asked for a comma separated list, apply the above rules depending of whether the element
|
| 252 |
to be put in the list is a number or a string.
|
| 253 |
+
\n\n
|
| 254 |
+
Now it's your turn.
|
| 255 |
"""
|
| 256 |
+
self.agent.prompt_templates['system_prompt'] = self.agent.prompt_templates['system_prompt'] + prompt
|
| 257 |
|
| 258 |
|
| 259 |
def __call__(self, question: str) -> str:
|