lionagi 0.7.0__tar.gz → 0.7.1__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {lionagi-0.7.0 → lionagi-0.7.1}/PKG-INFO +1 -1
- lionagi-0.7.1/docs/Makefile +23 -0
- lionagi-0.7.1/docs/_static/custom.css +89 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/docs/_templates/layout.html +23 -14
- lionagi-0.7.1/docs/conf.py +52 -0
- lionagi-0.7.1/docs/index.rst +37 -0
- lionagi-0.7.1/docs/modules/action.rst +128 -0
- lionagi-0.7.1/docs/modules/adapter.rst +120 -0
- lionagi-0.7.1/docs/modules/branch.rst +74 -0
- lionagi-0.7.1/docs/modules/branch_operations.rst +216 -0
- lionagi-0.7.1/docs/modules/concepts.rst +221 -0
- lionagi-0.7.1/docs/modules/element_id.rst +230 -0
- lionagi-0.7.1/docs/modules/event.rst +173 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/docs/modules/form.rst +7 -7
- lionagi-0.7.1/docs/modules/graph.rst +277 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/docs/modules/index.rst +6 -3
- {lionagi-0.7.0 → lionagi-0.7.1}/docs/modules/instruct.rst +4 -4
- {lionagi-0.7.0 → lionagi-0.7.1}/docs/modules/lib_nested.rst +3 -3
- {lionagi-0.7.0 → lionagi-0.7.1}/docs/modules/lib_validate.rst +1 -1
- lionagi-0.7.1/docs/modules/log.rst +240 -0
- lionagi-0.7.1/docs/modules/mail.rst +150 -0
- lionagi-0.7.1/docs/modules/message.rst +162 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/docs/modules/models.rst +2 -2
- lionagi-0.7.1/docs/modules/pile.rst +341 -0
- lionagi-0.7.1/docs/modules/processor.rst +236 -0
- lionagi-0.7.1/docs/modules/progression.rst +261 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/docs/modules/service.rst +3 -3
- {lionagi-0.7.0 → lionagi-0.7.1}/docs/modules/session.rst +2 -2
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/ReAct/ReAct.py +2 -2
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/communicate/communicate.py +0 -59
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/interpret/interpret.py +1 -2
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/operate/operate.py +10 -5
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/parse/parse.py +0 -36
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/plan/plan.py +3 -3
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/action/manager.py +105 -82
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/action/request_response_model.py +31 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/action/tool.py +50 -20
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/_concepts.py +1 -1
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/adapters/adapter.py +25 -0
- lionagi-0.7.1/lionagi/protocols/adapters/json_adapter.py +181 -0
- lionagi-0.7.1/lionagi/protocols/adapters/pandas_/csv_adapter.py +94 -0
- lionagi-0.7.1/lionagi/protocols/adapters/pandas_/excel_adapter.py +94 -0
- lionagi-0.7.1/lionagi/protocols/adapters/pandas_/pd_dataframe_adapter.py +81 -0
- lionagi-0.7.1/lionagi/protocols/adapters/pandas_/pd_series_adapter.py +57 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/generic/element.py +1 -1
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/generic/pile.py +5 -8
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/graph/edge.py +1 -1
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/graph/graph.py +16 -8
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/graph/node.py +1 -1
- lionagi-0.7.1/lionagi/protocols/mail/exchange.py +227 -0
- lionagi-0.7.1/lionagi/protocols/mail/mail.py +58 -0
- lionagi-0.7.1/lionagi/protocols/mail/mailbox.py +109 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/mail/manager.py +97 -41
- lionagi-0.7.1/lionagi/protocols/mail/package.py +109 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/messages/action_request.py +77 -26
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/messages/action_response.py +55 -26
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/messages/assistant_response.py +50 -15
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/messages/base.py +36 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/messages/instruction.py +175 -145
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/messages/manager.py +152 -56
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/messages/message.py +61 -25
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/messages/system.py +54 -19
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/service/imodel.py +24 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/session/branch.py +40 -32
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/utils.py +1 -0
- lionagi-0.7.1/lionagi/version.py +1 -0
- lionagi-0.7.1/prompts/doc_style.md +239 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/pyproject.toml +4 -1
- {lionagi-0.7.0 → lionagi-0.7.1}/uv.lock +349 -1
- lionagi-0.7.0/docs/Makefile +0 -20
- lionagi-0.7.0/docs/_static/custom.css +0 -59
- lionagi-0.7.0/docs/conf.py +0 -56
- lionagi-0.7.0/docs/index.rst +0 -35
- lionagi-0.7.0/docs/modules/action.rst +0 -339
- lionagi-0.7.0/docs/modules/adapter.rst +0 -241
- lionagi-0.7.0/docs/modules/branch.rst +0 -215
- lionagi-0.7.0/docs/modules/concepts.rst +0 -214
- lionagi-0.7.0/docs/modules/event.rst +0 -38
- lionagi-0.7.0/docs/modules/graph.rst +0 -238
- lionagi-0.7.0/docs/modules/mail.rst +0 -303
- lionagi-0.7.0/docs/modules/message.rst +0 -295
- lionagi-0.7.0/docs/modules/operations.rst +0 -111
- lionagi-0.7.0/docs/modules/pile_progression.rst +0 -324
- lionagi-0.7.0/docs/modules/strategies.rst +0 -140
- lionagi-0.7.0/docs/operations/core_operations.rst +0 -23
- lionagi-0.7.0/docs/operations/index.rst +0 -13
- lionagi-0.7.0/docs/operations/strategies.rst +0 -37
- lionagi-0.7.0/lionagi/protocols/adapters/json_adapter.py +0 -101
- lionagi-0.7.0/lionagi/protocols/adapters/pandas_/csv_adapter.py +0 -50
- lionagi-0.7.0/lionagi/protocols/adapters/pandas_/excel_adapter.py +0 -52
- lionagi-0.7.0/lionagi/protocols/adapters/pandas_/pd_dataframe_adapter.py +0 -31
- lionagi-0.7.0/lionagi/protocols/adapters/pandas_/pd_series_adapter.py +0 -17
- lionagi-0.7.0/lionagi/protocols/mail/exchange.py +0 -116
- lionagi-0.7.0/lionagi/protocols/mail/mail.py +0 -25
- lionagi-0.7.0/lionagi/protocols/mail/mailbox.py +0 -47
- lionagi-0.7.0/lionagi/protocols/mail/package.py +0 -55
- lionagi-0.7.0/lionagi/version.py +0 -1
- {lionagi-0.7.0 → lionagi-0.7.1}/.env.example +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/.github/FUNDING.yml +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/.github/dependabot.yml +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/.github/workflows/ci.yml +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/.github/workflows/codeql.yml +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/.github/workflows/docs.yml +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/.github/workflows/release.yml +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/.gitignore +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/.pre-commit-config.yaml +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/.python-version +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/CODE_OF_CONDUCT.md +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/CONTRIBUTING.md +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/LICENSE +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/README.md +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/dev_tools/count_code_base_lines.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/docs/modules/lib_file.rst +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/docs/modules/lib_package.rst +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/docs/modules/lib_schema.rst +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/docs/modules/operative_step.rst +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/docs/modules/utils.rst +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/docs/tutorials/get_started.rst +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/docs/tutorials/get_started_pt2.rst +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/docs/tutorials/get_started_pt3.rst +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/docs/tutorials/index.rst +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/_class_registry.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/_errors.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/file/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/file/chunk.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/file/file_ops.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/file/params.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/file/process.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/file/save.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/nested/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/nested/flatten.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/nested/nfilter.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/nested/nget.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/nested/ninsert.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/nested/nmerge.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/nested/npop.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/nested/nset.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/nested/unflatten.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/nested/utils.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/package/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/package/imports.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/package/management.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/package/params.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/package/system.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/parse.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/schema/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/schema/as_readable.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/schema/extract_code_block.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/schema/extract_docstring.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/schema/function_to_schema.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/schema/json_schema.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/token_transform/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/token_transform/llmlingua.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/token_transform/perplexity.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/token_transform/synthlang.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/validate/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/validate/common_field_validators.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/validate/fuzzy_match_keys.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/validate/fuzzy_validate_mapping.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/validate/string_similarity.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/libs/validate/validate_boolean.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/ReAct/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/ReAct/utils.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/_act/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/_act/act.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/brainstorm/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/brainstorm/brainstorm.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/brainstorm/prompt.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/chat/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/chat/chat.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/communicate/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/instruct/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/instruct/instruct.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/interpret/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/operate/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/parse/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/plan/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/plan/prompt.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/select/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/select/select.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/select/utils.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/translate/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/translate/translate.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/types.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operations/utils.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/action/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/action/function_calling.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/action/utils.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/forms/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/forms/base.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/forms/form.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/forms/report.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/forms/utils.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/instruct/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/instruct/base.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/instruct/instruct.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/instruct/instruct_collection.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/instruct/node.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/instruct/prompts.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/instruct/reason.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/manager.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/models/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/models/field_model.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/models/model_params.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/models/note.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/models/operable_model.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/models/schema_model.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/operative.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/step.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/strategies/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/strategies/base.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/strategies/concurrent.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/strategies/concurrent_chunk.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/strategies/concurrent_sequential_chunk.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/strategies/params.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/strategies/sequential.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/strategies/sequential_chunk.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/strategies/sequential_concurrent_chunk.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/strategies/utils.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/operatives/types.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/adapters/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/adapters/pandas_/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/adapters/types.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/generic/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/generic/event.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/generic/log.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/generic/processor.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/generic/progression.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/graph/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/mail/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/messages/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/messages/templates/README.md +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/messages/templates/action_request.jinja2 +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/messages/templates/action_response.jinja2 +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/messages/templates/assistant_response.jinja2 +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/messages/templates/instruction_message.jinja2 +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/messages/templates/system_message.jinja2 +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/messages/templates/tool_schemas.jinja2 +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/protocols/types.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/service/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/service/endpoints/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/service/endpoints/base.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/service/endpoints/chat_completion.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/service/endpoints/match_endpoint.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/service/endpoints/rate_limited_processor.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/service/endpoints/token_calculator.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/service/manager.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/service/providers/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/service/providers/anthropic_/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/service/providers/anthropic_/messages.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/service/providers/groq_/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/service/providers/groq_/chat_completions.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/service/providers/openai_/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/service/providers/openai_/chat_completions.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/service/providers/openrouter_/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/service/providers/openrouter_/chat_completions.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/service/providers/perplexity_/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/service/providers/perplexity_/chat_completions.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/service/types.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/session/__init__.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/session/session.py +0 -0
- {lionagi-0.7.0 → lionagi-0.7.1}/lionagi/settings.py +0 -0
@@ -0,0 +1,23 @@
|
|
1
|
+
SHELL = /bin/sh
|
2
|
+
|
3
|
+
SPHINXBUILD = sphinx-build
|
4
|
+
SOURCEDIR = .
|
5
|
+
BUILDDIR = _build
|
6
|
+
|
7
|
+
.PHONY: help clean html livehtml
|
8
|
+
|
9
|
+
help:
|
10
|
+
@echo "Please use 'make <target>' where <target> is one of:"
|
11
|
+
@echo " html to build the HTML documentation"
|
12
|
+
@echo " clean to remove build artifacts"
|
13
|
+
@echo " livehtml to run autobuild for live reloading"
|
14
|
+
|
15
|
+
clean:
|
16
|
+
rm -rf $(BUILDDIR)/*
|
17
|
+
|
18
|
+
html:
|
19
|
+
$(SPHINXBUILD) -M html "$(SOURCEDIR)" "$(BUILDDIR)"
|
20
|
+
|
21
|
+
# Optional: live reload docs as you edit
|
22
|
+
livehtml:
|
23
|
+
sphinx-autobuild $(SOURCEDIR) $(BUILDDIR)/html --port 8000
|
@@ -0,0 +1,89 @@
|
|
1
|
+
/* custom.css for your design overrides */
|
2
|
+
|
3
|
+
html {
|
4
|
+
font-size: 16px;
|
5
|
+
line-height: 1.6;
|
6
|
+
}
|
7
|
+
|
8
|
+
/* Constrain wide paragraphs for better readability on large screens */
|
9
|
+
@media (min-width: 1200px) {
|
10
|
+
.md-typeset {
|
11
|
+
max-width: 65ch;
|
12
|
+
}
|
13
|
+
|
14
|
+
/* Improve code block font & background a bit */
|
15
|
+
.highlight pre {
|
16
|
+
font-family: "JetBrains Mono", "Source Code Pro", monospace;
|
17
|
+
font-size: 0.9rem;
|
18
|
+
background: #f8f8f8;
|
19
|
+
border-radius: 4px;
|
20
|
+
}
|
21
|
+
|
22
|
+
/* Example custom coloring for notes/admonitions */
|
23
|
+
.admonition {
|
24
|
+
border-left: 4px solid var(--color-brand-primary);
|
25
|
+
margin: 1rem 0;
|
26
|
+
padding: 0.75rem 1rem;
|
27
|
+
}
|
28
|
+
|
29
|
+
/* Our custom GitHub header link container */
|
30
|
+
.my-custom-header {
|
31
|
+
margin: 0.75rem 1rem 0 1rem;
|
32
|
+
display: flex;
|
33
|
+
justify-content: flex-end;
|
34
|
+
align-items: center;
|
35
|
+
border-bottom: 1px solid var(--color-border-muted, #ccc);
|
36
|
+
padding-bottom: 0.5rem;
|
37
|
+
}
|
38
|
+
|
39
|
+
.my-custom-header .header-link {
|
40
|
+
display: inline-flex;
|
41
|
+
align-items: center;
|
42
|
+
gap: 0.4rem;
|
43
|
+
text-decoration: none;
|
44
|
+
color: var(--color-text-primary, #222);
|
45
|
+
background: var(--color-background-accent, #f5f5f5);
|
46
|
+
padding: 0.4rem 0.75rem;
|
47
|
+
border-radius: 6px;
|
48
|
+
font-weight: 500;
|
49
|
+
transition: background-color 0.2s ease, color 0.2s ease;
|
50
|
+
}
|
51
|
+
|
52
|
+
.my-custom-header .header-link:hover {
|
53
|
+
background: var(--color-background-accent-hover, #e0e0e0);
|
54
|
+
color: var(--color-text-primary-hover, #111);
|
55
|
+
}
|
56
|
+
|
57
|
+
/* GitHub icon sizing and transitions */
|
58
|
+
.my-custom-header .gh-icon {
|
59
|
+
width: 1.2em;
|
60
|
+
height: 1.2em;
|
61
|
+
flex-shrink: 0;
|
62
|
+
opacity: 0.8;
|
63
|
+
transition: opacity 0.2s ease;
|
64
|
+
}
|
65
|
+
|
66
|
+
.my-custom-header .header-link:hover .gh-icon {
|
67
|
+
opacity: 1.0;
|
68
|
+
}
|
69
|
+
|
70
|
+
/* Footer styling */
|
71
|
+
.my-custom-footer {
|
72
|
+
margin-top: 2rem;
|
73
|
+
padding-top: 1rem;
|
74
|
+
font-size: 0.9rem;
|
75
|
+
color: var(--color-text-secondary, #777);
|
76
|
+
border-top: 1px solid var(--color-border-muted, #ccc);
|
77
|
+
text-align: center;
|
78
|
+
}
|
79
|
+
|
80
|
+
.my-custom-footer a {
|
81
|
+
text-decoration: none;
|
82
|
+
color: var(--color-brand-primary, #3070a0);
|
83
|
+
font-weight: 500;
|
84
|
+
}
|
85
|
+
|
86
|
+
.my-custom-footer a:hover {
|
87
|
+
color: var(--color-brand-content, #3070a0);
|
88
|
+
}
|
89
|
+
}
|
@@ -1,18 +1,16 @@
|
|
1
1
|
{% extends "!layout.html" %}
|
2
2
|
|
3
3
|
{% block header %}
|
4
|
-
<!-- Our custom header container -->
|
5
4
|
<div class="my-custom-header">
|
6
|
-
<!-- A sleek "View on GitHub" link with an icon -->
|
7
5
|
<a class="header-link"
|
8
|
-
href="https://github.com/
|
6
|
+
href="https://github.com/your-org/your-repo"
|
9
7
|
target="_blank"
|
10
8
|
rel="noopener noreferrer"
|
11
|
-
title="
|
12
|
-
<!--
|
13
|
-
<svg class="gh-icon" xmlns="http://www.w3.org/2000/svg"
|
14
|
-
|
15
|
-
|
9
|
+
title="GitHub: your-org/your-repo">
|
10
|
+
<!-- Example GitHub icon (inlined) -->
|
11
|
+
<svg class="gh-icon" xmlns="http://www.w3.org/2000/svg" fill="currentColor"
|
12
|
+
viewBox="0 0 24 24" aria-hidden="true">
|
13
|
+
<path d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303
|
16
14
|
3.438 9.8 8.205 11.387.6.113.82-.258.82-.577
|
17
15
|
0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61
|
18
16
|
-.546-1.387-1.333-1.758-1.333-1.758-1.089-.744.083-.729.083-.729
|
@@ -26,9 +24,20 @@
|
|
26
24
|
5.92.43.372.81 1.102.81 2.221 0 1.604-.015
|
27
25
|
2.896-.015 3.286 0 .319.22.694.825.576C20.565
|
28
26
|
22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"/>
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
{% endblock %}
|
27
|
+
</svg>
|
28
|
+
<span>View on GitHub</span>
|
29
|
+
</a>
|
30
|
+
</div>
|
31
|
+
{{ super() }}
|
32
|
+
{% endblock %}
|
33
|
+
|
34
|
+
{% block footer %}
|
35
|
+
{{ super() }}
|
36
|
+
<div class="my-custom-footer">
|
37
|
+
<p>© 2025 Haiyang Li — Built with
|
38
|
+
<a href="https://www.sphinx-doc.org" target="_blank">Sphinx</a>
|
39
|
+
&
|
40
|
+
<a href="https://pradyunsg.me/furo/" target="_blank">Furo</a>.
|
41
|
+
</p>
|
42
|
+
</div>
|
43
|
+
{% endblock %}
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import os
|
2
|
+
import sys
|
3
|
+
|
4
|
+
# Insert your package directory so autodoc can find your modules
|
5
|
+
sys.path.insert(0, os.path.abspath(".."))
|
6
|
+
|
7
|
+
project = "LionAGI"
|
8
|
+
author = "Haiyang Li"
|
9
|
+
copyright = "2025"
|
10
|
+
release = "0.7"
|
11
|
+
|
12
|
+
extensions = [
|
13
|
+
"sphinx.ext.autodoc",
|
14
|
+
"sphinx.ext.napoleon",
|
15
|
+
"sphinx.ext.todo",
|
16
|
+
"sphinx.ext.viewcode",
|
17
|
+
]
|
18
|
+
|
19
|
+
templates_path = ["_templates"]
|
20
|
+
exclude_patterns = []
|
21
|
+
|
22
|
+
html_theme = "furo"
|
23
|
+
html_static_path = ["_static"]
|
24
|
+
html_title = "LionAGI Documentation"
|
25
|
+
|
26
|
+
html_theme_options = {
|
27
|
+
"sidebar_hide_name": True,
|
28
|
+
"navigation_with_keys": True,
|
29
|
+
# Hide the “On This Page” panel:
|
30
|
+
"light_css_variables": {
|
31
|
+
"color-brand-primary": "#3070a0",
|
32
|
+
"color-brand-content": "#3070a0",
|
33
|
+
"font-size--body": "16px",
|
34
|
+
},
|
35
|
+
"dark_css_variables": {
|
36
|
+
"color-brand-primary": "#5dafff",
|
37
|
+
"color-brand-content": "#5dafff",
|
38
|
+
},
|
39
|
+
}
|
40
|
+
pygments_style = "friendly"
|
41
|
+
pygments_dark_style = "solarized-dark"
|
42
|
+
|
43
|
+
html_css_files = [
|
44
|
+
"custom.css", # loads after theme CSS
|
45
|
+
]
|
46
|
+
|
47
|
+
# If you want a logo, place 'logo.png' in _static/
|
48
|
+
# html_logo = "_static/logo.png"
|
49
|
+
|
50
|
+
# Example: Add any additional Sphinx config below
|
51
|
+
# napoleon_use_param = True
|
52
|
+
# todo_include_todos = True
|
@@ -0,0 +1,37 @@
|
|
1
|
+
.. _lionagi-docs-index:
|
2
|
+
|
3
|
+
====================================================
|
4
|
+
LionAGI — Documentation Home Page
|
5
|
+
====================================================
|
6
|
+
|
7
|
+
Welcome to LionAGI's documentation! This site covers how to use LionAGI's
|
8
|
+
features, including:
|
9
|
+
|
10
|
+
- **Branch**: the main conversation manager,
|
11
|
+
- **Adapters**: converting data to/from external formats,
|
12
|
+
- **Operations**: powerful LLM flows (operate, instruct, parse, etc.),
|
13
|
+
- **Action system**: function-calling, advanced multi-step flows, and more.
|
14
|
+
|
15
|
+
If you're new, start with the **Tutorials**. If you're looking for deeper
|
16
|
+
API references, check out the **Modules** sections.
|
17
|
+
|
18
|
+
Contents
|
19
|
+
========
|
20
|
+
|
21
|
+
.. toctree::
|
22
|
+
:maxdepth: 2
|
23
|
+
:caption: Table of Contents:
|
24
|
+
|
25
|
+
tutorials/index
|
26
|
+
modules/index
|
27
|
+
|
28
|
+
Indices and tables
|
29
|
+
==================
|
30
|
+
|
31
|
+
.. toctree::
|
32
|
+
:maxdepth: 1
|
33
|
+
:caption: Indices & Tables
|
34
|
+
|
35
|
+
genindex
|
36
|
+
modindex
|
37
|
+
search
|
@@ -0,0 +1,128 @@
|
|
1
|
+
.. _lionagi-action-system:
|
2
|
+
|
3
|
+
================================================
|
4
|
+
Action System
|
5
|
+
================================================
|
6
|
+
.. module:: lionagi.operatives.action
|
7
|
+
:synopsis: Tools, requests, and managers for function-based actions.
|
8
|
+
|
9
|
+
Overview
|
10
|
+
--------
|
11
|
+
The **action** system enables **function calling** within LionAGI:
|
12
|
+
|
13
|
+
- **Tools** wrap a Python callable with optional pre/post processors and schema-based validation.
|
14
|
+
- **FunctionCalling** is a specialized `Event` that executes these tools.
|
15
|
+
- **ActionManager** registers multiple Tools for invocation by requests.
|
16
|
+
- **ActionRequestModel** and **ActionResponseModel** define standardized message formats
|
17
|
+
for specifying which function to call, with what arguments, and returning the function's output.
|
18
|
+
|
19
|
+
Contents
|
20
|
+
--------
|
21
|
+
.. contents::
|
22
|
+
:local:
|
23
|
+
:depth: 2
|
24
|
+
|
25
|
+
|
26
|
+
FunctionCalling
|
27
|
+
---------------
|
28
|
+
.. automodule:: lionagi.operatives.action.function_calling
|
29
|
+
:members:
|
30
|
+
:undoc-members:
|
31
|
+
:show-inheritance:
|
32
|
+
|
33
|
+
The :class:`FunctionCalling` class extends :class:`~lionagi.protocols.generic.event.Event`
|
34
|
+
to manage the entire lifecycle of a **tool** invocation, including optional
|
35
|
+
pre and post processing. It updates :attr:`execution` with status, duration,
|
36
|
+
and any output or error.
|
37
|
+
|
38
|
+
|
39
|
+
ActionManager
|
40
|
+
-------------
|
41
|
+
.. automodule:: lionagi.operatives.action.manager
|
42
|
+
:members:
|
43
|
+
:undoc-members:
|
44
|
+
:show-inheritance:
|
45
|
+
|
46
|
+
A specialized :class:`~lionagi.protocols._concepts.Manager` that keeps a
|
47
|
+
registry of **tools** (functions). It also provides an `invoke` method for
|
48
|
+
easily executing a registered function, given an :class:`ActionRequest` or
|
49
|
+
its Pydantic model.
|
50
|
+
|
51
|
+
|
52
|
+
Request & Response Models
|
53
|
+
-------------------------
|
54
|
+
.. automodule:: lionagi.operatives.action.request_response_model
|
55
|
+
:members:
|
56
|
+
:undoc-members:
|
57
|
+
:show-inheritance:
|
58
|
+
|
59
|
+
Contains pydantic classes:
|
60
|
+
- :class:`ActionRequestModel`: For specifying `function` and `arguments`.
|
61
|
+
- :class:`ActionResponseModel`: For indicating the function output.
|
62
|
+
|
63
|
+
|
64
|
+
Tool
|
65
|
+
----
|
66
|
+
.. automodule:: lionagi.operatives.action.tool
|
67
|
+
:members:
|
68
|
+
:undoc-members:
|
69
|
+
:show-inheritance:
|
70
|
+
|
71
|
+
Defines :class:`Tool`, which wraps a Python callable and auto-generates a JSON schema
|
72
|
+
describing its parameters. Also includes type aliases like ``FuncTool``.
|
73
|
+
|
74
|
+
Utilities
|
75
|
+
---------
|
76
|
+
.. automodule:: lionagi.operatives.action.utils
|
77
|
+
:members:
|
78
|
+
:undoc-members:
|
79
|
+
|
80
|
+
Internal helpers, including constants for field descriptions and the
|
81
|
+
function `parse_action_request` for parsing a JSON string into a list
|
82
|
+
of requests.
|
83
|
+
|
84
|
+
|
85
|
+
Example Usage
|
86
|
+
-------------
|
87
|
+
A short example of how to use these classes:
|
88
|
+
|
89
|
+
.. code-block:: python
|
90
|
+
|
91
|
+
from lionagi.operatives.action.manager import ActionManager
|
92
|
+
from lionagi.operatives.action.request_response_model import ActionRequestModel
|
93
|
+
|
94
|
+
# 1. Create an action manager and register a function
|
95
|
+
def multiply(x, y):
|
96
|
+
return x * y
|
97
|
+
|
98
|
+
manager = ActionManager()
|
99
|
+
manager.register_tool(multiply)
|
100
|
+
|
101
|
+
# 2. Build an ActionRequestModel
|
102
|
+
request_data = {"function": "multiply", "arguments": {"x": 3, "y": 4}}
|
103
|
+
action_request = ActionRequestModel.model_validate(request_data)
|
104
|
+
|
105
|
+
# 3. Invoke
|
106
|
+
result_event = await manager.invoke(action_request)
|
107
|
+
print(result_event.execution.response) # Should show 12
|
108
|
+
|
109
|
+
|
110
|
+
File Locations
|
111
|
+
--------------
|
112
|
+
- **function_calling.py**:
|
113
|
+
The :class:`FunctionCalling` event for executing tools.
|
114
|
+
|
115
|
+
- **manager.py** (ActionManager):
|
116
|
+
The main manager for registering and invoking Tools.
|
117
|
+
|
118
|
+
- **request_response_model.py**:
|
119
|
+
Pydantic-based models for requests/responses.
|
120
|
+
|
121
|
+
- **tool.py**:
|
122
|
+
The :class:`Tool` class that wraps a callable function with schema info.
|
123
|
+
|
124
|
+
- **utils.py**:
|
125
|
+
Shared utility constants and a simple parser method for requests.
|
126
|
+
|
127
|
+
``Copyright (c) 2023 - 2024, HaiyangLi <quantocean.li at gmail dot com>``
|
128
|
+
``SPDX-License-Identifier: Apache-2.0``
|
@@ -0,0 +1,120 @@
|
|
1
|
+
.. _lionagi-adapters:
|
2
|
+
|
3
|
+
=========================================
|
4
|
+
Adapter System
|
5
|
+
=========================================
|
6
|
+
.. module:: lionagi.protocols.adapters
|
7
|
+
:synopsis: Provides a unified interface for converting data to/from external formats.
|
8
|
+
|
9
|
+
Overview
|
10
|
+
--------
|
11
|
+
This system introduces the concept of an **Adapter** that knows how to
|
12
|
+
translate an internal object (like a Pydantic-based Element or a
|
13
|
+
``Collective``) to an external representation (JSON, CSV, Excel, Pandas
|
14
|
+
DataFrame, etc.), and vice versa. Adapters are registered in a global
|
15
|
+
:class:`AdapterRegistry` under a specific **key** (like ``".csv"`` or
|
16
|
+
``"pd_dataframe"``), allowing other code to call ``adapt_from`` or
|
17
|
+
``adapt_to`` generically.
|
18
|
+
|
19
|
+
Contents
|
20
|
+
--------
|
21
|
+
.. contents::
|
22
|
+
:local:
|
23
|
+
:depth: 2
|
24
|
+
|
25
|
+
|
26
|
+
Adapter and Registry
|
27
|
+
--------------------
|
28
|
+
.. automodule:: lionagi.protocols.adapters.adapter
|
29
|
+
:members:
|
30
|
+
:undoc-members:
|
31
|
+
:show-inheritance:
|
32
|
+
|
33
|
+
:class:`Adapter` is a Python protocol specifying two methods:
|
34
|
+
``from_obj()`` and ``to_obj()``. The :class:`AdapterRegistry` is a
|
35
|
+
container that associates each adapter with a key or extension.
|
36
|
+
|
37
|
+
|
38
|
+
JSON Adapters
|
39
|
+
-------------
|
40
|
+
.. automodule:: lionagi.protocols.adapters.json_adapter
|
41
|
+
:members:
|
42
|
+
:undoc-members:
|
43
|
+
:show-inheritance:
|
44
|
+
|
45
|
+
- **JsonAdapter**: For reading/writing **in-memory** JSON strings.
|
46
|
+
- **JsonFileAdapter**: For reading/writing JSON files from disk.
|
47
|
+
|
48
|
+
|
49
|
+
CSV and Excel Adapters
|
50
|
+
----------------------
|
51
|
+
.. automodule:: lionagi.protocols.adapters.pandas_.csv_adapter
|
52
|
+
:members:
|
53
|
+
:undoc-members:
|
54
|
+
:show-inheritance:
|
55
|
+
|
56
|
+
Provides **CSVFileAdapter** using pandas.
|
57
|
+
|
58
|
+
.. automodule:: lionagi.protocols.adapters.pandas_.excel_adapter
|
59
|
+
:members:
|
60
|
+
:undoc-members:
|
61
|
+
:show-inheritance:
|
62
|
+
|
63
|
+
Provides **ExcelFileAdapter** for `.xlsx` files with pandas.
|
64
|
+
|
65
|
+
|
66
|
+
Pandas DataFrame and Series Adapters
|
67
|
+
------------------------------------
|
68
|
+
.. automodule:: lionagi.protocols.adapters.pandas_.pd_dataframe_adapter
|
69
|
+
:members:
|
70
|
+
:undoc-members:
|
71
|
+
:show-inheritance:
|
72
|
+
|
73
|
+
**PandasDataFrameAdapter** handles converting a list of elements
|
74
|
+
to a single ``pd.DataFrame``, or a DataFrame back into a list of
|
75
|
+
dictionaries.
|
76
|
+
|
77
|
+
.. automodule:: lionagi.protocols.adapters.pandas_.pd_series_adapter
|
78
|
+
:members:
|
79
|
+
:undoc-members:
|
80
|
+
:show-inheritance:
|
81
|
+
|
82
|
+
**PandasSeriesAdapter** transforms a single item to/from a
|
83
|
+
single-row ``pd.Series``.
|
84
|
+
|
85
|
+
|
86
|
+
Example Usage
|
87
|
+
-------------
|
88
|
+
Below is a simple snippet using the registry:
|
89
|
+
|
90
|
+
.. code-block:: python
|
91
|
+
|
92
|
+
from lionagi.protocols.adapters.adapter import AdapterRegistry
|
93
|
+
from lionagi.protocols.adapters.json_adapter import JsonAdapter
|
94
|
+
|
95
|
+
# Register the adapter
|
96
|
+
AdapterRegistry.register(JsonAdapter)
|
97
|
+
|
98
|
+
# Suppose we have some object with `to_dict()`
|
99
|
+
my_element = SomeElement()
|
100
|
+
|
101
|
+
# Convert to JSON string
|
102
|
+
json_str = AdapterRegistry.adapt_to(my_element, "json")
|
103
|
+
|
104
|
+
# Convert JSON back into a dictionary
|
105
|
+
parsed = AdapterRegistry.adapt_from(type(my_element), json_str, "json")
|
106
|
+
|
107
|
+
# Typically, you'd then call `SomeElement.from_dict(parsed)` if needed.
|
108
|
+
|
109
|
+
|
110
|
+
File Locations
|
111
|
+
--------------
|
112
|
+
- **adapter.py**: The core protocol (Adapter) and :class:`AdapterRegistry`.
|
113
|
+
- **json_adapter.py**: In-memory JSON and JSON-file adapters.
|
114
|
+
- **pandas_/csv_adapter.py**: CSV file adapter.
|
115
|
+
- **pandas_/excel_adapter.py**: Excel file adapter (.xlsx).
|
116
|
+
- **pandas_/pd_dataframe_adapter.py**: DataFrame adapter.
|
117
|
+
- **pandas_/pd_series_adapter.py**: Series adapter.
|
118
|
+
|
119
|
+
``Copyright (c) 2023 - 2024, HaiyangLi <quantocean.li at gmail dot com>``
|
120
|
+
``SPDX-License-Identifier: Apache-2.0``
|
@@ -0,0 +1,74 @@
|
|
1
|
+
.. _lionagi-branch-class:
|
2
|
+
|
3
|
+
================================================
|
4
|
+
Branch: The Orchestrator
|
5
|
+
================================================
|
6
|
+
.. module:: lionagi.session.branch
|
7
|
+
:synopsis: Provides the Branch class to manage conversation, actions, logs, etc.
|
8
|
+
|
9
|
+
Overview
|
10
|
+
--------
|
11
|
+
A :class:`Branch` represents a single “branch” of conversation in LionAGI.
|
12
|
+
It **manages**:
|
13
|
+
|
14
|
+
- A :class:`~lionagi.protocols.generic.log.LogManager` for storing logs,
|
15
|
+
- A :class:`~lionagi.protocols.generic.log.LogManagerConfig` (if needed),
|
16
|
+
- A :class:`~lionagi.protocols.generic.element.Element` as the base object,
|
17
|
+
- A :class:`~lionagi.protocols.types.Communicatable` mailbox for cross-branch communication,
|
18
|
+
- A :class:`~lionagi.protocols.types.Relational` link,
|
19
|
+
- A :class:`~lionagi.protocols.types.SenderRecipient` to identify user or role,
|
20
|
+
- A :class:`MessageManager` for messages (system instructions, user instructions, model responses),
|
21
|
+
- An :class:`ActionManager` for tools,
|
22
|
+
- An :class:`iModelManager` for multiple LLM or model references (like “chat”, “parse”),
|
23
|
+
- Utility methods for “chat,” “operate,” “parse,” “act,” etc. (documented in :ref:`lionagi-branch-operations`).
|
24
|
+
|
25
|
+
Contents
|
26
|
+
--------
|
27
|
+
.. contents::
|
28
|
+
:local:
|
29
|
+
:depth: 2
|
30
|
+
|
31
|
+
|
32
|
+
Branch
|
33
|
+
------
|
34
|
+
.. autoclass:: lionagi.session.branch.Branch
|
35
|
+
:members:
|
36
|
+
:undoc-members:
|
37
|
+
:show-inheritance:
|
38
|
+
|
39
|
+
The key attributes include:
|
40
|
+
|
41
|
+
- **Messages** (via :attr:`msgs`)
|
42
|
+
- **Logs** (via :attr:`logs`)
|
43
|
+
- **Tools** (via :attr:`acts`)
|
44
|
+
- **Models** (via :attr:`mdls`)
|
45
|
+
- **Mailbox** (for external messaging)
|
46
|
+
|
47
|
+
**Common usage**:
|
48
|
+
1. Instantiate a Branch, optionally providing a system message and some initial tools.
|
49
|
+
2. Use :meth:`chat` or :meth:`communicate` for user queries.
|
50
|
+
3. If you want structured responses or function calls, use :meth:`operate`.
|
51
|
+
4. If you want to parse or validate final text, use :meth:`parse`.
|
52
|
+
5. Tools can be registered anytime via :attr:`acts` or with the arguments
|
53
|
+
to the constructor.
|
54
|
+
|
55
|
+
Also includes mailbox-based methods like :meth:`send` and :meth:`receive`
|
56
|
+
for cross-branch or cross-system communication in a multi-agent scenario.
|
57
|
+
|
58
|
+
|
59
|
+
Key Differences from a Basic Session
|
60
|
+
------------------------------------
|
61
|
+
Where a simpler “session” might just store messages + call an LLM,
|
62
|
+
**Branch** expands that concept by:
|
63
|
+
|
64
|
+
- Integrating advanced log management with a :class:`LogManager`.
|
65
|
+
- Holding a mailbox (like an email or queue system) so that branches
|
66
|
+
can pass :class:`Package` objects to each other.
|
67
|
+
- Tying in a :class:`ActionManager` for immediate function or tool calls.
|
68
|
+
- Potentially linking to a “Graph” node or referencing relations
|
69
|
+
(due to the :class:`Relational` inheritance).
|
70
|
+
- Providing **clone** operations if you want to copy the conversation
|
71
|
+
state to a new branch.
|
72
|
+
|
73
|
+
``Copyright (c) 2023 - 2024, HaiyangLi <quantocean.li at gmail dot com>``
|
74
|
+
``SPDX-License-Identifier: Apache-2.0``
|