crewplus 0.2.50__tar.gz → 0.2.52__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.

Files changed (24) hide show
  1. {crewplus-0.2.50 → crewplus-0.2.52}/PKG-INFO +1 -1
  2. {crewplus-0.2.50 → crewplus-0.2.52}/crewplus/vectorstores/milvus/vdb_service.py +14 -2
  3. {crewplus-0.2.50 → crewplus-0.2.52}/pyproject.toml +1 -1
  4. {crewplus-0.2.50 → crewplus-0.2.52}/LICENSE +0 -0
  5. {crewplus-0.2.50 → crewplus-0.2.52}/README.md +0 -0
  6. {crewplus-0.2.50 → crewplus-0.2.52}/crewplus/__init__.py +0 -0
  7. {crewplus-0.2.50 → crewplus-0.2.52}/crewplus/callbacks/__init__.py +0 -0
  8. {crewplus-0.2.50 → crewplus-0.2.52}/crewplus/callbacks/async_langfuse_handler.py +0 -0
  9. {crewplus-0.2.50 → crewplus-0.2.52}/crewplus/services/__init__.py +0 -0
  10. {crewplus-0.2.50 → crewplus-0.2.52}/crewplus/services/azure_chat_model.py +0 -0
  11. {crewplus-0.2.50 → crewplus-0.2.52}/crewplus/services/gemini_chat_model.py +0 -0
  12. {crewplus-0.2.50 → crewplus-0.2.52}/crewplus/services/init_services.py +0 -0
  13. {crewplus-0.2.50 → crewplus-0.2.52}/crewplus/services/model_load_balancer.py +0 -0
  14. {crewplus-0.2.50 → crewplus-0.2.52}/crewplus/services/tracing_manager.py +0 -0
  15. {crewplus-0.2.50 → crewplus-0.2.52}/crewplus/utils/__init__.py +0 -0
  16. {crewplus-0.2.50 → crewplus-0.2.52}/crewplus/utils/schema_action.py +0 -0
  17. {crewplus-0.2.50 → crewplus-0.2.52}/crewplus/utils/schema_document_updater.py +0 -0
  18. {crewplus-0.2.50 → crewplus-0.2.52}/crewplus/vectorstores/milvus/__init__.py +0 -0
  19. {crewplus-0.2.50 → crewplus-0.2.52}/crewplus/vectorstores/milvus/milvus_schema_manager.py +0 -0
  20. {crewplus-0.2.50 → crewplus-0.2.52}/crewplus/vectorstores/milvus/schema_milvus.py +0 -0
  21. {crewplus-0.2.50 → crewplus-0.2.52}/docs/GeminiChatModel.md +0 -0
  22. {crewplus-0.2.50 → crewplus-0.2.52}/docs/ModelLoadBalancer.md +0 -0
  23. {crewplus-0.2.50 → crewplus-0.2.52}/docs/VDBService.md +0 -0
  24. {crewplus-0.2.50 → crewplus-0.2.52}/docs/index.md +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: crewplus
3
- Version: 0.2.50
3
+ Version: 0.2.52
4
4
  Summary: Base services for CrewPlus AI applications
5
5
  Author-Email: Tim Liu <tim@opsmateai.com>
6
6
  License: MIT
@@ -12,6 +12,7 @@ from langchain_openai import AzureOpenAIEmbeddings
12
12
  from pymilvus import MilvusClient, AsyncMilvusClient
13
13
  import time
14
14
  import asyncio
15
+ import uuid
15
16
 
16
17
  from ...services.init_services import get_model_balancer
17
18
  from .schema_milvus import SchemaMilvus, DEFAULT_SCHEMA
@@ -24,6 +25,12 @@ class VDBService(object):
24
25
  This service centralizes the configuration and instantiation of the Milvus client
25
26
  and provides helper methods to get embedding functions and vector store instances.
26
27
 
28
+ This service generates a unique connection `alias` upon initialization. This `alias`
29
+ is propagated to all Milvus clients created by this service, including those
30
+ within `langchain_milvus` instances. This mechanism ensures that a single,
31
+ shared connection is used for all operations, preventing the creation of
32
+ multiple redundant connections and improving resource efficiency.
33
+
27
34
  Args:
28
35
  settings (dict, optional): A dictionary containing configuration for the vector store
29
36
  and embedding models.
@@ -115,7 +122,6 @@ class VDBService(object):
115
122
  """
116
123
  self.logger = logger or logging.getLogger(__name__)
117
124
  self.collection_schema = None
118
- self.schema_manager = MilvusSchemaManager(client=self.client, async_client=self.aclient)
119
125
 
120
126
  if settings:
121
127
  self.settings = settings
@@ -147,12 +153,17 @@ class VDBService(object):
147
153
  self.logger.error(msg)
148
154
  raise ValueError(msg)
149
155
 
156
+ self.alias = f"crewplus-vdb-{uuid.uuid4()}"
157
+ self.connection_args['alias'] = self.alias
158
+
150
159
  self._client = self._initialize_milvus_client(provider)
151
160
  self._async_client = self._initialize_async_milvus_client(provider)
152
161
 
153
162
  self.schema = schema
154
163
  self.index_params = self.settings.get("index_params")
155
164
 
165
+ self.schema_manager = MilvusSchemaManager(client=self._client, async_client=self._async_client)
166
+
156
167
  self.logger.info("VDBService initialized successfully")
157
168
 
158
169
  def _get_milvus_client_args(self, provider: str) -> dict:
@@ -171,7 +182,8 @@ class VDBService(object):
171
182
  "uri": uri,
172
183
  "user": self.connection_args.get("user"),
173
184
  "password": self.connection_args.get("password"),
174
- "db_name": self.connection_args.get("db_name")
185
+ "db_name": self.connection_args.get("db_name"),
186
+ "alias": self.connection_args.get("alias")
175
187
  }
176
188
  return {k: v for k, v in client_args.items() if v is not None}
177
189
 
@@ -6,7 +6,7 @@ build-backend = "pdm.backend"
6
6
 
7
7
  [project]
8
8
  name = "crewplus"
9
- version = "0.2.50"
9
+ version = "0.2.52"
10
10
  description = "Base services for CrewPlus AI applications"
11
11
  authors = [
12
12
  { name = "Tim Liu", email = "tim@opsmateai.com" },
File without changes
File without changes
File without changes
File without changes