swarmauri 0.5.3.dev4__tar.gz → 0.6.0.dev4__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.
Files changed (296) hide show
  1. {swarmauri-0.5.3.dev4 → swarmauri-0.6.0.dev4}/PKG-INFO +8 -5
  2. {swarmauri-0.5.3.dev4 → swarmauri-0.6.0.dev4}/pyproject.toml +22 -8
  3. swarmauri-0.6.0.dev4/swarmauri/__init__.py +7 -0
  4. swarmauri-0.6.0.dev4/swarmauri/importer.py +25 -0
  5. swarmauri-0.6.0.dev4/swarmauri/loader.py +10 -0
  6. swarmauri-0.6.0.dev4/swarmauri/registry.py +13 -0
  7. swarmauri-0.5.3.dev4/swarmauri/README.md +0 -37
  8. swarmauri-0.5.3.dev4/swarmauri/__init__.py +0 -37
  9. swarmauri-0.5.3.dev4/swarmauri/__version__.py +0 -1
  10. swarmauri-0.5.3.dev4/swarmauri/agent_factories/__init__.py +0 -1
  11. swarmauri-0.5.3.dev4/swarmauri/agent_factories/base/__init__.py +0 -0
  12. swarmauri-0.5.3.dev4/swarmauri/agent_factories/concrete/AgentFactory.py +0 -90
  13. swarmauri-0.5.3.dev4/swarmauri/agent_factories/concrete/ConfDrivenAgentFactory.py +0 -97
  14. swarmauri-0.5.3.dev4/swarmauri/agent_factories/concrete/JsonAgentFactory.py +0 -120
  15. swarmauri-0.5.3.dev4/swarmauri/agent_factories/concrete/ReflectiveAgentFactory.py +0 -83
  16. swarmauri-0.5.3.dev4/swarmauri/agent_factories/concrete/__init__.py +0 -22
  17. swarmauri-0.5.3.dev4/swarmauri/agents/__init__.py +0 -3
  18. swarmauri-0.5.3.dev4/swarmauri/agents/base/AgentBase.py +0 -16
  19. swarmauri-0.5.3.dev4/swarmauri/agents/base/AgentConversationMixin.py +0 -8
  20. swarmauri-0.5.3.dev4/swarmauri/agents/base/AgentRetrieveMixin.py +0 -10
  21. swarmauri-0.5.3.dev4/swarmauri/agents/base/AgentSystemContextMixin.py +0 -15
  22. swarmauri-0.5.3.dev4/swarmauri/agents/base/AgentToolMixin.py +0 -9
  23. swarmauri-0.5.3.dev4/swarmauri/agents/base/AgentVectorStoreMixin.py +0 -8
  24. swarmauri-0.5.3.dev4/swarmauri/agents/base/__init__.py +0 -0
  25. swarmauri-0.5.3.dev4/swarmauri/agents/concrete/QAAgent.py +0 -19
  26. swarmauri-0.5.3.dev4/swarmauri/agents/concrete/RagAgent.py +0 -99
  27. swarmauri-0.5.3.dev4/swarmauri/agents/concrete/SimpleConversationAgent.py +0 -28
  28. swarmauri-0.5.3.dev4/swarmauri/agents/concrete/ToolAgent.py +0 -47
  29. swarmauri-0.5.3.dev4/swarmauri/agents/concrete/__init__.py +0 -16
  30. swarmauri-0.5.3.dev4/swarmauri/apis/__init__.py +0 -0
  31. swarmauri-0.5.3.dev4/swarmauri/apis/base/README.md +0 -0
  32. swarmauri-0.5.3.dev4/swarmauri/apis/base/__init__.py +0 -0
  33. swarmauri-0.5.3.dev4/swarmauri/apis/concrete/__init__.py +0 -0
  34. swarmauri-0.5.3.dev4/swarmauri/chains/__init__.py +0 -1
  35. swarmauri-0.5.3.dev4/swarmauri/chains/base/ChainBase.py +0 -34
  36. swarmauri-0.5.3.dev4/swarmauri/chains/base/ChainContextBase.py +0 -46
  37. swarmauri-0.5.3.dev4/swarmauri/chains/base/ChainStepBase.py +0 -18
  38. swarmauri-0.5.3.dev4/swarmauri/chains/base/PromptContextChainBase.py +0 -154
  39. swarmauri-0.5.3.dev4/swarmauri/chains/base/__init__.py +0 -1
  40. swarmauri-0.5.3.dev4/swarmauri/chains/concrete/CallableChain.py +0 -29
  41. swarmauri-0.5.3.dev4/swarmauri/chains/concrete/ChainStep.py +0 -8
  42. swarmauri-0.5.3.dev4/swarmauri/chains/concrete/ContextChain.py +0 -48
  43. swarmauri-0.5.3.dev4/swarmauri/chains/concrete/PromptContextChain.py +0 -5
  44. swarmauri-0.5.3.dev4/swarmauri/chains/concrete/__init__.py +0 -15
  45. swarmauri-0.5.3.dev4/swarmauri/chunkers/__init__.py +0 -1
  46. swarmauri-0.5.3.dev4/swarmauri/chunkers/base/ChunkerBase.py +0 -19
  47. swarmauri-0.5.3.dev4/swarmauri/chunkers/base/__init__.py +0 -0
  48. swarmauri-0.5.3.dev4/swarmauri/chunkers/concrete/DelimiterBasedChunker.py +0 -35
  49. swarmauri-0.5.3.dev4/swarmauri/chunkers/concrete/FixedLengthChunker.py +0 -32
  50. swarmauri-0.5.3.dev4/swarmauri/chunkers/concrete/MdSnippetChunker.py +0 -44
  51. swarmauri-0.5.3.dev4/swarmauri/chunkers/concrete/SentenceChunker.py +0 -31
  52. swarmauri-0.5.3.dev4/swarmauri/chunkers/concrete/SlidingWindowChunker.py +0 -35
  53. swarmauri-0.5.3.dev4/swarmauri/chunkers/concrete/__init__.py +0 -17
  54. swarmauri-0.5.3.dev4/swarmauri/conversations/__init__.py +0 -1
  55. swarmauri-0.5.3.dev4/swarmauri/conversations/base/ConversationBase.py +0 -50
  56. swarmauri-0.5.3.dev4/swarmauri/conversations/base/ConversationSystemContextMixin.py +0 -8
  57. swarmauri-0.5.3.dev4/swarmauri/conversations/base/__init__.py +0 -0
  58. swarmauri-0.5.3.dev4/swarmauri/conversations/concrete/Conversation.py +0 -8
  59. swarmauri-0.5.3.dev4/swarmauri/conversations/concrete/MaxSizeConversation.py +0 -25
  60. swarmauri-0.5.3.dev4/swarmauri/conversations/concrete/MaxSystemContextConversation.py +0 -83
  61. swarmauri-0.5.3.dev4/swarmauri/conversations/concrete/SessionCacheConversation.py +0 -81
  62. swarmauri-0.5.3.dev4/swarmauri/conversations/concrete/__init__.py +0 -22
  63. swarmauri-0.5.3.dev4/swarmauri/distances/__init__.py +0 -1
  64. swarmauri-0.5.3.dev4/swarmauri/distances/base/DistanceBase.py +0 -35
  65. swarmauri-0.5.3.dev4/swarmauri/distances/base/VisionDistanceBase.py +0 -7
  66. swarmauri-0.5.3.dev4/swarmauri/distances/base/__init__.py +0 -0
  67. swarmauri-0.5.3.dev4/swarmauri/distances/concrete/CanberraDistance.py +0 -68
  68. swarmauri-0.5.3.dev4/swarmauri/distances/concrete/ChebyshevDistance.py +0 -48
  69. swarmauri-0.5.3.dev4/swarmauri/distances/concrete/ChiSquaredDistance.py +0 -39
  70. swarmauri-0.5.3.dev4/swarmauri/distances/concrete/CosineDistance.py +0 -61
  71. swarmauri-0.5.3.dev4/swarmauri/distances/concrete/EuclideanDistance.py +0 -50
  72. swarmauri-0.5.3.dev4/swarmauri/distances/concrete/HaversineDistance.py +0 -50
  73. swarmauri-0.5.3.dev4/swarmauri/distances/concrete/JaccardIndexDistance.py +0 -73
  74. swarmauri-0.5.3.dev4/swarmauri/distances/concrete/LevenshteinDistance.py +0 -75
  75. swarmauri-0.5.3.dev4/swarmauri/distances/concrete/ManhattanDistance.py +0 -49
  76. swarmauri-0.5.3.dev4/swarmauri/distances/concrete/MinkowskiDistance.py +0 -64
  77. swarmauri-0.5.3.dev4/swarmauri/distances/concrete/SorensenDiceDistance.py +0 -51
  78. swarmauri-0.5.3.dev4/swarmauri/distances/concrete/SquaredEuclideanDistance.py +0 -47
  79. swarmauri-0.5.3.dev4/swarmauri/distances/concrete/__init__.py +0 -27
  80. swarmauri-0.5.3.dev4/swarmauri/document_stores/__init__.py +0 -1
  81. swarmauri-0.5.3.dev4/swarmauri/document_stores/base/DocumentStoreBase.py +0 -88
  82. swarmauri-0.5.3.dev4/swarmauri/document_stores/base/DocumentStoreRetrieveBase.py +0 -22
  83. swarmauri-0.5.3.dev4/swarmauri/document_stores/base/__init__.py +0 -0
  84. swarmauri-0.5.3.dev4/swarmauri/document_stores/concrete/__init__.py +0 -0
  85. swarmauri-0.5.3.dev4/swarmauri/documents/__init__.py +0 -2
  86. swarmauri-0.5.3.dev4/swarmauri/documents/base/DocumentBase.py +0 -14
  87. swarmauri-0.5.3.dev4/swarmauri/documents/base/__init__.py +0 -0
  88. swarmauri-0.5.3.dev4/swarmauri/documents/concrete/Document.py +0 -5
  89. swarmauri-0.5.3.dev4/swarmauri/documents/concrete/__init__.py +0 -11
  90. swarmauri-0.5.3.dev4/swarmauri/embeddings/__init__.py +0 -1
  91. swarmauri-0.5.3.dev4/swarmauri/embeddings/base/EmbeddingBase.py +0 -11
  92. swarmauri-0.5.3.dev4/swarmauri/embeddings/base/VisionEmbeddingBase.py +0 -7
  93. swarmauri-0.5.3.dev4/swarmauri/embeddings/base/__init__.py +0 -1
  94. swarmauri-0.5.3.dev4/swarmauri/embeddings/concrete/CohereEmbedding.py +0 -207
  95. swarmauri-0.5.3.dev4/swarmauri/embeddings/concrete/GeminiEmbedding.py +0 -170
  96. swarmauri-0.5.3.dev4/swarmauri/embeddings/concrete/MistralEmbedding.py +0 -134
  97. swarmauri-0.5.3.dev4/swarmauri/embeddings/concrete/NmfEmbedding.py +0 -106
  98. swarmauri-0.5.3.dev4/swarmauri/embeddings/concrete/OpenAIEmbedding.py +0 -141
  99. swarmauri-0.5.3.dev4/swarmauri/embeddings/concrete/TfidfEmbedding.py +0 -52
  100. swarmauri-0.5.3.dev4/swarmauri/embeddings/concrete/VoyageEmbedding.py +0 -115
  101. swarmauri-0.5.3.dev4/swarmauri/embeddings/concrete/__init__.py +0 -19
  102. swarmauri-0.5.3.dev4/swarmauri/exceptions/__init__.py +0 -1
  103. swarmauri-0.5.3.dev4/swarmauri/exceptions/base/__init__.py +0 -0
  104. swarmauri-0.5.3.dev4/swarmauri/exceptions/concrete/IndexErrorWithContext.py +0 -21
  105. swarmauri-0.5.3.dev4/swarmauri/exceptions/concrete/__init__.py +0 -13
  106. swarmauri-0.5.3.dev4/swarmauri/image_gens/__init_.py +0 -0
  107. swarmauri-0.5.3.dev4/swarmauri/image_gens/base/ImageGenBase.py +0 -51
  108. swarmauri-0.5.3.dev4/swarmauri/image_gens/base/__init__.py +0 -0
  109. swarmauri-0.5.3.dev4/swarmauri/image_gens/concrete/BlackForestImgGenModel.py +0 -259
  110. swarmauri-0.5.3.dev4/swarmauri/image_gens/concrete/DeepInfraImgGenModel.py +0 -195
  111. swarmauri-0.5.3.dev4/swarmauri/image_gens/concrete/FalAIImgGenModel.py +0 -322
  112. swarmauri-0.5.3.dev4/swarmauri/image_gens/concrete/HyperbolicImgGenModel.py +0 -210
  113. swarmauri-0.5.3.dev4/swarmauri/image_gens/concrete/OpenAIImgGenModel.py +0 -192
  114. swarmauri-0.5.3.dev4/swarmauri/image_gens/concrete/__init__.py +0 -0
  115. swarmauri-0.5.3.dev4/swarmauri/llms/__init__.py +0 -1
  116. swarmauri-0.5.3.dev4/swarmauri/llms/base/LLMBase.py +0 -41
  117. swarmauri-0.5.3.dev4/swarmauri/llms/base/__init__.py +0 -0
  118. swarmauri-0.5.3.dev4/swarmauri/llms/concrete/AI21StudioModel.py +0 -411
  119. swarmauri-0.5.3.dev4/swarmauri/llms/concrete/AnthropicModel.py +0 -426
  120. swarmauri-0.5.3.dev4/swarmauri/llms/concrete/AnthropicToolModel.py +0 -444
  121. swarmauri-0.5.3.dev4/swarmauri/llms/concrete/CohereModel.py +0 -440
  122. swarmauri-0.5.3.dev4/swarmauri/llms/concrete/CohereToolModel.py +0 -601
  123. swarmauri-0.5.3.dev4/swarmauri/llms/concrete/DeepInfraModel.py +0 -407
  124. swarmauri-0.5.3.dev4/swarmauri/llms/concrete/DeepSeekModel.py +0 -355
  125. swarmauri-0.5.3.dev4/swarmauri/llms/concrete/FalAIVisionModel.py +0 -243
  126. swarmauri-0.5.3.dev4/swarmauri/llms/concrete/GeminiProModel.py +0 -452
  127. swarmauri-0.5.3.dev4/swarmauri/llms/concrete/GeminiToolModel.py +0 -582
  128. swarmauri-0.5.3.dev4/swarmauri/llms/concrete/GroqAIAudio.py +0 -200
  129. swarmauri-0.5.3.dev4/swarmauri/llms/concrete/GroqModel.py +0 -405
  130. swarmauri-0.5.3.dev4/swarmauri/llms/concrete/GroqToolModel.py +0 -471
  131. swarmauri-0.5.3.dev4/swarmauri/llms/concrete/GroqVisionModel.py +0 -387
  132. swarmauri-0.5.3.dev4/swarmauri/llms/concrete/HyperbolicAudioTTS.py +0 -146
  133. swarmauri-0.5.3.dev4/swarmauri/llms/concrete/HyperbolicModel.py +0 -427
  134. swarmauri-0.5.3.dev4/swarmauri/llms/concrete/HyperbolicVisionModel.py +0 -381
  135. swarmauri-0.5.3.dev4/swarmauri/llms/concrete/MistralModel.py +0 -432
  136. swarmauri-0.5.3.dev4/swarmauri/llms/concrete/MistralToolModel.py +0 -517
  137. swarmauri-0.5.3.dev4/swarmauri/llms/concrete/OpenAIAudio.py +0 -192
  138. swarmauri-0.5.3.dev4/swarmauri/llms/concrete/OpenAIAudioTTS.py +0 -224
  139. swarmauri-0.5.3.dev4/swarmauri/llms/concrete/OpenAIModel.py +0 -468
  140. swarmauri-0.5.3.dev4/swarmauri/llms/concrete/OpenAIToolModel.py +0 -444
  141. swarmauri-0.5.3.dev4/swarmauri/llms/concrete/PerplexityModel.py +0 -492
  142. swarmauri-0.5.3.dev4/swarmauri/llms/concrete/PlayHTModel.py +0 -352
  143. swarmauri-0.5.3.dev4/swarmauri/llms/concrete/WhisperLargeModel.py +0 -217
  144. swarmauri-0.5.3.dev4/swarmauri/llms/concrete/__init__.py +0 -43
  145. swarmauri-0.5.3.dev4/swarmauri/measurements/__init__.py +0 -1
  146. swarmauri-0.5.3.dev4/swarmauri/measurements/base/MeasurementAggregateMixin.py +0 -25
  147. swarmauri-0.5.3.dev4/swarmauri/measurements/base/MeasurementBase.py +0 -23
  148. swarmauri-0.5.3.dev4/swarmauri/measurements/base/MeasurementCalculateMixin.py +0 -32
  149. swarmauri-0.5.3.dev4/swarmauri/measurements/base/MeasurementThresholdMixin.py +0 -8
  150. swarmauri-0.5.3.dev4/swarmauri/measurements/base/__init__.py +0 -0
  151. swarmauri-0.5.3.dev4/swarmauri/measurements/concrete/CompletenessMeasurement.py +0 -79
  152. swarmauri-0.5.3.dev4/swarmauri/measurements/concrete/DistinctivenessMeasurement.py +0 -98
  153. swarmauri-0.5.3.dev4/swarmauri/measurements/concrete/FirstImpressionMeasurement.py +0 -16
  154. swarmauri-0.5.3.dev4/swarmauri/measurements/concrete/MeanMeasurement.py +0 -42
  155. swarmauri-0.5.3.dev4/swarmauri/measurements/concrete/MiscMeasurement.py +0 -176
  156. swarmauri-0.5.3.dev4/swarmauri/measurements/concrete/MissingnessMeasurement.py +0 -120
  157. swarmauri-0.5.3.dev4/swarmauri/measurements/concrete/PatternMatchingMeasurement.py +0 -31
  158. swarmauri-0.5.3.dev4/swarmauri/measurements/concrete/RatioOfSumsMeasurement.py +0 -35
  159. swarmauri-0.5.3.dev4/swarmauri/measurements/concrete/StaticMeasurement.py +0 -17
  160. swarmauri-0.5.3.dev4/swarmauri/measurements/concrete/UniquenessMeasurement.py +0 -96
  161. swarmauri-0.5.3.dev4/swarmauri/measurements/concrete/ZeroMeasurement.py +0 -17
  162. swarmauri-0.5.3.dev4/swarmauri/measurements/concrete/__init__.py +0 -41
  163. swarmauri-0.5.3.dev4/swarmauri/messages/__init__.py +0 -1
  164. swarmauri-0.5.3.dev4/swarmauri/messages/base/MessageBase.py +0 -12
  165. swarmauri-0.5.3.dev4/swarmauri/messages/base/__init__.py +0 -0
  166. swarmauri-0.5.3.dev4/swarmauri/messages/concrete/AgentMessage.py +0 -25
  167. swarmauri-0.5.3.dev4/swarmauri/messages/concrete/FunctionMessage.py +0 -14
  168. swarmauri-0.5.3.dev4/swarmauri/messages/concrete/HumanMessage.py +0 -40
  169. swarmauri-0.5.3.dev4/swarmauri/messages/concrete/SystemMessage.py +0 -8
  170. swarmauri-0.5.3.dev4/swarmauri/messages/concrete/__init__.py +0 -16
  171. swarmauri-0.5.3.dev4/swarmauri/parsers/__init__.py +0 -1
  172. swarmauri-0.5.3.dev4/swarmauri/parsers/base/ParserBase.py +0 -28
  173. swarmauri-0.5.3.dev4/swarmauri/parsers/base/__init__.py +0 -0
  174. swarmauri-0.5.3.dev4/swarmauri/parsers/concrete/BeautifulSoupElementParser.py +0 -42
  175. swarmauri-0.5.3.dev4/swarmauri/parsers/concrete/CSVParser.py +0 -46
  176. swarmauri-0.5.3.dev4/swarmauri/parsers/concrete/HTMLTagStripParser.py +0 -38
  177. swarmauri-0.5.3.dev4/swarmauri/parsers/concrete/KeywordExtractorParser.py +0 -47
  178. swarmauri-0.5.3.dev4/swarmauri/parsers/concrete/Md2HtmlParser.py +0 -37
  179. swarmauri-0.5.3.dev4/swarmauri/parsers/concrete/OpenAPISpecParser.py +0 -44
  180. swarmauri-0.5.3.dev4/swarmauri/parsers/concrete/PhoneNumberExtractorParser.py +0 -34
  181. swarmauri-0.5.3.dev4/swarmauri/parsers/concrete/PythonParser.py +0 -54
  182. swarmauri-0.5.3.dev4/swarmauri/parsers/concrete/RegExParser.py +0 -35
  183. swarmauri-0.5.3.dev4/swarmauri/parsers/concrete/URLExtractorParser.py +0 -39
  184. swarmauri-0.5.3.dev4/swarmauri/parsers/concrete/XMLParser.py +0 -42
  185. swarmauri-0.5.3.dev4/swarmauri/parsers/concrete/__init__.py +0 -29
  186. swarmauri-0.5.3.dev4/swarmauri/prompts/__init__.py +0 -1
  187. swarmauri-0.5.3.dev4/swarmauri/prompts/base/PromptBase.py +0 -37
  188. swarmauri-0.5.3.dev4/swarmauri/prompts/base/PromptGeneratorBase.py +0 -40
  189. swarmauri-0.5.3.dev4/swarmauri/prompts/base/PromptMatrixBase.py +0 -37
  190. swarmauri-0.5.3.dev4/swarmauri/prompts/base/PromptTemplateBase.py +0 -39
  191. swarmauri-0.5.3.dev4/swarmauri/prompts/base/__init__.py +0 -0
  192. swarmauri-0.5.3.dev4/swarmauri/prompts/concrete/Prompt.py +0 -5
  193. swarmauri-0.5.3.dev4/swarmauri/prompts/concrete/PromptGenerator.py +0 -5
  194. swarmauri-0.5.3.dev4/swarmauri/prompts/concrete/PromptMatrix.py +0 -5
  195. swarmauri-0.5.3.dev4/swarmauri/prompts/concrete/PromptTemplate.py +0 -5
  196. swarmauri-0.5.3.dev4/swarmauri/prompts/concrete/__init__.py +0 -16
  197. swarmauri-0.5.3.dev4/swarmauri/schema_converters/__init__.py +0 -1
  198. swarmauri-0.5.3.dev4/swarmauri/schema_converters/base/SchemaConverterBase.py +0 -15
  199. swarmauri-0.5.3.dev4/swarmauri/schema_converters/base/__init__.py +0 -0
  200. swarmauri-0.5.3.dev4/swarmauri/schema_converters/concrete/AnthropicSchemaConverter.py +0 -29
  201. swarmauri-0.5.3.dev4/swarmauri/schema_converters/concrete/CohereSchemaConverter.py +0 -33
  202. swarmauri-0.5.3.dev4/swarmauri/schema_converters/concrete/GeminiSchemaConverter.py +0 -72
  203. swarmauri-0.5.3.dev4/swarmauri/schema_converters/concrete/GroqSchemaConverter.py +0 -38
  204. swarmauri-0.5.3.dev4/swarmauri/schema_converters/concrete/MistralSchemaConverter.py +0 -35
  205. swarmauri-0.5.3.dev4/swarmauri/schema_converters/concrete/OpenAISchemaConverter.py +0 -35
  206. swarmauri-0.5.3.dev4/swarmauri/schema_converters/concrete/ShuttleAISchemaConverter.py +0 -35
  207. swarmauri-0.5.3.dev4/swarmauri/schema_converters/concrete/__init__.py +0 -37
  208. swarmauri-0.5.3.dev4/swarmauri/swarms/__init__.py +0 -1
  209. swarmauri-0.5.3.dev4/swarmauri/swarms/base/SwarmComponentBase.py +0 -15
  210. swarmauri-0.5.3.dev4/swarmauri/swarms/base/__init__.py +0 -0
  211. swarmauri-0.5.3.dev4/swarmauri/swarms/concrete/SimpleSwarmFactory.py +0 -50
  212. swarmauri-0.5.3.dev4/swarmauri/swarms/concrete/__init__.py +0 -11
  213. swarmauri-0.5.3.dev4/swarmauri/toolkits/__init__.py +0 -1
  214. swarmauri-0.5.3.dev4/swarmauri/toolkits/base/ToolkitBase.py +0 -96
  215. swarmauri-0.5.3.dev4/swarmauri/toolkits/base/__init__.py +0 -0
  216. swarmauri-0.5.3.dev4/swarmauri/toolkits/concrete/AccessibilityToolkit.py +0 -47
  217. swarmauri-0.5.3.dev4/swarmauri/toolkits/concrete/Toolkit.py +0 -5
  218. swarmauri-0.5.3.dev4/swarmauri/toolkits/concrete/__init__.py +0 -14
  219. swarmauri-0.5.3.dev4/swarmauri/tools/__init__.py +0 -1
  220. swarmauri-0.5.3.dev4/swarmauri/tools/base/ParameterBase.py +0 -13
  221. swarmauri-0.5.3.dev4/swarmauri/tools/base/ToolBase.py +0 -64
  222. swarmauri-0.5.3.dev4/swarmauri/tools/base/__init__.py +0 -0
  223. swarmauri-0.5.3.dev4/swarmauri/tools/concrete/AdditionTool.py +0 -39
  224. swarmauri-0.5.3.dev4/swarmauri/tools/concrete/AutomatedReadabilityIndexTool.py +0 -123
  225. swarmauri-0.5.3.dev4/swarmauri/tools/concrete/CalculatorTool.py +0 -56
  226. swarmauri-0.5.3.dev4/swarmauri/tools/concrete/CodeExtractorTool.py +0 -140
  227. swarmauri-0.5.3.dev4/swarmauri/tools/concrete/CodeInterpreterTool.py +0 -69
  228. swarmauri-0.5.3.dev4/swarmauri/tools/concrete/ColemanLiauIndexTool.py +0 -125
  229. swarmauri-0.5.3.dev4/swarmauri/tools/concrete/FleschKincaidTool.py +0 -172
  230. swarmauri-0.5.3.dev4/swarmauri/tools/concrete/FleschReadingEaseTool.py +0 -103
  231. swarmauri-0.5.3.dev4/swarmauri/tools/concrete/GunningFogTool.py +0 -152
  232. swarmauri-0.5.3.dev4/swarmauri/tools/concrete/ImportMemoryModuleTool.py +0 -96
  233. swarmauri-0.5.3.dev4/swarmauri/tools/concrete/JSONRequestsTool.py +0 -190
  234. swarmauri-0.5.3.dev4/swarmauri/tools/concrete/MatplotlibCsvTool.py +0 -84
  235. swarmauri-0.5.3.dev4/swarmauri/tools/concrete/MatplotlibTool.py +0 -121
  236. swarmauri-0.5.3.dev4/swarmauri/tools/concrete/Parameter.py +0 -7
  237. swarmauri-0.5.3.dev4/swarmauri/tools/concrete/RequestsTool.py +0 -182
  238. swarmauri-0.5.3.dev4/swarmauri/tools/concrete/SentenceComplexityTool.py +0 -84
  239. swarmauri-0.5.3.dev4/swarmauri/tools/concrete/TemperatureConverterTool.py +0 -70
  240. swarmauri-0.5.3.dev4/swarmauri/tools/concrete/TestTool.py +0 -34
  241. swarmauri-0.5.3.dev4/swarmauri/tools/concrete/WeatherTool.py +0 -38
  242. swarmauri-0.5.3.dev4/swarmauri/tools/concrete/__init__.py +0 -35
  243. swarmauri-0.5.3.dev4/swarmauri/tracing/__init__.py +0 -1
  244. swarmauri-0.5.3.dev4/swarmauri/tracing/base/__init__.py +0 -1
  245. swarmauri-0.5.3.dev4/swarmauri/tracing/concrete/CallableTracer.py +0 -32
  246. swarmauri-0.5.3.dev4/swarmauri/tracing/concrete/ChainTracer.py +0 -51
  247. swarmauri-0.5.3.dev4/swarmauri/tracing/concrete/SimpleTraceContext.py +0 -21
  248. swarmauri-0.5.3.dev4/swarmauri/tracing/concrete/SimpleTracer.py +0 -40
  249. swarmauri-0.5.3.dev4/swarmauri/tracing/concrete/TracedVariable.py +0 -28
  250. swarmauri-0.5.3.dev4/swarmauri/tracing/concrete/VariableTracer.py +0 -23
  251. swarmauri-0.5.3.dev4/swarmauri/tracing/concrete/__init__.py +0 -17
  252. swarmauri-0.5.3.dev4/swarmauri/utils/__init__.py +0 -0
  253. swarmauri-0.5.3.dev4/swarmauri/utils/_lazy_import.py +0 -22
  254. swarmauri-0.5.3.dev4/swarmauri/utils/apply_metaclass.py +0 -4
  255. swarmauri-0.5.3.dev4/swarmauri/utils/base64_encoder.py +0 -17
  256. swarmauri-0.5.3.dev4/swarmauri/utils/base64_to_file_path.py +0 -9
  257. swarmauri-0.5.3.dev4/swarmauri/utils/base64_to_img_url.py +0 -44
  258. swarmauri-0.5.3.dev4/swarmauri/utils/base64_to_in_memory_img.py +0 -9
  259. swarmauri-0.5.3.dev4/swarmauri/utils/decorate.py +0 -24
  260. swarmauri-0.5.3.dev4/swarmauri/utils/duration_manager.py +0 -13
  261. swarmauri-0.5.3.dev4/swarmauri/utils/file_path_to_base64.py +0 -10
  262. swarmauri-0.5.3.dev4/swarmauri/utils/file_path_to_img_url.py +0 -45
  263. swarmauri-0.5.3.dev4/swarmauri/utils/file_path_to_in_memory_img.py +0 -6
  264. swarmauri-0.5.3.dev4/swarmauri/utils/get_class_hash.py +0 -35
  265. swarmauri-0.5.3.dev4/swarmauri/utils/img_url_to_base64.py +0 -12
  266. swarmauri-0.5.3.dev4/swarmauri/utils/img_url_to_file_path.py +0 -8
  267. swarmauri-0.5.3.dev4/swarmauri/utils/img_url_to_in_memory_img.py +0 -9
  268. swarmauri-0.5.3.dev4/swarmauri/utils/in_memory_img_to_base64.py +0 -9
  269. swarmauri-0.5.3.dev4/swarmauri/utils/in_memory_img_to_file_path.py +0 -4
  270. swarmauri-0.5.3.dev4/swarmauri/utils/in_memory_img_to_img_url.py +0 -50
  271. swarmauri-0.5.3.dev4/swarmauri/utils/json_validator.py +0 -17
  272. swarmauri-0.5.3.dev4/swarmauri/utils/load_documents_from_folder.py +0 -58
  273. swarmauri-0.5.3.dev4/swarmauri/utils/load_documents_from_json.py +0 -28
  274. swarmauri-0.5.3.dev4/swarmauri/utils/memoize.py +0 -16
  275. swarmauri-0.5.3.dev4/swarmauri/utils/print_notebook_metadata.py +0 -82
  276. swarmauri-0.5.3.dev4/swarmauri/utils/retry_decorator.py +0 -94
  277. swarmauri-0.5.3.dev4/swarmauri/utils/sql_log.py +0 -76
  278. swarmauri-0.5.3.dev4/swarmauri/utils/timeout_wrapper.py +0 -42
  279. swarmauri-0.5.3.dev4/swarmauri/vector_stores/__init__.py +0 -3
  280. swarmauri-0.5.3.dev4/swarmauri/vector_stores/base/VectorStoreBase.py +0 -135
  281. swarmauri-0.5.3.dev4/swarmauri/vector_stores/base/VectorStoreCloudMixin.py +0 -23
  282. swarmauri-0.5.3.dev4/swarmauri/vector_stores/base/VectorStorePersistentMixin.py +0 -33
  283. swarmauri-0.5.3.dev4/swarmauri/vector_stores/base/VectorStoreRetrieveMixin.py +0 -21
  284. swarmauri-0.5.3.dev4/swarmauri/vector_stores/base/VectorStoreSaveLoadMixin.py +0 -163
  285. swarmauri-0.5.3.dev4/swarmauri/vector_stores/base/VisionVectorStoreBase.py +0 -7
  286. swarmauri-0.5.3.dev4/swarmauri/vector_stores/base/__init__.py +0 -2
  287. swarmauri-0.5.3.dev4/swarmauri/vector_stores/concrete/SqliteVectorStore.py +0 -173
  288. swarmauri-0.5.3.dev4/swarmauri/vector_stores/concrete/TfidfVectorStore.py +0 -74
  289. swarmauri-0.5.3.dev4/swarmauri/vector_stores/concrete/__init__.py +0 -14
  290. swarmauri-0.5.3.dev4/swarmauri/vectors/__init__.py +0 -2
  291. swarmauri-0.5.3.dev4/swarmauri/vectors/base/VectorBase.py +0 -28
  292. swarmauri-0.5.3.dev4/swarmauri/vectors/base/__init__.py +0 -2
  293. swarmauri-0.5.3.dev4/swarmauri/vectors/concrete/Vector.py +0 -5
  294. swarmauri-0.5.3.dev4/swarmauri/vectors/concrete/VectorProductMixin.py +0 -32
  295. swarmauri-0.5.3.dev4/swarmauri/vectors/concrete/__init__.py +0 -14
  296. {swarmauri-0.5.3.dev4 → swarmauri-0.6.0.dev4}/README.md +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: swarmauri
