From c046a837670500fdbedd7ccad04b3887580581d3 Mon Sep 17 00:00:00 2001 From: team 1 Date: Mon, 16 Feb 2026 10:17:42 +0100 Subject: [PATCH] add new md files --- config/services.yaml | 4 +++- src/Vector/VectorSearchClient.php | 7 ++++--- src/Vector/vector_search.py | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/config/services.yaml b/config/services.yaml index b444826..288432a 100644 --- a/config/services.yaml +++ b/config/services.yaml @@ -13,6 +13,7 @@ parameters: mto.vector.python_bin: '/var/www/html/.venv/bin/python3' mto.vector.ingest_script: '/src/Vector/vector_ingest.py' + mto.vector.search_script: '%kernel.project_dir%/src/Vector/vector_search.py' mto.vector.data.path: '%kernel.project_dir%/var/knowledge' mto.vector.data.upload.path: '%mto.vector.data.path%/uploads' @@ -104,7 +105,8 @@ services: App\Vector\VectorSearchClient: arguments: - $vectorDir: '%kernel.project_dir%/var/knowledge' + $binPythonDir: '%mto.vector.python_bin%' + $vectorSearchPyPath: '%mto.vector.search_script%' App\Vector\VectorIndexBuilder: arguments: diff --git a/src/Vector/VectorSearchClient.php b/src/Vector/VectorSearchClient.php index 3af952e..1d5b546 100644 --- a/src/Vector/VectorSearchClient.php +++ b/src/Vector/VectorSearchClient.php @@ -9,14 +9,15 @@ use Psr\Log\LoggerInterface; final class VectorSearchClient { public function __construct( - private readonly string $vectorDir, + private readonly string $binPythonDir, + private readonly string $vectorSearchPyPath, private LoggerInterface $agentLogger, ) { } public function search(string $query, int $limit = 5): array { - $script = rtrim($this->vectorDir, '/') . '/vector_search.py'; + $script = $this->vectorSearchPyPath; $this->agentLogger->info("Run vector search script $script"); if (!is_file($script)) { return []; @@ -25,7 +26,7 @@ final class VectorSearchClient // ------------------------------------------------- // Determine Python interpreter (venv preferred) // ------------------------------------------------- - $venvPython = $this->vectorDir . '/.venv/bin/python'; + $venvPython = $this->binPythonDir; $pythonBin = is_file($venvPython) ? $venvPython : 'python3'; $cmd = sprintf( diff --git a/src/Vector/vector_search.py b/src/Vector/vector_search.py index 63291a3..2f6c065 100644 --- a/src/Vector/vector_search.py +++ b/src/Vector/vector_search.py @@ -16,7 +16,7 @@ limit = int(sys.argv[2]) vector_dir = Path(__file__).resolve().parent index_path = vector_dir / "vector.index" -meta_path = vector_dir / "vector_meta.json" +meta_path = vector_dir / "vector.index.meta.json" # --------------------------------------------------------- # Dependency checks (controlled)