Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,14 +13,15 @@ st.set_page_config(page_title="RegBotBeta", page_icon="📜🤖")
|
|
| 13 |
st.title("Welcome to RegBotBeta2.0")
|
| 14 |
st.header("Powered by `LlamaIndex🦙`, `Langchain🦜🔗 ` and `OpenAI API`")
|
| 15 |
|
| 16 |
-
api_key = st.text_input("Enter your OpenAI API key here:", type="password")
|
|
|
|
| 17 |
|
| 18 |
if api_key:
|
| 19 |
resp = validate(api_key)
|
| 20 |
if "error" in resp.json():
|
| 21 |
st.info("Invalid Token! Try again.")
|
| 22 |
else:
|
| 23 |
-
st.info("Success")
|
| 24 |
os.environ["OPENAI_API_KEY"] = api_key
|
| 25 |
openai.api_key = api_key
|
| 26 |
|
|
|
|
| 13 |
st.title("Welcome to RegBotBeta2.0")
|
| 14 |
st.header("Powered by `LlamaIndex🦙`, `Langchain🦜🔗 ` and `OpenAI API`")
|
| 15 |
|
| 16 |
+
#api_key = st.text_input("Enter your OpenAI API key here:", type="password")
|
| 17 |
+
api_key = os.environ['OPENAI_API_KEY']
|
| 18 |
|
| 19 |
if api_key:
|
| 20 |
resp = validate(api_key)
|
| 21 |
if "error" in resp.json():
|
| 22 |
st.info("Invalid Token! Try again.")
|
| 23 |
else:
|
| 24 |
+
#st.info("Success")
|
| 25 |
os.environ["OPENAI_API_KEY"] = api_key
|
| 26 |
openai.api_key = api_key
|
| 27 |
|