3
- Version: 0.5.3.dev4
4
- Summary: This repository includes base classes, concrete generics, and concrete standard components within the Swarmauri framework.
3
+ Version: 0.6.0.dev4
4
+ Summary: This repository indexes components within the Swarmauri framework.
5
5
  Home-page: http://github.com/swarmauri/swarmauri-sdk
6
6
  License: Apache-2.0
7
7
  Author: Jacob Stewart
@@ -14,6 +14,7 @@ Classifier: Programming Language :: Python :: 3.11
14
14
  Classifier: Programming Language :: Python :: 3.12
15
15
  Provides-Extra: full
16
16
  Provides-Extra: io
17
+ Provides-Extra: ml-toolkits
17
18
  Provides-Extra: nlp
18
19
  Provides-Extra: nlp-tools
19
20
  Provides-Extra: visualization
@@ -21,15 +22,17 @@ Requires-Dist: Pillow (>=8.0,<11.0)
21
22
  Requires-Dist: aiofiles (==24.1.0) ; extra == "io" or extra == "full"
22
23
  Requires-Dist: aiohttp (>=3.10.10,<4.0.0) ; extra == "io" or extra == "full"
23
24
  Requires-Dist: beautifulsoup4 (==04.12.3) ; extra == "nlp-tools" or extra == "full"
