swarmauri-core 0.6.0.dev127__tar.gz → 0.6.0.dev129__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.
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/PKG-INFO +1 -1
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/pyproject.toml +1 -1
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/ComponentBase.py +48 -21
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/README.md +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/README.md +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/agent_apis/IAgentCommands.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/agent_apis/IAgentRouterCRUD.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/agent_apis/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/agent_factories/IExportConf.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/agent_factories/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/agents/IAgent.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/agents/IAgentConversation.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/agents/IAgentParser.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/agents/IAgentRetrieve.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/agents/IAgentSystemContext.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/agents/IAgentToolkit.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/agents/IAgentVectorStore.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/agents/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/chains/ICallableChain.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/chains/IChain.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/chains/IChainContext.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/chains/IChainContextLoader.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/chains/IChainDependencyResolver.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/chains/IChainFactory.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/chains/IChainStep.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/chains/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/chunkers/IChunker.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/chunkers/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/control_panels/IControlPanel.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/control_panels/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/conversations/IConversation.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/conversations/IMaxSize.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/conversations/ISystemContext.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/conversations/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/dataconnectors/IDataConnector.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/dataconnectors/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/distances/IDistanceSimilarity.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/distances/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/document_stores/IDocumentRetrieve.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/document_stores/IDocumentStore.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/document_stores/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/documents/IDocument.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/documents/IExperimentDocument.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/documents/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/embeddings/IFeature.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/embeddings/ISaveModel.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/embeddings/IVectorize.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/embeddings/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/experiment_stores/IExperimentStore.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/experiment_stores/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/factories/IFactory.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/factories/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/image_gens/IGenImage.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/image_gens/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/llms/IFit.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/llms/IPredict.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/llms/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/measurements/IMeasurement.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/measurements/IMeasurementAggregate.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/measurements/IMeasurementCalculate.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/measurements/IThreshold.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/measurements/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/messages/IMessage.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/messages/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/parsers/IParser.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/parsers/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/pipelines/IPipeline.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/pipelines/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/prompts/IPrompt.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/prompts/IPromptMatrix.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/prompts/ITemplate.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/prompts/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/schema_converters/ISchemaConvert.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/schema_converters/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/service_registries/IServiceRegistry.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/service_registries/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/state/IState.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/swarm_apis/IAgentRegistrationAPI.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/swarm_apis/ISwarmAPI.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/swarm_apis/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/swarms/ISwarm.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/swarms/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/task_mgmt_strategies/ITaskMgmtStrategy.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/task_mgmt_strategies/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/toolkits/IToolkit.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/toolkits/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/tools/IParameter.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/tools/ITool.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/tools/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/tracing/IChainTracer.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/tracing/ITraceContext.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/tracing/ITracer.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/tracing/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/transports/ITransport.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/transports/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/utils/ITransactional.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/utils/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/vcms/IPredictVision.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/vcms/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/vector_stores/ICloudVectorStore.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/vector_stores/IPersistentVectorStore.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/vector_stores/ISimilarity.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/vector_stores/IVectorNorm.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/vector_stores/IVectorStore.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/vector_stores/IVectorStoreRetrieve.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/vector_stores/IVectorStoreSaveLoad.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/vector_stores/__init__.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/vectors/IVector.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/vectors/IVectorMeta.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/vectors/IVectorProduct.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/vectors/IVectorTransform.py +0 -0
- {swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/vectors/__init__.py +0 -0
|
@@ -28,7 +28,7 @@ from typing import (
|
|
|
28
28
|
logger = logging.getLogger(__name__)
|
|
29
29
|
T = TypeVar("T", bound="ComponentBase")
|
|
30
30
|
|
|
31
|
-
class SubclassUnion(
|
|
31
|
+
class SubclassUnion(type):
|
|
32
32
|
"""
|
|
33
33
|
A generic class to create discriminated unions based on resource types.
|
|
34
34
|
"""
|
|
@@ -99,7 +99,7 @@ class ComponentBase(BaseModel):
|
|
|
99
99
|
# Class-level registry mapping resource types to their type mappings
|
|
100
100
|
TYPE_REGISTRY: ClassVar[Dict[Type['ComponentBase'], Dict[str, Type['ComponentBase']]]] = {}
|
|
101
101
|
# Model registry mapping models to their resource types
|
|
102
|
-
MODEL_REGISTRY: ClassVar[Dict[Type[BaseModel], Type['ComponentBase']]] = {}
|
|
102
|
+
MODEL_REGISTRY: ClassVar[Dict[Type[BaseModel], List[Type['ComponentBase']]]] = {}
|
|
103
103
|
_lock: ClassVar[Lock] = Lock()
|
|
104
104
|
|
|
105
105
|
name: Optional[str] = None
|
|
@@ -140,11 +140,11 @@ class ComponentBase(BaseModel):
|
|
|
140
140
|
|
|
141
141
|
@classmethod
|
|
142
142
|
def swm_ismethod_registered(cls, method_name: str):
|
|
143
|
-
return method_name in cls.
|
|
143
|
+
return method_name in cls.swm_public_interfaces()
|
|
144
144
|
|
|
145
145
|
@classmethod
|
|
146
146
|
def swm_method_signature(cls, input_signature):
|
|
147
|
-
for method_name in cls.
|
|
147
|
+
for method_name in cls.swm_public_interfaces():
|
|
148
148
|
method = getattr(cls, method_name)
|
|
149
149
|
if callable(method):
|
|
150
150
|
sig = str(inspect.signature(method))
|
|
@@ -152,8 +152,6 @@ class ComponentBase(BaseModel):
|
|
|
152
152
|
return True
|
|
153
153
|
return False
|
|
154
154
|
|
|
155
|
-
# Experimental properties in support of Remote Execution
|
|
156
|
-
|
|
157
155
|
@property
|
|
158
156
|
def swm_path(self):
|
|
159
157
|
if self.host and self.owner:
|
|
@@ -196,9 +194,9 @@ class ComponentBase(BaseModel):
|
|
|
196
194
|
if model_cls not in cls.MODEL_REGISTRY:
|
|
197
195
|
cls.MODEL_REGISTRY[model_cls] = []
|
|
198
196
|
|
|
199
|
-
# Inspect all fields to find SubclassUnion annotations
|
|
197
|
+
# Inspect all fields to find SubclassUnion annotations, including inherited fields
|
|
200
198
|
for field_name, field in model_cls.__fields__.items():
|
|
201
|
-
field_annotation =
|
|
199
|
+
field_annotation = cls.get_field_annotation(model_cls, field_name)
|
|
202
200
|
if not field_annotation:
|
|
203
201
|
continue
|
|
204
202
|
|
|
@@ -210,10 +208,29 @@ class ComponentBase(BaseModel):
|
|
|
210
208
|
if resource_type not in cls.MODEL_REGISTRY[model_cls]:
|
|
211
209
|
cls.MODEL_REGISTRY[model_cls].append(resource_type)
|
|
212
210
|
logger.info(f"Registered model '{model_cls.__name__}' for resource '{resource_type.__name__}'")
|
|
213
|
-
cls.recreate_models()
|
|
214
211
|
return model_cls
|
|
215
212
|
return decorator
|
|
216
213
|
|
|
214
|
+
@classmethod
|
|
215
|
+
def get_field_annotation(cls, model_cls: Type[BaseModel], field_name: str):
|
|
216
|
+
"""
|
|
217
|
+
Retrieve the field annotation for a given field, including inherited fields.
|
|
218
|
+
|
|
219
|
+
Parameters:
|
|
220
|
+
- model_cls: The Pydantic model class.
|
|
221
|
+
- field_name: The name of the field.
|
|
222
|
+
|
|
223
|
+
Returns:
|
|
224
|
+
- The type annotation of the field, or None if not found.
|
|
225
|
+
"""
|
|
226
|
+
for base in inspect.getmro(model_cls):
|
|
227
|
+
if base == object:
|
|
228
|
+
continue
|
|
229
|
+
annotations = getattr(base, '__annotations__', {})
|
|
230
|
+
if field_name in annotations:
|
|
231
|
+
return annotations[field_name]
|
|
232
|
+
return None
|
|
233
|
+
|
|
217
234
|
@classmethod
|
|
218
235
|
def get_class_by_type(cls, resource_type: Type[T], type_name: str) -> Type['ComponentBase']:
|
|
219
236
|
"""
|
|
@@ -250,7 +267,6 @@ class ComponentBase(BaseModel):
|
|
|
250
267
|
return any(cls.field_contains_subclass_union(arg) for arg in args)
|
|
251
268
|
return False
|
|
252
269
|
|
|
253
|
-
|
|
254
270
|
@classmethod
|
|
255
271
|
def extract_resource_types_from_field(cls, field_annotation) -> List[Type['ComponentBase']]:
|
|
256
272
|
"""
|
|
@@ -294,7 +310,6 @@ class ComponentBase(BaseModel):
|
|
|
294
310
|
|
|
295
311
|
return resource_types
|
|
296
312
|
|
|
297
|
-
|
|
298
313
|
@classmethod
|
|
299
314
|
def determine_new_type(cls, field_annotation, resource_type):
|
|
300
315
|
"""
|
|
@@ -369,20 +384,28 @@ class ComponentBase(BaseModel):
|
|
|
369
384
|
|
|
370
385
|
return new_type
|
|
371
386
|
|
|
372
|
-
|
|
373
387
|
@classmethod
|
|
374
388
|
def generate_models_with_fields(cls) -> Dict[Type[BaseModel], Dict[str, Any]]:
|
|
375
389
|
"""
|
|
376
|
-
Automatically generate the models_with_fields dictionary based on registered models
|
|
377
|
-
|
|
390
|
+
Automatically generate the models_with_fields dictionary based on registered models,
|
|
391
|
+
including subclasses that inherit fields using SubclassUnion.
|
|
392
|
+
|
|
378
393
|
Returns:
|
|
379
394
|
- A dictionary mapping model classes to their fields and corresponding resource types.
|
|
380
395
|
"""
|
|
381
396
|
models_with_fields = {}
|
|
382
|
-
|
|
397
|
+
|
|
398
|
+
# Collect all models, including subclasses of registered models
|
|
399
|
+
all_models = set(cls.MODEL_REGISTRY.keys())
|
|
400
|
+
for model_cls in list(all_models):
|
|
401
|
+
for subclass in model_cls.__subclasses__():
|
|
402
|
+
if issubclass(subclass, BaseModel):
|
|
403
|
+
all_models.add(subclass)
|
|
404
|
+
|
|
405
|
+
for model_cls in all_models:
|
|
383
406
|
models_with_fields[model_cls] = {}
|
|
384
|
-
for field_name
|
|
385
|
-
field_annotation =
|
|
407
|
+
for field_name in model_cls.__fields__:
|
|
408
|
+
field_annotation = cls.get_field_annotation(model_cls, field_name)
|
|
386
409
|
if not field_annotation:
|
|
387
410
|
continue
|
|
388
411
|
|
|
@@ -398,6 +421,7 @@ class ComponentBase(BaseModel):
|
|
|
398
421
|
|
|
399
422
|
return models_with_fields
|
|
400
423
|
|
|
424
|
+
|
|
401
425
|
@classmethod
|
|
402
426
|
def recreate_models(cls):
|
|
403
427
|
"""
|
|
@@ -411,8 +435,11 @@ class ComponentBase(BaseModel):
|
|
|
411
435
|
model_class.model_fields[field_name].annotation = new_type
|
|
412
436
|
else:
|
|
413
437
|
raise ValueError(f"Field '{field_name}' does not exist in model '{model_class.__name__}'")
|
|
414
|
-
|
|
438
|
+
try:
|
|
439
|
+
model_class.model_rebuild(force=True)
|
|
415
440
|
logger.debug(f"'{model_class}' has been successfully recreated.")
|
|
416
|
-
|
|
417
|
-
logger.
|
|
418
|
-
|
|
441
|
+
except ValidationError as ve:
|
|
442
|
+
logger.error(f"Validation error while rebuilding model '{model_class.__name__}': {ve}")
|
|
443
|
+
except Exception as e:
|
|
444
|
+
logger.error(f"Error while rebuilding model '{model_class.__name__}': {e}")
|
|
445
|
+
logger.info("All models have been successfully recreated.")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/agent_apis/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/agents/IAgentParser.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/agents/IAgentRetrieve.py
RENAMED
|
File without changes
|
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/agents/IAgentToolkit.py
RENAMED
|
File without changes
|
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/agents/__init__.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/chains/ICallableChain.py
RENAMED
|
File without changes
|
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/chains/IChainContext.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/chains/IChainFactory.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/chains/IChainStep.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/chains/__init__.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/chunkers/IChunker.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/chunkers/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/conversations/IMaxSize.py
RENAMED
|
File without changes
|
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/conversations/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/distances/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/documents/IDocument.py
RENAMED
|
File without changes
|
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/documents/__init__.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/embeddings/IFeature.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/embeddings/ISaveModel.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/embeddings/IVectorize.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/embeddings/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/factories/IFactory.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/factories/__init__.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/image_gens/IGenImage.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/image_gens/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/measurements/__init__.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/messages/IMessage.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/messages/__init__.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/parsers/IParser.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/parsers/__init__.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/pipelines/IPipeline.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/pipelines/__init__.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/prompts/IPrompt.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/prompts/IPromptMatrix.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/prompts/ITemplate.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/prompts/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/swarm_apis/ISwarmAPI.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/swarm_apis/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/swarms/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/toolkits/IToolkit.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/toolkits/__init__.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/tools/IParameter.py
RENAMED
|
File without changes
|
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/tools/__init__.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/tracing/IChainTracer.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/tracing/ITraceContext.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/tracing/ITracer.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/tracing/__init__.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/transports/ITransport.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/transports/__init__.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/utils/ITransactional.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/utils/__init__.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/vcms/IPredictVision.py
RENAMED
|
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
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/vector_stores/__init__.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/vectors/IVector.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/vectors/IVectorMeta.py
RENAMED
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/vectors/IVectorProduct.py
RENAMED
|
File without changes
|
|
File without changes
|
{swarmauri_core-0.6.0.dev127 → swarmauri_core-0.6.0.dev129}/swarmauri_core/vectors/__init__.py
RENAMED
|
File without changes
|