lionagi 0.2.6__tar.gz → 0.2.8__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- lionagi-0.2.8/PKG-INFO +66 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/README.md +1 -1
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/__init__.py +11 -25
- lionagi-0.2.8/lionagi/core/action/README.md +20 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/action/__init__.py +1 -2
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/action/function_calling.py +2 -27
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/action/node.py +1 -16
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/action/tool.py +4 -17
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/action/tool_manager.py +8 -31
- lionagi-0.2.8/lionagi/core/agent/README.md +1 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/agent/base_agent.py +3 -27
- lionagi-0.2.8/lionagi/core/agent/eval/README.md +1 -0
- lionagi-0.2.8/lionagi/core/collections/README.md +23 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/collections/__init__.py +2 -3
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/collections/_logger.py +0 -17
- lionagi-0.2.8/lionagi/core/collections/abc/README.md +63 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/collections/abc/__init__.py +18 -18
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/collections/abc/component.py +5 -21
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/collections/abc/concepts.py +1 -17
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/collections/abc/exceptions.py +0 -16
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/collections/exchange.py +1 -16
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/collections/flow.py +5 -25
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/collections/model.py +8 -21
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/collections/pile.py +317 -35
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/collections/progression.py +4 -17
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/collections/util.py +2 -2
- lionagi-0.2.8/lionagi/core/director/README.md +1 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/director/direct.py +1 -17
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/engine/branch_engine.py +6 -6
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/engine/instruction_map_engine.py +4 -4
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/engine/script_engine.py +2 -16
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/executor/base_executor.py +1 -1
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/executor/graph_executor.py +6 -9
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/executor/neo4j_executor.py +7 -9
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/generic/__init__.py +1 -2
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/generic/edge.py +7 -3
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/generic/edge_condition.py +3 -2
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/generic/graph.py +5 -6
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/generic/node.py +4 -4
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/generic/tree.py +2 -1
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/generic/tree_node.py +2 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/mail/__init__.py +0 -1
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/mail/mail.py +2 -1
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/mail/mail_manager.py +8 -6
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/mail/package.py +2 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/mail/start_mail.py +2 -2
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/message/__init__.py +4 -5
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/message/action_request.py +5 -31
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/message/action_response.py +3 -23
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/message/assistant_response.py +2 -17
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/message/instruction.py +2 -48
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/message/message.py +2 -17
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/message/system.py +2 -17
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/message/util.py +7 -26
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/report/base.py +4 -26
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/report/form.py +7 -28
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/report/report.py +3 -26
- lionagi-0.2.8/lionagi/core/report/util.py +13 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/rule/_default.py +3 -2
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/rule/action.py +4 -19
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/rule/base.py +4 -19
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/rule/boolean.py +2 -2
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/rule/choice.py +3 -2
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/rule/mapping.py +7 -21
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/rule/number.py +3 -1
- lionagi-0.2.8/lionagi/core/rule/rulebook.py +41 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/rule/string.py +2 -13
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/session/branch.py +20 -36
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/session/directive_mixin.py +1 -16
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/session/session.py +8 -24
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/unit/__init__.py +1 -2
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/unit/parallel_unit.py +4 -21
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/unit/template/action.py +0 -16
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/unit/template/base.py +0 -16
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/unit/template/plan.py +1 -16
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/unit/template/predict.py +0 -16
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/unit/template/score.py +1 -17
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/unit/template/select.py +1 -16
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/unit/unit.py +6 -21
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/unit/unit_form.py +6 -19
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/unit/unit_mixin.py +11 -29
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/unit/util.py +1 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/validator/validator.py +8 -22
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/work/work.py +2 -19
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/work/work_function.py +1 -18
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/work/work_function_node.py +0 -5
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/work/work_queue.py +1 -16
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/work/work_task.py +4 -4
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/work/worker.py +5 -20
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/work/worklog.py +1 -17
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/experimental/compressor/base.py +1 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/experimental/compressor/llm_compressor.py +7 -4
- lionagi-0.2.8/lionagi/experimental/directive/README.md +1 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/experimental/directive/parser/base_parser.py +2 -17
- lionagi-0.2.8/lionagi/experimental/directive/parser/base_syntax.txt +200 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/experimental/directive/template/base_template.py +1 -17
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/experimental/directive/tokenizer.py +0 -16
- lionagi-0.2.8/lionagi/experimental/evaluator/README.md +1 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/experimental/evaluator/ast_evaluator.py +0 -16
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/experimental/evaluator/base_evaluator.py +1 -17
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/bridge/langchain_/documents.py +1 -1
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/bridge/llamaindex_/node_parser.py +2 -1
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/bridge/llamaindex_/textnode.py +2 -1
- lionagi-0.2.8/lionagi/integrations/bridge/pydantic_/pydantic_bridge.py +1 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/bridge/transformers_/install_.py +1 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/chunker/chunk.py +5 -6
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/loader/load.py +3 -3
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/loader/load_util.py +2 -2
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/provider/__init__.py +0 -1
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/provider/_mapping.py +6 -5
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/provider/mlx_service.py +4 -3
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/provider/oai.py +1 -17
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/provider/openrouter.py +1 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/provider/transformers.py +2 -2
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/storage/neo4j.py +1 -1
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/storage/storage_util.py +3 -4
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/storage/structure_excel.py +5 -4
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/storage/to_csv.py +3 -2
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/storage/to_excel.py +2 -2
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/libs/__init__.py +15 -19
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/libs/ln_api.py +9 -26
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/libs/ln_async.py +3 -2
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/libs/ln_convert.py +1 -18
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/libs/ln_func_call.py +3 -20
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/libs/ln_image.py +4 -1
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/libs/ln_knowledge_graph.py +5 -2
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/libs/ln_nested.py +2 -18
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/libs/ln_parse.py +4 -19
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/libs/ln_queue.py +2 -17
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/libs/ln_tokenize.py +3 -1
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/libs/ln_validate.py +2 -18
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/libs/sys_util.py +0 -16
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/lions/coder/code_form.py +3 -1
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/lions/coder/coder.py +1 -1
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/lions/coder/util.py +3 -2
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/lions/researcher/data_source/finhub_.py +1 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/libs/test_api.py +2 -1
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/libs/test_convert.py +2 -1
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/libs/test_field_validators.py +9 -8
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/libs/test_func_call.py +2 -2
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/libs/test_nested.py +1 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/libs/test_queue.py +1 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/libs/test_sys_util.py +4 -4
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/test_core/collections/test_component.py +6 -4
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/test_core/collections/test_exchange.py +2 -1
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/test_core/collections/test_flow.py +2 -1
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/test_core/collections/test_pile.py +3 -2
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/test_core/collections/test_progression.py +3 -2
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/test_core/generic/test_edge.py +4 -2
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/test_core/generic/test_graph.py +3 -2
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/test_core/generic/test_node.py +2 -1
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/test_core/generic/test_tree_node.py +2 -1
- lionagi-0.2.8/lionagi/tests/test_core/mail/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/test_core/mail/test_mail.py +2 -1
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/test_core/test_branch.py +3 -2
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/test_core/test_form.py +1 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/test_core/test_report.py +1 -0
- lionagi-0.2.8/lionagi/tests/test_core/test_structure/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/test_core/test_validator.py +4 -3
- lionagi-0.2.8/lionagi/version.py +1 -0
- lionagi-0.2.8/pyproject.toml +25 -0
- lionagi-0.2.6/PKG-INFO +0 -277
- lionagi-0.2.6/README.rst +0 -9
- lionagi-0.2.6/lionagi/core/report/util.py +0 -28
- lionagi-0.2.6/lionagi/core/rule/rulebook.py +0 -109
- lionagi-0.2.6/lionagi/core/rule/util.py +0 -35
- lionagi-0.2.6/lionagi/integrations/bridge/pydantic_/pydantic_bridge.py +0 -1
- lionagi-0.2.6/lionagi/version.py +0 -1
- lionagi-0.2.6/lionagi.egg-info/PKG-INFO +0 -277
- lionagi-0.2.6/lionagi.egg-info/SOURCES.txt +0 -263
- lionagi-0.2.6/lionagi.egg-info/dependency_links.txt +0 -1
- lionagi-0.2.6/lionagi.egg-info/requires.txt +0 -10
- lionagi-0.2.6/lionagi.egg-info/top_level.txt +0 -1
- lionagi-0.2.6/pyproject.toml +0 -47
- lionagi-0.2.6/setup.cfg +0 -4
- lionagi-0.2.6/setup.py +0 -37
- {lionagi-0.2.6 → lionagi-0.2.8}/LICENSE +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/_setting/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/_setting/_setting.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/action/manual.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/agent/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/agent/eval/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/agent/eval/evaluator.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/agent/eval/vote.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/agent/learn/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/agent/learn/learner.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/agent/plan/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/agent/plan/plan.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/agent/plan/unit_template.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/collections/abc/util.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/director/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/director/director.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/engine/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/engine/sandbox_.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/executor/__init__.py +0 -0
- lionagi-0.2.6/lionagi/core/rule/__init__.py → lionagi-0.2.8/lionagi/core/generic/README.md +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/generic/hyperedge.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/report/__init__.py +0 -0
- {lionagi-0.2.6/lionagi/core/session → lionagi-0.2.8/lionagi/core/rule}/__init__.py +0 -0
- lionagi-0.2.6/lionagi/core/unit/template/__init__.py → lionagi-0.2.8/lionagi/core/rule/util.py +0 -0
- {lionagi-0.2.6/lionagi/core/validator → lionagi-0.2.8/lionagi/core/session}/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/structure/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/structure/chain.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/structure/forest.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/structure/graph.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/structure/tree.py +0 -0
- {lionagi-0.2.6/lionagi/core/work → lionagi-0.2.8/lionagi/core/unit/template}/__init__.py +0 -0
- {lionagi-0.2.6/lionagi/experimental → lionagi-0.2.8/lionagi/core/validator}/__init__.py +0 -0
- {lionagi-0.2.6/lionagi/experimental/compressor → lionagi-0.2.8/lionagi/core/work}/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/work/work_edge.py +3 -3
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/core/work/worker_engine.py +5 -5
- {lionagi-0.2.6/lionagi/experimental/directive/parser → lionagi-0.2.8/lionagi/experimental}/__init__.py +0 -0
- {lionagi-0.2.6/lionagi/experimental/directive/template → lionagi-0.2.8/lionagi/experimental/compressor}/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/experimental/compressor/llm_summarizer.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/experimental/compressor/util.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/experimental/directive/__init__.py +0 -0
- {lionagi-0.2.6/lionagi/experimental/evaluator → lionagi-0.2.8/lionagi/experimental/directive/parser}/__init__.py +0 -0
- {lionagi-0.2.6/lionagi/experimental/knowledge → lionagi-0.2.8/lionagi/experimental/directive/template}/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/experimental/directive/template/schema.py +0 -0
- {lionagi-0.2.6/lionagi/experimental/memory → lionagi-0.2.8/lionagi/experimental/evaluator}/__init__.py +0 -0
- {lionagi-0.2.6/lionagi/experimental/strategies → lionagi-0.2.8/lionagi/experimental/knowledge}/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/experimental/knowledge/base.py +1 -1
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/experimental/knowledge/graph.py +0 -0
- {lionagi-0.2.6/lionagi/integrations/bridge/autogen_ → lionagi-0.2.8/lionagi/experimental/memory}/__init__.py +0 -0
- {lionagi-0.2.6/lionagi/integrations/bridge/langchain_ → lionagi-0.2.8/lionagi/experimental/strategies}/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/experimental/strategies/base.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/bridge/__init__.py +1 -1
- {lionagi-0.2.6/lionagi/integrations/bridge/llamaindex_ → lionagi-0.2.8/lionagi/integrations/bridge/autogen_}/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/bridge/autogen_/autogen_.py +0 -0
- {lionagi-0.2.6/lionagi/integrations/bridge/pydantic_ → lionagi-0.2.8/lionagi/integrations/bridge/langchain_}/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/bridge/langchain_/langchain_bridge.py +0 -0
- {lionagi-0.2.6/lionagi/integrations/bridge/transformers_ → lionagi-0.2.8/lionagi/integrations/bridge/llamaindex_}/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/bridge/llamaindex_/index.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/bridge/llamaindex_/llama_index_bridge.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/bridge/llamaindex_/llama_pack.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/bridge/llamaindex_/reader.py +0 -0
- {lionagi-0.2.6/lionagi/integrations/chunker → lionagi-0.2.8/lionagi/integrations/bridge/pydantic_}/__init__.py +0 -0
- {lionagi-0.2.6/lionagi/integrations/loader → lionagi-0.2.8/lionagi/integrations/bridge/transformers_}/__init__.py +0 -0
- {lionagi-0.2.6/lionagi/lions → lionagi-0.2.8/lionagi/integrations/chunker}/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/config/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/config/mlx_configs.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/config/oai_configs.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/config/ollama_configs.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/config/openrouter_configs.py +0 -0
- {lionagi-0.2.6/lionagi/lions/coder → lionagi-0.2.8/lionagi/integrations/loader}/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/provider/litellm.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/provider/mistralai.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/provider/ollama.py +1 -1
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/provider/services.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/integrations/storage/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/libs/ln_context.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/libs/ln_dataframe.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/libs/special_tokens.py +0 -0
- {lionagi-0.2.6/lionagi/lions/researcher → lionagi-0.2.8/lionagi/lions}/__init__.py +0 -0
- {lionagi-0.2.6/lionagi/lions/researcher/data_source → lionagi-0.2.8/lionagi/lions/coder}/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/lions/coder/add_feature.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/lions/coder/base_prompts.py +0 -0
- {lionagi-0.2.6/lionagi/tests → lionagi-0.2.8/lionagi/lions/researcher}/__init__.py +0 -0
- {lionagi-0.2.6/lionagi/tests/api → lionagi-0.2.8/lionagi/lions/researcher/data_source}/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/lions/researcher/data_source/google_.py +2 -2
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/lions/researcher/data_source/wiki_.py +1 -1
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/lions/researcher/data_source/yfinance_.py +0 -0
- {lionagi-0.2.6/lionagi/tests/api/aws → lionagi-0.2.8/lionagi/tests}/__init__.py +0 -0
- {lionagi-0.2.6/lionagi/tests/integrations → lionagi-0.2.8/lionagi/tests/api}/__init__.py +0 -0
- {lionagi-0.2.6/lionagi/tests/libs → lionagi-0.2.8/lionagi/tests/api/aws}/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/api/aws/conftest.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/api/aws/test_aws_s3.py +0 -0
- {lionagi-0.2.6/lionagi/tests/test_core → lionagi-0.2.8/lionagi/tests/integrations}/__init__.py +0 -0
- {lionagi-0.2.6/lionagi/tests/test_core/collections → lionagi-0.2.8/lionagi/tests/libs}/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/libs/test_parse.py +0 -0
- {lionagi-0.2.6/lionagi/tests/test_core/generic → lionagi-0.2.8/lionagi/tests/test_core}/__init__.py +0 -0
- {lionagi-0.2.6/lionagi/tests/test_core/graph → lionagi-0.2.8/lionagi/tests/test_core/collections}/__init__.py +0 -0
- {lionagi-0.2.6/lionagi/tests/test_core/mail → lionagi-0.2.8/lionagi/tests/test_core/generic}/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/test_core/generic/test_structure.py +0 -0
- {lionagi-0.2.6/lionagi/tests/test_core/test_structure → lionagi-0.2.8/lionagi/tests/test_core/graph}/__init__.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/test_core/graph/test_graph.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/test_core/graph/test_tree.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/test_core/test_structure/test_base_structure.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/test_core/test_structure/test_graph.py +0 -0
- {lionagi-0.2.6 → lionagi-0.2.8}/lionagi/tests/test_core/test_structure/test_tree.py +0 -0
lionagi-0.2.8/PKG-INFO
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: lionagi
|
3
|
+
Version: 0.2.8
|
4
|
+
Summary: Towards automated general intelligence.
|
5
|
+
Author: HaiyangLi
|
6
|
+
Author-email: quantocean.li@gmail.com
|
7
|
+
Requires-Python: >=3.12,<4.0
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
9
|
+
Classifier: Programming Language :: Python :: 3.12
|
10
|
+
Requires-Dist: aiocache (>=0.12.3,<0.13.0)
|
11
|
+
Requires-Dist: ipython (>=8.27.0,<9.0.0)
|
12
|
+
Requires-Dist: lion-openai (>=0.1.4,<0.2.0)
|
13
|
+
Requires-Dist: lionfuncs (==1.0.1)
|
14
|
+
Requires-Dist: pandas (>=2.2.3,<3.0.0)
|
15
|
+
Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
|
16
|
+
Description-Content-Type: text/markdown
|
17
|
+
|
18
|
+
![PyPI - Version](https://img.shields.io/pypi/v/lionagi?labelColor=233476aa&color=231fc935) ![PyPI - Downloads](https://img.shields.io/pypi/dm/lionagi?color=blue)
|
19
|
+
|
20
|
+
|
21
|
+
[PyPI](https://pypi.org/project/lionagi/) | [Documentation](https://ocean-lion.com/Welcome) | [Discord](https://discord.gg/aqSJ2v46vu) | [Roadmap](https://trello.com/b/3seomsrI/lionagi)
|
22
|
+
|
23
|
+
|
24
|
+
# Language InterOperable Network - LION
|
25
|
+
### an AGentic Intelligence Operating System
|
26
|
+
|
27
|
+
```
|
28
|
+
pip install lionagi==0.2.7
|
29
|
+
```
|
30
|
+
|
31
|
+
**Powerful Intelligent Workflow Automation**
|
32
|
+
|
33
|
+
lionagi is an intelligent agentic workflow automation framework. It introduces advanced ML models into any existing workflows and data infrastructure.
|
34
|
+
|
35
|
+
|
36
|
+
### Why Automating Workflows?
|
37
|
+
|
38
|
+
Intelligent AI models such as [Large Language Model (LLM)](https://en.wikipedia.org/wiki/Large_language_model), introduced new possibilities of human-computer interaction. LLMs is drawing a lot of attention worldwide due to its “one model fits all”, and incredible performance. One way of using LLM is to use as search engine, however, this usage is complicated by the fact that LLMs [hallucinate](https://arxiv.org/abs/2311.05232).
|
39
|
+
|
40
|
+
What goes inside of a LLM is more akin to a [black-box](https://pauldeepakraj-r.medium.com/demystifying-the-black-box-a-deep-dive-into-llm-interpretability-971524966fdf), lacking interpretability, meaning we don’t know how it reaches certain answer or conclusion, thus we cannot fully trust/rely the output from such a system. Another approach of using LLM is to treat them as [intelligent agent](https://arxiv.org/html/2401.03428v1), that are equipped with various tools and data sources. A workflow conducted by such an intelligent agent have clear steps, and we can specify, observe, evaluate and optimize the logic for each decision that the `agent` made to perform actions. This approach, though we still cannot pinpoint how LLM output what it outputs, but the flow itself is **explainable**.
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
### Community
|
45
|
+
|
46
|
+
We encourage contributions to LionAGI and invite you to enrich its features and capabilities. Engage with us and other community members [Join Our Discord](https://discord.gg/aqSJ2v46vu)
|
47
|
+
|
48
|
+
### Citation
|
49
|
+
|
50
|
+
When referencing LionAGI in your projects or research, please cite:
|
51
|
+
|
52
|
+
```bibtex
|
53
|
+
@software{Li_LionAGI_2023,
|
54
|
+
author = {Haiyang Li},
|
55
|
+
month = {12},
|
56
|
+
year = {2023},
|
57
|
+
title = {LionAGI: Towards Automated General Intelligence},
|
58
|
+
url = {https://github.com/lion-agi/lionagi},
|
59
|
+
}
|
60
|
+
```
|
61
|
+
|
62
|
+
|
63
|
+
### Requirements
|
64
|
+
Python 3.10 or higher.
|
65
|
+
|
66
|
+
|
@@ -1,38 +1,24 @@
|
|
1
|
-
"""
|
2
|
-
Copyright 2024 HaiyangLi
|
3
|
-
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
you may not use this file except in compliance with the License.
|
6
|
-
You may obtain a copy of the License at
|
7
|
-
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
See the License for the specific language governing permissions and
|
14
|
-
limitations under the License.
|
15
|
-
"""
|
16
|
-
|
17
1
|
import logging
|
18
|
-
|
2
|
+
|
19
3
|
from dotenv import load_dotenv
|
20
4
|
|
21
|
-
|
22
|
-
from lionagi.libs.ln_func_call import alcall, bcall, lcall, CallDecorator as cd, tcall
|
23
|
-
from lionagi.core.collections.abc import Field
|
24
|
-
from lionagi.core.collections import progression, flow, pile, iModel
|
25
|
-
from lionagi.core.generic import Node, Graph, Tree, Edge
|
5
|
+
import lionagi.core.director.direct as direct
|
26
6
|
from lionagi.core.action import func_to_tool
|
7
|
+
from lionagi.core.collections import flow, iModel, pile, progression
|
8
|
+
from lionagi.core.collections.abc import Field
|
9
|
+
from lionagi.core.generic import Edge, Graph, Node, Tree
|
27
10
|
from lionagi.core.report import Form, Report
|
28
11
|
from lionagi.core.session.branch import Branch
|
29
12
|
from lionagi.core.session.session import Session
|
30
|
-
from lionagi.core.work.worker import
|
31
|
-
from lionagi.integrations.provider.services import Services
|
13
|
+
from lionagi.core.work.worker import Worker, work, worklink
|
32
14
|
from lionagi.integrations.chunker.chunk import chunk
|
33
15
|
from lionagi.integrations.loader.load import load
|
34
|
-
|
16
|
+
from lionagi.integrations.provider.services import Services
|
17
|
+
from lionagi.libs.ln_convert import to_df, to_dict, to_list, to_readable_dict
|
18
|
+
from lionagi.libs.ln_func_call import CallDecorator as cd
|
19
|
+
from lionagi.libs.ln_func_call import alcall, bcall, lcall, tcall
|
35
20
|
|
21
|
+
from .version import __version__
|
36
22
|
|
37
23
|
__all__ = [
|
38
24
|
"Field",
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# Action Folder
|
2
|
+
|
3
|
+
The `action` folder contains various modules designed to facilitate dynamic function invocation and tool management within the system. Each module provides specific functionalities, which are briefly described below:
|
4
|
+
|
5
|
+
## Modules
|
6
|
+
|
7
|
+
### function_calling.py
|
8
|
+
This module defines the `FunctionCalling` class, which supports dynamic invocation of functions based on different input types such as tuples, dictionaries, `ActionRequest` objects, or JSON strings. It enables seamless function calls by creating instances based on the provided input format and invoking the corresponding functions asynchronously.
|
9
|
+
|
10
|
+
### tool_manager.py
|
11
|
+
The `ToolManager` class is defined in this module. It manages tools in the system, allowing for the registration, invocation, and retrieval of tool schemas. Tools can be registered individually or in batches and invoked using various input formats including function names, JSON strings, or specialized objects like `FunctionCalling`.
|
12
|
+
|
13
|
+
### tool.py
|
14
|
+
This module contains the `Tool` class, representing a tool with capabilities for pre-processing, post-processing, and parsing function results. It allows for the definition of callable functions, optional pre-processors, post-processors, and parsers to handle function results. The `Tool` class ensures flexible and reusable tool definitions within the system.
|
15
|
+
|
16
|
+
## Usage Guide
|
17
|
+
|
18
|
+
- **function_calling.py**: Use this module when you need to dynamically invoke functions based on varying input formats. It simplifies function calls by creating a standardized interface for different types of function descriptions.
|
19
|
+
- **tool_manager.py**: Utilize the `ToolManager` class to manage your system's tools. It provides methods for registering tools, invoking them, and retrieving their schemas, making it a central point for tool management.
|
20
|
+
- **tool.py**: Define individual tools using the `Tool` class, specifying any necessary pre-processing or post-processing steps. This module is essential for creating robust and flexible tools that can be easily integrated into the system.
|
@@ -1,8 +1,7 @@
|
|
1
1
|
from .function_calling import FunctionCalling
|
2
|
+
from .node import ActionNode, DirectiveSelection
|
2
3
|
from .tool import Tool
|
3
4
|
from .tool_manager import ToolManager, func_to_tool
|
4
|
-
from .node import ActionNode, DirectiveSelection
|
5
|
-
|
6
5
|
|
7
6
|
__all__ = [
|
8
7
|
"FunctionCalling",
|
@@ -1,35 +1,10 @@
|
|
1
|
-
"""
|
2
|
-
Copyright 2024 HaiyangLi
|
3
|
-
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
you may not use this file except in compliance with the License.
|
6
|
-
You may obtain a copy of the License at
|
7
|
-
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
See the License for the specific language governing permissions and
|
14
|
-
limitations under the License.
|
15
|
-
"""
|
16
|
-
|
17
|
-
"""
|
18
|
-
This module defines the FunctionCalling class, which facilitates dynamic
|
19
|
-
invocation of functions based on various input types. It supports initializing
|
20
|
-
function calls from tuples, dictionaries, ActionRequest objects, or JSON strings.
|
21
|
-
|
22
|
-
Note:
|
23
|
-
Function Calling object is the only way for AI system to call functions.
|
24
|
-
"""
|
25
|
-
|
26
1
|
from functools import singledispatchmethod
|
27
2
|
from typing import Any, Callable, Dict
|
28
3
|
|
29
|
-
from lionagi.libs import ParseUtil
|
30
|
-
from lionagi.libs.ln_func_call import call_handler
|
31
4
|
from lionagi.core.collections.abc import Actionable
|
32
5
|
from lionagi.core.message.action_request import ActionRequest
|
6
|
+
from lionagi.libs import ParseUtil
|
7
|
+
from lionagi.libs.ln_func_call import call_handler
|
33
8
|
|
34
9
|
|
35
10
|
class FunctionCalling(Actionable):
|
@@ -1,23 +1,8 @@
|
|
1
|
-
"""
|
2
|
-
Copyright 2024 HaiyangLi
|
3
|
-
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
you may not use this file except in compliance with the License.
|
6
|
-
You may obtain a copy of the License at
|
7
|
-
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
See the License for the specific language governing permissions and
|
14
|
-
limitations under the License.
|
15
|
-
"""
|
16
|
-
|
17
1
|
from pydantic import Field
|
18
2
|
|
19
3
|
from lionagi.core.collections.abc import Actionable
|
20
4
|
from lionagi.core.generic.node import Node
|
5
|
+
|
21
6
|
from .tool import Tool
|
22
7
|
|
23
8
|
|
@@ -1,24 +1,11 @@
|
|
1
|
-
|
2
|
-
Copyright 2024 HaiyangLi
|
1
|
+
from typing import Any, Callable, Dict, List, Union
|
3
2
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
you may not use this file except in compliance with the License.
|
6
|
-
You may obtain a copy of the License at
|
7
|
-
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
See the License for the specific language governing permissions and
|
14
|
-
limitations under the License.
|
15
|
-
"""
|
16
|
-
|
17
|
-
from typing import Callable, Union, List, Dict, Any
|
18
3
|
from pydantic import Field, field_serializer
|
19
|
-
|
4
|
+
|
20
5
|
from lionagi.core.collections.abc import Actionable
|
21
6
|
from lionagi.core.generic.node import Node
|
7
|
+
from lionagi.libs.ln_func_call import call_handler
|
8
|
+
|
22
9
|
from .function_calling import FunctionCalling
|
23
10
|
|
24
11
|
|
@@ -1,35 +1,12 @@
|
|
1
|
-
"""
|
2
|
-
Copyright 2024 HaiyangLi
|
3
|
-
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
you may not use this file except in compliance with the License.
|
6
|
-
You may obtain a copy of the License at
|
7
|
-
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
See the License for the specific language governing permissions and
|
14
|
-
limitations under the License.
|
15
|
-
"""
|
16
|
-
|
17
|
-
"""
|
18
|
-
This module contains the ToolManager class, which manages tools in the system.
|
19
|
-
It allows registering, invoking, and retrieving schemas of tools. Tools can be
|
20
|
-
registered individually or in batches, and invoked using function names, JSON
|
21
|
-
strings, or specialized objects.
|
22
|
-
"""
|
23
|
-
|
24
1
|
import inspect
|
25
2
|
from functools import singledispatchmethod
|
26
|
-
from typing import Any, Callable, List,
|
27
|
-
|
28
|
-
from
|
29
|
-
|
30
|
-
from lionagi.core.collections.abc import Actionable
|
3
|
+
from typing import Any, Callable, List, Tuple, Union
|
4
|
+
|
5
|
+
from lionfuncs import function_to_schema, lcall, to_dict, to_list
|
6
|
+
|
31
7
|
from lionagi.core.action.function_calling import FunctionCalling
|
32
|
-
from lionagi.core.action.tool import
|
8
|
+
from lionagi.core.action.tool import TOOL_TYPE, Tool
|
9
|
+
from lionagi.core.collections.abc import Actionable
|
33
10
|
|
34
11
|
|
35
12
|
class ToolManager(Actionable):
|
@@ -336,7 +313,7 @@ def func_to_tool(
|
|
336
313
|
for idx in range(len(funcs)):
|
337
314
|
f_ = lambda _f: Tool(
|
338
315
|
function=_f,
|
339
|
-
schema_=
|
316
|
+
schema_=function_to_schema(_f, style=docstring_style),
|
340
317
|
parser=parsers[idx] if len(parsers) > 1 else parsers[0],
|
341
318
|
**kwargs,
|
342
319
|
)
|
@@ -348,7 +325,7 @@ def func_to_tool(
|
|
348
325
|
funcs,
|
349
326
|
lambda _f: Tool(
|
350
327
|
function=_f,
|
351
|
-
schema_=
|
328
|
+
schema_=function_to_schema(_f, style=docstring_style),
|
352
329
|
**kwargs,
|
353
330
|
),
|
354
331
|
)
|
@@ -0,0 +1 @@
|
|
1
|
+
agent as worker with structured executor
|
@@ -1,34 +1,10 @@
|
|
1
|
-
"""
|
2
|
-
Copyright 2024 HaiyangLi
|
3
|
-
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
you may not use this file except in compliance with the License.
|
6
|
-
You may obtain a copy of the License at
|
7
|
-
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
See the License for the specific language governing permissions and
|
14
|
-
limitations under the License.
|
15
|
-
"""
|
16
|
-
|
17
|
-
"""
|
18
|
-
This module contains the BaseAgent class, which serves as a base class for agents.
|
19
|
-
"""
|
20
|
-
|
21
|
-
from pydantic import Field
|
22
1
|
from typing import Any, Callable
|
23
2
|
|
24
|
-
from lionagi.
|
25
|
-
|
26
|
-
|
27
|
-
from lionagi.core.mail.start_mail import StartMail
|
3
|
+
from lionagi.core.executor.base_executor import BaseExecutor
|
28
4
|
from lionagi.core.generic.node import Node
|
29
5
|
from lionagi.core.mail.mail_manager import MailManager
|
30
|
-
from lionagi.core.
|
31
|
-
from lionagi.
|
6
|
+
from lionagi.core.mail.start_mail import StartMail
|
7
|
+
from lionagi.libs import AsyncUtil, func_call
|
32
8
|
|
33
9
|
|
34
10
|
class BaseAgent(Node):
|
@@ -0,0 +1 @@
|
|
1
|
+
TODO
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# LionAGI Core Collections
|
2
|
+
|
3
|
+
The `lionagi.core.collections` module provides essential data structures and abstractions for managing collections, sequences, and flows of items within the LionAGI system. These components form the foundation for efficient storage, access, and manipulation of data in AI-driven applications.
|
4
|
+
|
5
|
+
## Pile
|
6
|
+
|
7
|
+
`Pile` is a versatile container for managing collections of `Element` objects. It offers ordered and type-validated storage, flexible key access, item retrieval and assignment, inclusion and exclusion operations, homogeneity checks, iteration, and arithmetic operations. `Pile` also supports insertion, appending, and conversion to DataFrame for easy data analysis.
|
8
|
+
|
9
|
+
## Progression
|
10
|
+
|
11
|
+
`Progression` represents a sequence of items with a specific order. It provides methods for managing and manipulating the order of items, including inclusion and exclusion, item retrieval and removal, appending, extending, copying, and clearing. `Progression` supports arithmetic operations for adding and subtracting items or progressions, and offers length and iteration capabilities.
|
12
|
+
|
13
|
+
## Flow
|
14
|
+
|
15
|
+
`Flow` represents a flow of categorical sequences, allowing for the organization and management of multiple `Progression` sequences within a single structure. It provides sequence storage, a registry for sequence lookup by name, a default sequence concept, sequence retrieval and appending, registration, item removal, and iteration over sequences. `Flow` makes it convenient to work with related sequences and perform operations across multiple sequences.
|
16
|
+
|
17
|
+
## Exchange
|
18
|
+
|
19
|
+
`Exchange` is designed to handle incoming and outgoing flows of items. It uses a `Pile` to store pending items and maintains separate collections for pending incoming and outgoing items. `Exchange` provides methods for including and excluding items based on their direction (incoming or outgoing), facilitating efficient item exchange processing.
|
20
|
+
|
21
|
+
These core collections work together to provide a robust and flexible framework for managing data within the LionAGI system. They offer powerful capabilities for storing, accessing, and manipulating collections, sequences, and flows of items, enabling developers to build efficient and organized AI-driven applications.
|
22
|
+
|
23
|
+
For detailed usage examples and advanced features, please refer to the individual component documentation and upcoming tutorials.
|
@@ -1,9 +1,8 @@
|
|
1
|
+
from .exchange import Exchange
|
2
|
+
from .flow import Flow, flow
|
1
3
|
from .model import iModel
|
2
4
|
from .pile import Pile, pile
|
3
5
|
from .progression import Progression, progression
|
4
|
-
from .flow import Flow, flow
|
5
|
-
from .exchange import Exchange
|
6
|
-
|
7
6
|
|
8
7
|
__all__ = [
|
9
8
|
"iModel",
|
@@ -1,19 +1,3 @@
|
|
1
|
-
"""
|
2
|
-
Copyright 2024 HaiyangLi
|
3
|
-
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
you may not use this file except in compliance with the License.
|
6
|
-
You may obtain a copy of the License at
|
7
|
-
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
See the License for the specific language governing permissions and
|
14
|
-
limitations under the License.
|
15
|
-
"""
|
16
|
-
|
17
1
|
import atexit
|
18
2
|
import contextlib
|
19
3
|
import logging
|
@@ -24,7 +8,6 @@ from typing import Any, Dict, List
|
|
24
8
|
|
25
9
|
from lionagi.libs import SysUtil, convert, nested
|
26
10
|
|
27
|
-
|
28
11
|
# TODO: there should be a global data logger, under setting
|
29
12
|
|
30
13
|
|
@@ -0,0 +1,63 @@
|
|
1
|
+
# Core Components and Abstractions
|
2
|
+
|
3
|
+
The `lionagi.core.collections.abc` module provides essential building blocks and abstractions for constructing the LionAGI system. These components establish a solid foundation for managing data, relationships, and behaviors within the system's architecture. ^1
|
4
|
+
|
5
|
+
## Component
|
6
|
+
|
7
|
+
The `Component` class, located in `lionagi.core.collections.abc`, serves as a fundamental building block within the LionAGI system architecture. As a subclass of both `Element` and `ABC` (Abstract Base Class), it encapsulates the essential attributes and behaviors required for individual components to function within the larger system.
|
8
|
+
|
9
|
+
### Key Attributes
|
10
|
+
- **ln_id**: A unique 32-character identifier assigned to each component instance.
|
11
|
+
- **timestamp**: The UTC timestamp indicating when the component was created.
|
12
|
+
- **metadata**: A container for additional metadata associated with the component.
|
13
|
+
- **extra_fields**: Customizable fields that can be added to each component as needed.
|
14
|
+
- **content**: The primary data or functionality encapsulated by the component.
|
15
|
+
|
16
|
+
### Key Methods
|
17
|
+
- **Type Conversion**
|
18
|
+
- **from_obj()**: Accepts input in various formats, including dict, string, llamaindex, langchain, pydantic, pd.DataFrame, and pd.Series.
|
19
|
+
- **to**: Provides methods for converting the component to different representations, such as to_dict(), to_xml(), to_pd_series(), to_langchain_doc(), and to_llama_index_node().
|
20
|
+
- **repr**: Returns a string representation of the component in `pd.Series` format.
|
21
|
+
|
22
|
+
## Concepts
|
23
|
+
|
24
|
+
The `concepts.py` file, located in `lionagi.core.collections.abc`, defines a set of abstract base classes that are essential for managing the fundamental behaviors and relationships within the LionAGI system. These classes establish a structured framework for handling collections, sequencing, conditions, actions, and other core concepts.
|
25
|
+
|
26
|
+
### Key Classes
|
27
|
+
1. **Record**: Manages a collection of unique items, offering a standardized interface for item retrieval, addition, and iteration.
|
28
|
+
2. **Ordering**: Ensures a specific order is maintained when sequencing items.
|
29
|
+
3. **Condition**: Represents conditions that can be evaluated asynchronously to determine their applicability to a given context.
|
30
|
+
4. **Actionable**: Encapsulates actions that can be invoked asynchronously with arguments.
|
31
|
+
5. **Progressable**: Manages processes that can progress forward asynchronously.
|
32
|
+
6. **Relatable**: Establishes relationships between items based on provided arguments.
|
33
|
+
7. **Sendable**: Defines message-like objects with sender and recipient fields, including validation.
|
34
|
+
8. **Executable**: Represents objects that can be executed asynchronously.
|
35
|
+
9. **Directive**: Encapsulates higher-level directives for directing operations asynchronously.
|
36
|
+
|
37
|
+
These abstract classes form a consistent and extensible foundation for building complex, interactive components within the LionAGI system, promoting efficient and organized development practices.
|
38
|
+
|
39
|
+
## Exceptions
|
40
|
+
|
41
|
+
The `exceptions.py` file, found in `lionagi.core.collections.abc`, defines a comprehensive set of custom exceptions designed to handle various error conditions that may arise within the LionAGI system. These exceptions provide clear and specific error messages, facilitating easier debugging and error management. ^2
|
42
|
+
|
43
|
+
### Key Exception Classes
|
44
|
+
1. **LionAGIError**: The base class for all exceptions in the LionAGI system, providing a customizable generic error message.
|
45
|
+
2. **LionValueError**: Raised for errors related to input values, ensuring that incorrect values are properly reported.
|
46
|
+
3. **LionTypeError**: Raised for type mismatches or type checking errors, helping to enforce correct data types throughout the system.
|
47
|
+
4. **LionItemError**: A base class for exceptions related to LionAGI items, including specific error messages for item-related issues.
|
48
|
+
5. **ItemNotFoundError**: Raised when a specified item cannot be found within the system, indicating missing or incorrect item references.
|
49
|
+
6. **ItemInvalidError**: Raised when an invalid item is used in an operation, ensuring operations are performed on valid items only.
|
50
|
+
7. **FieldError**: Raised for errors in field validation, highlighting issues with specific data fields.
|
51
|
+
8. **LionOperationError**: A base class for exceptions related to operational failures, providing a framework for more specific operational errors.
|
52
|
+
9. **ConcurrencyError**: Raised for errors due to concurrency issues, ensuring that concurrent operations are properly managed.
|
53
|
+
10. **RelationError**: Raised for errors in relation operations, indicating issues with node relationships.
|
54
|
+
11. **ActionError**: Raised for errors in action operations, signaling problems with executing specified actions.
|
55
|
+
12. **ResourceLimitExceededError**: Raised when a resource limit is exceeded, helping to manage and enforce system resource constraints.
|
56
|
+
13. **TimeoutError**: Raised when an operation times out, ensuring that long-running operations are properly handled.
|
57
|
+
14. **ServiceError**: Raised for errors in endpoint configuration, indicating issues with service availability or configuration.
|
58
|
+
|
59
|
+
These exceptions contribute to a robust error handling mechanism within the LionAGI system, ensuring that errors are clearly reported and managed, ultimately aiding in maintaining the system's stability and reliability.
|
60
|
+
|
61
|
+
^1: [Design Patterns: Elements of Reusable Object-Oriented Software](https://en.wikipedia.org/wiki/Design_Patterns)
|
62
|
+
|
63
|
+
^2: [Python Exceptions: An Introduction](https://realpython.com/python-exceptions/)
|
@@ -1,31 +1,31 @@
|
|
1
1
|
"""abc: Abstract Base Classes for lionagi."""
|
2
2
|
|
3
3
|
from pydantic import Field
|
4
|
-
|
5
|
-
|
6
|
-
LionValueError,
|
7
|
-
ItemNotFoundError,
|
8
|
-
FieldError,
|
9
|
-
LionOperationError,
|
10
|
-
RelationError,
|
11
|
-
ActionError,
|
12
|
-
ModelLimitExceededError,
|
13
|
-
)
|
14
|
-
from .component import Element, Component, LionIDable, get_lion_id
|
4
|
+
|
5
|
+
from .component import Component, Element, LionIDable, get_lion_id
|
15
6
|
from .concepts import (
|
16
|
-
Record,
|
17
|
-
Ordering,
|
18
|
-
Condition,
|
19
7
|
Actionable,
|
20
|
-
|
8
|
+
Condition,
|
9
|
+
Directive,
|
10
|
+
Executable,
|
11
|
+
Ordering,
|
21
12
|
Progressable,
|
13
|
+
Record,
|
14
|
+
Relatable,
|
22
15
|
Sendable,
|
23
|
-
|
24
|
-
|
16
|
+
)
|
17
|
+
from .exceptions import (
|
18
|
+
ActionError,
|
19
|
+
FieldError,
|
20
|
+
ItemNotFoundError,
|
21
|
+
LionOperationError,
|
22
|
+
LionTypeError,
|
23
|
+
LionValueError,
|
24
|
+
ModelLimitExceededError,
|
25
|
+
RelationError,
|
25
26
|
)
|
26
27
|
from .util import SYSTEM_FIELDS
|
27
28
|
|
28
|
-
|
29
29
|
__all__ = [
|
30
30
|
"Element",
|
31
31
|
"Record",
|
@@ -1,37 +1,21 @@
|
|
1
|
-
"""
|
2
|
-
Copyright 2024 HaiyangLi
|
3
|
-
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
you may not use this file except in compliance with the License.
|
6
|
-
You may obtain a copy of the License at
|
7
|
-
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
See the License for the specific language governing permissions and
|
14
|
-
limitations under the License.
|
15
|
-
"""
|
16
|
-
|
17
1
|
"""Component class, base building block in LionAGI."""
|
18
2
|
|
19
|
-
from abc import ABC
|
20
3
|
import contextlib
|
4
|
+
from abc import ABC
|
21
5
|
from collections.abc import Sequence
|
22
6
|
from functools import singledispatchmethod
|
23
|
-
from typing import Any,
|
7
|
+
from typing import Any, Type, TypeAlias, TypeVar, Union
|
24
8
|
|
25
9
|
from pandas import DataFrame, Series
|
26
|
-
from pydantic import BaseModel, Field, ValidationError
|
10
|
+
from pydantic import AliasChoices, BaseModel, Field, ValidationError
|
27
11
|
|
28
12
|
from lionagi.libs import ParseUtil, SysUtil
|
29
13
|
from lionagi.libs.ln_convert import strip_lower, to_dict, to_str
|
30
14
|
from lionagi.libs.ln_func_call import lcall
|
31
|
-
from lionagi.libs.ln_nested import
|
15
|
+
from lionagi.libs.ln_nested import flatten, nget, ninsert, nset, unflatten
|
32
16
|
|
33
17
|
from .exceptions import FieldError, LionTypeError, LionValueError
|
34
|
-
from .util import base_lion_fields,
|
18
|
+
from .util import base_lion_fields, lc_meta_fields, llama_meta_fields
|
35
19
|
|
36
20
|
T = TypeVar("T")
|
37
21
|
|
@@ -1,26 +1,10 @@
|
|
1
|
-
"""
|
2
|
-
Copyright 2024 HaiyangLi
|
3
|
-
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
you may not use this file except in compliance with the License.
|
6
|
-
You may obtain a copy of the License at
|
7
|
-
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
See the License for the specific language governing permissions and
|
14
|
-
limitations under the License.
|
15
|
-
"""
|
16
|
-
|
17
1
|
"""This module defines abstract base classes for LionAGI."""
|
18
2
|
|
19
3
|
from abc import ABC, abstractmethod
|
20
4
|
from collections.abc import Generator
|
21
5
|
from typing import Any, Iterator, TypeVar
|
22
6
|
|
23
|
-
from pydantic import
|
7
|
+
from pydantic import BaseModel, Field, field_validator
|
24
8
|
|
25
9
|
from .component import LionIDable, get_lion_id
|
26
10
|
from .exceptions import LionTypeError
|
@@ -1,19 +1,3 @@
|
|
1
|
-
"""
|
2
|
-
Copyright 2024 HaiyangLi
|
3
|
-
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
you may not use this file except in compliance with the License.
|
6
|
-
You may obtain a copy of the License at
|
7
|
-
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
See the License for the specific language governing permissions and
|
14
|
-
limitations under the License.
|
15
|
-
"""
|
16
|
-
|
17
1
|
# import logging
|
18
2
|
|
19
3
|
# # Configure logging
|
@@ -1,20 +1,5 @@
|
|
1
|
-
|
2
|
-
Copyright 2024 HaiyangLi
|
1
|
+
from typing import Generic, TypeVar
|
3
2
|
|
4
|
-
Licensed under the Apache License, Version 2.0 (the "License");
|
5
|
-
you may not use this file except in compliance with the License.
|
6
|
-
You may obtain a copy of the License at
|
7
|
-
|
8
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
9
|
-
|
10
|
-
Unless required by applicable law or agreed to in writing, software
|
11
|
-
distributed under the License is distributed on an "AS IS" BASIS,
|
12
|
-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
13
|
-
See the License for the specific language governing permissions and
|
14
|
-
limitations under the License.
|
15
|
-
"""
|
16
|
-
|
17
|
-
from typing import TypeVar, Generic
|
18
3
|
from .abc import Element, Field, Sendable
|
19
4
|
from .pile import Pile, pile
|
20
5
|
from .progression import Progression, progression
|