24
- Requires-Dist: httpx (>=0.25.0,<0.26.0)
25
+ Requires-Dist: httpx (>=0.27.0,<0.28.0)
25
26
  Requires-Dist: joblib (>=1.4.0,<2.0.0)
26
27
  Requires-Dist: matplotlib (>=3.9.2) ; extra == "visualization" or extra == "full"
27
28
  Requires-Dist: numpy
28
29
  Requires-Dist: pandas
29
30
  Requires-Dist: pydantic (>=2.9.2,<3.0.0)
30
- Requires-Dist: requests
31
+ Requires-Dist: requests (>=2.32.3,<3.0.0)
32
+ Requires-Dist: scikit-learn (>=1.4.2,<2.0.0) ; extra == "ml-toolkits" or extra == "full"
31
33
  Requires-Dist: scipy (>=1.7.0,<1.14.0)
32
- Requires-Dist: swarmauri_core (==0.5.3.dev3)
34
+ Requires-Dist: swarmauri_base (>=0.6.0.dev4,<0.7.0)
35
+ Requires-Dist: swarmauri_core (>=0.6.0.dev4,<0.7.0)
33
36
  Requires-Dist: toml (>=0.10.2,<0.11.0)
34
37
  Requires-Dist: typing_extensions
35
38
  Requires-Dist: yake (==0.4.8) ; extra == "nlp" or extra == "full"
