lionagi 0.7.1__tar.gz → 0.7.2__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {lionagi-0.7.1 → lionagi-0.7.2}/PKG-INFO +1 -1
- lionagi-0.7.2/docs/modules/action.rst +585 -0
- lionagi-0.7.2/docs/modules/adapter.rst +641 -0
- lionagi-0.7.2/docs/modules/branch.rst +144 -0
- lionagi-0.7.2/docs/modules/branch_operations.rst +745 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/modules/concepts.rst +2 -4
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/modules/element_id.rst +1 -2
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/modules/form.rst +12 -3
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/modules/graph.rst +3 -11
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/modules/log.rst +3 -8
- lionagi-0.7.2/docs/modules/mail.rst +343 -0
- lionagi-0.7.2/docs/modules/message.rst +668 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/modules/operative_step.rst +16 -14
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/modules/pile.rst +1 -4
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/modules/processor.rst +4 -6
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/modules/progression.rst +8 -10
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/modules/service.rst +21 -16
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/_act/act.py +10 -3
- lionagi-0.7.2/lionagi/version.py +1 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/pyproject.toml +1 -1
- lionagi-0.7.1/docs/modules/action.rst +0 -128
- lionagi-0.7.1/docs/modules/adapter.rst +0 -120
- lionagi-0.7.1/docs/modules/branch.rst +0 -74
- lionagi-0.7.1/docs/modules/branch_operations.rst +0 -216
- lionagi-0.7.1/docs/modules/mail.rst +0 -150
- lionagi-0.7.1/docs/modules/message.rst +0 -162
- lionagi-0.7.1/lionagi/version.py +0 -1
- {lionagi-0.7.1 → lionagi-0.7.2}/.env.example +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/.github/FUNDING.yml +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/.github/dependabot.yml +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/.github/workflows/ci.yml +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/.github/workflows/codeql.yml +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/.github/workflows/docs.yml +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/.github/workflows/release.yml +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/.gitignore +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/.pre-commit-config.yaml +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/.python-version +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/CODE_OF_CONDUCT.md +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/CONTRIBUTING.md +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/LICENSE +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/README.md +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/dev_tools/count_code_base_lines.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/Makefile +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/_static/custom.css +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/_templates/layout.html +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/conf.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/index.rst +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/modules/event.rst +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/modules/index.rst +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/modules/instruct.rst +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/modules/lib_file.rst +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/modules/lib_nested.rst +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/modules/lib_package.rst +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/modules/lib_schema.rst +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/modules/lib_validate.rst +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/modules/models.rst +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/modules/session.rst +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/modules/utils.rst +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/tutorials/get_started.rst +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/tutorials/get_started_pt2.rst +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/tutorials/get_started_pt3.rst +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/docs/tutorials/index.rst +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/_class_registry.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/_errors.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/file/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/file/chunk.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/file/file_ops.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/file/params.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/file/process.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/file/save.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/nested/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/nested/flatten.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/nested/nfilter.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/nested/nget.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/nested/ninsert.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/nested/nmerge.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/nested/npop.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/nested/nset.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/nested/unflatten.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/nested/utils.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/package/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/package/imports.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/package/management.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/package/params.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/package/system.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/parse.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/schema/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/schema/as_readable.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/schema/extract_code_block.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/schema/extract_docstring.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/schema/function_to_schema.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/schema/json_schema.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/token_transform/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/token_transform/llmlingua.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/token_transform/perplexity.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/token_transform/synthlang.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/validate/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/validate/common_field_validators.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/validate/fuzzy_match_keys.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/validate/fuzzy_validate_mapping.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/validate/string_similarity.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/libs/validate/validate_boolean.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/ReAct/ReAct.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/ReAct/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/ReAct/utils.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/_act/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/brainstorm/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/brainstorm/brainstorm.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/brainstorm/prompt.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/chat/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/chat/chat.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/communicate/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/communicate/communicate.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/instruct/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/instruct/instruct.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/interpret/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/interpret/interpret.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/operate/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/operate/operate.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/parse/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/parse/parse.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/plan/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/plan/plan.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/plan/prompt.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/select/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/select/select.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/select/utils.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/translate/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/translate/translate.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/types.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operations/utils.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/action/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/action/function_calling.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/action/manager.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/action/request_response_model.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/action/tool.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/action/utils.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/forms/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/forms/base.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/forms/form.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/forms/report.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/forms/utils.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/instruct/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/instruct/base.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/instruct/instruct.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/instruct/instruct_collection.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/instruct/node.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/instruct/prompts.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/instruct/reason.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/manager.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/models/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/models/field_model.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/models/model_params.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/models/note.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/models/operable_model.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/models/schema_model.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/operative.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/step.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/strategies/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/strategies/base.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/strategies/concurrent.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/strategies/concurrent_chunk.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/strategies/concurrent_sequential_chunk.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/strategies/params.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/strategies/sequential.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/strategies/sequential_chunk.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/strategies/sequential_concurrent_chunk.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/strategies/utils.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/operatives/types.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/_concepts.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/adapters/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/adapters/adapter.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/adapters/json_adapter.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/adapters/pandas_/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/adapters/pandas_/csv_adapter.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/adapters/pandas_/excel_adapter.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/adapters/pandas_/pd_dataframe_adapter.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/adapters/pandas_/pd_series_adapter.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/adapters/types.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/generic/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/generic/element.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/generic/event.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/generic/log.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/generic/pile.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/generic/processor.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/generic/progression.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/graph/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/graph/edge.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/graph/graph.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/graph/node.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/mail/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/mail/exchange.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/mail/mail.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/mail/mailbox.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/mail/manager.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/mail/package.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/messages/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/messages/action_request.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/messages/action_response.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/messages/assistant_response.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/messages/base.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/messages/instruction.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/messages/manager.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/messages/message.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/messages/system.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/messages/templates/README.md +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/messages/templates/action_request.jinja2 +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/messages/templates/action_response.jinja2 +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/messages/templates/assistant_response.jinja2 +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/messages/templates/instruction_message.jinja2 +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/messages/templates/system_message.jinja2 +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/messages/templates/tool_schemas.jinja2 +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/protocols/types.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/service/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/service/endpoints/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/service/endpoints/base.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/service/endpoints/chat_completion.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/service/endpoints/match_endpoint.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/service/endpoints/rate_limited_processor.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/service/endpoints/token_calculator.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/service/imodel.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/service/manager.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/service/providers/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/service/providers/anthropic_/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/service/providers/anthropic_/messages.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/service/providers/groq_/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/service/providers/groq_/chat_completions.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/service/providers/openai_/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/service/providers/openai_/chat_completions.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/service/providers/openrouter_/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/service/providers/openrouter_/chat_completions.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/service/providers/perplexity_/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/service/providers/perplexity_/chat_completions.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/service/types.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/session/__init__.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/session/branch.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/session/session.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/settings.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/lionagi/utils.py +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/prompts/doc_style.md +0 -0
- {lionagi-0.7.1 → lionagi-0.7.2}/uv.lock +0 -0
@@ -0,0 +1,585 @@
|
|
1
|
+
.. _lionagi-action-system:
|
2
|
+
|
3
|
+
================================================
|
4
|
+
Action System
|
5
|
+
================================================
|
6
|
+
|
7
|
+
Overview
|
8
|
+
--------
|
9
|
+
The **action** system enables **function calling** within LionAGI:
|
10
|
+
|
11
|
+
- **Tools** wrap a Python callable with optional pre/post processors and schema-based validation.
|
12
|
+
- **FunctionCalling** is a specialized `Event` that executes these tools.
|
13
|
+
- **ActionManager** registers multiple Tools for invocation by requests.
|
14
|
+
- **ActionRequestModel** and **ActionResponseModel** define standardized protocols
|
15
|
+
for specifying which function to call, with what arguments, and returning the function's output.
|
16
|
+
|
17
|
+
Contents
|
18
|
+
--------
|
19
|
+
.. contents::
|
20
|
+
:local:
|
21
|
+
:depth: 2
|
22
|
+
|
23
|
+
|
24
|
+
FunctionCalling
|
25
|
+
---------------
|
26
|
+
|
27
|
+
The :class:`FunctionCalling` class extends :class:`~lionagi.protocols.generic.event.Event`
|
28
|
+
to manage the entire lifecycle of a **tool** invocation, including optional
|
29
|
+
pre and post processing. It updates :attr:`execution` with status, duration,
|
30
|
+
and any output or error.
|
31
|
+
|
32
|
+
Class Documentation
|
33
|
+
^^^^^^^^^^^^^^^^^
|
34
|
+
|
35
|
+
.. class:: FunctionCalling
|
36
|
+
:module: lionagi.operatives.action.function_calling
|
37
|
+
|
38
|
+
**Inherits from**: :class:`~lionagi.protocols.generic.event.Event`
|
39
|
+
|
40
|
+
Handles asynchronous function execution with pre/post processing.
|
41
|
+
This class manages function calls with optional preprocessing and
|
42
|
+
postprocessing, handling both synchronous and asynchronous functions.
|
43
|
+
|
44
|
+
Attributes
|
45
|
+
----------
|
46
|
+
func_tool : Tool
|
47
|
+
Tool instance containing the function to be called
|
48
|
+
arguments : dict[str, Any]
|
49
|
+
Dictionary of arguments to pass to the function
|
50
|
+
|
51
|
+
Methods
|
52
|
+
-------
|
53
|
+
invoke()
|
54
|
+
Execute the function call with pre/post processing.
|
55
|
+
to_dict()
|
56
|
+
Convert instance to dictionary.
|
57
|
+
|
58
|
+
Properties
|
59
|
+
----------
|
60
|
+
function
|
61
|
+
Returns the underlying function from func_tool.
|
62
|
+
|
63
|
+
Examples
|
64
|
+
--------
|
65
|
+
>>> def multiply(x, y):
|
66
|
+
... return x * y
|
67
|
+
>>> tool = Tool(func_callable=multiply)
|
68
|
+
>>> func_call = FunctionCalling(func_tool=tool, arguments={"x": 3, "y": 4})
|
69
|
+
>>> await func_call.invoke()
|
70
|
+
>>> print(func_call.execution.response) # Should show 12
|
71
|
+
|
72
|
+
Method Documentation
|
73
|
+
^^^^^^^^^^^^^^^^^^
|
74
|
+
|
75
|
+
.. method:: FunctionCalling.invoke()
|
76
|
+
|
77
|
+
Execute the function call with pre/post processing.
|
78
|
+
|
79
|
+
Handles both synchronous and asynchronous functions, including optional
|
80
|
+
preprocessing of arguments and postprocessing of results. Updates the
|
81
|
+
execution status, duration, and response/error.
|
82
|
+
|
83
|
+
Returns
|
84
|
+
-------
|
85
|
+
None
|
86
|
+
|
87
|
+
.. method:: FunctionCalling.to_dict()
|
88
|
+
|
89
|
+
Convert instance to dictionary.
|
90
|
+
|
91
|
+
Returns
|
92
|
+
-------
|
93
|
+
dict[str, Any]
|
94
|
+
Dictionary representation of the instance including function name
|
95
|
+
and arguments.
|
96
|
+
|
97
|
+
|
98
|
+
ActionManager
|
99
|
+
-------------
|
100
|
+
|
101
|
+
A specialized :class:`~lionagi.protocols._concepts.Manager` that keeps a
|
102
|
+
registry of **tools** (functions). It also provides an `invoke` method for
|
103
|
+
easily executing a registered function, given an :class:`ActionRequest` or
|
104
|
+
its Pydantic model.
|
105
|
+
|
106
|
+
Class Documentation
|
107
|
+
^^^^^^^^^^^^^^^^^
|
108
|
+
|
109
|
+
.. class:: ActionManager
|
110
|
+
:module: lionagi.operatives.action.manager
|
111
|
+
|
112
|
+
**Inherits from**: :class:`~lionagi.protocols._concepts.Manager`
|
113
|
+
|
114
|
+
A manager that registers function-based tools and invokes them
|
115
|
+
when triggered by an ActionRequest. Tools can be registered
|
116
|
+
individually or in bulk, and each tool must have a unique name.
|
117
|
+
|
118
|
+
Parameters
|
119
|
+
----------
|
120
|
+
*args : FuncTool
|
121
|
+
A variable number of tools or callables.
|
122
|
+
**kwargs
|
123
|
+
Additional named arguments that are also considered tools.
|
124
|
+
|
125
|
+
Attributes
|
126
|
+
----------
|
127
|
+
registry : dict[str, Tool]
|
128
|
+
Dictionary mapping function names to Tool instances.
|
129
|
+
|
130
|
+
Methods
|
131
|
+
-------
|
132
|
+
register_tool(tool, update=False)
|
133
|
+
Register a single tool/callable in the manager.
|
134
|
+
register_tools(tools, update=False)
|
135
|
+
Register multiple tools at once.
|
136
|
+
match_tool(action_request)
|
137
|
+
Convert an ActionRequest into a FunctionCalling instance.
|
138
|
+
invoke(func_call)
|
139
|
+
High-level API to parse and run a function call.
|
140
|
+
get_tool_schema(tools=False, auto_register=True, update=False)
|
141
|
+
Retrieve schemas for a subset of tools or for all.
|
142
|
+
|
143
|
+
Properties
|
144
|
+
----------
|
145
|
+
schema_list
|
146
|
+
Return the list of JSON schemas for all registered tools.
|
147
|
+
|
148
|
+
Method Documentation
|
149
|
+
^^^^^^^^^^^^^^^^^^
|
150
|
+
|
151
|
+
.. method:: ActionManager.register_tool(tool, update=False)
|
152
|
+
|
153
|
+
Register a single tool/callable in the manager.
|
154
|
+
|
155
|
+
Parameters
|
156
|
+
----------
|
157
|
+
tool : FuncTool
|
158
|
+
A `Tool` object or a raw callable function.
|
159
|
+
update : bool, default=False
|
160
|
+
If True, allow replacing an existing tool with the same name.
|
161
|
+
|
162
|
+
Raises
|
163
|
+
------
|
164
|
+
ValueError
|
165
|
+
If tool already registered and update=False.
|
166
|
+
TypeError
|
167
|
+
If `tool` is not a Tool or callable.
|
168
|
+
|
169
|
+
.. method:: ActionManager.register_tools(tools, update=False)
|
170
|
+
|
171
|
+
Register multiple tools at once.
|
172
|
+
|
173
|
+
Parameters
|
174
|
+
----------
|
175
|
+
tools : list[FuncTool] | FuncTool
|
176
|
+
A single or list of tools/callables.
|
177
|
+
update : bool, default=False
|
178
|
+
If True, allow updating existing tools.
|
179
|
+
|
180
|
+
Raises
|
181
|
+
------
|
182
|
+
ValueError
|
183
|
+
If a duplicate tool is found and update=False.
|
184
|
+
TypeError
|
185
|
+
If any item is not a Tool or callable.
|
186
|
+
|
187
|
+
.. method:: ActionManager.match_tool(action_request)
|
188
|
+
|
189
|
+
Convert an ActionRequest (or dict with "function"/"arguments")
|
190
|
+
into a `FunctionCalling` instance by finding the matching tool.
|
191
|
+
|
192
|
+
Parameters
|
193
|
+
----------
|
194
|
+
action_request : ActionRequest | ActionRequestModel | dict
|
195
|
+
The request specifying which function to call and with what arguments.
|
196
|
+
|
197
|
+
Returns
|
198
|
+
-------
|
199
|
+
FunctionCalling
|
200
|
+
The event object that can be invoked.
|
201
|
+
|
202
|
+
Raises
|
203
|
+
------
|
204
|
+
TypeError
|
205
|
+
If `action_request` is an unsupported type.
|
206
|
+
ValueError
|
207
|
+
If no matching tool is found in the registry.
|
208
|
+
|
209
|
+
.. method:: ActionManager.invoke(func_call)
|
210
|
+
|
211
|
+
High-level API to parse and run a function call.
|
212
|
+
|
213
|
+
Steps:
|
214
|
+
1) Convert `func_call` to FunctionCalling via `match_tool`.
|
215
|
+
2) `invoke()` the resulting object.
|
216
|
+
3) Return the `FunctionCalling`, which includes `execution`.
|
217
|
+
|
218
|
+
Parameters
|
219
|
+
----------
|
220
|
+
func_call : ActionRequestModel | ActionRequest
|
221
|
+
The action request model or ActionRequest object.
|
222
|
+
|
223
|
+
Returns
|
224
|
+
-------
|
225
|
+
FunctionCalling
|
226
|
+
The event object after execution completes.
|
227
|
+
|
228
|
+
.. method:: ActionManager.get_tool_schema(tools=False, auto_register=True, update=False)
|
229
|
+
|
230
|
+
Retrieve schemas for a subset of tools or for all.
|
231
|
+
|
232
|
+
Parameters
|
233
|
+
----------
|
234
|
+
tools : ToolRef, default=False
|
235
|
+
- If True, return schema for all tools.
|
236
|
+
- If False, return an empty dict.
|
237
|
+
- If specific tool(s), returns only those schemas.
|
238
|
+
auto_register : bool, default=True
|
239
|
+
If a tool (callable) is not yet in the registry, register if True.
|
240
|
+
update : bool, default=False
|
241
|
+
If True, allow updating existing tools.
|
242
|
+
|
243
|
+
Returns
|
244
|
+
-------
|
245
|
+
dict
|
246
|
+
Dictionary containing tool schemas, e.g., {"tools": [list of schemas]}
|
247
|
+
|
248
|
+
Raises
|
249
|
+
------
|
250
|
+
ValueError
|
251
|
+
If requested tool is not found and auto_register=False.
|
252
|
+
TypeError
|
253
|
+
If tool specification is invalid.
|
254
|
+
|
255
|
+
|
256
|
+
Request & Response Models
|
257
|
+
-------------------------
|
258
|
+
|
259
|
+
Contains Pydantic models for action requests and responses. These models typically map
|
260
|
+
to conversation messages describing which function is called, with what arguments,
|
261
|
+
and any returned output.
|
262
|
+
|
263
|
+
Class Documentation
|
264
|
+
^^^^^^^^^^^^^^^^^
|
265
|
+
|
266
|
+
.. class:: ActionRequestModel
|
267
|
+
:module: lionagi.operatives.action.request_response_model
|
268
|
+
|
269
|
+
**Inherits from**: :class:`pydantic.BaseModel`
|
270
|
+
|
271
|
+
Captures a single action request.
|
272
|
+
Includes the name of the function and the arguments.
|
273
|
+
|
274
|
+
Attributes
|
275
|
+
----------
|
276
|
+
function : str | None
|
277
|
+
Name of the function to call (e.g., "multiply", "create_user")
|
278
|
+
arguments : dict[str, Any] | None
|
279
|
+
Dictionary of arguments to pass to the function
|
280
|
+
|
281
|
+
Methods
|
282
|
+
-------
|
283
|
+
create(content)
|
284
|
+
Class method to parse a string into one or more ActionRequestModel instances.
|
285
|
+
|
286
|
+
Examples
|
287
|
+
--------
|
288
|
+
>>> request = ActionRequestModel(
|
289
|
+
... function="multiply",
|
290
|
+
... arguments={"x": 3, "y": 4}
|
291
|
+
... )
|
292
|
+
|
293
|
+
Method Documentation
|
294
|
+
^^^^^^^^^^^^^^^^^^
|
295
|
+
|
296
|
+
.. method:: ActionRequestModel.create(content)
|
297
|
+
|
298
|
+
Attempt to parse a string (usually from a conversation or JSON) into
|
299
|
+
one or more ActionRequestModel instances.
|
300
|
+
|
301
|
+
Parameters
|
302
|
+
----------
|
303
|
+
content : str
|
304
|
+
String content to parse.
|
305
|
+
|
306
|
+
Returns
|
307
|
+
-------
|
308
|
+
list[ActionRequestModel]
|
309
|
+
List of parsed request models. Returns empty list if no valid structure found.
|
310
|
+
|
311
|
+
.. class:: ActionResponseModel
|
312
|
+
:module: lionagi.operatives.action.request_response_model
|
313
|
+
|
314
|
+
**Inherits from**: :class:`pydantic.BaseModel`
|
315
|
+
|
316
|
+
Encapsulates a function's output after being called. Typically
|
317
|
+
references the original function name, arguments, and the result.
|
318
|
+
|
319
|
+
Attributes
|
320
|
+
----------
|
321
|
+
function : str
|
322
|
+
Name of the function that was called
|
323
|
+
arguments : dict[str, Any]
|
324
|
+
Dictionary of arguments that were passed
|
325
|
+
output : Any
|
326
|
+
The function's return value or output
|
327
|
+
|
328
|
+
Examples
|
329
|
+
--------
|
330
|
+
>>> response = ActionResponseModel(
|
331
|
+
... function="multiply",
|
332
|
+
... arguments={"x": 3, "y": 4},
|
333
|
+
... output=12
|
334
|
+
... )
|
335
|
+
|
336
|
+
Field Models
|
337
|
+
^^^^^^^^^^^
|
338
|
+
|
339
|
+
The module also defines two field models for use in other Pydantic models:
|
340
|
+
|
341
|
+
- ``ACTION_REQUESTS_FIELD``: For lists of action requests
|
342
|
+
- ``ACTION_RESPONSES_FIELD``: For lists of action responses
|
343
|
+
|
344
|
+
|
345
|
+
Tool
|
346
|
+
----
|
347
|
+
|
348
|
+
The Tool module provides functionality for wrapping Python callables with additional
|
349
|
+
features like pre/post-processing and automatic schema generation.
|
350
|
+
|
351
|
+
Class Documentation
|
352
|
+
^^^^^^^^^^^^^^^^^
|
353
|
+
|
354
|
+
.. class:: Tool
|
355
|
+
:module: lionagi.operatives.action.tool
|
356
|
+
|
357
|
+
**Inherits from**: :class:`pydantic.BaseModel`
|
358
|
+
|
359
|
+
Wraps a callable function with optional preprocessing of arguments,
|
360
|
+
postprocessing of results, and strict or partial argument matching.
|
361
|
+
The tool_schema is auto-generated from the function signature if not provided.
|
362
|
+
|
363
|
+
Parameters
|
364
|
+
----------
|
365
|
+
func_callable : Callable[..., Any]
|
366
|
+
The callable function to be wrapped by the tool
|
367
|
+
tool_schema : dict[str, Any] | None, optional
|
368
|
+
Schema describing the function's parameters and structure
|
369
|
+
preprocessor : Callable[[Any], Any] | None, optional
|
370
|
+
Optional function for preprocessing inputs before execution
|
371
|
+
preprocessor_kwargs : dict[str, Any], optional
|
372
|
+
Keyword arguments passed to the preprocessor function
|
373
|
+
postprocessor : Callable[[Any], Any] | None, optional
|
374
|
+
Optional function for postprocessing outputs after execution
|
375
|
+
postprocessor_kwargs : dict[str, Any], optional
|
376
|
+
Keyword arguments passed to the postprocessor function
|
377
|
+
strict_func_call : bool, default=False
|
378
|
+
Whether to enforce strict validation of function parameters
|
379
|
+
|
380
|
+
Properties
|
381
|
+
----------
|
382
|
+
function : str
|
383
|
+
Return the function name from the auto-generated schema
|
384
|
+
required_fields : set[str]
|
385
|
+
Return the set of required parameter names from the schema
|
386
|
+
minimum_acceptable_fields : set[str]
|
387
|
+
Return the set of parameters that have no default values
|
388
|
+
|
389
|
+
Methods
|
390
|
+
-------
|
391
|
+
to_dict()
|
392
|
+
Serialize the Tool to a dict, including the function name
|
393
|
+
|
394
|
+
Type Aliases
|
395
|
+
^^^^^^^^^^^
|
396
|
+
|
397
|
+
.. data:: FuncTool
|
398
|
+
|
399
|
+
Type alias representing either a `Tool` instance or a raw callable function.
|
400
|
+
``Tool | Callable[..., Any]``
|
401
|
+
|
402
|
+
.. data:: FuncToolRef
|
403
|
+
|
404
|
+
Type alias for a reference to a function-based tool, by either the actual object,
|
405
|
+
the raw callable, or the function name as a string.
|
406
|
+
``FuncTool | str``
|
407
|
+
|
408
|
+
.. data:: ToolRef
|
409
|
+
|
410
|
+
Type alias used for specifying one or more tool references, or a boolean
|
411
|
+
indicating 'all' or 'none'.
|
412
|
+
``FuncToolRef | list[FuncToolRef] | bool``
|
413
|
+
|
414
|
+
Helper Functions
|
415
|
+
^^^^^^^^^^^^^^
|
416
|
+
|
417
|
+
.. function:: func_to_tool(func, **kwargs)
|
418
|
+
|
419
|
+
Convenience function that wraps a raw function in a `Tool`.
|
420
|
+
|
421
|
+
Parameters
|
422
|
+
----------
|
423
|
+
func : Callable[..., Any]
|
424
|
+
The function to wrap
|
425
|
+
**kwargs
|
426
|
+
Additional arguments passed to the `Tool` constructor
|
427
|
+
|
428
|
+
Returns
|
429
|
+
-------
|
430
|
+
Tool
|
431
|
+
A new Tool instance wrapping `func`
|
432
|
+
|
433
|
+
Examples
|
434
|
+
^^^^^^^^
|
435
|
+
|
436
|
+
.. code-block:: python
|
437
|
+
|
438
|
+
def greet(name: str, greeting: str = "Hello") -> str:
|
439
|
+
return f"{greeting}, {name}!"
|
440
|
+
|
441
|
+
# Basic tool creation
|
442
|
+
tool = Tool(func_callable=greet)
|
443
|
+
|
444
|
+
# With preprocessing
|
445
|
+
def preprocess(args):
|
446
|
+
args["name"] = args["name"].title()
|
447
|
+
return args
|
448
|
+
|
449
|
+
tool_with_prep = Tool(
|
450
|
+
func_callable=greet,
|
451
|
+
preprocessor=preprocess,
|
452
|
+
strict_func_call=True
|
453
|
+
)
|
454
|
+
|
455
|
+
Utilities
|
456
|
+
---------
|
457
|
+
|
458
|
+
Internal helpers for parsing action requests and validating fields.
|
459
|
+
|
460
|
+
Functions
|
461
|
+
^^^^^^^^
|
462
|
+
|
463
|
+
.. function:: parse_action_request(content)
|
464
|
+
|
465
|
+
Attempt to parse a string or dictionary into a list of action request
|
466
|
+
dictionaries. Handles various input formats including JSON strings,
|
467
|
+
Python code blocks, and dictionaries.
|
468
|
+
|
469
|
+
Parameters
|
470
|
+
----------
|
471
|
+
content : str | dict
|
472
|
+
The content to parse, either as a string or dictionary.
|
473
|
+
|
474
|
+
Returns
|
475
|
+
-------
|
476
|
+
list[dict]
|
477
|
+
List of dictionaries, each containing 'function' and 'arguments' keys.
|
478
|
+
|
479
|
+
Field Models
|
480
|
+
^^^^^^^^^^^
|
481
|
+
|
482
|
+
.. data:: FUNCTION_FIELD
|
483
|
+
|
484
|
+
Field model for function names with validation.
|
485
|
+
|
486
|
+
Attributes
|
487
|
+
----------
|
488
|
+
name : str
|
489
|
+
"function"
|
490
|
+
default : None
|
491
|
+
Default value is None
|
492
|
+
annotation : str | None
|
493
|
+
Type annotation
|
494
|
+
description : str
|
495
|
+
Description of how to use the function field
|
496
|
+
examples : list
|
497
|
+
Example function names like ["add", "multiply", "divide"]
|
498
|
+
|
499
|
+
.. data:: ARGUMENTS_FIELD
|
500
|
+
|
501
|
+
Field model for function arguments with validation.
|
502
|
+
|
503
|
+
Attributes
|
504
|
+
----------
|
505
|
+
name : str
|
506
|
+
"arguments"
|
507
|
+
default_factory : dict
|
508
|
+
Default value is an empty dict
|
509
|
+
annotation : dict | None
|
510
|
+
Type annotation
|
511
|
+
description : str
|
512
|
+
Description of how to use the arguments field
|
513
|
+
examples : list
|
514
|
+
Example argument dictionaries
|
515
|
+
|
516
|
+
.. data:: ACTION_REQUIRED_FIELD
|
517
|
+
|
518
|
+
Field model indicating whether actions are required.
|
519
|
+
|
520
|
+
Attributes
|
521
|
+
----------
|
522
|
+
name : str
|
523
|
+
"action_required"
|
524
|
+
default : bool
|
525
|
+
Default value is False
|
526
|
+
annotation : bool
|
527
|
+
Type annotation
|
528
|
+
description : str
|
529
|
+
Description of when actions are required vs optional
|
530
|
+
|
531
|
+
Field Descriptions
|
532
|
+
^^^^^^^^^^^^^^^^^
|
533
|
+
|
534
|
+
The module provides several constant strings describing fields:
|
535
|
+
|
536
|
+
- ``function_field_description``: Guidelines for function name field
|
537
|
+
- ``arguments_field_description``: Guidelines for arguments field
|
538
|
+
- ``action_required_field_description``: Guidelines for required flag
|
539
|
+
- ``action_requests_field_description``: Guidelines for request lists
|
540
|
+
|
541
|
+
|
542
|
+
Example Usage
|
543
|
+
-------------
|
544
|
+
A short example of how to use these classes:
|
545
|
+
|
546
|
+
.. code-block:: python
|
547
|
+
|
548
|
+
from lionagi.operatives.action.manager import ActionManager
|
549
|
+
from lionagi.operatives.action.request_response_model import ActionRequestModel
|
550
|
+
|
551
|
+
# 1. Create an action manager and register a function
|
552
|
+
def multiply(x, y):
|
553
|
+
return x * y
|
554
|
+
|
555
|
+
manager = ActionManager()
|
556
|
+
manager.register_tool(multiply)
|
557
|
+
|
558
|
+
# 2. Build an ActionRequestModel
|
559
|
+
request_data = {"function": "multiply", "arguments": {"x": 3, "y": 4}}
|
560
|
+
action_request = ActionRequestModel.model_validate(request_data)
|
561
|
+
|
562
|
+
# 3. Invoke
|
563
|
+
result_event = await manager.invoke(action_request)
|
564
|
+
print(result_event.execution.response) # Should show 12
|
565
|
+
|
566
|
+
|
567
|
+
File Locations
|
568
|
+
--------------
|
569
|
+
- **function_calling.py**:
|
570
|
+
The :class:`FunctionCalling` event for executing tools.
|
571
|
+
|
572
|
+
- **manager.py** (ActionManager):
|
573
|
+
The main manager for registering and invoking Tools.
|
574
|
+
|
575
|
+
- **request_response_model.py**:
|
576
|
+
Pydantic-based models for requests/responses.
|
577
|
+
|
578
|
+
- **tool.py**:
|
579
|
+
The :class:`Tool` class that wraps a callable function with schema info.
|
580
|
+
|
581
|
+
- **utils.py**:
|
582
|
+
Shared utility constants and a simple parser method for requests.
|
583
|
+
|
584
|
+
``Copyright (c) 2023 - 2024, HaiyangLi <quantocean.li at gmail dot com>``
|
585
|
+
``SPDX-License-Identifier: Apache-2.0``
|