swarmauri-core 0.5.0.dev8__tar.gz → 0.5.1__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.5.1/PKG-INFO +58 -0
- swarmauri_core-0.5.1/README.md +38 -0
- swarmauri_core-0.5.1/pyproject.toml +48 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/ComponentBase.py +2 -1
- swarmauri_core-0.5.1/swarmauri_core/README.md +38 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/__init__.py +4 -1
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/experiment_stores/__init__.py +2 -2
- swarmauri_core-0.5.1/swarmauri_core/llms/IPredict.py +48 -0
- swarmauri_core-0.5.1/swarmauri_core/measurements/IMeasurement.py +19 -0
- swarmauri_core-0.5.1/swarmauri_core/measurements/IMeasurementAggregate.py +16 -0
- swarmauri_core-0.5.1/swarmauri_core/measurements/IMeasurementCalculate.py +30 -0
- swarmauri_core-0.5.1/swarmauri_core/typing.py +50 -0
- swarmauri_core-0.5.0.dev8/swarmauri_core/llms/IPredict.py → swarmauri_core-0.5.1/swarmauri_core/vcms/IPredictVision.py +2 -2
- swarmauri_core-0.5.1/swarmauri_core/vectors/__init__.py +0 -0
- swarmauri_core-0.5.0.dev8/PKG-INFO +0 -26
- swarmauri_core-0.5.0.dev8/setup.cfg +0 -4
- swarmauri_core-0.5.0.dev8/setup.py +0 -27
- swarmauri_core-0.5.0.dev8/swarmauri_core/metrics/IMetric.py +0 -19
- swarmauri_core-0.5.0.dev8/swarmauri_core/metrics/IMetricAggregate.py +0 -16
- swarmauri_core-0.5.0.dev8/swarmauri_core/metrics/IMetricCalculate.py +0 -30
- swarmauri_core-0.5.0.dev8/swarmauri_core/typing.py +0 -26
- swarmauri_core-0.5.0.dev8/swarmauri_core/vector_stores/IAngleBetweenVectors.py +0 -23
- swarmauri_core-0.5.0.dev8/swarmauri_core/vector_stores/IDecompose.py +0 -24
- swarmauri_core-0.5.0.dev8/swarmauri_core/vector_stores/IDivergence.py +0 -21
- swarmauri_core-0.5.0.dev8/swarmauri_core/vector_stores/IGradient.py +0 -22
- swarmauri_core-0.5.0.dev8/swarmauri_core/vector_stores/IOrthogonalProject.py +0 -21
- swarmauri_core-0.5.0.dev8/swarmauri_core/vector_stores/IProject.py +0 -22
- swarmauri_core-0.5.0.dev8/swarmauri_core/vector_stores/IReflect.py +0 -21
- swarmauri_core-0.5.0.dev8/swarmauri_core/vector_stores/ISimiliarityQuery.py +0 -19
- swarmauri_core-0.5.0.dev8/swarmauri_core/vector_stores/IVectorArithmetic.py +0 -31
- swarmauri_core-0.5.0.dev8/swarmauri_core/vector_stores/IVectorBasisCheck.py +0 -20
- swarmauri_core-0.5.0.dev8/swarmauri_core/vector_stores/IVectorLinearCombination.py +0 -21
- swarmauri_core-0.5.0.dev8/swarmauri_core/vector_stores/IVectorRotate.py +0 -24
- swarmauri_core-0.5.0.dev8/swarmauri_core/vector_stores/IVectorSpan.py +0 -21
- swarmauri_core-0.5.0.dev8/swarmauri_core.egg-info/PKG-INFO +0 -26
- swarmauri_core-0.5.0.dev8/swarmauri_core.egg-info/SOURCES.txt +0 -116
- swarmauri_core-0.5.0.dev8/swarmauri_core.egg-info/dependency_links.txt +0 -1
- swarmauri_core-0.5.0.dev8/swarmauri_core.egg-info/requires.txt +0 -3
- swarmauri_core-0.5.0.dev8/swarmauri_core.egg-info/top_level.txt +0 -1
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/agent_apis/IAgentCommands.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/agent_apis/IAgentRouterCRUD.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/agent_apis/__init__.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/agent_factories/IAgentFactory.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/agent_factories/IExportConf.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/agent_factories/__init__.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/agents/IAgent.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/agents/IAgentConversation.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/agents/IAgentParser.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/agents/IAgentRetrieve.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/agents/IAgentSystemContext.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/agents/IAgentToolkit.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/agents/IAgentVectorStore.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/agents/__init__.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/chains/ICallableChain.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/chains/IChain.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/chains/IChainContext.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/chains/IChainContextLoader.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/chains/IChainDependencyResolver.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/chains/IChainFactory.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/chains/IChainStep.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/chains/__init__.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/chunkers/IChunker.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/chunkers/__init__.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/conversations/IConversation.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/conversations/IMaxSize.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/conversations/ISystemContext.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/conversations/__init__.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/distances/IDistanceSimilarity.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/distances/__init__.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/document_stores/IDocumentRetrieve.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/document_stores/IDocumentStore.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/document_stores/__init__.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/documents/IDocument.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/documents/IExperimentDocument.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/documents/__init__.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/embeddings/IFeature.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/embeddings/ISaveModel.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/embeddings/IVectorize.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/embeddings/__init__.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/experiment_stores/IExperimentStore.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/llms/IFit.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/llms/__init__.py +0 -0
- {swarmauri_core-0.5.0.dev8/swarmauri_core/metrics → swarmauri_core-0.5.1/swarmauri_core/measurements}/IThreshold.py +0 -0
- {swarmauri_core-0.5.0.dev8/swarmauri_core/metrics → swarmauri_core-0.5.1/swarmauri_core/measurements}/__init__.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/messages/IMessage.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/messages/__init__.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/parsers/IParser.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/parsers/__init__.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/prompts/IPrompt.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/prompts/IPromptMatrix.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/prompts/ITemplate.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/prompts/__init__.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/schema_converters/ISchemaConvert.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/schema_converters/__init__.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/swarm_apis/IAgentRegistrationAPI.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/swarm_apis/ISwarmAPI.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/swarm_apis/__init__.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/swarms/ISwarm.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/swarms/ISwarmAgentRegistration.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/swarms/ISwarmChainCRUD.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/swarms/ISwarmComponent.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/swarms/ISwarmConfigurationExporter.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/swarms/ISwarmFactory.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/swarms/__init__.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/toolkits/IToolkit.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/toolkits/__init__.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/tools/IParameter.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/tools/ITool.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/tools/__init__.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/tracing/IChainTracer.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/tracing/ITraceContext.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/tracing/ITracer.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/tracing/__init__.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/utils/ITransactional.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/utils/__init__.py +0 -0
- {swarmauri_core-0.5.0.dev8/swarmauri_core/vector_stores → swarmauri_core-0.5.1/swarmauri_core/vcms}/__init__.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/vector_stores/ICloudVectorStore.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/vector_stores/IPersistentVectorStore.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/vector_stores/ISimilarity.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/vector_stores/IVectorNorm.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/vector_stores/IVectorStore.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/vector_stores/IVectorStoreRetrieve.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/vector_stores/IVectorStoreSaveLoad.py +0 -0
- {swarmauri_core-0.5.0.dev8/swarmauri_core/vectors → swarmauri_core-0.5.1/swarmauri_core/vector_stores}/__init__.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/vectors/IVector.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/vectors/IVectorMeta.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/vectors/IVectorProduct.py +0 -0
- {swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/vectors/IVectorTransform.py +0 -0
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: swarmauri-core
|
|
3
|
+
Version: 0.5.1
|
|
4
|
+
Summary: This repository includes core interfaces for the Swarmauri framework.
|
|
5
|
+
Home-page: http://github.com/swarmauri/swarmauri-sdk
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Author: Jacob Stewart
|
|
8
|
+
Author-email: jacob@swarmauri.com
|
|
9
|
+
Requires-Python: >=3.10,<4.0
|
|
10
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Requires-Dist: pydantic (>=2.0,<3.0)
|
|
17
|
+
Project-URL: Repository, http://github.com/swarmauri/swarmauri-sdk
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
|
|
20
|
+
# Core Library
|
|
21
|
+
|
|
22
|
+
The Core Library provides the foundational interfaces and abstract base classes necessary for developing scalable and flexible machine learning agents, models, and tools. It is designed to offer a standardized approach to implementing various components of machine learning systems, such as models, parsers, conversations, and vector stores.
|
|
23
|
+
|
|
24
|
+
## Features
|
|
25
|
+
|
|
26
|
+
- **Models Interface**: Define and interact with predictive models.
|
|
27
|
+
- **Agents Interface**: Build and manage intelligent agents for varied tasks.
|
|
28
|
+
- **Tools Interface**: Develop tools with standardized execution and configuration.
|
|
29
|
+
- **Parsers and Conversations**: Handle and parse text data, manage conversations states.
|
|
30
|
+
- **Vector Stores**: Interface for vector storage and similarity searches.
|
|
31
|
+
- **Document Stores**: Manage the storage and retrieval of documents.
|
|
32
|
+
- **Retrievers and Chunkers**: Efficiently retrieve relevant documents and chunk large text data.
|
|
33
|
+
|
|
34
|
+
## Getting Started
|
|
35
|
+
|
|
36
|
+
To start developing with the Core Library, include it as a module in your Python project. Ensure you have Python 3.6 or later installed.
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
# Example of using an abstract model interface from the Core Library
|
|
40
|
+
from swarmauri.core.models.IModel import IModel
|
|
41
|
+
|
|
42
|
+
class MyModel(IModel):
|
|
43
|
+
# Implement the abstract methods here
|
|
44
|
+
pass
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Documentation
|
|
48
|
+
|
|
49
|
+
For more detailed documentation on each interface and available abstract classes, refer to the [Docs](/docs) directory within the library.
|
|
50
|
+
|
|
51
|
+
## Contributing
|
|
52
|
+
|
|
53
|
+
Contributions are welcome! If you'd like to add a new feature, fix a bug, or improve documentation, please submit a pull request.
|
|
54
|
+
|
|
55
|
+
## License
|
|
56
|
+
|
|
57
|
+
See `LICENSE` for more information.
|
|
58
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Core Library
|
|
2
|
+
|
|
3
|
+
The Core Library provides the foundational interfaces and abstract base classes necessary for developing scalable and flexible machine learning agents, models, and tools. It is designed to offer a standardized approach to implementing various components of machine learning systems, such as models, parsers, conversations, and vector stores.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Models Interface**: Define and interact with predictive models.
|
|
8
|
+
- **Agents Interface**: Build and manage intelligent agents for varied tasks.
|
|
9
|
+
- **Tools Interface**: Develop tools with standardized execution and configuration.
|
|
10
|
+
- **Parsers and Conversations**: Handle and parse text data, manage conversations states.
|
|
11
|
+
- **Vector Stores**: Interface for vector storage and similarity searches.
|
|
12
|
+
- **Document Stores**: Manage the storage and retrieval of documents.
|
|
13
|
+
- **Retrievers and Chunkers**: Efficiently retrieve relevant documents and chunk large text data.
|
|
14
|
+
|
|
15
|
+
## Getting Started
|
|
16
|
+
|
|
17
|
+
To start developing with the Core Library, include it as a module in your Python project. Ensure you have Python 3.6 or later installed.
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
# Example of using an abstract model interface from the Core Library
|
|
21
|
+
from swarmauri.core.models.IModel import IModel
|
|
22
|
+
|
|
23
|
+
class MyModel(IModel):
|
|
24
|
+
# Implement the abstract methods here
|
|
25
|
+
pass
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Documentation
|
|
29
|
+
|
|
30
|
+
For more detailed documentation on each interface and available abstract classes, refer to the [Docs](/docs) directory within the library.
|
|
31
|
+
|
|
32
|
+
## Contributing
|
|
33
|
+
|
|
34
|
+
Contributions are welcome! If you'd like to add a new feature, fix a bug, or improve documentation, please submit a pull request.
|
|
35
|
+
|
|
36
|
+
## License
|
|
37
|
+
|
|
38
|
+
See `LICENSE` for more information.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
[tool.poetry]
|
|
2
|
+
name = "swarmauri-core"
|
|
3
|
+
version = "0.5.1"
|
|
4
|
+
description = "This repository includes core interfaces for the Swarmauri framework."
|
|
5
|
+
authors = ["Jacob Stewart <jacob@swarmauri.com>"]
|
|
6
|
+
license = "Apache-2.0"
|
|
7
|
+
readme = "README.md"
|
|
8
|
+
repository = "http://github.com/swarmauri/swarmauri-sdk"
|
|
9
|
+
classifiers = [
|
|
10
|
+
"License :: OSI Approved :: Apache Software License",
|
|
11
|
+
"Programming Language :: Python :: 3.10",
|
|
12
|
+
"Programming Language :: Python :: 3.11",
|
|
13
|
+
"Programming Language :: Python :: 3.12"
|
|
14
|
+
]
|
|
15
|
+
|
|
16
|
+
[tool.poetry.dependencies]
|
|
17
|
+
python = ">=3.10,<4.0"
|
|
18
|
+
#numpy = "==1.26.4"
|
|
19
|
+
#requests = "^2.0"
|
|
20
|
+
pydantic = "^2.0"
|
|
21
|
+
#pandas = ">2.2"
|
|
22
|
+
|
|
23
|
+
[tool.poetry.dev-dependencies]
|
|
24
|
+
flake8 = "^7.0" # Add flake8 as a development dependency
|
|
25
|
+
pytest = "^8.0" # Ensure pytest is also added if you run tests
|
|
26
|
+
pytest-asyncio = ">=0.24.0"
|
|
27
|
+
|
|
28
|
+
[build-system]
|
|
29
|
+
requires = ["poetry-core>=1.0.0"]
|
|
30
|
+
build-backend = "poetry.core.masonry.api"
|
|
31
|
+
|
|
32
|
+
[tool.pytest.ini_options]
|
|
33
|
+
norecursedirs = ["combined", "scripts"]
|
|
34
|
+
|
|
35
|
+
markers = [
|
|
36
|
+
"test: standard test",
|
|
37
|
+
"unit: Unit tests",
|
|
38
|
+
"integration: Integration tests",
|
|
39
|
+
"acceptance: Acceptance tests",
|
|
40
|
+
"experimental: Experimental tests",
|
|
41
|
+
]
|
|
42
|
+
|
|
43
|
+
log_cli = true
|
|
44
|
+
log_cli_level = "INFO"
|
|
45
|
+
log_cli_format = "%(asctime)s [%(levelname)s] %(message)s"
|
|
46
|
+
log_cli_date_format = "%Y-%m-%d %H:%M:%S"
|
|
47
|
+
|
|
48
|
+
asyncio_default_fixture_loop_scope = "function"
|
|
@@ -36,7 +36,7 @@ class ResourceTypes(Enum):
|
|
|
36
36
|
EXCEPTION = "Exception"
|
|
37
37
|
LLM = "LLM"
|
|
38
38
|
MESSAGE = "Message"
|
|
39
|
-
|
|
39
|
+
MEASUREMENT = "Measurement"
|
|
40
40
|
PARSER = "Parser"
|
|
41
41
|
PROMPT = "Prompt"
|
|
42
42
|
STATE = "State"
|
|
@@ -50,6 +50,7 @@ class ResourceTypes(Enum):
|
|
|
50
50
|
UTIL = "Util"
|
|
51
51
|
VECTOR_STORE = "VectorStore"
|
|
52
52
|
VECTOR = "Vector"
|
|
53
|
+
VCM = "VCM"
|
|
53
54
|
|
|
54
55
|
|
|
55
56
|
def generate_id() -> str:
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Core Library
|
|
2
|
+
|
|
3
|
+
The Core Library provides the foundational interfaces and abstract base classes necessary for developing scalable and flexible machine learning agents, models, and tools. It is designed to offer a standardized approach to implementing various components of machine learning systems, such as models, parsers, conversations, and vector stores.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Models Interface**: Define and interact with predictive models.
|
|
8
|
+
- **Agents Interface**: Build and manage intelligent agents for varied tasks.
|
|
9
|
+
- **Tools Interface**: Develop tools with standardized execution and configuration.
|
|
10
|
+
- **Parsers and Conversations**: Handle and parse text data, manage conversations states.
|
|
11
|
+
- **Vector Stores**: Interface for vector storage and similarity searches.
|
|
12
|
+
- **Document Stores**: Manage the storage and retrieval of documents.
|
|
13
|
+
- **Retrievers and Chunkers**: Efficiently retrieve relevant documents and chunk large text data.
|
|
14
|
+
|
|
15
|
+
## Getting Started
|
|
16
|
+
|
|
17
|
+
To start developing with the Core Library, include it as a module in your Python project. Ensure you have Python 3.6 or later installed.
|
|
18
|
+
|
|
19
|
+
```python
|
|
20
|
+
# Example of using an abstract model interface from the Core Library
|
|
21
|
+
from swarmauri.core.models.IModel import IModel
|
|
22
|
+
|
|
23
|
+
class MyModel(IModel):
|
|
24
|
+
# Implement the abstract methods here
|
|
25
|
+
pass
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Documentation
|
|
29
|
+
|
|
30
|
+
For more detailed documentation on each interface and available abstract classes, refer to the [Docs](/docs) directory within the library.
|
|
31
|
+
|
|
32
|
+
## Contributing
|
|
33
|
+
|
|
34
|
+
Contributions are welcome! If you'd like to add a new feature, fix a bug, or improve documentation, please submit a pull request.
|
|
35
|
+
|
|
36
|
+
## License
|
|
37
|
+
|
|
38
|
+
See `LICENSE` for more information.
|
{swarmauri_core-0.5.0.dev8 → swarmauri_core-0.5.1}/swarmauri_core/experiment_stores/__init__.py
RENAMED
|
@@ -75,10 +75,10 @@ class IExperimentStore(ABC):
|
|
|
75
75
|
@abstractmethod
|
|
76
76
|
def evaluate_experiments(self, evaluation_criteria: Dict[str, Any]) -> Any:
|
|
77
77
|
"""
|
|
78
|
-
Evaluates the experiments stored in the experiment store based on given criteria and
|
|
78
|
+
Evaluates the experiments stored in the experiment store based on given criteria and measurements.
|
|
79
79
|
|
|
80
80
|
Parameters:
|
|
81
|
-
- evaluation_criteria (Dict[str, Any]): The criteria and
|
|
81
|
+
- evaluation_criteria (Dict[str, Any]): The criteria and measurements to evaluate the experiments.
|
|
82
82
|
|
|
83
83
|
Returns:
|
|
84
84
|
- Any: The evaluation results, which may vary depending on the evaluation criteria.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
|
|
3
|
+
class IPredict(ABC):
|
|
4
|
+
"""
|
|
5
|
+
Interface focusing on the basic properties and settings essential for defining models.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
@abstractmethod
|
|
9
|
+
def predict(self, *args, **kwargs) -> any:
|
|
10
|
+
"""
|
|
11
|
+
Generate predictions based on the input data provided to the model.
|
|
12
|
+
"""
|
|
13
|
+
pass
|
|
14
|
+
|
|
15
|
+
@abstractmethod
|
|
16
|
+
async def apredict(self, *args, **kwargs) -> any:
|
|
17
|
+
"""
|
|
18
|
+
Generate predictions based on the input data provided to the model.
|
|
19
|
+
"""
|
|
20
|
+
pass
|
|
21
|
+
|
|
22
|
+
@abstractmethod
|
|
23
|
+
def stream(self, *args, **kwargs) -> any:
|
|
24
|
+
"""
|
|
25
|
+
Generate predictions based on the input data provided to the model.
|
|
26
|
+
"""
|
|
27
|
+
pass
|
|
28
|
+
|
|
29
|
+
@abstractmethod
|
|
30
|
+
async def astream(self, *args, **kwargs) -> any:
|
|
31
|
+
"""
|
|
32
|
+
Generate predictions based on the input data provided to the model.
|
|
33
|
+
"""
|
|
34
|
+
pass
|
|
35
|
+
|
|
36
|
+
@abstractmethod
|
|
37
|
+
def batch(self, *args, **kwargs) -> any:
|
|
38
|
+
"""
|
|
39
|
+
Generate predictions based on the input data provided to the model.
|
|
40
|
+
"""
|
|
41
|
+
pass
|
|
42
|
+
|
|
43
|
+
@abstractmethod
|
|
44
|
+
async def abatch(self, *args, **kwargs) -> any:
|
|
45
|
+
"""
|
|
46
|
+
Generate predictions based on the input data provided to the model.
|
|
47
|
+
"""
|
|
48
|
+
pass
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
from abc import ABC, abstractmethod
|
|
3
|
+
|
|
4
|
+
class IMeasurement(ABC):
|
|
5
|
+
"""
|
|
6
|
+
Defines a general interface for measurements within the SwarmaURI system.
|
|
7
|
+
Measurements can be anything from system performance measurements to
|
|
8
|
+
machine learning model evaluation measurements.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
@abstractmethod
|
|
12
|
+
def __call__(self, **kwargs) -> Any:
|
|
13
|
+
"""
|
|
14
|
+
Retrieves the current value of the measurement.
|
|
15
|
+
|
|
16
|
+
Returns:
|
|
17
|
+
The current value of the measurement.
|
|
18
|
+
"""
|
|
19
|
+
pass
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from typing import List, Any
|
|
2
|
+
from abc import ABC, abstractmethod
|
|
3
|
+
|
|
4
|
+
class IMeasurementAggregate(ABC):
|
|
5
|
+
|
|
6
|
+
@abstractmethod
|
|
7
|
+
def add_measurement(self, measurement: Any) -> None:
|
|
8
|
+
pass
|
|
9
|
+
|
|
10
|
+
@abstractmethod
|
|
11
|
+
def reset(self) -> None:
|
|
12
|
+
"""
|
|
13
|
+
Reset or clear the measurement's current state, starting fresh as if no data had been processed.
|
|
14
|
+
This is useful for measurements that might aggregate or average data over time and need to be reset.
|
|
15
|
+
"""
|
|
16
|
+
pass
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
from abc import ABC, abstractmethod
|
|
3
|
+
|
|
4
|
+
class IMeasurementCalculate(ABC):
|
|
5
|
+
|
|
6
|
+
@abstractmethod
|
|
7
|
+
def calculate(self, **kwargs) -> Any:
|
|
8
|
+
"""
|
|
9
|
+
Calculate the measurement based on the provided data.
|
|
10
|
+
|
|
11
|
+
Args:
|
|
12
|
+
*args: Variable length argument list that the measurement calculation might require.
|
|
13
|
+
**kwargs: Arbitrary keyword arguments that the measurement calculation might require.
|
|
14
|
+
"""
|
|
15
|
+
pass
|
|
16
|
+
|
|
17
|
+
@abstractmethod
|
|
18
|
+
def update(self, value) -> None:
|
|
19
|
+
"""
|
|
20
|
+
Update the measurement value based on new information.
|
|
21
|
+
|
|
22
|
+
Args:
|
|
23
|
+
value: The new information used to update the measurement. This could be a new
|
|
24
|
+
measurement or data point that affects the measurement's current value.
|
|
25
|
+
|
|
26
|
+
Note:
|
|
27
|
+
This method is intended for internal use and should not be publicly accessible.
|
|
28
|
+
"""
|
|
29
|
+
pass
|
|
30
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import logging
|
|
2
|
+
from pydantic import BaseModel, Field
|
|
3
|
+
from typing import TypeVar, Generic, Union, Annotated, Type
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class SubclassUnion:
|
|
7
|
+
_registry = {}
|
|
8
|
+
|
|
9
|
+
@classmethod
|
|
10
|
+
def __class_getitem__(cls, baseclass):
|
|
11
|
+
subclasses = cls.__swm__get_subclasses__(baseclass)
|
|
12
|
+
return Union[tuple(subclasses)]
|
|
13
|
+
|
|
14
|
+
@classmethod
|
|
15
|
+
def __swm__get_subclasses__(cls, baseclass) -> set:
|
|
16
|
+
logging.debug("__swm__get_subclasses__ executed\n")
|
|
17
|
+
|
|
18
|
+
def is_excluded_module(module_name: str) -> bool:
|
|
19
|
+
return module_name == "builtins" or module_name == "types"
|
|
20
|
+
|
|
21
|
+
subclasses_dict = {baseclass.__name__: baseclass}
|
|
22
|
+
for subclass in baseclass.__subclasses__():
|
|
23
|
+
if not is_excluded_module(subclass.__module__):
|
|
24
|
+
subclasses_dict.update(
|
|
25
|
+
{
|
|
26
|
+
_s.__name__: _s
|
|
27
|
+
for _s in cls.__swm__get_subclasses__(subclass)
|
|
28
|
+
if not is_excluded_module(_s.__module__)
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
return set(subclasses_dict.values())
|
|
33
|
+
|
|
34
|
+
@classmethod
|
|
35
|
+
def update(cls, baseclass, type_name: str, obj):
|
|
36
|
+
"""
|
|
37
|
+
Registers a class with the SubclassUnion.
|
|
38
|
+
"""
|
|
39
|
+
if baseclass not in cls._registry:
|
|
40
|
+
cls._registry[baseclass] = {}
|
|
41
|
+
|
|
42
|
+
cls._registry[baseclass][type_name] = obj
|
|
43
|
+
logging.debug(f"Registered {type_name} under {baseclass.__name__}")
|
|
44
|
+
|
|
45
|
+
@classmethod
|
|
46
|
+
def get_registry(cls, baseclass):
|
|
47
|
+
"""
|
|
48
|
+
Retrieves the registry of subclasses for a given base class.
|
|
49
|
+
"""
|
|
50
|
+
return cls._registry.get(baseclass, {})
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
from abc import ABC, abstractmethod
|
|
2
2
|
|
|
3
|
-
class
|
|
3
|
+
class IPredictVision(ABC):
|
|
4
4
|
"""
|
|
5
5
|
Interface focusing on the basic properties and settings essential for defining models.
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
8
|
@abstractmethod
|
|
9
|
-
def
|
|
9
|
+
def predict_vision(self, *args, **kwargs) -> any:
|
|
10
10
|
"""
|
|
11
11
|
Generate predictions based on the input data provided to the model.
|
|
12
12
|
"""
|
|
File without changes
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: swarmauri-core
|
|
3
|
-
Version: 0.5.0.dev8
|
|
4
|
-
Summary: This repository includes core interfaces, standard ABCs and concrete references, third party plugins, and experimental modules for the swarmaURI framework.
|
|
5
|
-
Home-page: http://github.com/swarmauri/swarmauri-sdk
|
|
6
|
-
Author: Jacob Stewart
|
|
7
|
-
Author-email: corporate@swarmauri.com
|
|
8
|
-
License: Apache Software License
|
|
9
|
-
Classifier: License :: OSI Approved :: Apache Software License
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
-
Requires-Python: >=3.10
|
|
13
|
-
Description-Content-Type: text/markdown
|
|
14
|
-
Requires-Dist: numpy
|
|
15
|
-
Requires-Dist: requests
|
|
16
|
-
Requires-Dist: pydantic
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
# Swarmauri Core
|
|
20
|
-
|
|
21
|
-
## Core
|
|
22
|
-
- **Core Interfaces**: Define the fundamental communication and data-sharing protocols between components in a Swarmauri-based system.
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
Visit us at: https://swarmauri.com
|
|
26
|
-
Follow us at: https://github.com/swarmauri
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
from setuptools import setup, find_packages
|
|
2
|
-
import swarmauri_core
|
|
3
|
-
|
|
4
|
-
setup(
|
|
5
|
-
name='swarmauri-core',
|
|
6
|
-
version=swarmauri_core.__version__,
|
|
7
|
-
author='Jacob Stewart',
|
|
8
|
-
author_email='corporate@swarmauri.com',
|
|
9
|
-
description='This repository includes core interfaces, standard ABCs and concrete references, third party plugins, and experimental modules for the swarmaURI framework.',
|
|
10
|
-
long_description=swarmauri_core.__long_desc__,
|
|
11
|
-
long_description_content_type='text/markdown',
|
|
12
|
-
url='http://github.com/swarmauri/swarmauri-sdk',
|
|
13
|
-
license='Apache Software License',
|
|
14
|
-
packages=find_packages(include=['swarmauri_core*']), # Include packages in your_package and libs directories
|
|
15
|
-
install_requires=[
|
|
16
|
-
'numpy',
|
|
17
|
-
'requests',
|
|
18
|
-
'pydantic'
|
|
19
|
-
],
|
|
20
|
-
classifiers=[
|
|
21
|
-
'License :: OSI Approved :: Apache Software License',
|
|
22
|
-
'Programming Language :: Python :: 3.10',
|
|
23
|
-
'Programming Language :: Python :: 3.11'
|
|
24
|
-
],
|
|
25
|
-
python_requires='>=3.10',
|
|
26
|
-
setup_requires=["wheel"]
|
|
27
|
-
)
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
from typing import Any
|
|
2
|
-
from abc import ABC, abstractmethod
|
|
3
|
-
|
|
4
|
-
class IMetric(ABC):
|
|
5
|
-
"""
|
|
6
|
-
Defines a general interface for metrics within the SwarmaURI system.
|
|
7
|
-
Metrics can be anything from system performance measurements to
|
|
8
|
-
machine learning model evaluation metrics.
|
|
9
|
-
"""
|
|
10
|
-
|
|
11
|
-
@abstractmethod
|
|
12
|
-
def __call__(self, **kwargs) -> Any:
|
|
13
|
-
"""
|
|
14
|
-
Retrieves the current value of the metric.
|
|
15
|
-
|
|
16
|
-
Returns:
|
|
17
|
-
The current value of the metric.
|
|
18
|
-
"""
|
|
19
|
-
pass
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
from typing import List, Any
|
|
2
|
-
from abc import ABC, abstractmethod
|
|
3
|
-
|
|
4
|
-
class IMetricAggregate(ABC):
|
|
5
|
-
|
|
6
|
-
@abstractmethod
|
|
7
|
-
def add_measurement(self, measurement: Any) -> None:
|
|
8
|
-
pass
|
|
9
|
-
|
|
10
|
-
@abstractmethod
|
|
11
|
-
def reset(self) -> None:
|
|
12
|
-
"""
|
|
13
|
-
Reset or clear the metric's current state, starting fresh as if no data had been processed.
|
|
14
|
-
This is useful for metrics that might aggregate or average data over time and need to be reset.
|
|
15
|
-
"""
|
|
16
|
-
pass
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
from typing import Any
|
|
2
|
-
from abc import ABC, abstractmethod
|
|
3
|
-
|
|
4
|
-
class IMetricCalculate(ABC):
|
|
5
|
-
|
|
6
|
-
@abstractmethod
|
|
7
|
-
def calculate(self, **kwargs) -> Any:
|
|
8
|
-
"""
|
|
9
|
-
Calculate the metric based on the provided data.
|
|
10
|
-
|
|
11
|
-
Args:
|
|
12
|
-
*args: Variable length argument list that the metric calculation might require.
|
|
13
|
-
**kwargs: Arbitrary keyword arguments that the metric calculation might require.
|
|
14
|
-
"""
|
|
15
|
-
pass
|
|
16
|
-
|
|
17
|
-
@abstractmethod
|
|
18
|
-
def update(self, value) -> None:
|
|
19
|
-
"""
|
|
20
|
-
Update the metric value based on new information.
|
|
21
|
-
|
|
22
|
-
Args:
|
|
23
|
-
value: The new information used to update the metric. This could be a new
|
|
24
|
-
measurement or data point that affects the metric's current value.
|
|
25
|
-
|
|
26
|
-
Note:
|
|
27
|
-
This method is intended for internal use and should not be publicly accessible.
|
|
28
|
-
"""
|
|
29
|
-
pass
|
|
30
|
-
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import logging
|
|
2
|
-
from pydantic import BaseModel, Field
|
|
3
|
-
from typing import TypeVar, Generic, Union, Annotated, Type
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class SubclassUnion:
|
|
7
|
-
|
|
8
|
-
@classmethod
|
|
9
|
-
def __class_getitem__(cls, baseclass):
|
|
10
|
-
subclasses = cls.__swm__get_subclasses__(baseclass)
|
|
11
|
-
return Union[tuple(subclasses)]
|
|
12
|
-
|
|
13
|
-
@classmethod
|
|
14
|
-
def __swm__get_subclasses__(cls, baseclass) -> set:
|
|
15
|
-
logging.debug('__swm__get_subclasses__ executed\n')
|
|
16
|
-
def is_excluded_module(module_name: str) -> bool:
|
|
17
|
-
return (module_name == 'builtins' or
|
|
18
|
-
module_name == 'types')
|
|
19
|
-
|
|
20
|
-
subclasses_dict = {baseclass.__name__: baseclass}
|
|
21
|
-
for subclass in baseclass.__subclasses__():
|
|
22
|
-
if not is_excluded_module(subclass.__module__):
|
|
23
|
-
subclasses_dict.update({_s.__name__: _s for _s in cls.__swm__get_subclasses__(subclass)
|
|
24
|
-
if not is_excluded_module(_s.__module__)})
|
|
25
|
-
|
|
26
|
-
return set(subclasses_dict.values())
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
from abc import ABC, abstractmethod
|
|
2
|
-
from typing import List
|
|
3
|
-
|
|
4
|
-
class IAngleBetweenVectors(ABC):
|
|
5
|
-
"""
|
|
6
|
-
Interface for calculating the angle between two vectors.
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
@abstractmethod
|
|
10
|
-
def angle_between(self, vector_a: List[float], vector_b: List[float]) -> float:
|
|
11
|
-
"""
|
|
12
|
-
Method to calculate and return the angle in radians between two vectors.
|
|
13
|
-
|
|
14
|
-
Parameters:
|
|
15
|
-
- vector_a (List[float]): The first vector as a list of floats.
|
|
16
|
-
- vector_b (List[float]): The second vector as a list of floats.
|
|
17
|
-
|
|
18
|
-
Returns:
|
|
19
|
-
- float: The angle between vector_a and vector_b in radians.
|
|
20
|
-
|
|
21
|
-
Note: Implementations should handle the vectors' dimensionality and throw appropriate exceptions for incompatible vectors.
|
|
22
|
-
"""
|
|
23
|
-
pass
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
from abc import ABC, abstractmethod
|
|
2
|
-
from typing import Tuple, List
|
|
3
|
-
from swarmauri_core.vectors.IVector import IVector # Assuming there's a base IVector interface for vector representations
|
|
4
|
-
|
|
5
|
-
class IDecompose(ABC):
|
|
6
|
-
"""
|
|
7
|
-
Interface for decomposing a vector into components along specified basis vectors.
|
|
8
|
-
This operation is essential in expressing a vector in different coordinate systems or reference frames.
|
|
9
|
-
"""
|
|
10
|
-
|
|
11
|
-
@abstractmethod
|
|
12
|
-
def decompose(self, vector: IVector, basis_vectors: List[IVector]) -> List[IVector]:
|
|
13
|
-
"""
|
|
14
|
-
Decompose the given vector into components along the specified basis vectors.
|
|
15
|
-
|
|
16
|
-
Parameters:
|
|
17
|
-
- vector (IVector): The vector to be decomposed.
|
|
18
|
-
- basis_vectors (List[IVector]): A list of basis vectors along which to decompose the given vector.
|
|
19
|
-
|
|
20
|
-
Returns:
|
|
21
|
-
- List[IVector]: A list of vectors, each representing the component of the decomposed vector along
|
|
22
|
-
the corresponding basis vector in the `basis_vectors` list.
|
|
23
|
-
"""
|
|
24
|
-
pass
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
from abc import ABC, abstractmethod
|
|
2
|
-
from typing import List
|
|
3
|
-
|
|
4
|
-
class IDivergence(ABC):
|
|
5
|
-
"""
|
|
6
|
-
Interface for calculating the divergence of a vector field.
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
@abstractmethod
|
|
10
|
-
def calculate_divergence(self, vector_field: List[List[float]], point: List[float]) -> float:
|
|
11
|
-
"""
|
|
12
|
-
Calculate the divergence of a vector field at a specific point.
|
|
13
|
-
|
|
14
|
-
Parameters:
|
|
15
|
-
- vector_field (List[List[float]]): A representation of the vector field as a list of vectors.
|
|
16
|
-
- point (List[float]): The point at which the divergence is to be calculated.
|
|
17
|
-
|
|
18
|
-
Returns:
|
|
19
|
-
- float: The divergence value at the specified point.
|
|
20
|
-
"""
|
|
21
|
-
pass
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
from abc import ABC, abstractmethod
|
|
2
|
-
from typing import List, Callable
|
|
3
|
-
|
|
4
|
-
class IGradient(ABC):
|
|
5
|
-
"""
|
|
6
|
-
Interface for calculating the gradient of a scalar field.
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
@abstractmethod
|
|
10
|
-
def calculate_gradient(self, scalar_field: Callable[[List[float]], float], point: List[float]) -> List[float]:
|
|
11
|
-
"""
|
|
12
|
-
Calculate the gradient of a scalar field at a specific point.
|
|
13
|
-
|
|
14
|
-
Parameters:
|
|
15
|
-
- scalar_field (Callable[[List[float]], float]): The scalar field represented as a function
|
|
16
|
-
that takes a point and returns a scalar value.
|
|
17
|
-
- point (List[float]): The point at which the gradient is to be calculated.
|
|
18
|
-
|
|
19
|
-
Returns:
|
|
20
|
-
- List[float]: The gradient vector at the specified point.
|
|
21
|
-
"""
|
|
22
|
-
pass
|