File size: 1,286 Bytes
860424e
 
 
 
 
 
 
 
 
 
2a41ea2
860424e
2a41ea2
860424e
 
 
 
 
 
2a41ea2
860424e
 
 
 
 
 
 
 
 
 
2a41ea2
 
 
 
 
 
 
 
 
 
860424e
 
 
 
2a41ea2
 
860424e
 
 
 
 
 
2a41ea2
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
from smolagents import (
    InferenceClientModel, 
    FinalAnswerTool
)

from tools.wikipedia_tools import wikipedia_summary, read_wikipedia_page
from tools.file_tools import read_file_as_text
from tools.youtube_tools import download_youtube_url_images, download_youtube_url_audio
from tools.image_processing_tools import ask_question_about_image

from agent.QuestionAnsweringAgent import QuestionAnsweringAgent

from ui.builder import GradioUI

model = InferenceClientModel(
    provider="auto",
    model_id="Qwen/Qwen3-Coder-30B-A3B-Instruct",
    temperature=0,
    top_p=1.0, 
    seed=42
)

agent_tools = [
    FinalAnswerTool(), 
    wikipedia_summary, read_wikipedia_page, 
    read_file_as_text,
    download_youtube_url_images, download_youtube_url_audio, 
    ask_question_about_image
] 

additional_authorized_imports=[
    "os", 
    "bs4", 
    "PIL", 
    "transformers", 
    "torch", 
    "requests", 
    "glob"
]

agent = QuestionAnsweringAgent(
    name="question_answering_expert",
    model=model,
    add_base_tools=True,
    tools=agent_tools,
    additional_authorized_imports=additional_authorized_imports,
    planning_interval=None,
    max_steps=10,
    verbosity_level=2,  # For better debugging
)

if __name__ == "__main__":
    GradioUI(agent).launch()