zonca commited on
Commit
7a9e02d
·
1 Parent(s): f490c61

visit webpage tool

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -8,8 +8,9 @@ import pandas as pd
8
  from smolagents import (
9
  CodeAgent,
10
  DuckDuckGoSearchTool,
 
11
  HfApiModel,
12
- ) # Add HfApiModel import
13
 
14
  # (Keep Constants as is)
15
  # --- Constants ---
@@ -29,12 +30,11 @@ SYSTEM_PROMPT = (
29
  class MyAgent:
30
  def __init__(self):
31
  print("MyAgent initialized.")
32
- self.tools = [DuckDuckGoSearchTool()]
33
  self.model = HfApiModel(model="HuggingFaceH4/zephyr-7b-beta")
34
  self.agent = CodeAgent(tools=self.tools, model=self.model)
35
 
36
  def __call__(self, question: str) -> str:
37
- # Prepend the system prompt to the question
38
  prompt = f"{SYSTEM_PROMPT}\n\nQuestion: {question}"
39
  result = self.agent.run(prompt)
40
  return result
 
8
  from smolagents import (
9
  CodeAgent,
10
  DuckDuckGoSearchTool,
11
+ VisitWebpageTool,
12
  HfApiModel,
13
+ )
14
 
15
  # (Keep Constants as is)
16
  # --- Constants ---
 
30
  class MyAgent:
31
  def __init__(self):
32
  print("MyAgent initialized.")
33
+ self.tools = [DuckDuckGoSearchTool(), VisitWebpageTool()]
34
  self.model = HfApiModel(model="HuggingFaceH4/zephyr-7b-beta")
35
  self.agent = CodeAgent(tools=self.tools, model=self.model)
36
 
37
  def __call__(self, question: str) -> str:
 
38
  prompt = f"{SYSTEM_PROMPT}\n\nQuestion: {question}"
39
  result = self.agent.run(prompt)
40
  return result