File size: 1,647 Bytes
9faf105
25a3b4b
9faf105
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
25a3b4b
 
6dd5f4b
 
 
 
 
 
 
 
 
 
 
7845350
25a3b4b
9faf105
 
 
6dd5f4b
 
 
 
 
 
 
 
 
9faf105
25a3b4b
9faf105
25a3b4b
9faf105
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# from smolagents import CodeAgent, DuckDuckGoSearchTool, InferenceClientModel, VisitWebpageTool, ManagedAgent

# model = InferenceClientModel(model_id="Qwen/Qwen2.5-Coder-32B-Instruct", provider="together")

# web_agent = CodeAgent(
#     model=model,
#     tools=[DuckDuckGoSearchTool(), VisitWebpageTool()],
#     additional_authorized_imports=["pandas"],
#     name="web_agent",
#     description="Browses the web to find information",
#     verbosity_level=0,
#     max_steps=20,
# )

from dotenv import load_dotenv
from smolagents import  InferenceClientModel, CodeAgent, DuckDuckGoSearchTool, GoogleSearchTool, VisitWebpageTool

load_dotenv()
model = InferenceClientModel(model_id="Qwen/Qwen2.5-Coder-32B-Instruct", provider="together")

from app_tools.web_search_tools import(
    SearchInformationTool,
    NavigationalSearchTool,
    VisitTool,
    PageUpTool,
    PageDownTool,
    FinderTool,
    FindNextTool,
    ArchiveSearchTool,
)

web_agent = CodeAgent(
    model=model,
    tools=[
        # DuckDuckGoSearchTool(),
        GoogleSearchTool("serper"),
        VisitWebpageTool(),
        SearchInformationTool(),
        NavigationalSearchTool(),
        VisitTool(),
        PageUpTool(),
        PageDownTool(),
        FinderTool(),
        FindNextTool(),
        ArchiveSearchTool(),
    ],
    name="web_agent",
    description="Runs web searches for you. Give it your query as an argument.",
    verbosity_level=0,
    max_steps=10,
)

# managed_web_agent = CodeAgent(
#     model=model,
#     agent=web_agent,
#     name="web_search",
#     description="Runs web searches for you. Give it your query as an argument."
# )