fawwazanvilen's picture
dari hub
8c2c1df
raw
history blame
No virus
727 Bytes
import gradio as gr
from anton_agent import agent_executor
# print(agent_executor.run("waofkaewof"))
# print(agent_executor.run("siapa namamu?"))
def predict(input, history=[]):
response = agent_executor.run(input)
history = history + [(input, response)]
response = history
# response = [response]
# return response, response
return response, response
with gr.Blocks() as demo:
chatbot = gr.Chatbot()
state = gr.State([])
with gr.Row():
txt = gr.Textbox(show_label=False, placeholder="Enter text and press enter").style(container=False)
txt.submit(predict, [txt, state], [chatbot, state])
# txt.submit(agent_executor.run, [txt, state], [chatbot, state])
demo.launch()