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.
- crewplus/services/model_load_balancer.py +20 -10
- {crewplus-0.2.22.dist-info → crewplus-0.2.24.dist-info}/METADATA +1 -1
- {crewplus-0.2.22.dist-info → crewplus-0.2.24.dist-info}/RECORD +6 -6
- {crewplus-0.2.22.dist-info → crewplus-0.2.24.dist-info}/WHEEL +0 -0
- {crewplus-0.2.22.dist-info → crewplus-0.2.24.dist-info}/entry_points.txt +0 -0
- {crewplus-0.2.22.dist-info → crewplus-0.2.24.dist-info}/licenses/LICENSE +0 -0
|
@@ -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
|
-
|
|
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
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
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,13 +1,13 @@
|
|
|
1
|
-
crewplus-0.2.
|
|
2
|
-
crewplus-0.2.
|
|
3
|
-
crewplus-0.2.
|
|
4
|
-
crewplus-0.2.
|
|
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=
|
|
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
|
+
crewplus-0.2.24.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|