bstraehle commited on
Commit
48d337f
1 Parent(s): cb5856a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -1,9 +1,11 @@
1
  import gradio as gr
2
- import openai, os, random
3
 
4
  client = openai.OpenAI(api_key = os.getenv("OPENAI_API_KEY"))
5
 
6
- def random_response(message, history):
7
- return random.choice(["Yes", "No"])
 
 
8
 
9
- gr.ChatInterface(random_response).launch()
 
1
  import gradio as gr
2
+ import openai, os, time
3
 
4
  client = openai.OpenAI(api_key = os.getenv("OPENAI_API_KEY"))
5
 
6
+ def chat(message, history):
7
+ for i in range(len(message)):
8
+ time.sleep(0.3)
9
+ yield "You typed: " + message[: i+1]
10
 
11
+ gr.ChatInterface(chat).launch()