@@ -1,7 +1,7 @@
1
1
  [tool.poetry]
2
2
  name = "swarmauri"
3
- version = "0.5.3.dev4"
4
- description = "This repository includes base classes, concrete generics, and concrete standard components within the Swarmauri framework."
3
+ version = "0.6.0.dev4"
4
+ description = "This repository indexes components within the Swarmauri framework."
5
5
  authors = ["Jacob Stewart <jacob@swarmauri.com>"]
6
6
  license = "Apache-2.0"
7
7
  readme = "README.md"
@@ -14,17 +14,27 @@ classifiers = [
14
14
  ]
15
15
 
16
16
  [tool.poetry.dependencies]
17
+ # Python Version
17
18
  python = ">=3.10,<3.13"
18
- swarmauri_core = "==0.5.3.dev3"
19
+
20
+ # Swarmauri
21
+ swarmauri_core = "^0.6.0.dev4"
22
+ swarmauri_base = "^0.6.0.dev4"
23
+
24
+ # Dependencies
19
25
  toml = "^0.10.2"
20
- httpx = "^0.25.0"
26
+ httpx = "^0.27.0"
21
27
  joblib = "^1.4.0"
22
28
  numpy = "*"
23
29
  pandas = "*"
24
30
  pydantic = "^2.9.2"
