Spaces:
Sleeping
Sleeping
Commit
·
51d59b8
1
Parent(s):
3adb7b1
Update app.py
Browse files
app.py
CHANGED
@@ -5,9 +5,9 @@ import gradio as gr
|
|
5 |
|
6 |
# _ = load_dotenv(find_dotenv()) # read local .env file
|
7 |
|
8 |
-
def get_openai_api_key(api_key):
|
9 |
-
|
10 |
-
|
11 |
|
12 |
|
13 |
chat_history = []
|
@@ -20,7 +20,8 @@ def get_completion(messages, model="gpt-3.5-turbo", temperature=0):
|
|
20 |
)
|
21 |
return response.choices[0].message["content"]
|
22 |
|
23 |
-
def conversation_interface(prompt):
|
|
|
24 |
global chat_history
|
25 |
|
26 |
if not chat_history:
|
|
|
5 |
|
6 |
# _ = load_dotenv(find_dotenv()) # read local .env file
|
7 |
|
8 |
+
# def get_openai_api_key(api_key):
|
9 |
+
# openai.api_key = api_key
|
10 |
+
# return openai.api_key
|
11 |
|
12 |
|
13 |
chat_history = []
|
|
|
20 |
)
|
21 |
return response.choices[0].message["content"]
|
22 |
|
23 |
+
def conversation_interface(api_key,prompt):
|
24 |
+
openai.api_key = api_key
|
25 |
global chat_history
|
26 |
|
27 |
if not chat_history:
|