Skip to content

Commit

Permalink
disable openai type when cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
dayesouza committed Apr 17, 2024
1 parent 783f8fd commit 464d9ca
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/pages/Settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def main():
st.markdown("Select the OpenAI type you want to use.")
types = ["OpenAI", "Azure OpenAI"]
index = types.index(openai.get_openai_type()) if openai.get_openai_type() in types else 0
type_input = st.radio("OpenAI Type", types, index=index)
type_input = st.radio("OpenAI Type", types, index=index, disabled=is_mode_cloud)
type = openai.get_openai_type()
if type != type_input:
on_change(secrets_handler, openai_type_key, type_input)()
Expand All @@ -59,13 +59,13 @@ def main():
if type_input == "Azure OpenAI":
col1, col2 = st.columns(2)
with col1:
endpoint = st.text_input("Azure OpenAI Endpoint", type="password", value=openai.get_azure_openai_endpoint())
endpoint = st.text_input("Azure OpenAI Endpoint", disabled=is_mode_cloud, type="password", value=openai.get_azure_openai_endpoint())
if endpoint != openai.get_azure_openai_endpoint():
on_change(secrets_handler, openai_endpoint_key, endpoint)()
st.rerun()

with col2:
version = st.text_input("Azure OpenAI Version", value=openai.get_azure_openai_version())
version = st.text_input("Azure OpenAI Version", disabled=is_mode_cloud, value=openai.get_azure_openai_version())
if version != openai.get_azure_openai_version():
on_change(secrets_handler, openai_version_key, version)()
st.rerun()
Expand Down

0 comments on commit 464d9ca

Please sign in to comment.