diff --git a/docs/swarms/memory/weaviate.md b/docs/swarms/memory/weaviate.md index 7044f1ad..b23baedf 100644 --- a/docs/swarms/memory/weaviate.md +++ b/docs/swarms/memory/weaviate.md @@ -28,7 +28,7 @@ pip install swarms ## Initialization -To use the Weaviate API Client, you need to initialize an instance of the `WeaviateClient` class. Here are the parameters you can pass to the constructor: +To use the Weaviate API Client, you need to initialize an instance of the `WeaviateDB` class. Here are the parameters you can pass to the constructor: | Parameter | Type | Description | |----------------------|----------------|----------------------------------------------------------------------------------------------------------------------------------| @@ -43,12 +43,12 @@ To use the Weaviate API Client, you need to initialize an instance of the `Weavi | `additional_config` | Optional[weaviate.AdditionalConfig] | Additional configuration for the client. (Optional) | | `connection_params` | Dict[str, Any] | Dictionary containing connection parameters. This parameter is used internally and can be ignored in most cases. | -Here's an example of how to initialize a WeaviateClient: +Here's an example of how to initialize a WeaviateDB: ```python -from swarms.memory import WeaviateClient +from swarms.memory import WeaviateDB -weaviate_client = WeaviateClient( +weaviate_client = WeaviateDB( http_host="YOUR_HTTP_HOST", http_port="YOUR_HTTP_PORT", http_secure=True, diff --git a/playground/demos/optimize_llm_stack/weaviate.py b/playground/demos/optimize_llm_stack/weaviate.py index fa3bf96e..ad594547 100644 --- a/playground/demos/optimize_llm_stack/weaviate.py +++ b/playground/demos/optimize_llm_stack/weaviate.py @@ -1,6 +1,6 @@ -from swarms.memory import WeaviateClient +from swarms.memory import WeaviateDB -weaviate_client = WeaviateClient( +weaviate_client = WeaviateDB( http_host="YOUR_HTTP_HOST", http_port="YOUR_HTTP_PORT", http_secure=True, diff --git a/swarms/memory/__init__.py b/swarms/memory/__init__.py index 631db943..de056f04 100644 --- a/swarms/memory/__init__.py +++ b/swarms/memory/__init__.py @@ -1,6 +1,6 @@ from swarms.memory.base_vectordb import VectorDatabase from swarms.memory.short_term_memory import ShortTermMemory from swarms.memory.sqlite import SQLiteDB -from swarms.memory.weaviate_db import WeaviateClient +from swarms.memory.weaviate_db import WeaviateDB -__all__ = ["VectorDatabase", "ShortTermMemory", "SQLiteDB", "WeaviateClient"] +__all__ = ["VectorDatabase", "ShortTermMemory", "SQLiteDB", "WeaviateDB"] diff --git a/swarms/memory/weaviate_db.py b/swarms/memory/weaviate_db.py index 83bb1b77..f5d3771f 100644 --- a/swarms/memory/weaviate_db.py +++ b/swarms/memory/weaviate_db.py @@ -11,7 +11,7 @@ try: except ImportError as error: print("pip install weaviate-client") -class WeaviateClient(VectorDatabase): +class WeaviateDB(VectorDatabase): """ Weaviate API Client @@ -36,7 +36,7 @@ class WeaviateClient(VectorDatabase): delete: Delete an object from a specified collection. Examples: - >>> from swarms.memory import WeaviateClient + >>> from swarms.memory import WeaviateDB """ def __init__( @@ -77,7 +77,7 @@ class WeaviateClient(VectorDatabase): ) # If additional headers are provided, add them to the connection params. - self.client = weaviate.WeaviateClient( + self.client = weaviate.WeaviateDB( connection_params=connection_params, auth_client_secret=auth_client_secret, additional_headers=additional_headers, diff --git a/tests/memory/test_weaviate.py b/tests/memory/test_weaviate.py index 09dc6d45..edd99b3a 100644 --- a/tests/memory/test_weaviate.py +++ b/tests/memory/test_weaviate.py @@ -1,12 +1,12 @@ import pytest from unittest.mock import Mock, patch -from swarms.memory.weaviate import WeaviateClient +from swarms.memory.weaviate_db import WeaviateDB -# Define fixture for a WeaviateClient instance with mocked methods +# Define fixture for a WeaviateDB instance with mocked methods @pytest.fixture def weaviate_client_mock(): - client = WeaviateClient( + client = WeaviateDB( http_host="mock_host", http_port="mock_port", http_secure=False, @@ -31,7 +31,7 @@ def weaviate_client_mock(): return client -# Define tests for the WeaviateClient class +# Define tests for the WeaviateDB class def test_create_collection(weaviate_client_mock): # Test creating a collection weaviate_client_mock.create_collection(