crewplus 0.2.51__py3-none-any.whl → 0.2.52__py3-none-any.whl

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.

@@ -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.
@@ -146,6 +153,9 @@ class VDBService(object):
146
153
  self.logger.error(msg)
147
154
  raise ValueError(msg)
148
155
 
156
+ self.alias = f"crewplus-vdb-{uuid.uuid4()}"
157
+ self.connection_args['alias'] = self.alias
158
+
149
159
  self._client = self._initialize_milvus_client(provider)
150
160
  self._async_client = self._initialize_async_milvus_client(provider)
151
161
 
@@ -172,7 +182,8 @@ class VDBService(object):
172
182
  "uri": uri,
173
183
  "user": self.connection_args.get("user"),
174
184
  "password": self.connection_args.get("password"),
175
- "db_name": self.connection_args.get("db_name")
185
+ "db_name": self.connection_args.get("db_name"),
186
+ "alias": self.connection_args.get("alias")
176
187
  }
177
188
  return {k: v for k, v in client_args.items() if v is not None}
178
189
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: crewplus
3
- Version: 0.2.51
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
@@ -1,7 +1,7 @@
1
- crewplus-0.2.51.dist-info/METADATA,sha256=YWQyvTpALzQ1U499VEujqYeas-mC8dyfVSao_eWklf4,5459
2
- crewplus-0.2.51.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
3
- crewplus-0.2.51.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
4
- crewplus-0.2.51.dist-info/licenses/LICENSE,sha256=2_NHSHRTKB_cTcT_GXgcenOCtIZku8j343mOgAguTfc,1087
1
+ crewplus-0.2.52.dist-info/METADATA,sha256=CpmJOPqhhdAp5S60ZR3agVdmTbtEqOWlcsJrLC6Do54,5459
2
+ crewplus-0.2.52.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
3
+ crewplus-0.2.52.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
4
+ crewplus-0.2.52.dist-info/licenses/LICENSE,sha256=2_NHSHRTKB_cTcT_GXgcenOCtIZku8j343mOgAguTfc,1087
5
5
  crewplus/__init__.py,sha256=m46HkZL1Y4toD619NL47Sn2Qe084WFFSFD7e6VoYKZc,284
6
6
  crewplus/callbacks/__init__.py,sha256=YG7ieeb91qEjp1zF0-inEN7mjZ7yT_D2yzdWFT8Z1Ws,63
7
7
  crewplus/callbacks/async_langfuse_handler.py,sha256=A4uFeLpvOUdc58M7sZoE65_C1V98u0QCvx5jUquM0pM,7006
@@ -17,9 +17,9 @@ crewplus/utils/schema_document_updater.py,sha256=frvffxn2vbi71fHFPoGb9hq7gH2azmm
17
17
  crewplus/vectorstores/milvus/__init__.py,sha256=OeYv2rdyG7tcREIjBJPyt2TbE54NvyeRoWMe7LwopRE,245
18
18
  crewplus/vectorstores/milvus/milvus_schema_manager.py,sha256=-QRav-hzu-XWeJ_yKUMolal_EyMUspSg-nvh5sqlrlQ,11442
19
19
  crewplus/vectorstores/milvus/schema_milvus.py,sha256=wwNpfqsKS0xeozZES40IvB0iNwUtpCall_7Hkg0dL1g,27223
20
- crewplus/vectorstores/milvus/vdb_service.py,sha256=7nXpX8Gq6v0vI-zWPdbg1twwlvQ16gY4m7zBtzzfzEU,31347
20
+ crewplus/vectorstores/milvus/vdb_service.py,sha256=s6nPKmXf-ErCxLOKpYcBhsUct1y2T_vR-wV0Mh9rNN4,31931
21
21
  docs/GeminiChatModel.md,sha256=zZYyl6RmjZTUsKxxMiC9O4yV70MC4TD-IGUmWhIDBKA,8677
22
22
  docs/ModelLoadBalancer.md,sha256=aGHES1dcXPz4c7Y8kB5-vsCNJjriH2SWmjBkSGoYKiI,4398
23
23
  docs/VDBService.md,sha256=Dw286Rrf_fsi13jyD3Bo4Sy7nZ_G7tYm7d8MZ2j9hxk,9375
24
24
  docs/index.md,sha256=3tlc15uR8lzFNM5WjdoZLw0Y9o1P1gwgbEnOdIBspqc,1643
25
- crewplus-0.2.51.dist-info/RECORD,,
25
+ crewplus-0.2.52.dist-info/RECORD,,