Skip to content

Commit b3ac68c

Browse files
committed
Disable SelectAI
1 parent 87819ab commit b3ac68c

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

src/client/content/config/databases.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import streamlit as st
1616
from streamlit import session_state as state
1717

18+
from client.content.config.oci import get_oci
1819
import client.utils.api_call as api_call
1920
import common.logging_config as logging_config
2021

@@ -187,7 +188,10 @@ def main() -> None:
187188
# Select AI
188189
#############################################
189190
st.subheader("SelectAI", divider="red")
190-
if state.database_config[name]["selectai"]:
191+
if "oci_config" not in state.user_settings:
192+
get_oci()
193+
oci_auth_profile = state.user_settings["oci"]["auth_profile"]
194+
if state.database_config[name]["selectai"] and state.oci_config[oci_auth_profile]["namespace"] :
191195
st.write("Tables eligible and enabled/disabled for SelectAI.")
192196
if state.database_config[name]["selectai_objects"]:
193197
df = pd.DataFrame(

src/client/utils/st_common.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
from client.content.config.models import get_models
1717
from client.content.config.databases import get_databases
18+
from client.content.config.oci import get_oci
1819
import client.utils.api_call as api_call
1920

2021
import common.help_text as help_text
@@ -253,6 +254,14 @@ def update_settings():
253254
("VectorSearch", "Use AI with Unstructured Data", disable_vector_search),
254255
]
255256

257+
# SelectAI Requirements
258+
if "oci_config" not in state.user_settings:
259+
get_oci()
260+
oci_auth_profile = state.user_settings["oci"]["auth_profile"]
261+
if not state.oci_config[oci_auth_profile]["namespace"]:
262+
logger.debug("SelectAI Disabled (OCI not configured.)")
263+
st.warning("OCI is not fully configured. Disabling SelectAI.", icon="⚠️")
264+
tools = [t for t in tools if t[0] != "SelectAI"]
256265
# Vector Search Requirements
257266
get_models(model_type="embed")
258267
available_embed_models = list(state.embed_model_enabled.keys())

src/server/agents/chatbot.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,5 @@ async def generate_response(state: AgentState, config: RunnableConfig) -> AgentS
422422
memory = MemorySaver()
423423
chatbot_graph = workflow.compile(checkpointer=memory)
424424

425-
## This will write a graph.png file of the LangGraph; don't deliver uncommented
426-
from IPython.display import Image, display
427-
428-
# display(Image(chatbot_graph.get_graph(xray=True).draw_mermaid_png(output_file_path="chatbot_graph.png")))
429-
chatbot_graph.get_graph(xray=True).print_ascii()
425+
## This will output the Graph in ascii; don't deliver uncommented
426+
# chatbot_graph.get_graph(xray=True).print_ascii()

0 commit comments

Comments
 (0)