lionagi 0.7.4__tar.gz → 0.7.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {lionagi-0.7.4 → lionagi-0.7.6}/PKG-INFO +2 -1
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/ReAct/ReAct.py +1 -1
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/brainstorm/brainstorm.py +9 -9
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/operate/operate.py +13 -2
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/plan/plan.py +4 -4
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/instruct/base.py +2 -0
- lionagi-0.7.6/lionagi/operatives/instruct/instruct.py +153 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/instruct/prompts.py +2 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/instruct/reason.py +33 -9
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/strategies/concurrent.py +1 -1
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/strategies/concurrent_sequential_chunk.py +1 -1
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/strategies/sequential.py +1 -1
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/strategies/sequential_chunk.py +1 -1
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/strategies/sequential_concurrent_chunk.py +1 -1
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/session/branch.py +93 -6
- lionagi-0.7.6/lionagi/version.py +1 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/pyproject.toml +2 -1
- lionagi-0.7.4/lionagi/operatives/instruct/instruct.py +0 -105
- lionagi-0.7.4/lionagi/version.py +0 -1
- {lionagi-0.7.4 → lionagi-0.7.6}/.env.example +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/.github/FUNDING.yml +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/.github/dependabot.yml +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/.github/workflows/ci.yml +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/.github/workflows/codeql.yml +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/.github/workflows/docs.yml +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/.github/workflows/release.yml +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/.gitignore +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/.pre-commit-config.yaml +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/CODE_OF_CONDUCT.md +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/CONTRIBUTING.md +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/LICENSE +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/README.md +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/cookbooks/ch01_get_started.md +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/cookbooks/ch02_concepts.md +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/cookbooks/ch10_e2e_project.md +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/cookbooks/ch11_performance.md +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/cookbooks/ch12_graph.md +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/cookbooks/ch3_internal_tools.md +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/cookbooks/ch4_structured_forms.md +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/cookbooks/ch5_react.md +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/cookbooks/ch6_multi_branch.md +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/cookbooks/ch7_multi_agent.md +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/cookbooks/ch8_rate_limiting.md +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/cookbooks/ch9_data_adapter.md +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/dev_tools/count_code_base_lines.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/Makefile +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/_static/custom.css +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/_templates/layout.html +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/conf.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/index.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/modules/action.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/modules/adapter.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/modules/branch.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/modules/branch_operations.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/modules/concepts.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/modules/element_id.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/modules/event.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/modules/form.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/modules/graph.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/modules/index.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/modules/instruct.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/modules/lib_file.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/modules/lib_nested.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/modules/lib_package.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/modules/lib_schema.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/modules/lib_validate.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/modules/log.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/modules/mail.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/modules/message.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/modules/models.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/modules/operative_step.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/modules/pile.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/modules/processor.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/modules/progression.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/modules/service.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/modules/session.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/modules/utils.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/tutorials/get_started.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/tutorials/get_started_pt2.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/tutorials/get_started_pt3.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/docs/tutorials/index.rst +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/_class_registry.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/_errors.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/_types.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/file/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/file/chunk.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/file/file_ops.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/file/params.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/file/process.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/file/save.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/nested/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/nested/flatten.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/nested/nfilter.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/nested/nget.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/nested/ninsert.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/nested/nmerge.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/nested/npop.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/nested/nset.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/nested/unflatten.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/nested/utils.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/package/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/package/imports.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/package/management.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/package/params.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/package/system.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/parse.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/schema/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/schema/as_readable.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/schema/extract_code_block.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/schema/extract_docstring.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/schema/function_to_schema.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/schema/json_schema.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/token_transform/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/token_transform/llmlingua.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/token_transform/perplexity.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/token_transform/synthlang.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/validate/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/validate/common_field_validators.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/validate/fuzzy_match_keys.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/validate/fuzzy_validate_mapping.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/validate/string_similarity.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/libs/validate/validate_boolean.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/ReAct/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/ReAct/utils.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/_act/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/_act/act.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/brainstorm/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/brainstorm/prompt.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/chat/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/chat/chat.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/communicate/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/communicate/communicate.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/instruct/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/instruct/instruct.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/interpret/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/interpret/interpret.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/operate/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/parse/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/parse/parse.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/plan/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/plan/prompt.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/select/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/select/select.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/select/utils.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/translate/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/translate/translate.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/types.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operations/utils.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/action/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/action/function_calling.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/action/manager.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/action/request_response_model.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/action/tool.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/action/utils.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/forms/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/forms/base.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/forms/form.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/forms/report.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/forms/utils.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/instruct/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/instruct/instruct_collection.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/instruct/node.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/manager.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/models/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/models/field_model.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/models/model_params.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/models/note.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/models/operable_model.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/models/schema_model.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/operative.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/step.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/strategies/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/strategies/base.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/strategies/concurrent_chunk.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/strategies/params.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/strategies/utils.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/types.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/_concepts.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/adapters/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/adapters/adapter.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/adapters/json_adapter.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/adapters/pandas_/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/adapters/pandas_/csv_adapter.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/adapters/pandas_/excel_adapter.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/adapters/pandas_/pd_dataframe_adapter.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/adapters/pandas_/pd_series_adapter.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/adapters/types.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/generic/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/generic/element.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/generic/event.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/generic/log.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/generic/pile.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/generic/processor.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/generic/progression.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/graph/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/graph/edge.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/graph/graph.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/graph/node.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/mail/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/mail/exchange.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/mail/mail.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/mail/mailbox.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/mail/manager.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/mail/package.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/messages/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/messages/action_request.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/messages/action_response.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/messages/assistant_response.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/messages/base.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/messages/instruction.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/messages/manager.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/messages/message.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/messages/system.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/messages/templates/README.md +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/messages/templates/action_request.jinja2 +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/messages/templates/action_response.jinja2 +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/messages/templates/assistant_response.jinja2 +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/messages/templates/instruction_message.jinja2 +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/messages/templates/system_message.jinja2 +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/messages/templates/tool_schemas.jinja2 +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/protocols/types.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/service/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/service/endpoints/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/service/endpoints/base.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/service/endpoints/chat_completion.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/service/endpoints/match_endpoint.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/service/endpoints/rate_limited_processor.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/service/endpoints/token_calculator.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/service/imodel.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/service/manager.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/service/providers/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/service/providers/anthropic_/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/service/providers/anthropic_/messages.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/service/providers/groq_/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/service/providers/groq_/chat_completions.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/service/providers/openai_/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/service/providers/openai_/chat_completions.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/service/providers/openrouter_/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/service/providers/openrouter_/chat_completions.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/service/providers/perplexity_/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/service/providers/perplexity_/chat_completions.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/service/types.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/session/__init__.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/session/session.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/settings.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/lionagi/utils.py +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/prompts/doc_style.md +0 -0
- {lionagi-0.7.4 → lionagi-0.7.6}/uv.lock +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: lionagi
|
3
|
-
Version: 0.7.
|
3
|
+
Version: 0.7.6
|
4
4
|
Summary: An Intelligence Operating System.
|
5
5
|
Author-email: HaiyangLi <quantocean.li@gmail.com>
|
6
6
|
License: Apache License
|
@@ -214,6 +214,7 @@ Classifier: License :: OSI Approved :: Apache Software License
|
|
214
214
|
Classifier: Operating System :: OS Independent
|
215
215
|
Classifier: Programming Language :: Python :: 3
|
216
216
|
Classifier: Programming Language :: Python :: 3 :: Only
|
217
|
+
Classifier: Programming Language :: Python :: 3.10
|
217
218
|
Classifier: Programming Language :: Python :: 3.11
|
218
219
|
Classifier: Programming Language :: Python :: 3.12
|
219
220
|
Classifier: Programming Language :: Python :: 3.13
|
@@ -112,7 +112,7 @@ async def ReAct(
|
|
112
112
|
if extensions:
|
113
113
|
extensions -= 1
|
114
114
|
|
115
|
-
# Step 3: Produce final answer by calling branch.
|
115
|
+
# Step 3: Produce final answer by calling branch.instruct with an answer prompt
|
116
116
|
answer_prompt = ReActAnalysis.ANSWER_PROMPT.format(
|
117
117
|
instruction=instruct_dict["instruction"]
|
118
118
|
)
|
@@ -75,7 +75,7 @@ async def run_instruct(
|
|
75
75
|
if verbose:
|
76
76
|
snippet = (
|
77
77
|
child_ins.guidance[:100] + "..."
|
78
|
-
if len(child_ins.guidance) > 100
|
78
|
+
if len(child_ins.guidance or "") > 100
|
79
79
|
else child_ins.guidance
|
80
80
|
)
|
81
81
|
print(f"\n-----Running instruction-----\n{snippet}")
|
@@ -181,7 +181,7 @@ async def brainstorm(
|
|
181
181
|
if verbose:
|
182
182
|
snippet = (
|
183
183
|
ins_.guidance[:100] + "..."
|
184
|
-
if len(ins_.guidance) > 100
|
184
|
+
if len(ins_.guidance or "") > 100
|
185
185
|
else ins_.guidance
|
186
186
|
)
|
187
187
|
print(f"\n-----Running instruction-----\n{snippet}")
|
@@ -255,12 +255,12 @@ async def brainstorm(
|
|
255
255
|
if verbose:
|
256
256
|
snippet = (
|
257
257
|
ins_.guidance[:100] + "..."
|
258
|
-
if len(ins_.guidance) > 100
|
258
|
+
if len(ins_.guidance or "") > 100
|
259
259
|
else ins_.guidance
|
260
260
|
)
|
261
261
|
print(f"\n-----Exploring Idea-----\n{snippet}")
|
262
262
|
new_branch = session.split(branch)
|
263
|
-
resp = await new_branch.
|
263
|
+
resp = await new_branch.instruct(
|
264
264
|
ins_, **(explore_kwargs or {})
|
265
265
|
)
|
266
266
|
return InstructResponse(instruct=ins_, response=resp)
|
@@ -303,11 +303,11 @@ async def brainstorm(
|
|
303
303
|
if verbose:
|
304
304
|
snippet = (
|
305
305
|
i.guidance[:100] + "..."
|
306
|
-
if len(i.guidance) > 100
|
306
|
+
if len(i.guidance or "") > 100
|
307
307
|
else i.guidance
|
308
308
|
)
|
309
309
|
print(f"\n-----Exploring Idea-----\n{snippet}")
|
310
|
-
seq_res = await branch.
|
310
|
+
seq_res = await branch.instruct(
|
311
311
|
i, **(explore_kwargs or {})
|
312
312
|
)
|
313
313
|
explore_results.append(
|
@@ -337,7 +337,7 @@ async def brainstorm(
|
|
337
337
|
|
338
338
|
async def _explore(ins_: Instruct):
|
339
339
|
child_branch = session.split(base_branch)
|
340
|
-
child_resp = await child_branch.
|
340
|
+
child_resp = await child_branch.instruct(
|
341
341
|
ins_, **(explore_kwargs or {})
|
342
342
|
)
|
343
343
|
return InstructResponse(
|
@@ -393,14 +393,14 @@ async def brainstorm(
|
|
393
393
|
if verbose:
|
394
394
|
snippet = (
|
395
395
|
ins_.guidance[:100] + "..."
|
396
|
-
if len(ins_.guidance) > 100
|
396
|
+
if len(ins_.guidance or "") > 100
|
397
397
|
else ins_.guidance
|
398
398
|
)
|
399
399
|
print(
|
400
400
|
f"\n-----Exploring Idea (sequential in chunk)-----\n{snippet}"
|
401
401
|
)
|
402
402
|
|
403
|
-
seq_resp = await local_branch.
|
403
|
+
seq_resp = await local_branch.instruct(
|
404
404
|
ins_, **(explore_kwargs or {})
|
405
405
|
)
|
406
406
|
chunk_results.append(
|
@@ -47,6 +47,9 @@ async def operate(
|
|
47
47
|
actions: bool = False,
|
48
48
|
reason: bool = False,
|
49
49
|
action_kwargs: dict = None,
|
50
|
+
action_strategy: Literal[
|
51
|
+
"sequential", "concurrent", "batch"
|
52
|
+
] = "concurrent",
|
50
53
|
field_models: list[FieldModel] = None,
|
51
54
|
exclude_fields: list | dict | None = None,
|
52
55
|
request_params: ModelParams = None,
|
@@ -97,6 +100,8 @@ async def operate(
|
|
97
100
|
instruct.reason = True
|
98
101
|
if actions:
|
99
102
|
instruct.actions = True
|
103
|
+
if action_strategy:
|
104
|
+
instruct.action_strategy = action_strategy
|
100
105
|
|
101
106
|
# 1) Create or update the Operative
|
102
107
|
operative = Step.request_operative(
|
@@ -178,9 +183,15 @@ async def operate(
|
|
178
183
|
getattr(response_model, "action_required", None) is True
|
179
184
|
and getattr(response_model, "action_requests", None) is not None
|
180
185
|
):
|
186
|
+
action_kwargs = action_kwargs or {}
|
187
|
+
action_kwargs["strategy"] = (
|
188
|
+
instruct.action_strategy
|
189
|
+
if instruct.action_strategy
|
190
|
+
else action_kwargs.get("strategy", "concurrent")
|
191
|
+
)
|
192
|
+
|
181
193
|
action_response_models = await branch.act(
|
182
|
-
response_model.action_requests,
|
183
|
-
**(action_kwargs or {}),
|
194
|
+
response_model.action_requests, **action_kwargs
|
184
195
|
)
|
185
196
|
# Possibly refine the operative with the tool outputs
|
186
197
|
operative = Step.respond_operative(
|
@@ -249,7 +249,7 @@ async def plan(
|
|
249
249
|
)
|
250
250
|
print(f"Instruction: {snippet}")
|
251
251
|
|
252
|
-
step_response = await execute_branch.
|
252
|
+
step_response = await execute_branch.instruct(
|
253
253
|
plan_step, **(execution_kwargs or {})
|
254
254
|
)
|
255
255
|
seq_results.append(
|
@@ -277,7 +277,7 @@ async def plan(
|
|
277
277
|
print(f"\n------ Executing step (concurrently) ------")
|
278
278
|
print(f"Instruction: {snippet}")
|
279
279
|
local_branch = session.split(execute_branch)
|
280
|
-
resp = await local_branch.
|
280
|
+
resp = await local_branch.instruct(
|
281
281
|
plan_step, **(execution_kwargs or {})
|
282
282
|
)
|
283
283
|
return InstructResponse(instruct=plan_step, response=resp)
|
@@ -309,7 +309,7 @@ async def plan(
|
|
309
309
|
|
310
310
|
async def _execute(plan_step: Instruct):
|
311
311
|
local_branch = session.split(execute_branch)
|
312
|
-
resp = await local_branch.
|
312
|
+
resp = await local_branch.instruct(
|
313
313
|
plan_step, **(execution_kwargs or {})
|
314
314
|
)
|
315
315
|
return InstructResponse(
|
@@ -355,7 +355,7 @@ async def plan(
|
|
355
355
|
print(
|
356
356
|
f"\n--- Executing step (sequential in chunk) ---\nInstruction: {snippet}"
|
357
357
|
)
|
358
|
-
resp = await local_branch.
|
358
|
+
resp = await local_branch.instruct(
|
359
359
|
plan_step, **(execution_kwargs or {})
|
360
360
|
)
|
361
361
|
chunk_result.append(
|
@@ -0,0 +1,153 @@
|
|
1
|
+
# Copyright (c) 2023 - 2024, HaiyangLi <quantocean.li at gmail dot com>
|
2
|
+
#
|
3
|
+
# SPDX-License-Identifier: Apache-2.0
|
4
|
+
|
5
|
+
from typing import Any, ClassVar, Literal
|
6
|
+
|
7
|
+
from pydantic import Field, JsonValue, field_validator
|
8
|
+
|
9
|
+
from lionagi.libs.validate.common_field_validators import (
|
10
|
+
validate_boolean_field,
|
11
|
+
validate_nullable_jsonvalue_field,
|
12
|
+
)
|
13
|
+
from lionagi.utils import HashableModel, to_num
|
14
|
+
|
15
|
+
from ..models.field_model import FieldModel
|
16
|
+
|
17
|
+
__all__ = (
|
18
|
+
"Instruct",
|
19
|
+
"InstructResponse",
|
20
|
+
"INSTRUCT_FIELD",
|
21
|
+
"LIST_INSTRUCT_FIELD",
|
22
|
+
)
|
23
|
+
|
24
|
+
|
25
|
+
class Instruct(HashableModel):
|
26
|
+
"""Model for defining instruction parameters and execution requirements.
|
27
|
+
|
28
|
+
Attributes:
|
29
|
+
instruction (JsonValue | None): The primary instruction.
|
30
|
+
guidance (JsonValue | None): Execution guidance.
|
31
|
+
context (JsonValue | None): Task context.
|
32
|
+
"""
|
33
|
+
|
34
|
+
reserved_kwargs: ClassVar[list[str]] = [
|
35
|
+
"operative_model",
|
36
|
+
"field_models",
|
37
|
+
"operative",
|
38
|
+
"reason",
|
39
|
+
"actions",
|
40
|
+
"action_strategy",
|
41
|
+
"batch_size",
|
42
|
+
"request_params",
|
43
|
+
"response_params",
|
44
|
+
]
|
45
|
+
instruction: JsonValue | None = Field(
|
46
|
+
None,
|
47
|
+
title="Primary Instruction",
|
48
|
+
description=(
|
49
|
+
"A clear, actionable task definition. Specify:\n"
|
50
|
+
"1) The primary goal or objective\n"
|
51
|
+
"2) Key success criteria or constraints\n"
|
52
|
+
"\n"
|
53
|
+
"Guidelines:\n"
|
54
|
+
"- Start with a direct action verb (e.g., 'Analyze', 'Generate', 'Create')\n"
|
55
|
+
"- Include scope, boundaries, or constraints\n"
|
56
|
+
"- Provide success criteria if relevant\n"
|
57
|
+
"- For complex tasks, break them into logical steps"
|
58
|
+
),
|
59
|
+
)
|
60
|
+
guidance: JsonValue | None = Field(
|
61
|
+
None,
|
62
|
+
title="Guidance",
|
63
|
+
description=(
|
64
|
+
"Strategic direction and constraints for executing the task. "
|
65
|
+
"Include:\n"
|
66
|
+
"1) Preferred methods or frameworks\n"
|
67
|
+
"2) Quality benchmarks (e.g., speed, clarity)\n"
|
68
|
+
"3) Resource or environmental constraints\n"
|
69
|
+
"4) Relevant compliance or standards\n"
|
70
|
+
"Use None if no special guidance."
|
71
|
+
),
|
72
|
+
)
|
73
|
+
context: JsonValue | None = Field(
|
74
|
+
None,
|
75
|
+
description=(
|
76
|
+
"Background information and current-state data needed for the task. "
|
77
|
+
"Should be:\n"
|
78
|
+
"1) Directly relevant\n"
|
79
|
+
"2) Sufficient to perform the task\n"
|
80
|
+
"3) Free of extraneous detail\n"
|
81
|
+
"Include environment, prior outcomes, system states, or dependencies. "
|
82
|
+
"Use None if no additional context is needed."
|
83
|
+
),
|
84
|
+
)
|
85
|
+
reason: bool | None = Field(
|
86
|
+
None,
|
87
|
+
description=(
|
88
|
+
"Include a thoughtful explanation of decisions, trade-offs, "
|
89
|
+
"and insights. Encourage deeper introspection on why certain "
|
90
|
+
"choices were made, potential alternatives, and how confidence "
|
91
|
+
"was shaped. If not needed, set to None."
|
92
|
+
),
|
93
|
+
)
|
94
|
+
actions: bool | None = Field(
|
95
|
+
None,
|
96
|
+
description=(
|
97
|
+
"Controls execution mode. "
|
98
|
+
"True: Execute specified actions. "
|
99
|
+
"False: Analysis/recommendations only. "
|
100
|
+
"None: Contextual execution."
|
101
|
+
),
|
102
|
+
)
|
103
|
+
action_strategy: Literal["batch", "sequential", "concurrent"] | None = (
|
104
|
+
Field(
|
105
|
+
None,
|
106
|
+
description="Action strategy to use for executing actions. Default "
|
107
|
+
"is 'concurrent'. Only provide for if actions are enabled.",
|
108
|
+
)
|
109
|
+
)
|
110
|
+
batch_size: int | None = Field(
|
111
|
+
None,
|
112
|
+
description="Batch size for executing actions. Only provide for 'batch' strategy.",
|
113
|
+
)
|
114
|
+
|
115
|
+
@field_validator("instruction", "guidance", "context", mode="before")
|
116
|
+
def _validate_instruction(cls, v):
|
117
|
+
return validate_nullable_jsonvalue_field(cls, v)
|
118
|
+
|
119
|
+
@field_validator("reason", "actions", mode="before")
|
120
|
+
def _validate_reason(cls, v):
|
121
|
+
return validate_boolean_field(cls, v)
|
122
|
+
|
123
|
+
@field_validator("action_strategy", mode="before")
|
124
|
+
def _validate_action_strategy(cls, v):
|
125
|
+
if v not in ["batch", "sequential", "concurrent"]:
|
126
|
+
return "concurrent"
|
127
|
+
return v
|
128
|
+
|
129
|
+
@field_validator("batch_size", mode="before")
|
130
|
+
def _validate_batch_size(cls, v):
|
131
|
+
try:
|
132
|
+
return to_num(v, num_type=int)
|
133
|
+
except Exception:
|
134
|
+
return None
|
135
|
+
|
136
|
+
|
137
|
+
INSTRUCT_FIELD = FieldModel(
|
138
|
+
name="instruct_model",
|
139
|
+
annotation=Instruct | None,
|
140
|
+
default=None,
|
141
|
+
)
|
142
|
+
|
143
|
+
|
144
|
+
class InstructResponse(HashableModel):
|
145
|
+
instruct: Instruct
|
146
|
+
response: Any | None = None
|
147
|
+
|
148
|
+
|
149
|
+
LIST_INSTRUCT_FIELD_MODEL = FieldModel(
|
150
|
+
name="instruct_models",
|
151
|
+
annotation=list[Instruct] | None,
|
152
|
+
default=None,
|
153
|
+
)
|
@@ -2,13 +2,19 @@
|
|
2
2
|
#
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
4
4
|
|
5
|
-
from pydantic import BaseModel, field_validator
|
5
|
+
from pydantic import BaseModel, Field, field_validator
|
6
6
|
|
7
7
|
from lionagi.utils import to_num
|
8
8
|
|
9
9
|
from ..models.field_model import FieldModel
|
10
10
|
|
11
|
+
__all__ = (
|
12
|
+
"Reason",
|
13
|
+
"REASON_FIELD",
|
14
|
+
)
|
15
|
+
|
11
16
|
|
17
|
+
# deprecated
|
12
18
|
def validate_confidence_score(cls, value) -> float:
|
13
19
|
try:
|
14
20
|
return to_num(
|
@@ -22,6 +28,7 @@ def validate_confidence_score(cls, value) -> float:
|
|
22
28
|
return -1
|
23
29
|
|
24
30
|
|
31
|
+
# deprecated
|
25
32
|
confidence_description = (
|
26
33
|
"Numeric confidence score (0.0 to 1.0, up to three decimals) indicating "
|
27
34
|
"how well you've met user expectations. Use this guide:\n"
|
@@ -31,6 +38,7 @@ confidence_description = (
|
|
31
38
|
" • 0.0-0.5: Off track"
|
32
39
|
)
|
33
40
|
|
41
|
+
# deprecated
|
34
42
|
CONFIDENCE_SCORE_FIELD = FieldModel(
|
35
43
|
name="confidence_score",
|
36
44
|
annotation=float | None,
|
@@ -47,13 +55,32 @@ class Reason(BaseModel):
|
|
47
55
|
|
48
56
|
title: str | None = None
|
49
57
|
content: str | None = None
|
50
|
-
confidence_score: float | None =
|
51
|
-
|
52
|
-
|
53
|
-
|
58
|
+
confidence_score: float | None = Field(
|
59
|
+
None,
|
60
|
+
title="Confidence Score",
|
61
|
+
description=(
|
62
|
+
"Numeric confidence score (0.0 to 1.0, up to three decimals) indicating "
|
63
|
+
"how well you've met user expectations. Use this guide:\n"
|
64
|
+
" • 1.0: Highly confident\n"
|
65
|
+
" • 0.8-1.0: Reasonably sure\n"
|
66
|
+
" • 0.5-0.8: Re-check or refine\n"
|
67
|
+
" • 0.0-0.5: Off track"
|
68
|
+
),
|
69
|
+
examples=[0.821, 0.257, 0.923, 0.439],
|
54
70
|
)
|
71
|
+
|
72
|
+
@field_validator("confidence_score", mode="before")
|
55
73
|
def _validate_confidence(cls, v):
|
56
|
-
|
74
|
+
try:
|
75
|
+
return to_num(
|
76
|
+
v,
|
77
|
+
upper_bound=1,
|
78
|
+
lower_bound=0,
|
79
|
+
num_type=float,
|
80
|
+
precision=3,
|
81
|
+
)
|
82
|
+
except Exception:
|
83
|
+
return -1
|
57
84
|
|
58
85
|
|
59
86
|
REASON_FIELD = FieldModel(
|
@@ -62,6 +89,3 @@ REASON_FIELD = FieldModel(
|
|
62
89
|
title="Reason",
|
63
90
|
description="**Provide a concise reason for the decision made.**",
|
64
91
|
)
|
65
|
-
|
66
|
-
|
67
|
-
__all__ = ["Reason"]
|
@@ -25,7 +25,7 @@ class ConcurrentExecutor(StrategyExecutor):
|
|
25
25
|
return await self.execute_instruct(ins_, b_, False, **kwargs)
|
26
26
|
|
27
27
|
config = {**ins.model_dump(), **kwargs}
|
28
|
-
res = await branch.
|
28
|
+
res = await branch.instruct(**config)
|
29
29
|
branch.msgs.logger.dump()
|
30
30
|
instructs = (
|
31
31
|
res.instruct_models if hasattr(res, "instruct_models") else []
|
{lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/strategies/concurrent_sequential_chunk.py
RENAMED
@@ -68,7 +68,7 @@ class ConcurrentSequentialChunkExecutor(StrategyExecutor):
|
|
68
68
|
else f"\n-----Executing Instruct {idx}-----\n{msg_}"
|
69
69
|
)
|
70
70
|
|
71
|
-
res = await self.branch.
|
71
|
+
res = await self.branch.instruct(ins_, **self.params.execute_kwargs)
|
72
72
|
return InstructResponse(instruct=ins_, response=res)
|
73
73
|
|
74
74
|
async def _execute_chunk(
|
@@ -20,7 +20,7 @@ class SequentialExecutor(StrategyExecutor):
|
|
20
20
|
for idx, item in enumerate(instructs, start=1):
|
21
21
|
if self.params.verbose:
|
22
22
|
print(f"\nExecuting step {idx}/{len(instructs)}")
|
23
|
-
out = await self.execute_branch.
|
23
|
+
out = await self.execute_branch.instruct(
|
24
24
|
item, **self.params.execute_kwargs
|
25
25
|
)
|
26
26
|
ress.append(InstructResponse(instruct=item, response=out))
|
@@ -60,7 +60,7 @@ class SequentialChunkExecutor(StrategyExecutor):
|
|
60
60
|
else:
|
61
61
|
print(f"\n-----Executing Instruct-----\n{msg_}")
|
62
62
|
|
63
|
-
res = await self.branch.
|
63
|
+
res = await self.branch.instruct(ins_, **self.params.execute_kwargs)
|
64
64
|
return InstructResponse(instruct=ins_, response=res)
|
65
65
|
|
66
66
|
async def _execute_chunk(
|
{lionagi-0.7.4 → lionagi-0.7.6}/lionagi/operatives/strategies/sequential_concurrent_chunk.py
RENAMED
@@ -71,7 +71,7 @@ class SequentialConcurrentChunkExecutor(StrategyExecutor):
|
|
71
71
|
)
|
72
72
|
|
73
73
|
branch = self.session.split(self.branch)
|
74
|
-
res = await branch.
|
74
|
+
res = await branch.instruct(ins_, **self.params.execute_kwargs)
|
75
75
|
return InstructResponse(instruct=ins_, response=res)
|
76
76
|
|
77
77
|
async def _execute_chunk(
|
@@ -47,7 +47,7 @@ from lionagi.protocols.types import (
|
|
47
47
|
)
|
48
48
|
from lionagi.service.types import iModel, iModelManager
|
49
49
|
from lionagi.settings import Settings
|
50
|
-
from lionagi.utils import UNDEFINED, alcall, copy
|
50
|
+
from lionagi.utils import UNDEFINED, alcall, bcall, copy
|
51
51
|
|
52
52
|
if TYPE_CHECKING:
|
53
53
|
# Forward references for type checking (e.g., in operations or extended modules)
|
@@ -1103,6 +1103,8 @@ class Branch(Element, Communicatable, Relational):
|
|
1103
1103
|
self,
|
1104
1104
|
action_request: list | ActionRequest | BaseModel | dict,
|
1105
1105
|
*,
|
1106
|
+
strategy: Literal["concurrent", "sequential", "batch"] = "concurrent",
|
1107
|
+
batch_size: int = None,
|
1106
1108
|
suppress_errors: bool = True,
|
1107
1109
|
sanitize_input: bool = False,
|
1108
1110
|
unique_input: bool = False,
|
@@ -1119,7 +1121,7 @@ class Branch(Element, Communicatable, Relational):
|
|
1119
1121
|
dropna: bool = True,
|
1120
1122
|
unique_output: bool = False,
|
1121
1123
|
flatten_tuple_set: bool = False,
|
1122
|
-
) -> list[ActionResponse]
|
1124
|
+
) -> list[ActionResponse]:
|
1123
1125
|
"""
|
1124
1126
|
Public, potentially batched, asynchronous interface to run one or multiple action requests.
|
1125
1127
|
|
@@ -1164,10 +1166,95 @@ class Branch(Element, Communicatable, Relational):
|
|
1164
1166
|
Any:
|
1165
1167
|
The result or results from the invoked tool(s).
|
1166
1168
|
"""
|
1167
|
-
|
1168
|
-
|
1169
|
-
|
1170
|
-
|
1169
|
+
if batch_size and not strategy == "batch":
|
1170
|
+
raise ValueError(
|
1171
|
+
"Batch size is only applicable for 'batch' strategy."
|
1172
|
+
)
|
1173
|
+
|
1174
|
+
match strategy:
|
1175
|
+
case "concurrent":
|
1176
|
+
return await self._concurrent_act(
|
1177
|
+
action_request,
|
1178
|
+
suppress_errors=suppress_errors,
|
1179
|
+
sanitize_input=sanitize_input,
|
1180
|
+
unique_input=unique_input,
|
1181
|
+
num_retries=num_retries,
|
1182
|
+
initial_delay=initial_delay,
|
1183
|
+
retry_delay=retry_delay,
|
1184
|
+
backoff_factor=backoff_factor,
|
1185
|
+
retry_default=retry_default,
|
1186
|
+
retry_timeout=retry_timeout,
|
1187
|
+
retry_timing=retry_timing,
|
1188
|
+
max_concurrent=max_concurrent,
|
1189
|
+
throttle_period=throttle_period,
|
1190
|
+
flatten=flatten,
|
1191
|
+
dropna=dropna,
|
1192
|
+
unique_output=unique_output,
|
1193
|
+
flatten_tuple_set=flatten_tuple_set,
|
1194
|
+
)
|
1195
|
+
case "sequential":
|
1196
|
+
return await self._sequential_act(
|
1197
|
+
action_request,
|
1198
|
+
suppress_errors=suppress_errors,
|
1199
|
+
)
|
1200
|
+
case "batch":
|
1201
|
+
return await self._batch_act(
|
1202
|
+
action_request,
|
1203
|
+
batch_size=batch_size or 1,
|
1204
|
+
max_concurrent=max_concurrent,
|
1205
|
+
suppress_errors=suppress_errors,
|
1206
|
+
sanitize_input=sanitize_input,
|
1207
|
+
unique_input=unique_input,
|
1208
|
+
num_retries=num_retries,
|
1209
|
+
initial_delay=initial_delay,
|
1210
|
+
retry_delay=retry_delay,
|
1211
|
+
backoff_factor=backoff_factor,
|
1212
|
+
retry_default=retry_default,
|
1213
|
+
retry_timeout=retry_timeout,
|
1214
|
+
retry_timing=retry_timing,
|
1215
|
+
throttle_period=throttle_period,
|
1216
|
+
flatten=flatten,
|
1217
|
+
dropna=dropna,
|
1218
|
+
unique_output=unique_output,
|
1219
|
+
flatten_tuple_set=flatten_tuple_set,
|
1220
|
+
)
|
1221
|
+
|
1222
|
+
async def _concurrent_act(
|
1223
|
+
self,
|
1224
|
+
action_request: ActionRequest | BaseModel | dict,
|
1225
|
+
**kwargs,
|
1226
|
+
) -> list:
|
1227
|
+
return await alcall(action_request, self._act, **kwargs)
|
1228
|
+
|
1229
|
+
async def _sequential_act(
|
1230
|
+
self,
|
1231
|
+
action_request: ActionRequest | BaseModel | dict,
|
1232
|
+
suppress_errors: bool = True,
|
1233
|
+
) -> list:
|
1234
|
+
action_request = (
|
1235
|
+
action_request
|
1236
|
+
if isinstance(action_request, list)
|
1237
|
+
else [action_request]
|
1238
|
+
)
|
1239
|
+
results = []
|
1240
|
+
for req in action_request:
|
1241
|
+
results.append(
|
1242
|
+
await self._act(req, suppress_errors=suppress_errors)
|
1243
|
+
)
|
1244
|
+
return results
|
1245
|
+
|
1246
|
+
async def _batch_act(
|
1247
|
+
self,
|
1248
|
+
action_request: list[ActionRequest | BaseModel | dict],
|
1249
|
+
batch_size: int = None,
|
1250
|
+
**kwargs,
|
1251
|
+
) -> list:
|
1252
|
+
result = []
|
1253
|
+
async for i in await bcall(
|
1254
|
+
action_request, self._act, batch_size=batch_size, **kwargs
|
1255
|
+
):
|
1256
|
+
result.extend(i)
|
1257
|
+
return result
|
1171
1258
|
|
1172
1259
|
async def translate(
|
1173
1260
|
self,
|
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = "0.7.6"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[project]
|
2
2
|
name = "lionagi"
|
3
|
-
version = "0.7.
|
3
|
+
version = "0.7.6"
|
4
4
|
description = "An Intelligence Operating System."
|
5
5
|
authors = [
|
6
6
|
{ name = "HaiyangLi", email = "quantocean.li@gmail.com" },
|
@@ -21,6 +21,7 @@ license = {file = "LICENSE"}
|
|
21
21
|
classifiers=[
|
22
22
|
"Programming Language :: Python :: 3",
|
23
23
|
"Programming Language :: Python :: 3 :: Only",
|
24
|
+
"Programming Language :: Python :: 3.10",
|
24
25
|
"Programming Language :: Python :: 3.11",
|
25
26
|
"Programming Language :: Python :: 3.12",
|
26
27
|
"Programming Language :: Python :: 3.13",
|