Spaces:
Sleeping
Sleeping
Update src/app.py
Browse files- src/app.py +4 -1
src/app.py
CHANGED
|
@@ -112,13 +112,16 @@ with st.sidebar:
|
|
| 112 |
user_api_key = st.text_input(
|
| 113 |
"🔓 Unlock GPT-4o (Enter API Key)",
|
| 114 |
type="password",
|
| 115 |
-
help="Enter your OpenAI API key to access GPT-4o. Press Enter to apply."
|
|
|
|
| 116 |
)
|
| 117 |
if user_api_key:
|
| 118 |
st.session_state.user_openai_key = user_api_key
|
| 119 |
st.caption("✅ Key Active")
|
| 120 |
else:
|
| 121 |
st.session_state.user_openai_key = None
|
|
|
|
|
|
|
| 122 |
|
| 123 |
# 3. DYNAMICALLY ADD GPT-4o TO THE LIST
|
| 124 |
# If Admin OR if they just entered a key, show the option
|
|
|
|
| 112 |
user_api_key = st.text_input(
|
| 113 |
"🔓 Unlock GPT-4o (Enter API Key)",
|
| 114 |
type="password",
|
| 115 |
+
help="Enter your OpenAI API key to access GPT-4o. Press Enter to apply.",
|
| 116 |
+
key=f"user_key_{st.session_state.username}"
|
| 117 |
)
|
| 118 |
if user_api_key:
|
| 119 |
st.session_state.user_openai_key = user_api_key
|
| 120 |
st.caption("✅ Key Active")
|
| 121 |
else:
|
| 122 |
st.session_state.user_openai_key = None
|
| 123 |
+
else:
|
| 124 |
+
st.session_state.user_openai_key = None
|
| 125 |
|
| 126 |
# 3. DYNAMICALLY ADD GPT-4o TO THE LIST
|
| 127 |
# If Admin OR if they just entered a key, show the option
|