File size: 773 Bytes
e943939
da8e742
7585692
e943939
 
 
 
 
 
 
 
da8e742
 
 
e943939
e10e06d
e943939
e10e06d
da8e742
e943939
da8e742
e943939
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import gradio as gr
from tools import convert_currency
from tools_agent import Agent


def respond(
    message,
    history: list[tuple[str, str]],
    system_message,
):

    
    agent = Agent()
    agent.add_tool(convert_currency)

     # message = "I am traveling to Japan from Serbia, I have 1500 of local currency, how much of Japaese currency will I be able to get?"

    plan = agent.execute(message)
    print(plan)

    return plan


"""
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
"""
demo = gr.ChatInterface(
    respond,
    additional_inputs=[
        gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
    ],
)


if __name__ == "__main__":
    demo.launch()