lionagi 0.8.5__tar.gz → 0.8.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.8.5 → lionagi-0.8.6}/PKG-INFO +1 -1
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/__init__.py +6 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/ReAct/ReAct.py +31 -7
- lionagi-0.8.6/lionagi/operations/ReAct/utils.py +92 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/_act/act.py +8 -0
- lionagi-0.8.6/lionagi/operations/interpret/interpret.py +74 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/operate/operate.py +7 -1
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/session/branch.py +54 -6
- lionagi-0.8.6/lionagi/tools/__init__.py +0 -0
- lionagi-0.8.6/lionagi/tools/base.py +12 -0
- lionagi-0.8.6/lionagi/tools/reader.py +244 -0
- lionagi-0.8.6/lionagi/tools/types.py +3 -0
- lionagi-0.8.6/lionagi/version.py +1 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/pyproject.toml +5 -1
- {lionagi-0.8.5 → lionagi-0.8.6}/uv.lock +1462 -237
- lionagi-0.8.5/lionagi/operations/ReAct/utils.py +0 -28
- lionagi-0.8.5/lionagi/operations/interpret/interpret.py +0 -43
- lionagi-0.8.5/lionagi/version.py +0 -1
- {lionagi-0.8.5 → lionagi-0.8.6}/.env.example +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/.github/FUNDING.yml +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/.github/dependabot.yml +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/.github/workflows/ci.yml +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/.github/workflows/codeql.yml +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/.github/workflows/docs.yml +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/.github/workflows/release.yml +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/.gitignore +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/.pre-commit-config.yaml +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/CODE_OF_CONDUCT.md +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/CONTRIBUTING.md +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/LICENSE +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/README.md +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/cookbooks/ch01_get_started.md +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/cookbooks/ch02_concepts.md +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/dev_tools/count_code_base_lines.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/Makefile +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/_static/custom.css +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/_templates/layout.html +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/conf.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/index.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/modules/action.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/modules/adapter.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/modules/branch.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/modules/branch_operations.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/modules/concepts.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/modules/element_id.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/modules/event.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/modules/form.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/modules/graph.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/modules/index.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/modules/instruct.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/modules/lib_file.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/modules/lib_nested.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/modules/lib_package.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/modules/lib_schema.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/modules/lib_validate.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/modules/log.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/modules/mail.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/modules/message.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/modules/models.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/modules/operative_step.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/modules/pile.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/modules/processor.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/modules/progression.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/modules/service.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/modules/session.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/modules/utils.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/tutorials/get_started.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/tutorials/get_started_pt2.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/tutorials/get_started_pt3.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/docs/tutorials/index.rst +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/_class_registry.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/_errors.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/_types.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/file/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/file/chunk.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/file/file_ops.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/file/params.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/file/process.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/file/save.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/nested/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/nested/flatten.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/nested/nfilter.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/nested/nget.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/nested/ninsert.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/nested/nmerge.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/nested/npop.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/nested/nset.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/nested/unflatten.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/nested/utils.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/package/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/package/imports.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/package/management.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/package/params.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/package/system.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/parse.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/schema/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/schema/as_readable.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/schema/extract_code_block.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/schema/extract_docstring.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/schema/function_to_schema.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/schema/json_schema.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/token_transform/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/token_transform/llmlingua.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/token_transform/perplexity.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/token_transform/synthlang.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/validate/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/validate/common_field_validators.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/validate/fuzzy_match_keys.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/validate/fuzzy_validate_mapping.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/validate/string_similarity.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/libs/validate/validate_boolean.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/ReAct/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/_act/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/brainstorm/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/brainstorm/brainstorm.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/brainstorm/prompt.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/chat/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/chat/chat.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/communicate/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/communicate/communicate.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/instruct/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/instruct/instruct.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/interpret/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/manager.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/operate/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/parse/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/parse/parse.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/plan/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/plan/plan.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/plan/prompt.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/select/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/select/select.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/select/utils.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/translate/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/translate/translate.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/types.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operations/utils.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/action/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/action/function_calling.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/action/manager.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/action/request_response_model.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/action/tool.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/action/utils.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/forms/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/forms/base.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/forms/flow.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/forms/form.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/forms/report.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/instruct/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/instruct/base.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/instruct/instruct.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/instruct/instruct_collection.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/instruct/node.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/instruct/prompts.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/instruct/reason.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/manager.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/models/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/models/field_model.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/models/model_params.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/models/note.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/models/operable_model.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/models/schema_model.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/operative.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/step.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/strategies/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/strategies/base.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/strategies/concurrent.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/strategies/concurrent_chunk.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/strategies/concurrent_sequential_chunk.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/strategies/params.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/strategies/sequential.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/strategies/sequential_chunk.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/strategies/sequential_concurrent_chunk.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/strategies/utils.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/operatives/types.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/_concepts.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/adapters/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/adapters/adapter.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/adapters/json_adapter.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/adapters/pandas_/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/adapters/pandas_/csv_adapter.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/adapters/pandas_/excel_adapter.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/adapters/pandas_/pd_dataframe_adapter.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/adapters/pandas_/pd_series_adapter.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/adapters/types.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/generic/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/generic/element.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/generic/event.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/generic/log.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/generic/pile.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/generic/processor.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/generic/progression.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/graph/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/graph/edge.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/graph/graph.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/graph/node.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/mail/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/mail/exchange.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/mail/mail.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/mail/mailbox.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/mail/manager.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/mail/package.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/messages/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/messages/action_request.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/messages/action_response.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/messages/assistant_response.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/messages/base.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/messages/instruction.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/messages/manager.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/messages/message.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/messages/system.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/messages/templates/README.md +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/messages/templates/action_request.jinja2 +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/messages/templates/action_response.jinja2 +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/messages/templates/assistant_response.jinja2 +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/messages/templates/instruction_message.jinja2 +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/messages/templates/system_message.jinja2 +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/messages/templates/tool_schemas.jinja2 +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/protocols/types.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/service/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/service/endpoints/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/service/endpoints/base.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/service/endpoints/chat_completion.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/service/endpoints/match_endpoint.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/service/endpoints/rate_limited_processor.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/service/endpoints/token_calculator.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/service/imodel.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/service/manager.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/service/providers/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/service/providers/anthropic_/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/service/providers/anthropic_/messages.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/service/providers/exa_/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/service/providers/exa_/models.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/service/providers/exa_/search.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/service/providers/exa_/types.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/service/providers/groq_/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/service/providers/groq_/chat_completions.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/service/providers/openai_/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/service/providers/openai_/chat_completions.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/service/providers/openrouter_/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/service/providers/openrouter_/chat_completions.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/service/providers/perplexity_/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/service/providers/perplexity_/chat_completions.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/service/providers/perplexity_/models.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/service/providers/types.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/service/types.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/session/__init__.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/session/session.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/settings.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/lionagi/utils.py +0 -0
- {lionagi-0.8.5 → lionagi-0.8.6}/prompts/doc_style.md +0 -0
@@ -2,6 +2,8 @@
|
|
2
2
|
#
|
3
3
|
# SPDX-License-Identifier: Apache-2.0
|
4
4
|
|
5
|
+
import logging
|
6
|
+
|
5
7
|
from pydantic import BaseModel, Field
|
6
8
|
|
7
9
|
from . import _types as types
|
@@ -13,6 +15,9 @@ from .version import __version__
|
|
13
15
|
|
14
16
|
LiteiModel = iModel
|
15
17
|
|
18
|
+
logger = logging.getLogger(__name__)
|
19
|
+
logger.setLevel(logging.INFO)
|
20
|
+
|
16
21
|
__all__ = (
|
17
22
|
"Session",
|
18
23
|
"Branch",
|
@@ -24,4 +29,5 @@ __all__ = (
|
|
24
29
|
"__version__",
|
25
30
|
"BaseModel",
|
26
31
|
"Field",
|
32
|
+
"logger",
|
27
33
|
)
|
@@ -33,6 +33,7 @@ async def ReAct(
|
|
33
33
|
response_kwargs: dict | None = None,
|
34
34
|
return_analysis: bool = False,
|
35
35
|
analysis_model: iModel | None = None,
|
36
|
+
verbose_analysis: bool = False,
|
36
37
|
**kwargs,
|
37
38
|
):
|
38
39
|
# If no tools or tool schemas are provided, default to "all tools"
|
@@ -60,10 +61,13 @@ async def ReAct(
|
|
60
61
|
if isinstance(instruct, Instruct)
|
61
62
|
else dict(instruct)
|
62
63
|
)
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
64
|
+
|
65
|
+
# Overwrite "instruction" with the interpreted prompt (if any) plus a note about expansions
|
66
|
+
max_ext_info = f"\nIf needed, you can do up to {max_extensions or 0 if extension_allowed else 0} expansions."
|
67
|
+
instruct_dict["instruction"] = (
|
68
|
+
instruction_str
|
69
|
+
or (instruct_dict.get("instruction") or "") # in case it's missing
|
70
|
+
) + max_ext_info
|
67
71
|
|
68
72
|
# Prepare a copy of user-provided kwargs for the first operate call
|
69
73
|
kwargs_for_operate = copy(kwargs)
|
@@ -81,6 +85,12 @@ async def ReAct(
|
|
81
85
|
)
|
82
86
|
analyses = [analysis]
|
83
87
|
|
88
|
+
# If verbose, show round #1 analysis
|
89
|
+
if verbose_analysis:
|
90
|
+
print(
|
91
|
+
f"ReAct Round #1 Analysis:\n {analysis.model_dump_json(indent=2)}",
|
92
|
+
)
|
93
|
+
|
84
94
|
# Validate and clamp max_extensions if needed
|
85
95
|
if max_extensions and max_extensions > 5:
|
86
96
|
logging.warning("max_extensions should not exceed 5; defaulting to 5.")
|
@@ -88,6 +98,8 @@ async def ReAct(
|
|
88
98
|
|
89
99
|
# Step 2: Possibly loop through expansions if extension_needed
|
90
100
|
extensions = max_extensions
|
101
|
+
round_count = 1
|
102
|
+
|
91
103
|
while (
|
92
104
|
extension_allowed
|
93
105
|
and analysis.extension_needed
|
@@ -103,16 +115,28 @@ async def ReAct(
|
|
103
115
|
extensions=extensions
|
104
116
|
)
|
105
117
|
|
118
|
+
operate_kwargs = copy(kwargs)
|
119
|
+
operate_kwargs["actions"] = True
|
120
|
+
operate_kwargs["reason"] = True
|
121
|
+
operate_kwargs["response_format"] = ReActAnalysis
|
122
|
+
operate_kwargs["action_strategy"] = analysis.action_strategy
|
123
|
+
if analysis.action_batch_size:
|
124
|
+
operate_kwargs["action_batch_size"] = analysis.action_batch_size
|
125
|
+
|
106
126
|
analysis = await branch.operate(
|
107
127
|
instruction=new_instruction,
|
108
|
-
response_format=ReActAnalysis,
|
109
128
|
tools=tools,
|
110
129
|
tool_schemas=tool_schemas,
|
111
|
-
|
112
|
-
actions=True,
|
130
|
+
**operate_kwargs,
|
113
131
|
)
|
114
132
|
analyses.append(analysis)
|
133
|
+
round_count += 1
|
115
134
|
|
135
|
+
# If verbose, show round analysis
|
136
|
+
if verbose_analysis:
|
137
|
+
print(
|
138
|
+
f"ReAct Round #{round_count} Analysis:\n {analysis.model_dump_json(indent=2)}",
|
139
|
+
)
|
116
140
|
if extensions:
|
117
141
|
extensions -= 1
|
118
142
|
|
@@ -0,0 +1,92 @@
|
|
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 ClassVar, Literal
|
6
|
+
|
7
|
+
from pydantic import BaseModel, Field
|
8
|
+
|
9
|
+
|
10
|
+
class PlannedAction(BaseModel):
|
11
|
+
"""
|
12
|
+
Short descriptor for an upcoming action/tool invocation the LLM wants to perform.
|
13
|
+
The model can hold multiple actions in a single round if needed.
|
14
|
+
"""
|
15
|
+
|
16
|
+
action_type: str = Field(
|
17
|
+
...,
|
18
|
+
description="The name or type of tool/action to invoke (e.g., 'search_exa', 'reader_tool').",
|
19
|
+
)
|
20
|
+
description: str = Field(
|
21
|
+
...,
|
22
|
+
description="A short explanation of why or what is intended to achieve with this action.",
|
23
|
+
)
|
24
|
+
|
25
|
+
|
26
|
+
class ReActAnalysis(BaseModel):
|
27
|
+
"""
|
28
|
+
Captures the ReAct chain-of-thought output each round:
|
29
|
+
1) The LLM's 'analysis' (reasoning),
|
30
|
+
2) A list of planned actions to perform before finalizing,
|
31
|
+
3) Indication whether more expansions/rounds are needed,
|
32
|
+
4) Additional tuning knobs: how to handle validation, how to execute actions, etc.
|
33
|
+
"""
|
34
|
+
|
35
|
+
# Standard ReAct strings for controlling expansions:
|
36
|
+
FIRST_EXT_PROMPT: ClassVar[str] = (
|
37
|
+
"You can perform multiple reason-action steps for accuracy. "
|
38
|
+
"If you are not ready to finalize, set extension_needed to True. "
|
39
|
+
"You have up to {extensions} expansions. Please continue."
|
40
|
+
)
|
41
|
+
CONTINUE_EXT_PROMPT: ClassVar[str] = (
|
42
|
+
"Another round is available. You may do multiple actions if needed. "
|
43
|
+
"You have up to {extensions} expansions. Please continue."
|
44
|
+
)
|
45
|
+
ANSWER_PROMPT: ClassVar[str] = (
|
46
|
+
"Given your reasoning and actions, please now provide the final answer "
|
47
|
+
"to the user's request:\n\n{instruction}"
|
48
|
+
)
|
49
|
+
|
50
|
+
analysis: str = Field(
|
51
|
+
...,
|
52
|
+
description="Free-form reasoning or chain-of-thought summary. Must be consistent with the plan.",
|
53
|
+
)
|
54
|
+
|
55
|
+
planned_actions: list[PlannedAction] = Field(
|
56
|
+
default_factory=list,
|
57
|
+
description=(
|
58
|
+
"One or more short descriptors of the tool calls or operations "
|
59
|
+
"the LLM wants to perform this round. For example, read the doc, "
|
60
|
+
"then run a search."
|
61
|
+
),
|
62
|
+
)
|
63
|
+
|
64
|
+
extension_needed: bool = Field(
|
65
|
+
False,
|
66
|
+
description="Set True if more expansions are needed. If False, final answer is next.",
|
67
|
+
)
|
68
|
+
|
69
|
+
milestone: str | None = Field(
|
70
|
+
None,
|
71
|
+
description=(
|
72
|
+
"A sub-goal or mini-checkpoint to reach before finalizing. "
|
73
|
+
"E.g. 'Validate results from search_exa, then summarize outcomes.'"
|
74
|
+
),
|
75
|
+
)
|
76
|
+
|
77
|
+
action_strategy: Literal["sequential", "concurrent", "batch"] = Field(
|
78
|
+
"concurrent",
|
79
|
+
description=(
|
80
|
+
"Specifies how to invoke the planned actions:\n"
|
81
|
+
"'sequential' => Each action is run in order, \n"
|
82
|
+
"'concurrent' => All actions run in parallel, \n"
|
83
|
+
"'batch' => Divide actions into async batches of N (if reasonable)."
|
84
|
+
),
|
85
|
+
)
|
86
|
+
|
87
|
+
action_batch_size: int | None = Field(
|
88
|
+
None,
|
89
|
+
description=(
|
90
|
+
"provide if and only if action_strategy is 'batch', this specifies the number of actions to run in parallel per batch."
|
91
|
+
),
|
92
|
+
)
|
@@ -18,6 +18,7 @@ async def _act(
|
|
18
18
|
branch: "Branch",
|
19
19
|
action_request: BaseModel | dict,
|
20
20
|
suppress_errors: bool = False,
|
21
|
+
verbose_action: bool = False,
|
21
22
|
) -> "ActionResponseModel":
|
22
23
|
|
23
24
|
_request = {}
|
@@ -35,6 +36,11 @@ async def _act(
|
|
35
36
|
|
36
37
|
try:
|
37
38
|
func_call = await branch._action_manager.invoke(_request)
|
39
|
+
if verbose_action:
|
40
|
+
print(
|
41
|
+
f"Action {_request['function']} invoked, status: {func_call.status}."
|
42
|
+
)
|
43
|
+
|
38
44
|
except Exception as e:
|
39
45
|
content = {
|
40
46
|
"error": str(e),
|
@@ -43,6 +49,8 @@ async def _act(
|
|
43
49
|
"branch": str(branch.id),
|
44
50
|
}
|
45
51
|
branch._log_manager.log(Log(content=content))
|
52
|
+
if verbose_action:
|
53
|
+
print(f"Action {_request['function']} failed, error: {str(e)}.")
|
46
54
|
if suppress_errors:
|
47
55
|
logging.error(
|
48
56
|
f"Error invoking action '{_request['function']}': {e}"
|
@@ -0,0 +1,74 @@
|
|
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 TYPE_CHECKING
|
6
|
+
|
7
|
+
if TYPE_CHECKING:
|
8
|
+
from lionagi.session.branch import Branch
|
9
|
+
|
10
|
+
|
11
|
+
async def interpret(
|
12
|
+
branch: "Branch",
|
13
|
+
text: str,
|
14
|
+
domain: str | None = None,
|
15
|
+
style: str | None = None,
|
16
|
+
sample_writing: str | None = None,
|
17
|
+
**kwargs,
|
18
|
+
) -> str:
|
19
|
+
instruction = """
|
20
|
+
You are given a user's raw instruction or question. Your task is to rewrite it into a clearer, more structured prompt for an LLM or system, making any implicit or missing details explicit.
|
21
|
+
|
22
|
+
Follow these guidelines:
|
23
|
+
|
24
|
+
1. **Dissect the user's request**:
|
25
|
+
- If the user references a local file, note it clearly (e.g., "paper_file_path": "…").
|
26
|
+
- If the user might need external references or up-to-date data, mention that possibility.
|
27
|
+
- If the user's question is ambiguous, propose clarifications.
|
28
|
+
|
29
|
+
2. **Be explicit about the user's final objective**:
|
30
|
+
- For example, if the user wants a comparison with other works, add that as a bullet point or sub-question.
|
31
|
+
- If the user wants a summary plus code snippet, highlight that in your structured prompt.
|
32
|
+
|
33
|
+
3. **Do NOT produce final system actions**:
|
34
|
+
- You're not calling any tools directly here; only rewriting the user query to reflect potential next steps.
|
35
|
+
- If the user's request might require searching or doc reading, note it as an *option*, e.g. "Potential tool usage: {search, partial doc read}."
|
36
|
+
|
37
|
+
4. **Return only the improved user prompt**:
|
38
|
+
- The final output should be a single text block or short JSON specifying the clarified user request.
|
39
|
+
- Keep it concise yet thorough.
|
40
|
+
|
41
|
+
For instance, if the user's original text is:
|
42
|
+
"Please read my local PDF on RL and compare it to the newest research methods from exa or perplexity."
|
43
|
+
|
44
|
+
A re-written version might be:
|
45
|
+
"**Task**:
|
46
|
+
- Summarize the local PDF (paper_file_path: 'myRLpaper.pdf').
|
47
|
+
- Compare its approach with recent reinforcement learning research found via exa/perplexity searches.
|
48
|
+
**Potential Tool Usage**:
|
49
|
+
- Doc reading (reader_tool)
|
50
|
+
- External search (search_exa, search_perplexity)
|
51
|
+
**Output**:
|
52
|
+
- A structured summary + comparative analysis."
|
53
|
+
|
54
|
+
Now, apply this rewriting to the input below. Return only the re-written prompt.
|
55
|
+
"""
|
56
|
+
guidance = (
|
57
|
+
f"Domain hint: {domain or 'general'}. "
|
58
|
+
f"Desired style: {style or 'concise'}. "
|
59
|
+
)
|
60
|
+
if sample_writing:
|
61
|
+
guidance += f" Sample writing: {sample_writing}"
|
62
|
+
|
63
|
+
context = [f"User input: {text}"]
|
64
|
+
|
65
|
+
# Default temperature if none provided
|
66
|
+
kwargs["guidance"] = guidance + "\n" + kwargs.get("guidance", "")
|
67
|
+
kwargs["instruction"] = instruction + "\n" + kwargs.get("instruction", "")
|
68
|
+
kwargs["temperature"] = kwargs.get("temperature", 0.1)
|
69
|
+
|
70
|
+
refined_prompt = await branch.chat(
|
71
|
+
context=context,
|
72
|
+
**kwargs,
|
73
|
+
)
|
74
|
+
return str(refined_prompt)
|
@@ -50,6 +50,8 @@ async def operate(
|
|
50
50
|
action_strategy: Literal[
|
51
51
|
"sequential", "concurrent", "batch"
|
52
52
|
] = "concurrent",
|
53
|
+
action_batch_size: int = None,
|
54
|
+
verbose_action: bool = False,
|
53
55
|
field_models: list[FieldModel] = None,
|
54
56
|
exclude_fields: list | dict | None = None,
|
55
57
|
request_params: ModelParams = None,
|
@@ -189,9 +191,13 @@ async def operate(
|
|
189
191
|
if instruct.action_strategy
|
190
192
|
else action_kwargs.get("strategy", "concurrent")
|
191
193
|
)
|
194
|
+
if action_batch_size:
|
195
|
+
action_kwargs["batch_size"] = action_batch_size
|
192
196
|
|
193
197
|
action_response_models = await branch.act(
|
194
|
-
response_model.action_requests,
|
198
|
+
response_model.action_requests,
|
199
|
+
verbose_action=verbose_action,
|
200
|
+
**action_kwargs,
|
195
201
|
)
|
196
202
|
# Possibly refine the operative with the tool outputs
|
197
203
|
operative = Step.respond_operative(
|
@@ -48,6 +48,7 @@ from lionagi.protocols.types import (
|
|
48
48
|
from lionagi.service.endpoints.base import EndPoint
|
49
49
|
from lionagi.service.types import iModel, iModelManager
|
50
50
|
from lionagi.settings import Settings
|
51
|
+
from lionagi.tools.base import LionTool
|
51
52
|
from lionagi.utils import UNDEFINED, alcall, bcall, copy
|
52
53
|
|
53
54
|
if TYPE_CHECKING:
|
@@ -205,7 +206,9 @@ class Branch(Element, Communicatable, Relational):
|
|
205
206
|
)
|
206
207
|
|
207
208
|
# --- ActionManager ---
|
208
|
-
self._action_manager = ActionManager(
|
209
|
+
self._action_manager = ActionManager()
|
210
|
+
if tools:
|
211
|
+
self.register_tools(tools)
|
209
212
|
|
210
213
|
# --- LogManager ---
|
211
214
|
if log_config:
|
@@ -346,19 +349,28 @@ class Branch(Element, Communicatable, Relational):
|
|
346
349
|
|
347
350
|
return branch_clone
|
348
351
|
|
352
|
+
def _register_tool(self, tools: FuncTool | LionTool, update: bool = False):
|
353
|
+
if isinstance(tools, type) and issubclass(tools, LionTool):
|
354
|
+
tools = tools()
|
355
|
+
if isinstance(tools, LionTool):
|
356
|
+
tools = tools.to_tool()
|
357
|
+
self._action_manager.register_tool(tools, update=update)
|
358
|
+
|
349
359
|
def register_tools(
|
350
|
-
self, tools: FuncTool | list[FuncTool], update: bool = False
|
360
|
+
self, tools: FuncTool | list[FuncTool] | LionTool, update: bool = False
|
351
361
|
):
|
352
362
|
"""
|
353
363
|
Registers one or more tools in the ActionManager.
|
354
364
|
|
355
365
|
Args:
|
356
|
-
tools (FuncTool | list[FuncTool]):
|
366
|
+
tools (FuncTool | list[FuncTool] | LionTool):
|
357
367
|
A single tool or a list of tools to register.
|
358
368
|
update (bool, optional):
|
359
369
|
If `True`, updates existing tools with the same name.
|
360
370
|
"""
|
361
|
-
|
371
|
+
tools = [tools] if not isinstance(tools, list) else tools
|
372
|
+
for tool in tools:
|
373
|
+
self._register_tool(tool, update=update)
|
362
374
|
|
363
375
|
# -------------------------------------------------------------------------
|
364
376
|
# Conversion / Serialization
|
@@ -892,6 +904,11 @@ class Branch(Element, Communicatable, Relational):
|
|
892
904
|
actions: bool = False,
|
893
905
|
reason: bool = False,
|
894
906
|
action_kwargs: dict = None,
|
907
|
+
action_strategy: Literal[
|
908
|
+
"sequential", "concurrent", "batch"
|
909
|
+
] = "concurrent",
|
910
|
+
action_batch_size: int = None,
|
911
|
+
verbose_action: bool = False,
|
895
912
|
field_models: list[FieldModel] = None,
|
896
913
|
exclude_fields: list | dict | None = None,
|
897
914
|
request_params: ModelParams = None,
|
@@ -966,6 +983,12 @@ class Branch(Element, Communicatable, Relational):
|
|
966
983
|
If `True`, signals that the LLM should provide chain-of-thought or reasoning (where applicable).
|
967
984
|
action_kwargs (dict | None, optional):
|
968
985
|
Additional parameters for the `branch.act()` call if tools are invoked.
|
986
|
+
action_strategy (Literal["sequential","concurrent","batch"], optional):
|
987
|
+
The strategy for invoking tools (default: "concurrent").
|
988
|
+
action_batch_size (int, optional):
|
989
|
+
The batch size for concurrent tool invocation if `action_strategy="batch"`.
|
990
|
+
verbose_action (bool, optional):
|
991
|
+
If `True`, logs detailed information about tool invocation.
|
969
992
|
field_models (list[FieldModel] | None, optional):
|
970
993
|
Field-level definitions or overrides for the model schema.
|
971
994
|
exclude_fields (list|dict|None, optional):
|
@@ -1023,6 +1046,9 @@ class Branch(Element, Communicatable, Relational):
|
|
1023
1046
|
actions=actions,
|
1024
1047
|
reason=reason,
|
1025
1048
|
action_kwargs=action_kwargs,
|
1049
|
+
action_strategy=action_strategy,
|
1050
|
+
action_batch_size=action_batch_size,
|
1051
|
+
verbose_action=verbose_action,
|
1026
1052
|
field_models=field_models,
|
1027
1053
|
exclude_fields=exclude_fields,
|
1028
1054
|
request_params=request_params,
|
@@ -1150,6 +1176,7 @@ class Branch(Element, Communicatable, Relational):
|
|
1150
1176
|
self,
|
1151
1177
|
action_request: ActionRequest | BaseModel | dict,
|
1152
1178
|
suppress_errors: bool = False,
|
1179
|
+
verbose_action: bool = False,
|
1153
1180
|
) -> ActionResponse:
|
1154
1181
|
"""
|
1155
1182
|
Internal method to invoke a tool (action) asynchronously.
|
@@ -1165,13 +1192,19 @@ class Branch(Element, Communicatable, Relational):
|
|
1165
1192
|
"""
|
1166
1193
|
from lionagi.operations._act.act import _act
|
1167
1194
|
|
1168
|
-
return await _act(
|
1195
|
+
return await _act(
|
1196
|
+
branch=self,
|
1197
|
+
action_request=action_request,
|
1198
|
+
suppress_errors=suppress_errors,
|
1199
|
+
verbose_action=verbose_action,
|
1200
|
+
)
|
1169
1201
|
|
1170
1202
|
async def act(
|
1171
1203
|
self,
|
1172
1204
|
action_request: list | ActionRequest | BaseModel | dict,
|
1173
1205
|
*,
|
1174
1206
|
strategy: Literal["concurrent", "sequential", "batch"] = "concurrent",
|
1207
|
+
verbose_action: bool = False,
|
1175
1208
|
batch_size: int = None,
|
1176
1209
|
suppress_errors: bool = True,
|
1177
1210
|
sanitize_input: bool = False,
|
@@ -1197,6 +1230,10 @@ class Branch(Element, Communicatable, Relational):
|
|
1197
1230
|
action_request (list|ActionRequest|BaseModel|dict):
|
1198
1231
|
A single or list of action requests, each requiring
|
1199
1232
|
`function` and `arguments`.
|
1233
|
+
strategy (Literal["concurrent","sequential","batch"]):
|
1234
|
+
The execution strategy to use.
|
1235
|
+
verbose_action (bool):
|
1236
|
+
If True, log detailed information about the action.
|
1200
1237
|
suppress_errors (bool):
|
1201
1238
|
If True, log errors instead of raising exceptions.
|
1202
1239
|
sanitize_input (bool):
|
@@ -1243,6 +1280,7 @@ class Branch(Element, Communicatable, Relational):
|
|
1243
1280
|
case "concurrent":
|
1244
1281
|
return await self._concurrent_act(
|
1245
1282
|
action_request,
|
1283
|
+
verbose_action=verbose_action,
|
1246
1284
|
suppress_errors=suppress_errors,
|
1247
1285
|
sanitize_input=sanitize_input,
|
1248
1286
|
unique_input=unique_input,
|
@@ -1263,11 +1301,13 @@ class Branch(Element, Communicatable, Relational):
|
|
1263
1301
|
case "sequential":
|
1264
1302
|
return await self._sequential_act(
|
1265
1303
|
action_request,
|
1304
|
+
verbose_action=verbose_action,
|
1266
1305
|
suppress_errors=suppress_errors,
|
1267
1306
|
)
|
1268
1307
|
case "batch":
|
1269
1308
|
return await self._batch_act(
|
1270
1309
|
action_request,
|
1310
|
+
verbose_action=verbose_action,
|
1271
1311
|
batch_size=batch_size or 1,
|
1272
1312
|
max_concurrent=max_concurrent,
|
1273
1313
|
suppress_errors=suppress_errors,
|
@@ -1298,6 +1338,7 @@ class Branch(Element, Communicatable, Relational):
|
|
1298
1338
|
self,
|
1299
1339
|
action_request: ActionRequest | BaseModel | dict,
|
1300
1340
|
suppress_errors: bool = True,
|
1341
|
+
verbose_action: bool = False,
|
1301
1342
|
) -> list:
|
1302
1343
|
action_request = (
|
1303
1344
|
action_request
|
@@ -1307,7 +1348,11 @@ class Branch(Element, Communicatable, Relational):
|
|
1307
1348
|
results = []
|
1308
1349
|
for req in action_request:
|
1309
1350
|
results.append(
|
1310
|
-
await self._act(
|
1351
|
+
await self._act(
|
1352
|
+
req,
|
1353
|
+
verbose_action=verbose_action,
|
1354
|
+
suppress_errors=suppress_errors,
|
1355
|
+
)
|
1311
1356
|
)
|
1312
1357
|
return results
|
1313
1358
|
|
@@ -1560,6 +1605,7 @@ class Branch(Element, Communicatable, Relational):
|
|
1560
1605
|
response_kwargs: dict | None = None,
|
1561
1606
|
return_analysis: bool = False,
|
1562
1607
|
analysis_model: iModel | None = None,
|
1608
|
+
verbose: bool = False,
|
1563
1609
|
**kwargs,
|
1564
1610
|
):
|
1565
1611
|
"""
|
@@ -1646,6 +1692,8 @@ class Branch(Element, Communicatable, Relational):
|
|
1646
1692
|
response_kwargs=response_kwargs,
|
1647
1693
|
return_analysis=return_analysis,
|
1648
1694
|
analysis_model=analysis_model,
|
1695
|
+
verbose_action=verbose,
|
1696
|
+
verbose_analysis=verbose,
|
1649
1697
|
**kwargs,
|
1650
1698
|
)
|
1651
1699
|
|
File without changes
|