dkolarova's picture
Update app.py
e0cb50e verified
raw
history blame
773 Bytes
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()