lionagi 0.2.2__tar.gz → 0.2.4__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (273) hide show
  1. {lionagi-0.2.2 → lionagi-0.2.4}/PKG-INFO +7 -3
  2. {lionagi-0.2.2 → lionagi-0.2.4}/README.md +2 -2
  3. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/engine/branch_engine.py +4 -4
  4. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/provider/litellm.py +7 -5
  5. lionagi-0.2.4/lionagi/tests/api/aws/conftest.py +28 -0
  6. lionagi-0.2.4/lionagi/tests/api/aws/test_aws_s3.py +7 -0
  7. lionagi-0.2.4/lionagi/tests/test_core/generic/test_structure.py +194 -0
  8. lionagi-0.2.4/lionagi/tests/test_core/graph/test_graph.py +71 -0
  9. lionagi-0.2.4/lionagi/tests/test_core/graph/test_tree.py +76 -0
  10. lionagi-0.2.4/lionagi/tests/test_core/mail/__init__.py +0 -0
  11. lionagi-0.2.4/lionagi/tests/test_core/mail/test_mail.py +98 -0
  12. lionagi-0.2.4/lionagi/tests/test_core/test_structure/__init__.py +0 -0
  13. lionagi-0.2.4/lionagi/tests/test_core/test_structure/test_base_structure.py +198 -0
  14. lionagi-0.2.4/lionagi/tests/test_core/test_structure/test_graph.py +55 -0
  15. lionagi-0.2.4/lionagi/tests/test_core/test_structure/test_tree.py +49 -0
  16. lionagi-0.2.4/lionagi/version.py +1 -0
  17. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi.egg-info/PKG-INFO +7 -3
  18. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi.egg-info/SOURCES.txt +4 -0
  19. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi.egg-info/requires.txt +4 -0
  20. {lionagi-0.2.2 → lionagi-0.2.4}/pyproject.toml +11 -2
  21. lionagi-0.2.2/lionagi/tests/test_core/generic/test_structure.py +0 -193
  22. lionagi-0.2.2/lionagi/tests/test_core/graph/test_graph.py +0 -70
  23. lionagi-0.2.2/lionagi/tests/test_core/graph/test_tree.py +0 -75
  24. lionagi-0.2.2/lionagi/tests/test_core/mail/test_mail.py +0 -62
  25. lionagi-0.2.2/lionagi/tests/test_core/test_structure/test_base_structure.py +0 -196
  26. lionagi-0.2.2/lionagi/tests/test_core/test_structure/test_graph.py +0 -54
  27. lionagi-0.2.2/lionagi/tests/test_core/test_structure/test_tree.py +0 -48
  28. lionagi-0.2.2/lionagi/version.py +0 -1
  29. {lionagi-0.2.2 → lionagi-0.2.4}/LICENSE +0 -0
  30. {lionagi-0.2.2 → lionagi-0.2.4}/README.rst +0 -0
  31. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/__init__.py +0 -0
  32. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/__init__.py +0 -0
  33. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/_setting/__init__.py +0 -0
  34. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/_setting/_setting.py +0 -0
  35. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/action/__init__.py +0 -0
  36. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/action/function_calling.py +0 -0
  37. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/action/manual.py +0 -0
  38. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/action/node.py +0 -0
  39. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/action/tool.py +0 -0
  40. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/action/tool_manager.py +0 -0
  41. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/agent/__init__.py +0 -0
  42. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/agent/base_agent.py +0 -0
  43. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/agent/eval/__init__.py +0 -0
  44. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/agent/eval/evaluator.py +0 -0
  45. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/agent/eval/vote.py +0 -0
  46. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/agent/learn/__init__.py +0 -0
  47. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/agent/learn/learner.py +0 -0
  48. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/agent/plan/__init__.py +0 -0
  49. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/agent/plan/plan.py +0 -0
  50. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/agent/plan/unit_template.py +0 -0
  51. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/collections/__init__.py +0 -0
  52. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/collections/_logger.py +0 -0
  53. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/collections/abc/__init__.py +0 -0
  54. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/collections/abc/component.py +0 -0
  55. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/collections/abc/concepts.py +0 -0
  56. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/collections/abc/exceptions.py +0 -0
  57. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/collections/abc/util.py +0 -0
  58. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/collections/exchange.py +0 -0
  59. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/collections/flow.py +0 -0
  60. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/collections/model.py +0 -0
  61. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/collections/pile.py +0 -0
  62. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/collections/progression.py +0 -0
  63. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/collections/util.py +0 -0
  64. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/director/__init__.py +0 -0
  65. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/director/direct.py +0 -0
  66. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/director/director.py +0 -0
  67. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/engine/__init__.py +0 -0
  68. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/engine/instruction_map_engine.py +0 -0
  69. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/engine/sandbox_.py +0 -0
  70. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/engine/script_engine.py +0 -0
  71. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/executor/__init__.py +0 -0
  72. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/executor/base_executor.py +0 -0
  73. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/executor/graph_executor.py +0 -0
  74. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/executor/neo4j_executor.py +0 -0
  75. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/generic/__init__.py +0 -0
  76. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/generic/edge.py +0 -0
  77. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/generic/edge_condition.py +0 -0
  78. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/generic/graph.py +0 -0
  79. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/generic/hyperedge.py +0 -0
  80. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/generic/node.py +0 -0
  81. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/generic/tree.py +0 -0
  82. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/generic/tree_node.py +0 -0
  83. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/mail/__init__.py +0 -0
  84. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/mail/mail.py +0 -0
  85. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/mail/mail_manager.py +0 -0
  86. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/mail/package.py +0 -0
  87. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/mail/start_mail.py +0 -0
  88. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/message/__init__.py +0 -0
  89. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/message/action_request.py +0 -0
  90. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/message/action_response.py +0 -0
  91. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/message/assistant_response.py +0 -0
  92. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/message/instruction.py +0 -0
  93. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/message/message.py +0 -0
  94. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/message/system.py +0 -0
  95. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/message/util.py +0 -0
  96. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/report/__init__.py +0 -0
  97. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/report/base.py +0 -0
  98. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/report/form.py +0 -0
  99. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/report/report.py +0 -0
  100. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/report/util.py +0 -0
  101. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/rule/__init__.py +0 -0
  102. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/rule/_default.py +0 -0
  103. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/rule/action.py +0 -0
  104. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/rule/base.py +0 -0
  105. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/rule/boolean.py +0 -0
  106. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/rule/choice.py +0 -0
  107. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/rule/mapping.py +0 -0
  108. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/rule/number.py +0 -0
  109. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/rule/rulebook.py +0 -0
  110. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/rule/string.py +0 -0
  111. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/rule/util.py +0 -0
  112. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/session/__init__.py +0 -0
  113. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/session/branch.py +0 -0
  114. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/session/directive_mixin.py +0 -0
  115. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/session/session.py +0 -0
  116. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/structure/__init__.py +0 -0
  117. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/structure/chain.py +0 -0
  118. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/structure/forest.py +0 -0
  119. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/structure/graph.py +0 -0
  120. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/structure/tree.py +0 -0
  121. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/unit/__init__.py +0 -0
  122. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/unit/parallel_unit.py +0 -0
  123. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/unit/template/__init__.py +0 -0
  124. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/unit/template/action.py +0 -0
  125. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/unit/template/base.py +0 -0
  126. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/unit/template/plan.py +0 -0
  127. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/unit/template/predict.py +0 -0
  128. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/unit/template/score.py +0 -0
  129. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/unit/template/select.py +0 -0
  130. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/unit/unit.py +0 -0
  131. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/unit/unit_form.py +0 -0
  132. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/unit/unit_mixin.py +0 -0
  133. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/unit/util.py +0 -0
  134. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/validator/__init__.py +0 -0
  135. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/validator/validator.py +0 -0
  136. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/work/__init__.py +0 -0
  137. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/work/work.py +0 -0
  138. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/work/work_edge.py +0 -0
  139. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/work/work_function.py +0 -0
  140. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/work/work_function_node.py +0 -0
  141. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/work/work_queue.py +0 -0
  142. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/work/work_task.py +0 -0
  143. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/work/worker.py +0 -0
  144. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/work/worker_engine.py +0 -0
  145. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/core/work/worklog.py +0 -0
  146. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/experimental/__init__.py +0 -0
  147. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/experimental/compressor/__init__.py +0 -0
  148. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/experimental/compressor/base.py +0 -0
  149. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/experimental/compressor/llm_compressor.py +0 -0
  150. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/experimental/compressor/llm_summarizer.py +0 -0
  151. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/experimental/compressor/util.py +0 -0
  152. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/experimental/directive/__init__.py +0 -0
  153. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/experimental/directive/parser/__init__.py +0 -0
  154. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/experimental/directive/parser/base_parser.py +0 -0
  155. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/experimental/directive/template/__init__.py +0 -0
  156. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/experimental/directive/template/base_template.py +0 -0
  157. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/experimental/directive/template/schema.py +0 -0
  158. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/experimental/directive/tokenizer.py +0 -0
  159. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/experimental/evaluator/__init__.py +0 -0
  160. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/experimental/evaluator/ast_evaluator.py +0 -0
  161. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/experimental/evaluator/base_evaluator.py +0 -0
  162. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/experimental/knowledge/__init__.py +0 -0
  163. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/experimental/knowledge/base.py +0 -0
  164. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/experimental/knowledge/graph.py +0 -0
  165. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/experimental/memory/__init__.py +0 -0
  166. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/experimental/strategies/__init__.py +0 -0
  167. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/experimental/strategies/base.py +0 -0
  168. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/__init__.py +0 -0
  169. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/bridge/__init__.py +0 -0
  170. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/bridge/autogen_/__init__.py +0 -0
  171. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/bridge/autogen_/autogen_.py +0 -0
  172. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/bridge/langchain_/__init__.py +0 -0
  173. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/bridge/langchain_/documents.py +0 -0
  174. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/bridge/langchain_/langchain_bridge.py +0 -0
  175. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/bridge/llamaindex_/__init__.py +0 -0
  176. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/bridge/llamaindex_/index.py +0 -0
  177. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/bridge/llamaindex_/llama_index_bridge.py +0 -0
  178. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/bridge/llamaindex_/llama_pack.py +0 -0
  179. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/bridge/llamaindex_/node_parser.py +0 -0
  180. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/bridge/llamaindex_/reader.py +0 -0
  181. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/bridge/llamaindex_/textnode.py +0 -0
  182. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/bridge/pydantic_/__init__.py +0 -0
  183. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/bridge/pydantic_/pydantic_bridge.py +0 -0
  184. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/bridge/transformers_/__init__.py +0 -0
  185. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/bridge/transformers_/install_.py +0 -0
  186. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/chunker/__init__.py +0 -0
  187. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/chunker/chunk.py +0 -0
  188. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/config/__init__.py +0 -0
  189. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/config/mlx_configs.py +0 -0
  190. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/config/oai_configs.py +0 -0
  191. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/config/ollama_configs.py +0 -0
  192. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/config/openrouter_configs.py +0 -0
  193. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/loader/__init__.py +0 -0
  194. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/loader/load.py +0 -0
  195. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/loader/load_util.py +0 -0
  196. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/provider/__init__.py +0 -0
  197. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/provider/_mapping.py +0 -0
  198. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/provider/mistralai.py +0 -0
  199. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/provider/mlx_service.py +0 -0
  200. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/provider/oai.py +0 -0
  201. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/provider/ollama.py +0 -0
  202. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/provider/openrouter.py +0 -0
  203. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/provider/services.py +0 -0
  204. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/provider/transformers.py +0 -0
  205. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/storage/__init__.py +0 -0
  206. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/storage/neo4j.py +0 -0
  207. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/storage/storage_util.py +0 -0
  208. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/storage/structure_excel.py +0 -0
  209. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/storage/to_csv.py +0 -0
  210. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/integrations/storage/to_excel.py +0 -0
  211. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/libs/__init__.py +0 -0
  212. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/libs/ln_api.py +0 -0
  213. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/libs/ln_async.py +0 -0
  214. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/libs/ln_context.py +0 -0
  215. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/libs/ln_convert.py +0 -0
  216. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/libs/ln_dataframe.py +0 -0
  217. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/libs/ln_func_call.py +0 -0
  218. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/libs/ln_image.py +0 -0
  219. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/libs/ln_knowledge_graph.py +0 -0
  220. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/libs/ln_nested.py +0 -0
  221. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/libs/ln_parse.py +0 -0
  222. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/libs/ln_queue.py +0 -0
  223. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/libs/ln_tokenize.py +0 -0
  224. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/libs/ln_validate.py +0 -0
  225. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/libs/special_tokens.py +0 -0
  226. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/libs/sys_util.py +0 -0
  227. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/lions/__init__.py +0 -0
  228. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/lions/coder/__init__.py +0 -0
  229. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/lions/coder/add_feature.py +0 -0
  230. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/lions/coder/base_prompts.py +0 -0
  231. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/lions/coder/code_form.py +0 -0
  232. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/lions/coder/coder.py +0 -0
  233. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/lions/coder/util.py +0 -0
  234. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/lions/researcher/__init__.py +0 -0
  235. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/lions/researcher/data_source/__init__.py +0 -0
  236. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/lions/researcher/data_source/finhub_.py +0 -0
  237. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/lions/researcher/data_source/google_.py +0 -0
  238. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/lions/researcher/data_source/wiki_.py +0 -0
  239. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/lions/researcher/data_source/yfinance_.py +0 -0
  240. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/tests/__init__.py +0 -0
  241. {lionagi-0.2.2/lionagi/tests/integrations → lionagi-0.2.4/lionagi/tests/api}/__init__.py +0 -0
  242. {lionagi-0.2.2/lionagi/tests/libs → lionagi-0.2.4/lionagi/tests/api/aws}/__init__.py +0 -0
  243. {lionagi-0.2.2/lionagi/tests/test_core → lionagi-0.2.4/lionagi/tests/integrations}/__init__.py +0 -0
  244. {lionagi-0.2.2/lionagi/tests/test_core/collections → lionagi-0.2.4/lionagi/tests/libs}/__init__.py +0 -0
  245. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/tests/libs/test_api.py +0 -0
  246. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/tests/libs/test_convert.py +0 -0
  247. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/tests/libs/test_field_validators.py +0 -0
  248. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/tests/libs/test_func_call.py +0 -0
  249. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/tests/libs/test_nested.py +0 -0
  250. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/tests/libs/test_parse.py +0 -0
  251. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/tests/libs/test_queue.py +0 -0
  252. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/tests/libs/test_sys_util.py +0 -0
  253. {lionagi-0.2.2/lionagi/tests/test_core/generic → lionagi-0.2.4/lionagi/tests/test_core}/__init__.py +0 -0
  254. {lionagi-0.2.2/lionagi/tests/test_core/graph → lionagi-0.2.4/lionagi/tests/test_core/collections}/__init__.py +0 -0
  255. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/tests/test_core/collections/test_component.py +0 -0
  256. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/tests/test_core/collections/test_exchange.py +0 -0
  257. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/tests/test_core/collections/test_flow.py +0 -0
  258. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/tests/test_core/collections/test_pile.py +0 -0
  259. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/tests/test_core/collections/test_progression.py +0 -0
  260. {lionagi-0.2.2/lionagi/tests/test_core/mail → lionagi-0.2.4/lionagi/tests/test_core/generic}/__init__.py +0 -0
  261. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/tests/test_core/generic/test_edge.py +0 -0
  262. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/tests/test_core/generic/test_graph.py +0 -0
  263. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/tests/test_core/generic/test_node.py +0 -0
  264. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/tests/test_core/generic/test_tree_node.py +0 -0
  265. {lionagi-0.2.2/lionagi/tests/test_core/test_structure → lionagi-0.2.4/lionagi/tests/test_core/graph}/__init__.py +0 -0
  266. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/tests/test_core/test_branch.py +0 -0
  267. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/tests/test_core/test_form.py +0 -0
  268. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/tests/test_core/test_report.py +0 -0
  269. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi/tests/test_core/test_validator.py +0 -0
  270. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi.egg-info/dependency_links.txt +0 -0
  271. {lionagi-0.2.2 → lionagi-0.2.4}/lionagi.egg-info/top_level.txt +0 -0
  272. {lionagi-0.2.2 → lionagi-0.2.4}/setup.cfg +0 -0
  273. {lionagi-0.2.2 → lionagi-0.2.4}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lionagi
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: Towards automated general intelligence.
5
5
  Author: HaiyangLi
