crewplus 0.2.5__tar.gz → 0.2.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of crewplus might be problematic. Click here for more details.
- {crewplus-0.2.5 → crewplus-0.2.6}/PKG-INFO +1 -1
- {crewplus-0.2.5 → crewplus-0.2.6}/crewplus/vectorstores/milvus/vdb_service.py +15 -2
- {crewplus-0.2.5 → crewplus-0.2.6}/docs/VDBService.md +1 -1
- {crewplus-0.2.5 → crewplus-0.2.6}/pyproject.toml +1 -1
- {crewplus-0.2.5 → crewplus-0.2.6}/LICENSE +0 -0
- {crewplus-0.2.5 → crewplus-0.2.6}/README.md +0 -0
- {crewplus-0.2.5 → crewplus-0.2.6}/crewplus/__init__.py +0 -0
- {crewplus-0.2.5 → crewplus-0.2.6}/crewplus/services/__init__.py +0 -0
- {crewplus-0.2.5 → crewplus-0.2.6}/crewplus/services/gemini_chat_model.py +0 -0
- {crewplus-0.2.5 → crewplus-0.2.6}/crewplus/services/init_services.py +0 -0
- {crewplus-0.2.5 → crewplus-0.2.6}/crewplus/services/model_load_balancer.py +0 -0
- {crewplus-0.2.5 → crewplus-0.2.6}/crewplus/utils/schema_action.py +0 -0
- {crewplus-0.2.5 → crewplus-0.2.6}/crewplus/utils/schema_document_updater.py +0 -0
- {crewplus-0.2.5 → crewplus-0.2.6}/crewplus/vectorstores/milvus/__init__.py +0 -0
- {crewplus-0.2.5 → crewplus-0.2.6}/crewplus/vectorstores/milvus/milvus_schema_manager.py +0 -0
- {crewplus-0.2.5 → crewplus-0.2.6}/crewplus/vectorstores/milvus/schema_milvus.py +0 -0
- {crewplus-0.2.5 → crewplus-0.2.6}/docs/GeminiChatModel.md +0 -0
- {crewplus-0.2.5 → crewplus-0.2.6}/docs/ModelLoadBalancer.md +0 -0
- {crewplus-0.2.5 → crewplus-0.2.6}/docs/index.md +0 -0
|
@@ -248,8 +248,8 @@ class VDBService(object):
|
|
|
248
248
|
def get_vector_store(self, collection_name: str, embeddings: Embeddings = None, metric_type: str = "L2") -> Zilliz:
|
|
249
249
|
"""
|
|
250
250
|
Gets a vector store instance, creating it if it doesn't exist for the collection.
|
|
251
|
-
|
|
252
|
-
|
|
251
|
+
This method validates both the embedding function and the vector store connection
|
|
252
|
+
before caching the instance to prevent faulty instances from being reused.
|
|
253
253
|
|
|
254
254
|
Args:
|
|
255
255
|
collection_name (str): The name of the collection in the vector database.
|
|
@@ -272,6 +272,19 @@ class VDBService(object):
|
|
|
272
272
|
if embeddings is None:
|
|
273
273
|
embeddings = self.get_embeddings()
|
|
274
274
|
|
|
275
|
+
# 1. Validate the embedding function before proceeding.
|
|
276
|
+
try:
|
|
277
|
+
self.logger.debug(f"Testing embedding function for collection '{collection_name}'...")
|
|
278
|
+
embeddings.embed_query("validation_test_string")
|
|
279
|
+
self.logger.debug("Embedding function is valid.")
|
|
280
|
+
except Exception as e:
|
|
281
|
+
self.logger.error(
|
|
282
|
+
f"The provided embedding function is invalid and failed with error: {e}. "
|
|
283
|
+
f"Cannot create a vector store for collection '{collection_name}'."
|
|
284
|
+
)
|
|
285
|
+
raise RuntimeError(f"Invalid embedding function provided.") from e
|
|
286
|
+
|
|
287
|
+
# If embeddings are valid, proceed to create the Zilliz instance.
|
|
275
288
|
index_params = self.index_params or {
|
|
276
289
|
"metric_type": metric_type,
|
|
277
290
|
"index_type": "AUTOINDEX",
|
|
@@ -101,7 +101,7 @@ This requires the `ModelLoadBalancer` to have been initialized, as shown in the
|
|
|
101
101
|
# The service will call get_model_balancer() internally to get the initialized instance.
|
|
102
102
|
embedding_model = vdb_service.get_embeddings(
|
|
103
103
|
from_model_balancer=True,
|
|
104
|
-
provider="azure-openai",
|
|
104
|
+
provider="azure-openai-embeddings",
|
|
105
105
|
model_type="embedding-large" # Specify the model type configured in the balancer
|
|
106
106
|
)
|
|
107
107
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|