diff --git a/learn2rag/__main__.py b/learn2rag/__main__.py index 45b7386..4487ce6 100644 --- a/learn2rag/__main__.py +++ b/learn2rag/__main__.py @@ -47,7 +47,8 @@ def configure_logging(config_path: pathlib.Path, debug: bool) -> None: with open('config.yml', 'r') as f: config = yaml.safe_load(f) except FileNotFoundError: - print('No user config file (config.yml)') + print('You can create config.yml for more configuration options') + print('https://docs.learn2rag.de/en/basic/administrator/#advanced-configuration') args, rest = LauncherArgumentParser().parse_known_args() module = importlib.import_module(args.module) diff --git a/learn2rag/compose/__init__.py b/learn2rag/compose/__init__.py index 40ae59d..b735789 100644 --- a/learn2rag/compose/__init__.py +++ b/learn2rag/compose/__init__.py @@ -65,7 +65,7 @@ def init_db(con: sqlite3.Connection) -> None: try: cur.execute(sql) except sqlite3.OperationalError as e: - logger.warning('Database initialization: %s', e) + logger.debug('Database initialization: %s', e) def process_running(pid: int) -> bool: @@ -83,7 +83,6 @@ def process_running(pid: int) -> bool: def healthy(value: list[str]) -> bool: - print(f"len(value) is {len(value)} and value is : {' '.join(value)}") assert len(value) == 4 assert value[0:3] == ['CMD', 'curl' ,'-f'] url = value[3] diff --git a/learn2rag/ui/__init__.py b/learn2rag/ui/__init__.py index ff7ae29..77b988a 100644 --- a/learn2rag/ui/__init__.py +++ b/learn2rag/ui/__init__.py @@ -163,7 +163,6 @@ def get_locale() -> str: return translation babel.init_app(app, locale_selector=get_locale) - app.logger.info('create_app') app.logger.debug('cwd: %s', os.getcwd()) app.logger.debug('root_path: %s', app.root_path) assert app.template_folder is not None @@ -393,14 +392,11 @@ def pipelines_list() -> 'str | werkzeug.wrappers.response.Response': @app.post('/pipelines') def pipeline_create() -> 'str | werkzeug.wrappers.response.Response': label = request.form['label'] - ports = [int(port) for port in request.form.getlist("ports") if port] - name = learn2rag.data.create_entry(app.instance_path, 'pipelines', { - 'label': label, - 'storage_path': request.form['storage_path'], - 'language_model': request.form['language_model'], - 'sources': request.form.getlist('sources'), - 'ports': ports, - }) + data: dict[str, Any] = request.form.to_dict() + data.pop('import', None) + data['ports'] = [int(port) for port in request.form.getlist("ports") if port] + data['sources'] = request.form.getlist('sources') + name = learn2rag.data.create_entry(app.instance_path, 'pipelines', data) flash(pgettext('flash', 'Added a new pipeline configuration: %(label)s', label=label)) if request.form.get('import'): pipeline = learn2rag.data.get_entry(app.instance_path, 'pipelines', name) @@ -542,7 +538,6 @@ def shutdown_request() -> 'str | werkzeug.wrappers.response.Response': threading.Thread(target=shutdown).start() return pgettext('shutdown', 'Bye!') # type: ignore[no-any-return] - app.logger.info('App creation complete') return app @@ -593,13 +588,12 @@ def main(config: dict[str, Any]) -> None: use_https = False if ssl_key and ssl_cert: if os.path.exists(ssl_key) and os.path.exists(ssl_cert): - logging.info(f" SSL files defined and found at {ssl_key} or {ssl_cert}") + logging.debug('TLS enabled') use_https = True else: - logging.error(f"Warning: SSL files defined but not found at {ssl_key} or {ssl_cert}") - raise FileNotFoundError(f"SSL files defined but not found at {ssl_key} or {ssl_cert}") + raise FileNotFoundError(f'The configured TLS files are not found: {ssl_key}, {ssl_cert}') else: - logging.info(f"no SSL files provided then switch to HTTP mode") + logging.debug('TLS disabled') protocol = 'https' if use_https else 'http' url = f"{protocol}://localhost:{port}" diff --git a/learn2rag/ui/templates/compose/pipelines/pipeline.yml b/learn2rag/ui/templates/compose/pipelines/pipeline.yml index 4899b7c..cb16548 100644 --- a/learn2rag/ui/templates/compose/pipelines/pipeline.yml +++ b/learn2rag/ui/templates/compose/pipelines/pipeline.yml @@ -6,7 +6,7 @@ ports: - qdrant_http - pipeline - open_webui_pipelines -ui_url: '{{learn2rag_scheme}}://{{learn2rag_hostname}}:{{ports.ui}}/' +ui_url: '{{ pipeline.chat_proxy_url or learn2rag_scheme ~ "://" ~ learn2rag_hostname ~ ":" ~ ports.ui ~ "/" }}' files: - path: '{{storage_path}}/qdrant_config.yml' content: | diff --git a/learn2rag/ui/templates/pipelines_add.html b/learn2rag/ui/templates/pipelines_add.html index f3430d3..4323205 100644 --- a/learn2rag/ui/templates/pipelines_add.html +++ b/learn2rag/ui/templates/pipelines_add.html @@ -30,6 +30,10 @@