6
6
  Author-email: Haiyang Li <ocean@lionagi.ai>
@@ -222,6 +222,10 @@ Requires-Dist: tiktoken>=0.5.1
222
222
  Requires-Dist: pydantic>=2.6.0
223
223
  Requires-Dist: aiocache>=0.12.2
224
224
  Requires-Dist: pandas>=2.1.0
225
+ Requires-Dist: pytest>=8.2.2
226
+ Requires-Dist: moto>=5.0.9
227
+ Requires-Dist: PyYAML>=6.0.1
228
+ Requires-Dist: boto3>=1.34.131
225
229
 
226
230
  ![PyPI - Version](https://img.shields.io/pypi/v/lionagi?labelColor=233476aa&color=231fc935) ![PyPI - Downloads](https://img.shields.io/pypi/dm/lionagi?color=blue)
227
231
 
@@ -230,10 +234,10 @@ Requires-Dist: pandas>=2.1.0
230
234
 
231
235
 
232
236
  # Language InterOperable Network - LION
233
- ### An AGentic Intelligence Operating System
237
+ ### an AGentic Intelligence Operating System
234
238
 
235
239
  ```
236
- pip install lionagi==0.2.2
240
+ pip install lionagi==0.2.3
237
241
  ```
238
242
 
239
243
  **Powerful Intelligent Workflow Automation**
@@ -5,10 +5,10 @@
5
5
 
6
6
 
7
7
  # Language InterOperable Network - LION
8
- ### An AGentic Intelligence Operating System
8
+ ### an AGentic Intelligence Operating System
9
9
 
10
10
  ```
11
- pip install lionagi==0.2.2
11
+ pip install lionagi==0.2.3
12
12
  ```
13
13
 
14
14
  **Powerful Intelligent Workflow Automation**
@@ -44,7 +44,7 @@ class BranchExecutor(Branch, BaseExecutor):
44
44
  it processes starts, nodes, node lists, conditions, or ends, accordingly executing different functions.
45
45
  """
46
46
  for key in list(self.mailbox.pending_ins.keys()):
47
- while self.mailbox.pending_ins[key].size() > 0:
47
+ while self.mailbox.pending_ins.get(key, Pile()).size() > 0:
48
48
  mail_id = self.mailbox.pending_ins[key].popleft()
49
49
  mail = self.mailbox.pile.pop(mail_id)
50
50
  if mail.category == "start":
@@ -57,7 +57,7 @@ class BranchExecutor(Branch, BaseExecutor):
57
57
  await self._process_condition(mail)
58
58
  elif mail.category == "end":
59
59
  self._process_end(mail)
60
- if self.mailbox.pending_ins[key].size() == 0:
60
+ if key in self.mailbox.pending_ins and self.mailbox.pending_ins.get(key, Pile()).size() == 0:
61
61
  self.mailbox.pending_ins.pop(key)
62
62
 
63
63
  async def execute(self, refresh_time=1) -> None:
@@ -118,8 +118,8 @@ class BranchExecutor(Branch, BaseExecutor):
118
118
  package=node.ln_id,
119
119
  request_source=self.ln_id,
120
120
  )
121
- except:
122
- raise ValueError(f"Invalid mail to process. Mail:{mail}")
121
+ except Exception as e:
122
+ raise ValueError(f"Invalid mail to process. Mail:{mail}, Error: {e}")
123
123
 
124
124
  def _process_node_list(self, mail: Mail):
125
125
  """
@@ -26,9 +26,10 @@ class LiteLLMService(BaseService):
26
26
 
27
27
  SysUtil.check_import("litellm")
28
28
 
29
- from litellm import acompletion
30
-
31
- self.acompletion = acompletion
29
+ import litellm
30
+ litellm.drop_params = True
31
+
32
+ self.acompletion = litellm.acompletion
32
33
  self.model = model
33
34
  self.kwargs = kwargs
34
35
  self.allowed_kwargs = allowed_kwargs
@@ -41,12 +42,13 @@ class LiteLLMService(BaseService):
41
42
  config[k] = v
42
43
 
43
44
  kwargs = {**self.kwargs, **config}
45
+ kwargs["model"] = self.model or kwargs.get("model")
44
46
 
45
47
  try:
46
48
  completion = await self.acompletion(
47
- model=self.model, messages=messages, **kwargs
49
+ messages=messages, **kwargs
48
50
  )
49
- return payload, completion
51
+ return payload, completion.model_dump()
50
52
  except Exception as e:
51
53
  self.status_tracker.num_tasks_failed += 1
52
54
  raise e
@@ -0,0 +1,28 @@
1
+ import pytest
2
+ from api.apicore import _connect as _connect_
3
+ from api.apicore import _config as _config_
4
+
5
+
6
+ """
7
+ Setup the testing construct to ease future testing cases
8
+ """
9
+
10
+
11
+ @pytest.fixture()
12
+ def config():
13
+ _config = _config_.ConfigSingleton()
14
+ _config.config["MOCK"] = True # turn on mock mode
15
+ yield _config
16
+
17
+
18
+ @pytest.fixture
19
+ def test_s3_conn(config):
20
+ yield _connect_.get_object("AWSS3")
21
+
22
+
23
+ @pytest.fixture
24
+ def test_ec2_conn(config):
25
+ yield _connect_.get_object("AWSEC2")
26
+
27
+
28
+
@@ -0,0 +1,7 @@
1
+ from moto import mock_aws
2
+
3
+
4
+ @mock_aws
5
+ def test_awss3_list_bucket_pass(test_s3_conn):
6
+ assert test_s3_conn.list_bucket_names() == []
7
+
@@ -0,0 +1,194 @@
1
+ #TODO
2
+ # import unittest
3
+ # from lionagi.core.generic.structure import *
4
+ #
5
+ # class TestCondition(Condition):
6
+ # def check(self, node: Node) -> bool:
7
+ # return True
8
+ #
9
+ # class TestBaseStructure(unittest.TestCase):
10
+ # def setUp(self):
11
+ # self.structure = BaseStructure(id_="test_structure")
12
+ # self.node1 = Node(id_="node1", content="Node 1 content")
13
+ # self.node2 = Node(id_="node2", content="Node 2 content")
14
+ # self.node3 = Node(id_="node3", content="Node 3 content")
15
+ #
16
+ # def test_internal_edges(self):
17
+ # self.structure.add_node([self.node1, self.node2])
18
+ # self.structure.relate_nodes(self.node1, self.node2)
19
+ # self.assertEqual(len(self.structure.internal_edges), 1)
20
+ #
21
+ # def test_is_empty(self):
22
+ # self.assertTrue(self.structure.is_empty)
23
+ # self.structure.add_node(self.node1)
24
+ # self.assertFalse(self.structure.is_empty)
25
+ #
26
+ # def test_add_node_single(self):
27
+ # self.structure.add_node(self.node1)
28
+ # self.assertIn(self.node1.id_, self.structure.internal_nodes)
29
+ #
30
+ # def test_add_node_list(self):
31
+ # self.structure.add_node([self.node1, self.node2])
32
+ # self.assertIn(self.node1.id_, self.structure.internal_nodes)
33
+ # self.assertIn(self.node2.id_, self.structure.internal_nodes)
34
+ #
35
+ # def test_add_node_dict(self):
36
+ # self.structure.add_node({self.node1.id_: self.node1, self.node2.id_: self.node2})
37
+ # self.assertIn(self.node1.id_, self.structure.internal_nodes)
38
+ # self.assertIn(self.node2.id_, self.structure.internal_nodes)
39
+ #
40
+ # def test_add_node_duplicate(self):
41
+ # self.structure.add_node(self.node1)
42
+ # with self.assertRaises(ValueError):
43
+ # self.structure.add_node(self.node1)
44
+ #
45
+ # def test_get_node_str(self):
46
+ # self.structure.add_node(self.node1)
47
+ # self.assertEqual(self.structure.get_node(self.node1.id_), self.node1)
48
+ #
49
+ # def test_get_node_node(self):
50
+ # self.structure.add_node(self.node1)
51
+ # self.assertEqual(self.structure.get_node(self.node1), self.node1)
52
+ #
53
+ # def test_get_node_list(self):
54
+ # self.structure.add_node([self.node1, self.node2])
55
+ # self.assertEqual(self.structure.get_node([self.node1.id_, self.node2.id_]), [self.node1, self.node2])
56
+ #
57
+ # def test_get_node_dict(self):
58
+ # self.structure.add_node([self.node1, self.node2])
59
+ # self.assertEqual(self.structure.get_node({self.node1.id_: self.node1, self.node2.id_: self.node2}), [self.node1, self.node2])
60
+ #
61
+ # def test_get_node_not_found(self):
62
+ # with self.assertRaises(KeyError):
63
+ # self.structure.get_node("nonexistent_node")
64
+ #
65
+ # def test_get_node_default(self):
66
+ # self.assertIsNone(self.structure.get_node("nonexistent_node", default=None))
67
+ #
68
+ # def test_remove_node_node(self):
69
+ # self.structure.add_node(self.node1)
70
+ # self.structure.remove_node(self.node1)
71
+ # self.assertNotIn(self.node1.id_, self.structure.internal_nodes)
72
+ #
73
+ # def test_remove_node_str(self):
74
+ # self.structure.add_node(self.node1)
75
+ # self.structure.remove_node(self.node1.id_)
76
+ # self.assertNotIn(self.node1.id_, self.structure.internal_nodes)
77
+ #
78
+ # def test_remove_node_list(self):
79
+ # self.structure.add_node([self.node1, self.node2])
80
+ # self.structure.remove_node([self.node1, self.node2])
81
+ # self.assertNotIn(self.node1.id_, self.structure.internal_nodes)
82
+ # self.assertNotIn(self.node2.id_, self.structure.internal_nodes)
83
+ #
84
+ # def test_remove_node_dict(self):
85
+ # self.structure.add_node([self.node1, self.node2])
86
+ # self.structure.remove_node({self.node1.id_: self.node1, self.node2.id_: self.node2})
87
+ # self.assertNotIn(self.node1.id_, self.structure.internal_nodes)
88
+ # self.assertNotIn(self.node2.id_, self.structure.internal_nodes)
89
+ #
90
+ # def test_pop_node_node(self):
91
+ # self.structure.add_node(self.node1)
92
+ # popped_node = self.structure.pop_node(self.node1)
93
+ # self.assertEqual(popped_node, self.node1)
94
+ # self.assertNotIn(self.node1.id_, self.structure.internal_nodes)
95
+ #
96
+ # def test_pop_node_str(self):
97
+ # self.structure.add_node(self.node1)
98
+ # popped_node = self.structure.pop_node(self.node1.id_)
99
+ # self.assertEqual(popped_node, self.node1)
100
+ # self.assertNotIn(self.node1.id_, self.structure.internal_nodes)
101
+ #
102
+ # def test_pop_node_list(self):
103
+ # self.structure.add_node([self.node1, self.node2])
104
+ # popped_nodes = self.structure.pop_node([self.node1, self.node2])
105
+ # self.assertEqual(popped_nodes, [self.node1, self.node2])
106
+ # self.assertNotIn(self.node1.id_, self.structure.internal_nodes)
107
+ # self.assertNotIn(self.node2.id_, self.structure.internal_nodes)
108
+ #
109
+ # def test_pop_node_dict(self):
110
+ # self.structure.add_node([self.node1, self.node2])
111
+ # popped_nodes = self.structure.pop_node({self.node1.id_: self.node1, self.node2.id_: self.node2})
112
+ # self.assertEqual(popped_nodes, [self.node1, self.node2])
113
+ # self.assertNotIn(self.node1.id_, self.structure.internal_nodes)
114
+ # self.assertNotIn(self.node2.id_, self.structure.internal_nodes)
115
+ #
116
+ # def test_pop_node_default(self):
117
+ # self.assertIsNone(self.structure.pop_node("nonexistent_node", default=None))
118
+ #
119
+ # def test_remove_edge_edge(self):
120
+ # self.structure.add_node([self.node1, self.node2])
121
+ # self.structure.relate_nodes(self.node1, self.node2)
122
+ # edge = list(self.node1.edges.values())[0]
123
+ # self.structure.remove_edge(edge)
124
+ # self.assertNotIn(edge.id_, self.structure.internal_edges)
125
+ #
126
+ # def test_remove_edge_str(self):
127
+ # self.structure.add_node([self.node1, self.node2])
128
+ # self.structure.relate_nodes(self.node1, self.node2)
129
+ # edge = list(self.node1.edges.values())[0]
130
+ # self.structure.remove_edge(edge.id_)
131
+ # self.assertNotIn(edge.id_, self.structure.internal_edges)
132
+ #
133
+ # def test_remove_edge_list(self):
134
+ # self.structure.add_node([self.node1, self.node2, self.node3])
135
+ # self.structure.relate_nodes(self.node1, self.node2)
136
+ # self.structure.relate_nodes(self.node2, self.node3)
137
+ # edges = list(self.node2.edges.values())
138
+ #
139
+ # self.structure.remove_edge(edges)
140
+ # self.assertNotIn(edges[0].id_, self.structure.internal_edges)
141
+ # self.assertNotIn(edges[1].id_, self.structure.internal_edges)
142
+ #
143
+ # def test_remove_edge_dict(self):
144
+ # self.structure.add_node([self.node1, self.node2, self.node3])
145
+ # self.structure.relate_nodes(self.node1, self.node2)
146
+ # self.structure.relate_nodes(self.node2, self.node3)
147
+ #
148
+ # edge_dict = self.node2.edges
149
+ # edge_list = list(edge_dict.values())
150
+ #
151
+ # self.structure.remove_edge(edge_dict)
152
+ # self.assertNotIn(edge_list[0].id_, self.structure.internal_edges)
153
+ # self.assertNotIn(edge_list[1].id_, self.structure.internal_edges)
154
+ #
155
+ # def test_remove_edge_not_found(self):
156
+ # with self.assertRaises(ValueError):
157
+ # self.structure.remove_edge("nonexistent_edge")
158
+ #
159
+ # def test_clear(self):
160
+ # self.structure.add_node([self.node1, self.node2])
161
+ # self.structure.clear()
162
+ # self.assertTrue(self.structure.is_empty)
163
+ #
164
+ # def test_get_node_edges_head(self):
165
+ # self.structure.add_node([self.node1, self.node2])
166
+ # self.structure.relate_nodes(self.node1, self.node2)
167
+ # edges = self.structure.get_node_edges(self.node1, node_as="head")
168
+ # self.assertEqual(len(edges), 1)
169
+ #
170
+ # def test_get_node_edges_tail(self):
171
+ # self.structure.add_node([self.node1, self.node2])
172
+ # self.structure.relate_nodes(self.node1, self.node2)
173
+ # edges = self.structure.get_node_edges(self.node2, node_as="tail")
174
+ # self.assertEqual(len(edges), 1)
175
+ #
176
+ # def test_get_node_edges_label(self):
177
+ # self.structure.add_node([self.node1, self.node2])
178
+ # self.structure.relate_nodes(self.node1, self.node2, label="test_label")
179
+ # edges = self.structure.get_node_edges(self.node1, node_as="head", label="test_label")
180
+ # self.assertEqual(len(edges), 1)
181
+ #
182
+ # def test_add_edge(self):
183
+ # self.structure.relate_nodes(self.node1, self.node2)
184
+ # self.assertIn(self.node1.id_, self.structure.internal_nodes)
185
+ # self.assertIn(self.node2.id_, self.structure.internal_nodes)
186
+ # self.assertEqual(len(self.structure.internal_edges), 1)
187
+ #
188
+ # def test_add_edge_with_label(self):
189
+ # self.structure.relate_nodes(self.node1, self.node2, label="test_label")
190
+ # edge = list(self.structure.internal_edges.values())[0]
191
+ # self.assertEqual(edge.label, "test_label")
192
+ #
193
+ # if __name__ == "__main__":
194
+ # unittest.main()
@@ -0,0 +1,71 @@
1
+ #TODO
2
+ # import unittest
3
+ # from unittest.mock import MagicMock, patch
4
+ # from lionagi.core.graph.graph import Graph
5
+ # from lionagi.core.generic.node import Node
6
+ # from lionagi.core.generic.edge import Edge
7
+ #
8
+ # class TestGraph(unittest.TestCase):
9
+ #
10
+ # def setUp(self):
11
+ # self.graph = Graph()
12
+ # self.node1 = Node(id_="node1", content="Node 1 content")
13
+ # self.node2 = Node(id_="node2", content="Node 2 content")
14
+ # self.node3 = Node(id_="node3", content="Node 3 content")
15
+ # self.graph.add_node(self.node1)
16
+ # self.graph.add_node(self.node2)
17
+ # self.graph.add_node(self.node3)
18
+ #
19
+ # def test_graph_heads(self):
20
+ # self.graph.relate_nodes(self.node1, self.node2)
21
+ # self.assertEqual(["node1"], self.graph.graph_heads)
22
+ #
23
+ #
24
+ # def test_acyclic(self):
25
+ # self.graph.relate_nodes(self.node1, self.node2)
26
+ # self.assertTrue(self.graph.acyclic)
27
+ #
28
+ # self.graph.relate_nodes(self.node2, self.node1) # Creating a cycle
29
+ # self.assertFalse(self.graph.acyclic)
30
+ #
31
+ # @patch("lionagi.libs.SysUtil.check_import")
32
+ # def test_to_networkx_success(self, mock_check_import):
33
+ # mock_check_import.return_value = None
34
+ # with patch("networkx.DiGraph") as mock_digraph:
35
+ # mock_graph = MagicMock()
36
+ # mock_digraph.return_value = mock_graph
37
+ # result = self.graph.to_networkx()
38
+ # self.assertEqual(result, mock_graph)
39
+ #
40
+ # @patch("lionagi.libs.SysUtil.check_import")
41
+ # def test_to_networkx_empty_graph(self, mock_check_import):
42
+ # mock_check_import.return_value = None
43
+ # with patch("networkx.DiGraph") as mock_digraph:
44
+ # mock_graph = MagicMock()
45
+ # mock_digraph.return_value = mock_graph
46
+ #
47
+ # self.graph.internal_nodes = {}
48
+ # result = self.graph.to_networkx()
49
+ #
50
+ # self.assertEqual(result, mock_graph)
51
+ # mock_check_import.assert_called_once_with("networkx")
52
+ # mock_digraph.assert_called_once()
53
+ # mock_graph.add_node.assert_not_called()
54
+ # mock_graph.add_edge.assert_not_called()
55
+ #
56
+ # def test_add_node(self):
57
+ # new_node = Node(id_="node4", content="Node 4 content")
58
+ # self.graph.add_node(new_node)
59
+ # self.assertIn("node4", self.graph.internal_nodes)
60
+ #
61
+ # def test_remove_node(self):
62
+ # self.graph.remove_node(self.node1)
63
+ # self.assertNotIn("node1", self.graph.internal_nodes)
64
+ #
65
+ # def test_clear(self):
66
+ # self.graph.clear()
67
+ # self.assertEqual(len(self.graph.internal_nodes), 0)
68
+ # self.assertTrue(self.graph.is_empty)
69
+ #
70
+ # if __name__ == "__main__":
71
+ # unittest.main()
@@ -0,0 +1,76 @@
1
+ #TODO
2
+ # import unittest
3
+ # from lionagi.core.graph.tree import TreeNode, Tree
4
+ #
5
+ # class TestTreeNode(unittest.TestCase):
6
+ # def setUp(self):
7
+ # self.parent_node = TreeNode(id_="parent", content="Parent Node")
8
+ # self.child_node1 = TreeNode(id_="child1", content="Child Node 1")
9
+ # self.child_node2 = TreeNode(id_="child2", content="Child Node 2")
10
+ #
11
+ # def test_relate_child(self):
12
+ # self.parent_node.relate_child(self.child_node1)
13
+ # self.assertIn("child1", self.parent_node.children)
14
+ # self.assertEqual(self.child_node1.parent, self.parent_node)
15
+ #
16
+ # def test_relate_children(self):
17
+ # self.parent_node.relate_child([self.child_node1, self.child_node2])
18
+ # self.assertIn("child1", self.parent_node.children)
19
+ # self.assertIn("child2", self.parent_node.children)
20
+ # self.assertEqual(self.child_node1.parent, self.parent_node)
21
+ # self.assertEqual(self.child_node2.parent, self.parent_node)
22
+ #
23
+ # def test_relate_parent(self):
24
+ # self.child_node1.relate_parent(self.parent_node)
25
+ # self.assertIn("child1", self.parent_node.children)
26
+ # self.assertEqual(self.child_node1.parent, self.parent_node)
27
+ #
28
+ # def test_unrelate_child(self):
29
+ # self.parent_node.relate_child(self.child_node1)
30
+ # self.parent_node.unrelate_child(self.child_node1)
31
+ # self.assertNotIn("child1", self.parent_node.children)
32
+ # self.assertIsNone(self.child_node1.parent)
33
+ #
34
+ # def test_unrelate_parent(self):
35
+ # self.child_node1.relate_parent(self.parent_node)
36
+ # self.child_node1.unrelate_parent()
37
+ # self.assertNotIn("child1", self.parent_node.children)
38
+ # self.assertIsNone(self.child_node1.parent)
39
+ #
40
+ # class TestTree(unittest.TestCase):
41
+ # def setUp(self):
42
+ # self.tree = Tree()
43
+ # self.root = TreeNode(id_="root", content="Root Node")
44
+ # self.child_node1 = TreeNode(id_="child1", content="Child Node 1")
45
+ # self.child_node2 = TreeNode(id_="child2", content="Child Node 2")
46
+ # self.grandchild_node = TreeNode(id_="grandchild", content="Grandchild Node")
47
+ #
48
+ # def test_add_node(self):
49
+ # self.tree.add_node(self.root)
50
+ # self.assertIn("root", self.tree.internal_nodes)
51
+ #
52
+ # def test_relate_parent_child(self):
53
+ # self.tree.relate_parent_child(self.root, [self.child_node1, self.child_node2])
54
+ # self.assertIn("child1", self.root.children)
55
+ # self.assertIn("child2", self.root.children)
56
+ # self.assertEqual(self.tree.root, self.root)
57
+ #
58
+ # def test_tree_structure(self):
59
+ # # Build the tree
60
+ # self.tree.relate_parent_child(self.root, [self.child_node1, self.child_node2])
61
+ # self.tree.relate_parent_child(self.child_node1, self.grandchild_node)
62
+ #
63
+ # # Check the tree structure
64
+ # self.assertIn("grandchild", self.child_node1.children)
65
+ # self.assertEqual(self.grandchild_node.parent, self.child_node1)
66
+ # self.assertEqual(self.child_node1.parent, self.root)
67
+ #
68
+ # def test_acyclic(self):
69
+ # # Build the tree
70
+ # self.tree.relate_parent_child(self.root, self.child_node1)
71
+ # self.tree.relate_parent_child(self.child_node1, self.child_node2)
72
+ # # Trees should always be acyclic
73
+ # self.assertTrue(self.tree.acyclic)
74
+ #
75
+ # if __name__ == "__main__":
76
+ # unittest.main()
File without changes
@@ -0,0 +1,98 @@
1
+ import pytest
2
+
3
+ from lionagi.core.mail import Mail
4
+ from lionagi.core.mail.package import Package
5
+ from datetime import datetime
6
+
7
+ """
8
+ More to be added
9
+ """
10
+
11
+
12
+ def trim_timestamp_to_day(timestamp_str):
13
+ dt = datetime.fromisoformat(timestamp_str)
14
+ return dt.strftime('%Y-%m-%d')
15
+
16
+
17
+ class MockPackage(Package):
18
+ """A mock package class for testing purposes."""
19
+
20
+
21
+ @pytest.fixture
22
+ def mail():
23
+ """Fixture to create a Mail instance with a MockPackage."""
24
+ package = MockPackage()
25
+ mail_instance = Mail(timestamp=datetime.today().strftime('%Y-%m-%d'), package=package)
26
+ return mail_instance
27
+
28
+
29
+ def test_mail_category(mail):
30
+ """Test the category property of Mail."""
31
+ assert mail.category is None
32
+
33
+
34
+
35
+
36
+
37
+ # from lionagi.core.generic.mail import *
38
+ #
39
+ # import unittest
40
+ #
41
+ #
42
+ # class TestMail(unittest.TestCase):
43
+ # def setUp(self):
44
+ # self.mail = Mail(
45
+ # sender="node1",
46
+ # recipient="node2",
47
+ # category=MailPackageCategory.MESSAGES,
48
+ # package="Hello, World!"
49
+ # )
50
+ #
51
+ # def test_mail_initialization(self):
52
+ # """Test initialization of Mail objects."""
53
+ # self.assertIsInstance(self.mail, BaseComponent)
54
+ # self.assertEqual(self.mail.sender, "node1")
55
+ # self.assertEqual(self.mail.recipient, "node2")
56
+ # self.assertEqual(self.mail.category, MailPackageCategory.MESSAGES)
57
+ # self.assertEqual(self.mail.package, "Hello, World!")
58
+ #
59
+ # def test_mail_str(self):
60
+ # """Test the string representation of Mail."""
61
+ # expected_str = "Mail from node1 to node2 with category messages and package Hello, World!"
62
+ # self.assertEqual(str(self.mail), expected_str)
63
+ #
64
+ # class TestMailBox(unittest.TestCase):
65
+ # def setUp(self):
66
+ # self.mailbox = MailBox()
67
+ # self.mail1 = Mail(
68
+ # sender="node1",
69
+ # recipient="node3",
70
+ # category="model",
71
+ # package={"model": "Random Forest"}
72
+ # )
73
+ # self.mail2 = Mail(
74
+ # sender="node2",
75
+ # recipient="node3",
76
+ # category=MailPackageCategory.SERVICE,
77
+ # package={"service": "Prediction"}
78
+ # )
79
+ #
80
+ # def test_adding_mails(self):
81
+ # """Test adding mails to MailBox."""
82
+ # self.mailbox.pending_ins["node1"] = self.mail1
83
+ # self.mailbox.pending_outs["node3"] = self.mail2
84
+ #
85
+ # self.assertIn("node1", self.mailbox.pending_ins)
86
+ # self.assertIn("node3", self.mailbox.pending_outs)
87
+ # self.assertEqual(self.mailbox.pending_ins["node1"], self.mail1)
88
+ # self.assertEqual(self.mailbox.pending_outs["node3"], self.mail2)
89
+ #
90
+ # def test_mailbox_str(self):
91
+ # """Test the string representation of MailBox."""
92
+ # self.mailbox.pending_ins["node1"] = self.mail1
93
+ # self.mailbox.pending_outs["node3"] = self.mail2
94
+ # expected_str = "MailBox with 1 pending incoming mails and 1 pending outgoing mails."
95
+ # self.assertEqual(str(self.mailbox), expected_str)
96
+ #
97
+ # if __name__ == "__main__":
98
+ # unittest.main()