|
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) |
|
|
|
|
|
|
|
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() |
|
|