Sivaraj commited on
Commit
520e168
·
1 Parent(s): a6fe20b

updated custom prompt_templates

Browse files
Files changed (1) hide show
  1. agent.py +19 -12
agent.py CHANGED
@@ -1,5 +1,9 @@
1
  from smolagents import (
2
  ToolCallingAgent,
 
 
 
 
3
  PromptTemplates,
4
  PlanningPromptTemplate,
5
  ManagedAgentPromptTemplate,
@@ -19,22 +23,25 @@ class BaseAgent:
19
  model=openai_model,
20
  tools=[
21
  addition_tool,
 
 
 
22
  ],
23
  verbosity_level=2,
24
  prompt_templates=PromptTemplates(
25
  system_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.",
26
- # planning=PlanningPromptTemplate(
27
- # initial_plan="",
28
- # update_plan_pre_messages="",
29
- # update_plan_post_messages="",
30
- # ),
31
- # managed_agent=ManagedAgentPromptTemplate(
32
- # task="",
33
- # report="",
34
- # ),
35
- # final_answer=FinalAnswerPromptTemplate(
36
- # pre_messages="", post_messages=""
37
- # ),
38
  ),
39
  )
40
 
 
1
  from smolagents import (
2
  ToolCallingAgent,
3
+ CodeAgent,
4
+ DuckDuckGoSearchTool,
5
+ FinalAnswerTool,
6
+ VisitWebpageTool,
7
  PromptTemplates,
8
  PlanningPromptTemplate,
9
  ManagedAgentPromptTemplate,
 
23
  model=openai_model,
24
  tools=[
25
  addition_tool,
26
+ # DuckDuckGoSearchTool(),
27
+ # VisitWebpageTool(),
28
+ # FinalAnswerTool(),
29
  ],
30
  verbosity_level=2,
31
  prompt_templates=PromptTemplates(
32
  system_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.",
33
+ planning=PlanningPromptTemplate(
34
+ initial_plan="",
35
+ update_plan_pre_messages="",
36
+ update_plan_post_messages="",
37
+ ),
38
+ managed_agent=ManagedAgentPromptTemplate(
39
+ task="",
40
+ report="",
41
+ ),
42
+ final_answer=FinalAnswerPromptTemplate(
43
+ pre_messages="", post_messages=""
44
+ ),
45
  ),
46
  )
47