Spaces:
Running
Running
Commit
·
03099f1
1
Parent(s):
167e68e
update apikey handling
Browse files
app.py
CHANGED
@@ -56,9 +56,7 @@ tool_list.columns = ['Tool', 'Description']
|
|
56 |
def on_api_key_change():
|
57 |
api_key = ss.get('api_key') or os.getenv('OPENAI_API_KEY')
|
58 |
# Check if key is valid
|
59 |
-
if oai_key_isvalid(api_key):
|
60 |
-
os.environ["OPENAI_API_KEY"] = api_key
|
61 |
-
else:
|
62 |
st.write("Please input a valid OpenAI API key.")
|
63 |
|
64 |
# sidebar
|
|
|
56 |
def on_api_key_change():
|
57 |
api_key = ss.get('api_key') or os.getenv('OPENAI_API_KEY')
|
58 |
# Check if key is valid
|
59 |
+
if not oai_key_isvalid(api_key):
|
|
|
|
|
60 |
st.write("Please input a valid OpenAI API key.")
|
61 |
|
62 |
# sidebar
|