crewplus 0.2.22__py3-none-any.whl → 0.2.24__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.

@@ -63,7 +63,11 @@ class ModelLoadBalancer:
63
63
  # Instantiate models
64
64
  for model_config in self.models_config:
65
65
  model_id = model_config['id']
66
- self.models[model_id] = self._instantiate_model(model_config)
66
+ model_instance = self._instantiate_model(model_config)
67
+ if model_instance is not None:
68
+ self.models[model_id] = model_instance
69
+ else:
70
+ self.logger.warning(f"Model with id {model_id} was not loaded due to instantiation error.")
67
71
 
68
72
  self._config_loaded = True
69
73
  self.logger.debug("Model balancer: configuration loaded successfully.")
@@ -141,15 +145,21 @@ class ModelLoadBalancer:
141
145
  kwargs['temperature'] = model_config['temperature']
142
146
  return ChatOpenAI(**kwargs)
143
147
  elif provider == 'azure-openai-embeddings':
144
- return AzureOpenAIEmbeddings(
145
- model=model_config['model_name'],
146
- azure_deployment=model_config['deployment_name'],
147
- openai_api_version=model_config['api_version'],
148
- api_key=model_config['api_key'],
149
- azure_endpoint=model_config['api_base'],
150
- dimensions=model_config['dimensions'],
151
- chunk_size=16, request_timeout=60, max_retries=2
152
- )
148
+ try:
149
+ emb_kwargs = dict(
150
+ model=model_config['model_name'],
151
+ azure_deployment=model_config['deployment_name'],
152
+ openai_api_version=model_config['api_version'],
153
+ api_key=model_config['api_key'],
154
+ azure_endpoint=model_config['api_base'],
155
+ chunk_size=16, request_timeout=60, max_retries=2
156
+ )
157
+ if 'dimensions' in model_config:
158
+ emb_kwargs['dimensions'] = model_config['dimensions']
159
+ return AzureOpenAIEmbeddings(**emb_kwargs)
160
+ except Exception as e:
161
+ self.logger.error(f"Failed to instantiate AzureOpenAIEmbeddings: {e}")
162
+ return None
153
163
  elif provider == 'google-genai':
154
164
  kwargs = {
155
165
  'google_api_key': model_config['api_key'],
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: crewplus
3
- Version: 0.2.22
3
+ Version: 0.2.24
4
4
  Summary: Base services for CrewPlus AI applications
5
5
  Author-Email: Tim Liu <tim@opsmateai.com>
6
6
  License: MIT
@@ -1,13 +1,13 @@
1
- crewplus-0.2.22.dist-info/METADATA,sha256=0Mhxz-ArK28dpPEBsh835Tw2IWxEXsNEH6uLwbrMJkw,4991
2
- crewplus-0.2.22.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
3
- crewplus-0.2.22.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
4
- crewplus-0.2.22.dist-info/licenses/LICENSE,sha256=2_NHSHRTKB_cTcT_GXgcenOCtIZku8j343mOgAguTfc,1087
1
+ crewplus-0.2.24.dist-info/METADATA,sha256=wX-CuscOFMbCilpB_19YYFmSh40F7z1dhUw0fIJ2-lo,4991
2
+ crewplus-0.2.24.dist-info/WHEEL,sha256=9P2ygRxDrTJz3gsagc0Z96ukrxjr-LFBGOgv3AuKlCA,90
3
+ crewplus-0.2.24.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
4
+ crewplus-0.2.24.dist-info/licenses/LICENSE,sha256=2_NHSHRTKB_cTcT_GXgcenOCtIZku8j343mOgAguTfc,1087
5
5
  crewplus/__init__.py,sha256=m46HkZL1Y4toD619NL47Sn2Qe084WFFSFD7e6VoYKZc,284
6
6
  crewplus/services/__init__.py,sha256=zUM4ZwUfGMBDx-j7Wehf_KC5yYXPTK8BK_oeO5veIXQ,398
7
7
  crewplus/services/azure_chat_model.py,sha256=xPuIsQpLV5Y3Ntwe3eqvquhBjh35g65VlF22AWJdEcU,8648
8
8
  crewplus/services/gemini_chat_model.py,sha256=HMDt7TKlLpQ43ZPxY9omG64EGFkP846BXT_SfyBeM0I,38415
9
9
  crewplus/services/init_services.py,sha256=U91zoMNJlOEKyldarNnATjeZDT2V-0CrXPAwI64hZkw,758
10
- crewplus/services/model_load_balancer.py,sha256=OvWgyGurmhWGRZY3tpAHbZ3ab_FSaR7tEKTmT53ikCI,8847
10
+ crewplus/services/model_load_balancer.py,sha256=HH_eHxFfxgarPWFGpANg7dgShnWca4q46Jz0b1vJ4Sw,9405
11
11
  crewplus/utils/__init__.py,sha256=2Gk1n5srFJQnFfBuYTxktdtKOVZyNrFcNaZKhXk35Pw,142
12
12
  crewplus/utils/schema_action.py,sha256=GDaBoVFQD1rXqrLVSMTfXYW1xcUu7eDcHsn57XBSnIg,422
13
13
  crewplus/utils/schema_document_updater.py,sha256=frvffxn2vbi71fHFPoGb9hq7gH2azmmdq17p-Fumnvg,7322
@@ -19,4 +19,4 @@ docs/GeminiChatModel.md,sha256=_IQyup3ofAa2HxfSurO1GYUEezTHYYt5Q1khYNVThGM,8040
19
19
  docs/ModelLoadBalancer.md,sha256=aGHES1dcXPz4c7Y8kB5-vsCNJjriH2SWmjBkSGoYKiI,4398
20
20
  docs/VDBService.md,sha256=Dw286Rrf_fsi13jyD3Bo4Sy7nZ_G7tYm7d8MZ2j9hxk,9375
21
21
  docs/index.md,sha256=3tlc15uR8lzFNM5WjdoZLw0Y9o1P1gwgbEnOdIBspqc,1643
22
- crewplus-0.2.22.dist-info/RECORD,,
22
+ crewplus-0.2.24.dist-info/RECORD,,