sqfoo commited on
Commit
3c965e9
·
verified ·
1 Parent(s): 820aa0b

Update agent.py

Browse files
Files changed (1) hide show
  1. agent.py +5 -5
agent.py CHANGED
@@ -91,13 +91,13 @@ class BasicAgent:
91
  There are few tools provided: web_search, visit_webpage, read_file and image_caption.
92
  Here are few examples demonstrating how to call and use the tools.
93
  """
94
- tools = [web_search, visit_webpage, read_file, image_caption]
95
- prompt = ChatPromptTemplate.from_messages([
96
  ("system", self.sys_prompt),
97
- ("human", "Question: {input}")
98
  ])
99
- self.agent = create_tool_calling_agent(self.model, tools, prompt)
100
- self.agent_exe = AgentExecutor(agent=self.agent, tools=tools, verbose=True)
101
  print("BasicAgent initialized.")
102
 
103
  def __call__(self, question: str) -> str:
 
91
  There are few tools provided: web_search, visit_webpage, read_file and image_caption.
92
  Here are few examples demonstrating how to call and use the tools.
93
  """
94
+ self.tools = [web_search, visit_webpage, read_file, image_caption]
95
+ self.prompt = ChatPromptTemplate.from_messages([
96
  ("system", self.sys_prompt),
97
+ ("human", "{input}")
98
  ])
99
+ self.agent = create_tool_calling_agent(self.model, self.tools, self.prompt)
100
+ self.agent_exe = AgentExecutor(agent=self.agent, tools=self.tools, verbose=True)
101
  print("BasicAgent initialized.")
102
 
103
  def __call__(self, question: str) -> str: