Skip to content

Commit 98d9624

Browse files
committed
Linting
1 parent b0ae6ea commit 98d9624

File tree

5 files changed

+14
-45
lines changed

5 files changed

+14
-45
lines changed

src/client/utils/st_common.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ def tools_sidebar() -> None:
236236
"""SelectAI Sidebar Settings, conditional if all sorts of bs setup"""
237237

238238
def update_set_tool():
239+
"""Update user settings as to which tool is being used"""
239240
state.user_settings["vector_search"]["enabled"] = state.selected_tool == "VectorSearch"
240241
state.user_settings["selectai"]["enabled"] = state.selected_tool == "SelectAI"
241242

@@ -286,7 +287,6 @@ def update_set_tool():
286287
tools = [t for t in tools if t[0] != "Vector Search"]
287288

288289
tool_box = [name for name, _, disabled in tools if not disabled]
289-
# tool_cap = [desc for _, desc, disabled in tools if not disabled]
290290
if len(tool_box) > 1:
291291
st.sidebar.subheader("Toolkit", divider="red")
292292
tool_index = next(
@@ -301,7 +301,6 @@ def update_set_tool():
301301
st.sidebar.selectbox(
302302
"Tool Selection",
303303
tool_box,
304-
# captions=tool_cap,
305304
index=tool_index,
306305
label_visibility="collapsed",
307306
on_change=update_set_tool,

src/server/endpoints.py

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -982,33 +982,4 @@ async def selectai_update_objects(
982982
selectai.set_profile(db_conn, client_settings.selectai.profile, "object_list", object_list)
983983
return selectai.get_objects(db_conn, client_settings.selectai.profile)
984984

985-
# @auth.post("/v1/selectai", description="Call SelectAI Tool", response_model=str)
986-
# async def selectai_endpoint(
987-
# query: str,
988-
# client: schema.ClientIdType = Header(default="server"),
989-
# ) -> str:
990-
# """Call selectai_tool with provided profile and query parameters."""
991-
# logger.debug("Received selectai_endpoint - query: %s", query)
992-
# client_settings = get_client_settings(client)
993-
# logger.debug("SelectAI Enabled: %s", client_settings.selectai.selectai_enabled)
994-
# if not client_settings.selectai.selectai_enabled:
995-
# return f"SelectAI is Disabled for client: {client}"
996-
997-
# try:
998-
# # Create RunnableConfig with profile and query
999-
# config = RunnableConfig(
1000-
# profile=client_settings.selectai.profile,
1001-
# query=query,
1002-
# action=client_settings.selectai.action,
1003-
# configurable={"db_conn": get_client_db(client).connection},
1004-
# )
1005-
1006-
# # Call the tool
1007-
# result = selectai_tool(config=config)
1008-
1009-
# return result
1010-
# except Exception as ex:
1011-
# logger.error("An exception occurred: %s", ex)
1012-
# raise HTTPException(status_code=500, detail=str(ex)) from ex
1013-
1014985
logger.info("Endpoints Loaded.")

src/server/utils/databases.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ def connect(config: Database) -> oracledb.Connection:
2727
include_fields = set(DatabaseAuth.model_fields.keys())
2828
db_config = config.model_dump(include=include_fields)
2929
logger.debug("Database Config: %s", db_config)
30-
# If a wallet password is provided but no wallet location is set, default the wallet location to the config directory
30+
# If a wallet password is provided but no wallet location is set
31+
# default the wallet location to the config directory
3132
if db_config.get("wallet_password") and not db_config.get("wallet_location"):
3233
db_config["wallet_location"] = db_config["config_dir"]
3334
# Check if connection settings are configured

src/server/utils/models.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,6 @@ async def get_client(
103103
base_url=model_url,
104104
**ll_common_params,
105105
num_predict=ll_common_params["max_completion_tokens"],
106-
# repeat_penalty=ll_common_params["frequency_penalty"],
107-
# disable_streaming=not ll_common_params["streaming"]
108106
),
109107
"Perplexity": lambda: ChatOpenAI(
110108
model=model_name, base_url=model_url, api_key=model_api_key, **ll_common_params

widget/app.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ document.addEventListener('DOMContentLoaded', () => {
1616

1717
openChatBtn.addEventListener('click', () => {
1818
chatWidget.classList.remove('chat-hidden');
19-
openChatBtn.style.display = 'none';
19+
openChatBtn.style.display = 'none';
2020
});
2121

2222
closeChatBtn.addEventListener('click', () => {
23-
chatWidget.classList.add('chat-hidden');
24-
openChatBtn.style.display = 'block';
23+
chatWidget.classList.add('chat-hidden');
24+
openChatBtn.style.display = 'block';
2525
});
2626

27-
27+
2828
sendBtn.addEventListener('click', async () => {
2929
const userMessage = chatInput.value;
3030
if (userMessage.trim()) {
@@ -36,7 +36,7 @@ document.addEventListener('DOMContentLoaded', () => {
3636
}
3737
});
3838

39-
39+
4040
function appendMessage(message, className) {
4141
const messageElement = document.createElement('div');
4242
messageElement.classList.add('message', className);
@@ -63,23 +63,23 @@ document.addEventListener('DOMContentLoaded', () => {
6363
const response = await fetch(apiUrl, {
6464
method: 'POST',
6565
headers: {
66-
'Content-Type': 'application/json',
67-
'Authorization': 'Bearer '+api_key
66+
'Content-Type': 'application/json',
67+
'Authorization': 'Bearer ' + api_key
6868
},
69-
body: JSON.stringify(messagePayload)
69+
body: JSON.stringify(messagePayload)
7070
});
7171

7272
const data = await response.json();
7373
//return data.answer;
74-
return data.choices[0].text+"\n Source: "+data.sources[0];
74+
return data.choices[0].text + "\n Source: " + data.sources[0];
7575
} catch (error) {
7676
console.error('Error fetching API:', error);
7777
return "Sorry, I couldn't connect to the server.";
7878
}
7979
}
8080
});
8181

82-
8382

8483

85-
84+
85+

0 commit comments

Comments
 (0)