25
- Pillow = ">=8.0,<11.0"
26
31
  typing_extensions = "*"
27
- requests = "*"
32
+
33
+ # We should remove and only rely on httpx
34
+ requests = "^2.32.3"
35
+
36
+ # This should be set to optional also
37
+ Pillow = ">=8.0,<11.0"
28
38
 
29
39
  # Optional dependencies with versions specified
30
40
  aiofiles = { version = "24.1.0", optional = true }
@@ -40,7 +50,7 @@ yake = { version = "==0.4.8", optional = true }
40
50
  beautifulsoup4 = { version = "04.12.3", optional = true }
41
51
  #gensim = { version = "==4.3.3", optional = true }
42
52
  scipy = { version = ">=1.7.0,<1.14.0", optional = true }
43
- #scikit-learn = { version = "^1.4.2", optional = true }
53
+ scikit-learn = { version = "^1.4.2", optional = true }
44
54
  #spacy = { version = ">=3.0.0,<=3.8.2", optional = true }
45
55
  #transformers = { version = "^4.45.0", optional = true }
46
56
  #torch = { version = "^2.5.0", optional = true }
@@ -59,6 +69,7 @@ nlp = [
59
69
  ]
60
70
  nlp_tools = ["beautifulsoup4"]
61
71
  #ml_toolkits = ["gensim", "scipy", "scikit-learn"]
