Update app.py
Browse files
app.py
CHANGED
@@ -7,12 +7,12 @@ lock = threading.Lock()
|
|
7 |
|
8 |
LLM = "gpt-4o"
|
9 |
|
10 |
-
def invoke(openai_api_key,
|
11 |
if not openai_api_key:
|
12 |
raise gr.Error("OpenAI API Key is required.")
|
13 |
|
14 |
-
if not
|
15 |
-
raise gr.Error("
|
16 |
|
17 |
with lock:
|
18 |
os.environ["OPENAI_API_KEY"] = openai_api_key
|
|
|
7 |
|
8 |
LLM = "gpt-4o"
|
9 |
|
10 |
+
def invoke(openai_api_key, message):
|
11 |
if not openai_api_key:
|
12 |
raise gr.Error("OpenAI API Key is required.")
|
13 |
|
14 |
+
if not message:
|
15 |
+
raise gr.Error("Message is required.")
|
16 |
|
17 |
with lock:
|
18 |
os.environ["OPENAI_API_KEY"] = openai_api_key
|