File size: 601 Bytes
2987ffc
98ab0ca
2987ffc
0fc5d2e
62b52cd
 
a0a32e9
b41134d
62b52cd
0fc5d2e
62b52cd
b41134d
a0a32e9
b41134d
 
2c8aea7
0fc5d2e
a0a32e9
0fc5d2e
 
 
 
 
 
 
62b52cd
 
 
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
import os
os.environ["HF_TOKEN"] = os.getenv("HF_TOKEN")

import gradio as gr
from smolagents import CodeAgent, HfApiModel
from retriever import guest_info_tool
from tools import search_tool, weather_info_tool, hub_stats_tool


# Setup agent
model = HfApiModel()
alfred = CodeAgent(
    tools=[guest_info_tool, search_tool, weather_info_tool, hub_stats_tool],
    model=model
)



# Gradio interface function
def ask_alfred(question):
    return alfred.run(question)

# Gradio app
demo = gr.Interface(fn=ask_alfred, inputs="text", outputs="text", title="🎩 Alfred, Gala Assistant")
demo.launch()