Spaces:
Runtime error
Runtime error
Commit
·
c8012c7
1
Parent(s):
f277e70
Update app.py
Browse files
app.py
CHANGED
@@ -1,15 +1,16 @@
|
|
|
|
1 |
import interpreter
|
2 |
|
3 |
-
#
|
4 |
-
interpreter.api_key = "your_openai_api_key"
|
5 |
-
|
6 |
-
import interpreter
|
7 |
-
|
8 |
-
# Paste your OpenAI API key below.
|
9 |
interpreter.api_key = "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"
|
10 |
|
11 |
-
interpreter
|
|
|
|
|
|
|
12 |
|
13 |
-
|
|
|
14 |
|
15 |
-
|
|
|
|
1 |
+
import gradio as gr
|
2 |
import interpreter
|
3 |
|
4 |
+
# Set your OpenAI API key
|
|
|
|
|
|
|
|
|
|
|
5 |
interpreter.api_key = "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"
|
6 |
|
7 |
+
# Define the chat function using the interpreter library
|
8 |
+
def chat(input_text):
|
9 |
+
response = interpreter.chat(input_text)
|
10 |
+
return response
|
11 |
|
12 |
+
# Create a Gradio interface
|
13 |
+
iface = gr.Interface(fn=chat, inputs="text", outputs="text", live=True)
|
14 |
|
15 |
+
# Launch the interface
|
16 |
+
iface.launch()
|