m-ric HF staff commited on
Commit
fecada4
β€’
1 Parent(s): 76b8fa2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -2,9 +2,11 @@ import os
2
  import gradio as gr
3
  from transformers import ReactCodeAgent, HfEngine, Tool
4
 
5
- from gradio import ChatMessage
6
- from gradio.utils import stream_from_transformers_agent
7
-
 
 
8
  from dotenv import load_dotenv
9
  from huggingface_hub import login
10
  from transformers.agents.default_tools import (
@@ -127,7 +129,7 @@ Write your function in the left textbox, and the agent on the right will generat
127
  )
128
  submit = gr.Button("Generate tests!")
129
  with gr.Column():
130
- chatbot = gr.Chatbot(label="Agent")
131
 
132
  submit.click(interact_with_agent, [text_input], [chatbot])
133
 
 
2
  import gradio as gr
3
  from transformers import ReactCodeAgent, HfEngine, Tool
4
 
5
+ from gradio_agentchatbot import (
6
+ AgentChatbot,
7
+ stream_from_transformers_agent,
8
+ ChatMessage,
9
+ )
10
  from dotenv import load_dotenv
11
  from huggingface_hub import login
12
  from transformers.agents.default_tools import (
 
129
  )
130
  submit = gr.Button("Generate tests!")
131
  with gr.Column():
132
+ chatbot = AgentChatbot(label="Agent")
133
 
134
  submit.click(interact_with_agent, [text_input], [chatbot])
135