Skip to content

Commit

Permalink
fix: add requirement
Browse files Browse the repository at this point in the history
  • Loading branch information
taprosoft committed Dec 23, 2024
1 parent 7a8d531 commit ccd14d7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 3 additions & 1 deletion libs/ktem/ktem/assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ function run() {
// move setting close button
let setting_tab_nav_bar = document.querySelector("#settings-tab .tab-nav");
let setting_close_button = document.getElementById("save-setting-btn");
setting_tab_nav_bar.appendChild(setting_close_button);
if (setting_close_button) {
setting_tab_nav_bar.appendChild(setting_close_button);
}

let default_conv_column_min_width = "min(300px, 100%)";
conv_column.style.minWidth = default_conv_column_min_width
Expand Down
8 changes: 3 additions & 5 deletions libs/ktem/ktem/pages/chat/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import asyncio
import importlib
import json
import re
from copy import deepcopy
Expand All @@ -19,6 +18,7 @@
from plotly.io import from_json
from sqlmodel import Session, select
from theflow.settings import settings as flowsettings
from theflow.utils.modules import import_dotted_string

from kotaemon.base import Document
from kotaemon.indices.ingests.files import KH_DEFAULT_FILE_EXTRACTORS
Expand All @@ -34,11 +34,9 @@
WebSearch = None
if KH_WEB_SEARCH_BACKEND:
try:
module_name, class_name = KH_WEB_SEARCH_BACKEND.rsplit(".", 1)
module = importlib.import_module(module_name)
WebSearch = getattr(module, class_name)
WebSearch = import_dotted_string(KH_WEB_SEARCH_BACKEND, safe=False)
except (ImportError, AttributeError) as e:
print(f"Error importing {class_name} from {module_name}: {e}")
print(f"Error importing {KH_WEB_SEARCH_BACKEND}: {e}")

DEFAULT_SETTING = "(default)"
INFO_PANEL_SCALES = {True: 8, False: 4}
Expand Down
1 change: 1 addition & 0 deletions libs/ktem/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ dependencies = [
"sqlmodel>=0.0.16,<0.1",
"tiktoken>=0.6.0,<1",
"gradio>=4.31.0,<5",
"gradiologin",
"python-multipart==0.0.12", # required for gradio, pinning to avoid yanking issues with micropip (fixed in gradio >= 5.4.0)
"markdown>=3.6,<4",
"tzlocal>=5.0",
Expand Down

0 comments on commit ccd14d7

Please sign in to comment.