File size: 914 Bytes
e1896bb
 
 
10c462d
8b358c4
 
 
 
 
e1896bb
 
 
 
 
10c462d
 
 
e1896bb
 
10c462d
 
 
8b358c4
 
 
 
10c462d
8b358c4
10c462d
 
 
060a8f4
10c462d
 
 
060a8f4
 
 
10c462d
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
'''Agent definition for GAIA question answering system.'''

# Imports for agent creation
from smolagents import CodeAgent, InferenceClientModel, VisitWebpageTool
from functions.tools import (
    google_search,
    wikipedia_search,
    get_wikipedia_page
)

def create_agent():
    '''Creates agent for GAIA question answering system.'''

    model = InferenceClientModel(
        "Qwen/Qwen2.5-Coder-32B-Instruct",
        provider="hf-inference",
        max_tokens=8096
    )

    tools = [
        wikipedia_search,
        get_wikipedia_page,
        google_search,
        VisitWebpageTool()
    ]

    agent = CodeAgent(
        model=model,
        tools=tools,
        additional_authorized_imports=['bs4.*', 'json'],
        name="GAIA_agent",
        verbosity_level=1,
        max_steps=20,
        planning_interval=5,
        description="GAIA agent for question answering"
    )


    return agent