diff --git a/README.md b/README.md index a4ccbda..2fe7183 100644 --- a/README.md +++ b/README.md @@ -282,7 +282,7 @@ Start services: start ./start_services.cmd # Window ``` -Use the CLI: `python3 cli.py` +Use the CLI: `uv run cli.py` --- diff --git a/README_CHS.md b/README_CHS.md index 2cdaa2d..7ea2713 100644 --- a/README_CHS.md +++ b/README_CHS.md @@ -243,7 +243,7 @@ start ./start_services.cmd full # Windows start ./start_services.cmd # Windows ``` -然后运行:`python3 cli.py` +然后运行:`uv run cli.py` --- diff --git a/README_CHT.md b/README_CHT.md index c301fcf..283d764 100644 --- a/README_CHT.md +++ b/README_CHT.md @@ -239,7 +239,7 @@ start ./start_services.cmd full # Windows start ./start_services.cmd # Windows ``` -然後運行:`python3 cli.py` +然後運行:`uv run cli.py` --- diff --git a/README_ES.md b/README_ES.md index 953132e..2b5a50d 100644 --- a/README_ES.md +++ b/README_ES.md @@ -243,7 +243,7 @@ Inicia los servicios: start ./start_services.cmd # Windows ``` -Luego ejecuta: `python3 cli.py` +Luego ejecuta: `uv run cli.py` ## Uso diff --git a/README_FR.md b/README_FR.md index 7ee894d..569f6d5 100644 --- a/README_FR.md +++ b/README_FR.md @@ -243,7 +243,7 @@ Démarrez les services : start ./start_services.cmd # Windows ``` -Puis lancez : `python3 cli.py` +Puis lancez : `uv run cli.py` --- diff --git a/README_JP.md b/README_JP.md index 4e1348f..42081f8 100644 --- a/README_JP.md +++ b/README_JP.md @@ -238,7 +238,7 @@ CLIで実行する場合はホストにパッケージをインストールし start ./start_services.cmd # Windows ``` -その後 `python3 cli.py` を実行 +その後 `uv run cli.py` を実行 --- diff --git a/README_PTBR.md b/README_PTBR.md index 0b0e55d..47d8c17 100644 --- a/README_PTBR.md +++ b/README_PTBR.md @@ -243,7 +243,7 @@ Inicie os serviços: start ./start_services.cmd # Windows ``` -Depois execute: `python3 cli.py` +Depois execute: `uv run cli.py` --- diff --git a/install.bat b/install.bat index b8bfa58..3f985e8 100644 --- a/install.bat +++ b/install.bat @@ -5,7 +5,6 @@ set LLM_ROUTER_DIR=llm_router if exist "%SCRIPTS_DIR%\windows_install.bat" ( echo Running Windows installation script... call "%SCRIPTS_DIR%\windows_install.bat" - cd "%LLM_ROUTER_DIR%" && call dl_safetensors.bat ) else ( echo Error: %SCRIPTS_DIR%\windows_install.bat not found! exit /b 1 diff --git a/sources/tools/tools.py b/sources/tools/tools.py index cb63869..d0648df 100644 --- a/sources/tools/tools.py +++ b/sources/tools/tools.py @@ -41,13 +41,13 @@ class Tools(): self.config = configparser.ConfigParser() self.work_dir = self.create_work_dir() self.excutable_blocks_found = False - self.safe_mode = True + self.safe_mode = False self.allow_language_exec_bash = False def get_work_dir(self): return self.work_dir - def set_allow_language_exec_bash(value: bool) -> None: + def set_allow_language_exec_bash(self, value: bool) -> None: self.allow_language_exec_bash = value def safe_get_work_dir_path(self): @@ -152,7 +152,7 @@ class Tools(): self.excutable_blocks_found = False return tmp - def load_exec_block(self, llm_text: str) -> tuple[list[str], str | None]: + def load_exec_block(self, llm_text: str): """ Extract code/query blocks from LLM-generated text and process them for execution. This method parses the text looking for code blocks marked with the tool's tag (e.g. ```python). diff --git a/start_services.cmd b/start_services.cmd index d4d1102..efce1a2 100644 --- a/start_services.cmd +++ b/start_services.cmd @@ -7,20 +7,32 @@ if "%1"=="full" ( echo !msg! ) - -where openssl >nul 2>&1 +@echo off +openssl rand -hex 32 >nul 2>&1 if %ERRORLEVEL% == 0 ( for /f %%i in ('openssl rand -hex 32') do set SEARXNG_SECRET_KEY=%%i -) else ( - where python >nul 2>&1 - if %ERRORLEVEL% == 0 ( - for /f %%i in ('python -c "import secrets; print(secrets.token_hex(32))"') do set SEARXNG_SECRET_KEY=%%i - ) else ( - echo Error: Neither openssl nor python is available to generate a secret key. - exit /b 2 - ) + goto :key_generated ) +python --version >nul 2>&1 +if %ERRORLEVEL% == 0 ( + for /f %%i in ('python -c "import secrets; print(secrets.token_hex(32))"') do set SEARXNG_SECRET_KEY=%%i + goto :key_generated +) + +py --version >nul 2>&1 +if %ERRORLEVEL% == 0 ( + for /f %%i in ('py -c "import secrets; print(secrets.token_hex(32))"') do set SEARXNG_SECRET_KEY=%%i + goto :key_generated +) + +echo Error: Neither openssl nor python is available to generate a secret key. +echo Please install Python from https://python.org or OpenSSL +exit /b 2 + +:key_generated +echo Secret key generated successfully + REM Generate secret key for /f %%i in ('powershell -command "[System.Web.Security.Membership]::GeneratePassword(64,0)"') do set SEARXNG_SECRET_KEY=%%i