Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,9 +1,11 @@
|
|
1 |
import gradio as gr
|
2 |
-
import openai, os,
|
3 |
|
4 |
client = openai.OpenAI(api_key = os.getenv("OPENAI_API_KEY"))
|
5 |
|
6 |
-
def
|
7 |
-
|
|
|
|
|
8 |
|
9 |
-
gr.ChatInterface(
|
|
|
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()
|