File size: 794 Bytes
c6c3859
 
d7def6d
c6c3859
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
d7def6d
c6c3859
 
 
 
 
 
 
 
 
d7def6d
c6c3859
 
 
 
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
import yaml
import os
from smolagents import GradioUI, HfPaiToolAgent, LiteLLMModel

# Get current directory path
CURRENT_DIR = os.path.dirname(os.path.abspath(__file__))

from tools.final_answer import FinalAnswerTool as FinalAnswer



model = LiteLLMModel(
model_id='openai/gpt-4o-mini',
api_base=None,
)

final_answer = FinalAnswer()


with open(os.path.join(CURRENT_DIR, "prompts.yaml"), 'r') as stream:
    prompt_templates = yaml.safe_load(stream)

agent = HfPaiToolAgent(
    model=model,
    tools=[],
    managed_agents=[],
    max_steps=20,
    verbosity_level=1,
    grammar=None,
    planning_interval=None,
    name=None,
    description=None,
    model_settings={'temperature': 0.0},
    prompt_templates=prompt_templates
)
if __name__ == "__main__":
    GradioUI(agent).launch()