Update app.py
Browse files
app.py
CHANGED
@@ -27,7 +27,7 @@ def setup_api_clients():
|
|
27 |
with st.sidebar:
|
28 |
st.title("API Configuration")
|
29 |
|
30 |
-
use_stored = st.checkbox("Use stored API keys")
|
31 |
|
32 |
if use_stored:
|
33 |
username = st.text_input("Username")
|
@@ -49,7 +49,7 @@ def setup_api_clients():
|
|
49 |
genai.configure(api_key=os.environ["GEMINI_API_KEY"])
|
50 |
|
51 |
st.session_state.api_configured = True
|
52 |
-
st.success("Successfully configured API clients with stored keys!")
|
53 |
else:
|
54 |
st.error("Invalid credentials. Please try again or use your own API keys.")
|
55 |
st.session_state.api_configured = False
|
@@ -60,7 +60,7 @@ def setup_api_clients():
|
|
60 |
anthropic_key = st.text_input("Anthropic API Key", type="password", key="anthropic_key")
|
61 |
gemini_key = st.text_input("Gemini API Key", type="password", key="gemini_key")
|
62 |
|
63 |
-
if st.button("Initialize with provided keys"):
|
64 |
try:
|
65 |
st.session_state.togetherai_client = OpenAI(
|
66 |
api_key=togetherai_key,
|
@@ -75,7 +75,7 @@ def setup_api_clients():
|
|
75 |
genai.configure(api_key=gemini_key)
|
76 |
|
77 |
st.session_state.api_configured = True
|
78 |
-
st.success("Successfully configured API clients with provided keys!")
|
79 |
except Exception as e:
|
80 |
st.error(f"Error initializing API clients: {str(e)}")
|
81 |
st.session_state.api_configured = False
|
|
|
27 |
with st.sidebar:
|
28 |
st.title("API Configuration")
|
29 |
|
30 |
+
use_stored = st.checkbox("Use the stored API keys")
|
31 |
|
32 |
if use_stored:
|
33 |
username = st.text_input("Username")
|
|
|
49 |
genai.configure(api_key=os.environ["GEMINI_API_KEY"])
|
50 |
|
51 |
st.session_state.api_configured = True
|
52 |
+
st.success("Successfully configured the API clients with stored keys!")
|
53 |
else:
|
54 |
st.error("Invalid credentials. Please try again or use your own API keys.")
|
55 |
st.session_state.api_configured = False
|
|
|
60 |
anthropic_key = st.text_input("Anthropic API Key", type="password", key="anthropic_key")
|
61 |
gemini_key = st.text_input("Gemini API Key", type="password", key="gemini_key")
|
62 |
|
63 |
+
if st.button("Initialize with the provided keys"):
|
64 |
try:
|
65 |
st.session_state.togetherai_client = OpenAI(
|
66 |
api_key=togetherai_key,
|
|
|
75 |
genai.configure(api_key=gemini_key)
|
76 |
|
77 |
st.session_state.api_configured = True
|
78 |
+
st.success("Successfully configured the API clients with provided keys!")
|
79 |
except Exception as e:
|
80 |
st.error(f"Error initializing API clients: {str(e)}")
|
81 |
st.session_state.api_configured = False
|