72
+ ml_toolkits = ["scikit-learn"]
62
73
  #spacy = ["spacy"]
63
74
  #transformers = ["transformers"]
64
75
  #torch = ["torch"]
@@ -72,6 +83,7 @@ full = [
72
83
  #"nltk", "textblob",
73
84
  "yake",
74
85
  "beautifulsoup4",
86
+ "scikit-learn",
75
87
  #"gensim", "scipy", "scikit-learn",
76
88
  #"spacy",
77
89
  #"transformers",
@@ -86,9 +98,11 @@ pytest = "^8.0"
86
98
  pytest-asyncio = ">=0.24.0"
87
99
  pytest-timeout = "^2.3.1"
88
100
  pytest-xdist = "^3.6.1"
101
+ pytest-json-report = "^1.5.0"
89
102
  python-dotenv = "^1.0.0"
90
103
  jsonschema = "^4.18.5"
91
- ipython = "8.28.0"
104
+ ipython = "^8.28.0"
105
+ requests = "^2.32.3"
92
106
 
93
107
  [build-system]
94
108
  requires = ["poetry-core>=1.0.0"]
@@ -0,0 +1,7 @@
1
+ # Namespace package setup
2
+ from .importer import SwarmauriImporter
3
+
4
+ # Ensure the SwarmauriImporter is registered in sys.meta_path
5
+ import sys
6
+ if not any(isinstance(importer, SwarmauriImporter) for importer in sys.meta_path):
7
+ sys.meta_path.insert(0, SwarmauriImporter())
@@ -0,0 +1,25 @@
1
+ import sys
2
+ import importlib
3
+ from .registry import get_external_module_path
4
+
5
+ class SwarmauriImporter:
6
+ def find_spec(self, fullname, path, target=None):
7
+ """
8
+ Intercept import attempts under the 'swarmauri' namespace.
9
+
10
+ :param fullname: Full module name being imported (e.g., "swarmauri.llms.OpenAIModel.OpenAiModel").
11
+ :param path: The path of the module (not used here).
12
+ :param target: Target module (not used here).
13
+ :return: None if the module is not managed by this importer.
14
+ """
15
+ # Check if the resource path exists in the registry
16
+ external_module_path = get_external_module_path(fullname)
17
+ if external_module_path:
18
+ # Dynamically load the external module
19
+ module = importlib.import_module(external_module_path)
20
+ sys.modules[fullname] = module
21
+ return module.__spec__
22
+ return None
23
+
24
+ # Add the importer to sys.meta_path
25
+ sys.meta_path.insert(0, SwarmauriImporter())
@@ -0,0 +1,10 @@
1
+ import importlib
2
+ import sys
3
+
4
+ def load_component(component_name):
5
+ try:
6
+ module = importlib.import_module(component_name)
7
+ return module
8
+ except ModuleNotFoundError:
9
+ print(f"Component '{component_name}' not found.")
10
+ sys.exit(1)
@@ -0,0 +1,13 @@
1
+ REGISTRY = {
2
+ # Mapping for swarmauri.llms.OpenAIModel
3
+ "swarmauri.llms.OpenAIModel.OpenAiModel": "httpx"
4
+ }
5
+
6
+ def get_external_module_path(resource_path):
7
+ """
8
+ Get the external module path for a given resource path.
9
+
10
+ :param resource_path: Full resource path (e.g., "swarmauri.llms.OpenAIModel.OpenAiModel").
11
+ :return: External module path (e.g., "external_repo.OpenAiModel") or None if not found.
12
+ """
13
+ return REGISTRY.get(resource_path)
@@ -1,37 +0,0 @@
1
- # Standard Library
2
-
3
-
4
- The Standard Library extends the Core Library with concrete implementations of models, agents, tools, parsers, and more. It aims to provide ready-to-use components that can be easily integrated into machine learning projects.
5
-
6
- ## Features
7
-
8
- - **Predefined Models and Agents**: Implements standard models and agents ready for use.
9
- - **Toolkit**: A collection of tools for various tasks (e.g., weather information, math operations).
10
- - **Parsers Implementations**: Various parsers for text data, including HTML and CSV parsers.
11
- - **Conversations and Chunkers**: Manage conversation histories and chunk text data.
12
- - **Vectorizers**: Transform text data into vector representations.
13
- - **Document Stores and Vector Stores**: Concrete implementations for storing and retrieving data.
14
-
15
- ## Getting Started
16
-
17
- To make the best use of the Standard Library, first ensure that the Core Library is set up in your project as the Standard Library builds upon it.
18
-
19
- ```python
20
- # Example usage of a concrete model from the Standard Library
21
- from swarmauri.standard.models.concrete import OpenAIModel
22
-
23
- # Initialize the model with necessary configuration
24
- model = OpenAIModel(api_key="your_api_key_here")
25
- ```
26
-
27
- ## Documentation
28
-
29
- For more detailed guides and API documentation, check the [Docs](/docs) directory within the library. You'll find examples, configuration options, and best practices for utilizing the provided components.
30
-
31
- ## Contributing
32
-
33
- Your contributions can help the Standard Library grow! Whether it's adding new tools, improving models, or writing documentation, we appreciate your help. Please send a pull request with your contributions.
34
-
35
- ## License
36
-
37
- Please see the `LICENSE` file in the repository for details.
@@ -1,37 +0,0 @@
1
- __long_desc__ = """
2
- # Swarmauri Standard SDK
3
-
4
- The Swarmauri Standard SDK offers a comprehensive suite of tools designed for building distributed, extensible systems using the Swarmauri framework.
5
-
6
- ## Standard
7
- - **Base Classes**: Provide a foundation for constructing Swarmauri components, with standardized methods and properties.
8
- - **Mixins**: Reusable code fragments designed to be integrated into various classes, offering shared functionality across different components.
9
- - **Concrete Classes**: Ready-to-use, pre-implemented classes that fulfill standard system needs while adhering to Swarmauri principles. **These classes are the first in line for ongoing support and maintenance, ensuring they remain stable, performant, and up to date with future SDK developments.**
10
-
11
- # Features
12
-
13
- - **Polymorphism**: Allows for dynamic behavior switching between components, enabling flexible, context-aware system behavior.
14
- - **Discriminated Unions**: Provides a robust method for handling multiple possible object types in a type-safe manner.
15
- - **Serialization**: Efficiently encode and decode data for transmission across different environments and system components, with support for both standard and custom serialization formats.
16
- - **Intensional and Extensional Programming**: Leverages both rule-based (intensional) and set-based (extensional) approaches to building and manipulating complex data structures, offering developers a wide range of tools for system design.
17
-
18
- ## Use Cases
19
-
20
- - **Modular Systems**: Develop scalable, pluggable systems that can evolve over time by adding or modifying components without disrupting the entire ecosystem.
21
- - **Distributed Architectures**: Build systems with distributed nodes that seamlessly communicate using the SDK’s standardized interfaces.
22
- - **Third-Party Integrations**: Extend the system's capabilities by easily incorporating third-party tools, libraries, and services.
23
- - **Prototype and Experimentation**: Test cutting-edge ideas using the experimental components in the SDK, while retaining the reliability of core and standard features for production systems.
24
-
25
- # Future Development
26
-
27
- The Swarmauri SDK is an evolving platform, and the community is encouraged to contribute to its growth. Upcoming releases will focus on enhancing the framework's modularity, providing more advanced serialization methods, and expanding the community-driven component library.
28
-
29
- Visit us at: https://swarmauri.com
30
- Follow us at: https://github.com/swarmauri
31
- """
32
- from .__version__ import __version__
33
-
34
- __all__ = [
35
- "__version__",
36
- # other packages you want to expose
37
- ]
@@ -1 +0,0 @@
1
- __version__ = "0.5.2.dev1"
@@ -1 +0,0 @@
1
- from swarmauri.agent_factories.concrete import *
@@ -1,90 +0,0 @@
1
- import json
2
- from datetime import datetime
3
- from typing import Callable, Dict, Any
4
- from swarmauri_core.agents.IAgent import IAgent
5
- from swarmauri_core.agent_factories.IAgentFactory import IAgentFactory
6
- from swarmauri_core.agent_factories.IExportConf import IExportConf
7
-
8
-
9
- class AgentFactory(IAgentFactory, IExportConf):
10
- def __init__(self):
11
- """Initializes the AgentFactory with an empty registry and metadata."""
12
- self._registry: Dict[str, Callable[..., IAgent]] = {}
13
- self._metadata = {
14
- "id": None,
15
- "name": "DefaultAgentFactory",
16
- "type": "Generic",
17
- "date_created": datetime.now(),
18
- "last_modified": datetime.now(),
19
- }
20
-
21
- # Implementation of IAgentFactory methods
22
- def create_agent(self, agent_type: str, **kwargs) -> IAgent:
23
- if agent_type not in self._registry:
24
- raise ValueError(f"Agent type '{agent_type}' is not registered.")
25
-
26
- constructor = self._registry[agent_type]
27
- return constructor(**kwargs)
28
-
29
- def register_agent(
30
- self, agent_type: str, constructor: Callable[..., IAgent]
31
- ) -> None:
32
- if agent_type in self._registry:
33
- raise ValueError(f"Agent type '{agent_type}' is already registered.")
34
- self._registry[agent_type] = constructor
35
- self._metadata["last_modified"] = datetime.now()
36
-
37
- # Implementation of IExportConf methods
38
- def to_dict(self) -> Dict[str, Any]:
39
- """Exports the registry metadata as a dictionary."""
40
- export_data = self._metadata.copy()
41
- export_data["registry"] = list(self._registry.keys())
42
- return export_data
43
-
44
- def to_json(self) -> str:
45
- """Exports the registry metadata as a JSON string."""
46
- return json.dumps(self.to_dict(), default=str, indent=4)
47
-
48
- def export_to_file(self, file_path: str) -> None:
49
- """Exports the registry metadata to a file."""
50
- with open(file_path, "w") as f:
51
- f.write(self.to_json())
52
-
53
- @property
54
- def id(self) -> int:
55
- return self._metadata["id"]
56
-
57
- @id.setter
58
- def id(self, value: int) -> None:
59
- self._metadata["id"] = value
60
- self._metadata["last_modified"] = datetime.now()
61
-
62
- @property
63
- def name(self) -> str:
64
- return self._metadata["name"]
65
-
66
- @name.setter
67
- def name(self, value: str) -> None:
68
- self._metadata["name"] = value
69
- self._metadata["last_modified"] = datetime.now()
70
-
71
- @property
72
- def type(self) -> str:
73
- return self._metadata["type"]
74
-
75
- @type.setter
76
- def type(self, value: str) -> None:
77
- self._metadata["type"] = value
78
- self._metadata["last_modified"] = datetime.now()
79
-
80
- @property
81
- def date_created(self) -> datetime:
82
- return self._metadata["date_created"]
83
-
84
- @property
85
- def last_modified(self) -> datetime:
86
- return self._metadata["last_modified"]
87
-
88
- @last_modified.setter
89
- def last_modified(self, value: datetime) -> None:
90
- self._metadata["last_modified"] = value
@@ -1,97 +0,0 @@
1
- import json
2
- import importlib
3
- from datetime import datetime
4
- from typing import Any, Dict, Callable
5
- from swarmauri_core.agents.IAgent import IAgent # Replace with the correct IAgent path
6
- from swarmauri_core.agentfactories.IAgentFactory import IAgentFactory
7
- from swarmauri_core.agentfactories.IExportConf import IExportConf
8
-
9
-
10
- class ConfDrivenAgentFactory(IAgentFactory, IExportConf):
11
- def __init__(self, config_path: str):
12
- self._config_path = config_path
13
- self._config = self._load_config(config_path)
14
- self._registry = {}
15
- self._metadata = {
16
- 'id': None,
17
- 'name': 'ConfAgentFactory',
18
- 'type': 'Configurable',
19
- 'date_created': datetime.now(),
20
- 'last_modified': datetime.now()
21
- }
22
-
23
- self._initialize_registry()
24
-
25
- def _load_config(self, config_path: str) -> Dict[str, Any]:
26
- with open(config_path, 'r') as file:
27
- return json.load(file)
28
-
29
- def _initialize_registry(self) -> None:
30
- for agent_type, agent_info in self._config.get("agents", {}).items():
31
- module_name, class_name = agent_info["class_path"].rsplit('.', 1)
32
- module = importlib.import_module(module_name)
33
- cls = getattr(module, class_name)
34
- self.register_agent(agent_type, cls)
35
-
36
- # Implementation of IAgentFactory methods
37
- def create_agent(self, agent_type: str, **kwargs) -> IAgent:
38
- if agent_type not in self._registry:
39
- raise ValueError(f"Agent type '{agent_type}' is not registered.")
40
-
41
- return self._registry[agent_type](**kwargs)
42
-
43
- def register_agent(self, agent_type: str, constructor: Callable[..., IAgent]) -> None:
44
- self._registry[agent_type] = constructor
45
- self._metadata['last_modified'] = datetime.now()
46
-
47
- # Implementation of IExportConf methods
48
- def to_dict(self) -> Dict[str, Any]:
49
- return self._metadata.copy()
50
-
51
- def to_json(self) -> str:
52
- return json.dumps(self.to_dict(), default=str, indent=4)
53
-
54
- def export_to_file(self, file_path: str) -> None:
55
- with open(file_path, 'w') as f:
56
- f.write(self.to_json())
57
-
58
- # Additional methods to implement required properties and their setters
59
- # Implementing getters and setters for metadata properties as needed
60
- @property
61
- def id(self) -> int:
62
- return self._metadata['id']
63
-
64
- @id.setter
65
- def id(self, value: int) -> None:
66
- self._metadata['id'] = value
67
- self._metadata['last_modified'] = datetime.now()
68
-
69
- @property
70
- def name(self) -> str:
71
- return self._metadata['name']
72
-
73
- @name.setter
74
- def name(self, value: str) -> None:
75
- self._metadata['name'] = value
76
- self._metadata['last_modified'] = datetime.now()
77
-
78
- @property
79
- def type(self) -> str:
80
- return self._metadata['type']
81
-
82
- @type.setter
83
- def type(self, value: str) -> None:
84
- self._metadata['type'] = value
85
- self._metadata['last_modified'] = datetime.now()
86
-
87
- @property
88
- def date_created(self) -> datetime:
89
- return self._metadata['date_created']
90
-
91
- @property
92
- def last_modified(self) -> datetime:
93
- return self._metadata['last_modified']
94
-
95
- @last_modified.setter
96
- def last_modified(self, value: datetime) -> None:
97
- self._metadata['last_modified'] = value
@@ -1,120 +0,0 @@
1
- import json
2
- from jsonschema import validate, ValidationError
3
- from typing import Dict, Any, Callable, Type
4
- from swarmauri_core.agents.IAgent import IAgent
5
- from swarmauri_core.agent_factories.IAgentFactory import IAgentFactory
6
- from swarmauri_core.agent_factories.IExportConf import IExportConf
7
- import importlib
8
-
9
- class JsonAgentFactory:
10
- def __init__(self, config: Dict[str, Any]):
11
- self._config = config
12
- self._registry: Dict[str, Type[Any]] = {}
13
-
14
- # Load and validate config
15
- self._validate_config()
16
- self._load_config()
17
-
18
- def _validate_config(self) -> None:
19
- """Validates the configuration against the JSON schema."""
20
- schema = {
21
- "$schema": "http://json-schema.org/draft-07/schema#",
22
- "type": "object",
23
- "properties": {
24
- "agents": {
25
- "type": "object",
26
- "patternProperties": {
27
- "^[a-zA-Z][a-zA-Z0-9_-]*$": {
28
- "type": "object",
29
- "properties": {
30
- "constructor": {
31
- "type": "object",
32
- "required": ["module", "class"]
33
- }
34
- },
35
- "required": ["constructor"]
36
- }
37
- }
38
- }
39
- },
40
- "required": ["agents"]
41
- }
42
-
43
- try:
44
- validate(instance=self._config, schema=schema)
45
- except ValidationError as e:
46
- raise ValueError(f"Invalid configuration: {e.message}")
47
-
48
- def _load_config(self):
49
- """Loads configuration and registers agents accordingly."""
50
- agents_config = self._config.get("agents", {})
51
- for agent_type, agent_info in agents_config.items():
52
- module_name = agent_info["constructor"]["module"]
53
- class_name = agent_info["constructor"]["class"]
54
-
55
- module = importlib.import_module(module_name)
56
- cls = getattr(module, class_name)
57
-
58
- self.register_agent(agent_type, cls)
59
-
60
- def create_agent(self, agent_type: str, **kwargs) -> Any:
61
- if agent_type not in self._registry:
62
- raise ValueError(f"Agent type '{agent_type}' is not registered.")
63
-
64
- constructor = self._registry[agent_type]
65
- print(f"Creating instance of {constructor}, with args: {kwargs}")
66
- return constructor(**kwargs)
67
-
68
- def register_agent(self, agent_type: str, constructor: Callable[..., Any]) -> None:
69
- if agent_type in self._registry:
70
- raise ValueError(f"Agent type '{agent_type}' is already registered.")
71
-
72
- print(f"Registering agent type '{agent_type}' with constructor: {constructor}")
73
- self._registry[agent_type] = constructor
74
-
75
- def to_dict(self) -> Dict[str, Any]:
76
- return self._config
77
-
78
- def to_json(self) -> str:
79
- return json.dumps(self._config, default=str, indent=4)
80
-
81
- def export_to_file(self, file_path: str) -> None:
82
- with open(file_path, 'w') as file:
83
- file.write(self.to_json())
84
-
85
- @property
86
- def id(self) -> int:
87
- return self._config.get('id', None) # Assuming config has an 'id'.
88
-
89
- @id.setter
90
- def id(self, value: int) -> None:
91
- self._config['id'] = value
92
-
93
- @property
94
- def name(self) -> str:
95
- return self._config.get('name', 'ConfDrivenAgentFactory')
96
-
97
- @name.setter
98
- def name(self, value: str) -> None:
99
- self._config['name'] = value
100
-
101
- @property
102
- def type(self) -> str:
103
- return self._config.get('type', 'Configuration-Driven')
104
-
105
- @type.setter
106
- def type(self, value: str) -> None:
107
- self._config['type'] = value
108
-
109
- @property
110
- def date_created(self) -> str:
111
- return self._config.get('date_created', None)
112
-
113
- @property
114
- def last_modified(self) -> str:
115
- return self._config.get('last_modified', None)
116
-
117
- @last_modified.setter
118
- def last_modified(self, value: str) -> None:
119
- self._config['last_modified'] = value
120
- self._config['last_modified'] = value
@@ -1,83 +0,0 @@
1
- import importlib
2
- from datetime import datetime
3
- import json
4
- from typing import Callable, Dict, Type, Any
5
- from swarmauri_core.agents.IAgent import IAgent # Update this import path as needed
6
- from swarmauri_core.agentfactories.IAgentFactory import IAgentFactory
7
- from swarmauri_core.agentfactories.IExportConf import IExportConf
8
-
9
- class ReflectiveAgentFactory(IAgentFactory, IExportConf):
10
- def __init__(self):
11
- self._registry: Dict[str, Type[IAgent]] = {}
12
- self._metadata = {
13
- 'id': None,
14
- 'name': 'ReflectiveAgentFactory',
15
- 'type': 'Reflective',
16
- 'date_created': datetime.now(),
17
- 'last_modified': datetime.now()
18
- }
19
-
20
- def create_agent(self, agent_type: str, **kwargs) -> IAgent:
21
- if agent_type not in self._registry:
22
- raise ValueError(f"Agent type '{agent_type}' is not registered.")
23
-
24
- agent_class = self._registry[agent_type]
25
- return agent_class(**kwargs)
26
-
27
- def register_agent(self, agent_type: str, class_path: str) -> None:
28
- module_name, class_name = class_path.rsplit('.', 1)
29
- module = importlib.import_module(module_name)
30
- cls = getattr(module, class_name)
31
- self._registry[agent_type] = cls
32
- self._metadata['last_modified'] = datetime.now()
33
-
34
- # Implementations for the IExportConf interface
35
- def to_dict(self) -> Dict[str, Any]:
36
- return self._metadata.copy()
37
-
38
- def to_json(self) -> str:
39
- return json.dumps(self.to_dict(), default=str, indent=4)
40
-
41
- def export_to_file(self, file_path: str) -> None:
42
- with open(file_path, 'w') as file:
43
- file.write(self.to_json())
44
-
45
- # Property implementations: id, name, type, date_created, and last_modified
46
- @property
47
- def id(self) -> int:
48
- return self._metadata['id']
49
-
50
- @id.setter
51
- def id(self, value: int) -> None:
52
- self._metadata['id'] = value
53
- self._metadata['last_modified'] = datetime.now()
54
-
55
- @property
56
- def name(self) -> str:
57
- return self._metadata['name']
58
-
59
- @name.setter
60
- def name(self, value: str) -> None:
61
- self._metadata['name'] = value
62
- self._metadata['last_modified'] = datetime.now()
63
-
64
- @property
65
- def type(self) -> str:
66
- return self._metadata['type']
67
-
68
- @type.setter
69
- def type(self, value: str) -> None:
70
- self._metadata['type'] = value
71
- self._metadata['last_modified'] = datetime.now()
72
-
73
- @property
74
- def date_created(self) -> datetime:
75
- return self._metadata['date_created']
76
-
77
- @property
78
- def last_modified(self) -> datetime:
79
- return self._metadata['last_modified']
80
-
81
- @last_modified.setter
82
- def last_modified(self, value: datetime) -> None:
83
- self._metadata['last_modified'] = value
@@ -1,22 +0,0 @@
1
- from swarmauri.utils._lazy_import import _lazy_import
2
-
3
- # List of agent factory names (file names without the ".py" extension) and corresponding class names
4
- agent_factory_files = [
5
- ("swarmauri.agent_factories.concrete.agent_factory", "AgentFactory"),
6
- (
7
- "swarmauri.agent_factories.concrete.conf_driven_agent_factory",
8
- "ConfDrivenAgentFactory",
9
- ),
10
- ("swarmauri.agent_factories.concrete.JsonAgentFactory", "JsonAgentFactory"),
11
- (
12
- "swarmauri.agent_factories.concrete.ReflectionAgentFactory",
13
- "ReflectionAgentFactory",
14
- ),
15
- ]
16
-
17
- # Lazy loading of agent factories storing them in variables
18
- for module_name, class_name in agent_factory_files:
19
- globals()[class_name] = _lazy_import(module_name, class_name)
20
-
21
- # Adding the lazy-loaded agent factories to __all__
22
- __all__ = [class_name for _, class_name in agent_factory_files]