Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -25,13 +25,13 @@ from assistants import (
|
|
25 |
extract_content_values,
|
26 |
)
|
27 |
|
28 |
-
def chat(message, history):
|
29 |
if not message:
|
30 |
raise gr.Error("Message is required.")
|
31 |
|
32 |
-
raise gr.Error("Please clone and bring your own credentials.")
|
33 |
|
34 |
-
global assistant, thread
|
35 |
|
36 |
# On first run, create assistant and update assistant_id,
|
37 |
# see https://platform.openai.com/playground/assistants.
|
@@ -80,4 +80,7 @@ gr.ChatInterface(
|
|
80 |
["1. Execute with tools: Get key announcements from latest OpenAI Dev Day. 2. Show the web references."]
|
81 |
],
|
82 |
cache_examples=False,
|
|
|
|
|
|
|
83 |
).launch()
|
|
|
25 |
extract_content_values,
|
26 |
)
|
27 |
|
28 |
+
def chat(message, history, openai_api_key):
|
29 |
if not message:
|
30 |
raise gr.Error("Message is required.")
|
31 |
|
32 |
+
#raise gr.Error("Please clone and bring your own credentials.")
|
33 |
|
34 |
+
global assistant, thread
|
35 |
|
36 |
# On first run, create assistant and update assistant_id,
|
37 |
# see https://platform.openai.com/playground/assistants.
|
|
|
80 |
["1. Execute with tools: Get key announcements from latest OpenAI Dev Day. 2. Show the web references."]
|
81 |
],
|
82 |
cache_examples=False,
|
83 |
+
additional_inputs=[
|
84 |
+
gr.Textbox("sk-<BringYourOwn>", label="OpenAI API Key")
|
85 |
+
],
|
86 |
).launch()
|