diff --git a/llama_stack/providers/registry/vector_io.py b/llama_stack/providers/registry/vector_io.py index e8237bc62..4f5b74081 100644 --- a/llama_stack/providers/registry/vector_io.py +++ b/llama_stack/providers/registry/vector_io.py @@ -500,7 +500,7 @@ See [PGVector's documentation](https://github.com/pgvector/pgvector) for more de api=Api.vector_io, adapter_type="weaviate", provider_type="remote::weaviate", - pip_packages=["weaviate-client"], + pip_packages=["weaviate-client>=4.16.5"], module="llama_stack.providers.remote.vector_io.weaviate", config_class="llama_stack.providers.remote.vector_io.weaviate.WeaviateVectorIOConfig", provider_data_validator="llama_stack.providers.remote.vector_io.weaviate.WeaviateRequestProviderData", diff --git a/llama_stack/providers/remote/vector_io/weaviate/weaviate.py b/llama_stack/providers/remote/vector_io/weaviate/weaviate.py index ea56705ef..02d132106 100644 --- a/llama_stack/providers/remote/vector_io/weaviate/weaviate.py +++ b/llama_stack/providers/remote/vector_io/weaviate/weaviate.py @@ -96,9 +96,9 @@ class WeaviateIndex(EmbeddingIndex): k: Limit of number of results to return score_threshold: Minimum similarity score threshold Returns: - QueryChunksResponse with chunks and scores + QueryChunksResponse with chunks and scores. """ - log.info( + log.debug( f"WEAVIATE VECTOR SEARCH CALLED: embedding_shape={embedding.shape}, k={k}, threshold={score_threshold}" ) sanitized_collection_name = sanitize_collection_name(self.collection_name, weaviate_format=True) @@ -135,7 +135,7 @@ class WeaviateIndex(EmbeddingIndex): chunks.append(chunk) scores.append(score) - log.info(f"WEAVIATE VECTOR SEARCH RESULTS: Found {len(chunks)} chunks with scores {scores}") + log.debug(f"WEAVIATE VECTOR SEARCH RESULTS: Found {len(chunks)} chunks with scores {scores}") return QueryChunksResponse(chunks=chunks, scores=scores) async def delete(self, chunk_ids: list[str] | None = None) -> None: @@ -166,7 +166,7 @@ class WeaviateIndex(EmbeddingIndex): Returns: QueryChunksResponse with chunks and scores """ - log.info(f"WEAVIATE KEYWORD SEARCH CALLED: query='{query_string}', k={k}, threshold={score_threshold}") + log.debug(f"WEAVIATE KEYWORD SEARCH CALLED: query='{query_string}', k={k}, threshold={score_threshold}") sanitized_collection_name = sanitize_collection_name(self.collection_name, weaviate_format=True) collection = self.client.collections.get(sanitized_collection_name) @@ -199,7 +199,7 @@ class WeaviateIndex(EmbeddingIndex): chunks.append(chunk) scores.append(score) - log.info(f"WEAVIATE KEYWORD SEARCH RESULTS: Found {len(chunks)} chunks with scores {scores}.") + log.debug(f"WEAVIATE KEYWORD SEARCH RESULTS: Found {len(chunks)} chunks with scores {scores}.") return QueryChunksResponse(chunks=chunks, scores=scores) async def query_hybrid( @@ -223,7 +223,7 @@ class WeaviateIndex(EmbeddingIndex): Returns: QueryChunksResponse with combined results """ - log.info( + log.debug( f"WEAVIATE HYBRID SEARCH CALLED: query='{query_string}', embedding_shape={embedding.shape}, k={k}, threshold={score_threshold}, reranker={reranker_type}" ) sanitized_collection_name = sanitize_collection_name(self.collection_name, weaviate_format=True) @@ -265,11 +265,10 @@ class WeaviateIndex(EmbeddingIndex): if score < score_threshold: continue - log.info(f"Document {chunk.metadata.get('document_id')} has score {score}") chunks.append(chunk) scores.append(score) - log.info(f"WEAVIATE HYBRID SEARCH RESULTS: Found {len(chunks)} chunks with scores {scores}") + log.debug(f"WEAVIATE HYBRID SEARCH RESULTS: Found {len(chunks)} chunks with scores {scores}") return QueryChunksResponse(chunks=chunks, scores=scores) @@ -297,7 +296,7 @@ class WeaviateVectorIOAdapter( def _get_client(self) -> weaviate.WeaviateClient: if "localhost" in self.config.weaviate_cluster_url: - log.info("using Weaviate locally in container") + log.info("Using Weaviate locally in container") host, port = self.config.weaviate_cluster_url.split(":") key = "local_test" client = weaviate.connect_to_local( diff --git a/pyproject.toml b/pyproject.toml index ba5e082c0..ecbd8991a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,8 +25,8 @@ classifiers = [ ] dependencies = [ "aiohttp", - "fastapi>=0.115.0,<1.0", # server - "fire", # for MCP in LLS client + "fastapi>=0.115.0,<1.0", # server + "fire", # for MCP in LLS client "httpx", "huggingface-hub>=0.34.0,<1.0", "jinja2>=3.1.6", @@ -43,13 +43,12 @@ dependencies = [ "tiktoken", "pillow", "h11>=0.16.0", - "python-multipart>=0.0.20", # For fastapi Form - "uvicorn>=0.34.0", # server - "opentelemetry-sdk>=1.30.0", # server + "python-multipart>=0.0.20", # For fastapi Form + "uvicorn>=0.34.0", # server + "opentelemetry-sdk>=1.30.0", # server "opentelemetry-exporter-otlp-proto-http>=1.30.0", # server - "aiosqlite>=0.21.0", # server - for metadata store - "asyncpg", # for metadata store - "weaviate-client>=4.16.5", + "aiosqlite>=0.21.0", # server - for metadata store + "asyncpg", # for metadata store ] [project.optional-dependencies] diff --git a/tests/unit/providers/vector_io/remote/test_milvus.py b/tests/unit/providers/vector_io/remote/test_milvus.py index c9af52ad8..ca5f45fa2 100644 --- a/tests/unit/providers/vector_io/remote/test_milvus.py +++ b/tests/unit/providers/vector_io/remote/test_milvus.py @@ -23,13 +23,13 @@ pymilvus_mock.AnnSearchRequest = MagicMock with patch.dict("sys.modules", {"pymilvus": pymilvus_mock}): from llama_stack.providers.remote.vector_io.milvus.milvus import MilvusIndex -# This test is a unit test for the MilvusIndex class. This should only contain +# This test is a unit test for the MilvusVectorIOAdapter class. This should only contain # tests which are specific to this class. More general (API-level) tests should be placed in # tests/integration/vector_io/ # # How to run this test: # -# pytest tests/unit/providers/vector_io/remote/test_milvus.py \ +# pytest tests/unit/providers/vector_io/test_milvus.py \ # -v -s --tb=short --disable-warnings --asyncio-mode=auto MILVUS_PROVIDER = "milvus" @@ -324,6 +324,3 @@ async def test_query_hybrid_search_default_rrf( call_args = mock_milvus_client.hybrid_search.call_args ranker = call_args[1]["ranker"] assert ranker is not None - - -# TODO: Write tests for the MilvusVectorIOAdapter class. diff --git a/uv.lock b/uv.lock index bfa6d7d04..0833a9d77 100644 --- a/uv.lock +++ b/uv.lock @@ -1777,7 +1777,6 @@ dependencies = [ { name = "termcolor" }, { name = "tiktoken" }, { name = "uvicorn" }, - { name = "weaviate-client" }, ] [package.optional-dependencies] @@ -1905,7 +1904,6 @@ requires-dist = [ { name = "termcolor" }, { name = "tiktoken" }, { name = "uvicorn", specifier = ">=0.34.0" }, - { name = "weaviate-client", specifier = ">=4.16.5" }, ] provides-extras = ["ui"]