lionagi 0.14.6__tar.gz → 0.14.8__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.14.6 → lionagi-0.14.8}/PKG-INFO +72 -41
- {lionagi-0.14.6 → lionagi-0.14.8}/README.md +64 -23
- lionagi-0.14.8/cookbooks/007_fan_out_in.py +110 -0
- lionagi-0.14.8/cookbooks/claude_proxy/README.md +31 -0
- lionagi-0.14.8/cookbooks/claude_proxy/claude_code_proxy.py +132 -0
- lionagi-0.14.8/cookbooks/claude_proxy/run_w_claude_code_proxy.ipynb +217 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/fields/instruct.py +0 -1
- lionagi-0.14.8/lionagi/libs/hash/__init__.py +3 -0
- lionagi-0.14.8/lionagi/libs/hash/hash_dict.py +108 -0
- lionagi-0.14.8/lionagi/libs/hash/manager.py +26 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/models/hashable_model.py +2 -1
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/messages/message.py +3 -1
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/connections/providers/_claude_code/models.py +13 -4
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/connections/providers/_claude_code/stream_cli.py +9 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/types.py +2 -1
- lionagi-0.14.8/lionagi/version.py +1 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/pyproject.toml +16 -22
- lionagi-0.14.8/uv.lock +5622 -0
- lionagi-0.14.6/lionagi/version.py +0 -1
- lionagi-0.14.6/uv.lock +0 -5036
- {lionagi-0.14.6 → lionagi-0.14.8}/.coveragerc +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/.env.example +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/.github/FUNDING.yml +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/.github/dependabot.yml +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/.github/workflows/ci.yml +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/.github/workflows/codeql.yml +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/.github/workflows/docs.yml +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/.github/workflows/release.yml +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/.gitignore +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/.pre-commit-config.yaml +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/.python-version +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/CODE_OF_CONDUCT.md +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/CONTRIBUTING.md +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/LICENSE +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/assets/operation_builder.gif +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/cookbooks/001_branch_converse.ipynb +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/cookbooks/002_branch_interact.ipynb +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/cookbooks/003_branch_info.ipynb +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/cookbooks/004_conversation_patterns.ipynb +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/cookbooks/005_react_basics.ipynb +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/cookbooks/006_operation_graphs_claim_extraction.ipynb +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/cookbooks/data/002_comedian.json +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/cookbooks/data/002_critic.json +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/cookbooks/data/006_lion_proof_ch2.md +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/cookbooks/using_claude_code.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/Makefile +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/_static/custom.css +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/_templates/layout.html +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/conf.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/discussions/anyio-migration.md +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/index.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/modules/action.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/modules/adapter.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/modules/branch.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/modules/branch_operations.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/modules/concepts.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/modules/element_id.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/modules/event.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/modules/form.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/modules/graph.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/modules/index.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/modules/instruct.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/modules/lib_file.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/modules/lib_nested.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/modules/lib_package.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/modules/lib_schema.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/modules/lib_validate.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/modules/log.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/modules/mail.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/modules/message.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/modules/models.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/modules/operative_step.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/modules/pile.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/modules/processor.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/modules/progression.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/modules/service.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/modules/session.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/modules/utils.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/tutorials/get_started.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/tutorials/get_started_pt2.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/tutorials/get_started_pt3.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/docs/tutorials/index.rst +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/_class_registry.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/_errors.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/_types.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/adapters/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/adapters/async_postgres_adapter.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/adapters/postgres_model_adapter.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/config.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/fields/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/fields/action.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/fields/base.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/fields/code.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/fields/file.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/fields/reason.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/fields/research.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/concurrency/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/concurrency/cancel.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/concurrency/errors.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/concurrency/patterns.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/concurrency/primitives.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/concurrency/resource_tracker.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/concurrency/task.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/file/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/file/chunk.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/file/concat.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/file/concat_files.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/file/file_ops.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/file/params.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/file/process.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/file/save.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/nested/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/nested/flatten.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/nested/nfilter.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/nested/nget.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/nested/ninsert.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/nested/nmerge.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/nested/npop.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/nested/nset.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/nested/unflatten.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/nested/utils.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/package/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/package/imports.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/package/management.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/package/params.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/package/system.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/parse.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/schema/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/schema/as_readable.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/schema/extract_code_block.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/schema/extract_docstring.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/schema/function_to_schema.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/schema/json_schema.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/schema/load_pydantic_model_from_schema.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/token_transform/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/token_transform/base.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/token_transform/llmlingua.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/token_transform/perplexity.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/token_transform/symbolic_compress_context.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/token_transform/synthlang.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/token_transform/synthlang_/base.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/token_transform/synthlang_/resources/frameworks/abstract_algebra.toml +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/token_transform/synthlang_/resources/frameworks/category_theory.toml +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/token_transform/synthlang_/resources/frameworks/complex_analysis.toml +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/token_transform/synthlang_/resources/frameworks/framework_options.json +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/token_transform/synthlang_/resources/frameworks/group_theory.toml +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/token_transform/synthlang_/resources/frameworks/math_logic.toml +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/token_transform/synthlang_/resources/frameworks/reflective_patterns.toml +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/token_transform/synthlang_/resources/frameworks/set_theory.toml +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/token_transform/synthlang_/resources/frameworks/topology_fundamentals.toml +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/token_transform/synthlang_/resources/mapping/lion_emoji_mapping.toml +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/token_transform/synthlang_/resources/mapping/python_math_mapping.toml +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/token_transform/synthlang_/resources/mapping/rust_chinese_mapping.toml +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/token_transform/synthlang_/resources/utility/base_synthlang_system_prompt.toml +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/token_transform/synthlang_/translate_to_synthlang.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/token_transform/types.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/validate/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/validate/common_field_validators.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/validate/fuzzy_match_keys.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/validate/fuzzy_validate_mapping.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/validate/string_similarity.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/libs/validate/validate_boolean.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/models/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/models/field_model.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/models/model_params.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/models/note.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/models/operable_model.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/models/schema_model.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/ReAct/ReAct.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/ReAct/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/ReAct/utils.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/_act/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/_act/act.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/brainstorm/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/brainstorm/brainstorm.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/brainstorm/prompt.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/builder.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/chat/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/chat/chat.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/communicate/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/communicate/communicate.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/flow.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/instruct/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/instruct/instruct.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/interpret/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/interpret/interpret.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/manager.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/node.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/operate/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/operate/operate.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/parse/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/parse/parse.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/plan/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/plan/plan.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/plan/prompt.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/select/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/select/select.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/select/utils.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/translate/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/translate/translate.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/types.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/operations/utils.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/_concepts.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/action/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/action/function_calling.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/action/manager.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/action/tool.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/forms/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/forms/base.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/forms/flow.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/forms/form.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/forms/report.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/generic/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/generic/element.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/generic/event.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/generic/log.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/generic/pile.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/generic/processor.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/generic/progression.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/graph/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/graph/edge.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/graph/graph.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/graph/node.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/mail/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/mail/exchange.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/mail/mail.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/mail/mailbox.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/mail/manager.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/mail/package.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/messages/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/messages/action_request.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/messages/action_response.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/messages/assistant_response.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/messages/base.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/messages/instruction.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/messages/manager.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/messages/system.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/messages/templates/README.md +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/messages/templates/action_request.jinja2 +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/messages/templates/action_response.jinja2 +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/messages/templates/assistant_response.jinja2 +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/messages/templates/instruction_message.jinja2 +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/messages/templates/system_message.jinja2 +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/messages/templates/tool_schemas.jinja2 +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/operatives/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/operatives/operative.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/operatives/step.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/protocols/types.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/py.typed +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/connections/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/connections/api_calling.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/connections/endpoint.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/connections/endpoint_config.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/connections/header_factory.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/connections/match_endpoint.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/connections/providers/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/connections/providers/_claude_code/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/connections/providers/anthropic_.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/connections/providers/claude_code_.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/connections/providers/claude_code_cli.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/connections/providers/exa_.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/connections/providers/oai_.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/connections/providers/ollama_.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/connections/providers/perplexity_.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/imodel.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/manager.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/rate_limited_processor.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/resilience.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/third_party/README.md +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/third_party/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/third_party/anthropic_models.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/third_party/exa_models.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/third_party/openai_models.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/third_party/pplx_models.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/service/token_calculator.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/session/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/session/branch.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/session/prompts.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/session/session.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/settings.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/tools/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/tools/base.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/tools/file/__init__.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/tools/file/reader.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/tools/memory/tools.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/tools/types.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/lionagi/utils.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/main.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/scripts/README.md +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/scripts/concat.py +0 -0
- {lionagi-0.14.6 → lionagi-0.14.8}/scripts/config.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: lionagi
|
3
|
-
Version: 0.14.
|
3
|
+
Version: 0.14.8
|
4
4
|
Summary: An Intelligence Operating System.
|
5
5
|
Author-email: HaiyangLi <quantocean.li@gmail.com>, Liangbingyan Luo <llby_luo@outlook.com>
|
6
6
|
License: Apache License
|
@@ -234,9 +234,9 @@ Requires-Dist: tiktoken>=0.8.0
|
|
234
234
|
Requires-Dist: toml>=0.9.0
|
235
235
|
Provides-Extra: all
|
236
236
|
Requires-Dist: aiosqlite>=0.21.0; extra == 'all'
|
237
|
-
Requires-Dist: claude-code-sdk>=0.0.
|
237
|
+
Requires-Dist: claude-code-sdk>=0.0.15; extra == 'all'
|
238
238
|
Requires-Dist: datamodel-code-generator>=0.31.2; extra == 'all'
|
239
|
-
Requires-Dist: docling>=2.15.
|
239
|
+
Requires-Dist: docling>=2.15.0; extra == 'all'
|
240
240
|
Requires-Dist: fastmcp>=2.10.5; extra == 'all'
|
241
241
|
Requires-Dist: matplotlib>=3.7.0; extra == 'all'
|
242
242
|
Requires-Dist: networkx>=3.0.0; extra == 'all'
|
@@ -244,36 +244,26 @@ Requires-Dist: ollama>=0.4.0; extra == 'all'
|
|
244
244
|
Requires-Dist: pydapter[postgres]; extra == 'all'
|
245
245
|
Requires-Dist: rich>=13.0.0; extra == 'all'
|
246
246
|
Provides-Extra: claude-code
|
247
|
-
Requires-Dist: claude-code-sdk>=0.0.
|
248
|
-
Provides-Extra: docs
|
249
|
-
Requires-Dist: furo>=2024.8.6; extra == 'docs'
|
250
|
-
Requires-Dist: sphinx-autobuild>=2024.10.3; extra == 'docs'
|
251
|
-
Requires-Dist: sphinx>=8.1.3; extra == 'docs'
|
247
|
+
Requires-Dist: claude-code-sdk>=0.0.15; extra == 'claude-code'
|
252
248
|
Provides-Extra: graph
|
253
249
|
Requires-Dist: matplotlib>=3.7.0; extra == 'graph'
|
254
250
|
Requires-Dist: networkx>=3.0.0; extra == 'graph'
|
255
|
-
Provides-Extra: lint
|
256
|
-
Requires-Dist: black[jupyter]>=24.10.0; extra == 'lint'
|
257
|
-
Requires-Dist: isort>=5.13.2; extra == 'lint'
|
258
|
-
Requires-Dist: pre-commit>=4.0.1; extra == 'lint'
|
259
251
|
Provides-Extra: mcp
|
260
252
|
Requires-Dist: fastmcp>=2.10.5; extra == 'mcp'
|
261
253
|
Provides-Extra: ollama
|
262
254
|
Requires-Dist: ollama>=0.4.0; extra == 'ollama'
|
263
255
|
Provides-Extra: postgres
|
264
|
-
Requires-Dist: aiosqlite>=0.21.0; extra == 'postgres'
|
265
256
|
Requires-Dist: pydapter[postgres]; extra == 'postgres'
|
266
257
|
Provides-Extra: reader
|
267
|
-
Requires-Dist: docling>=2.15.
|
258
|
+
Requires-Dist: docling>=2.15.0; extra == 'reader'
|
268
259
|
Provides-Extra: rich
|
269
260
|
Requires-Dist: rich>=13.0.0; extra == 'rich'
|
270
261
|
Provides-Extra: schema
|
271
262
|
Requires-Dist: datamodel-code-generator>=0.31.2; extra == 'schema'
|
272
|
-
Provides-Extra:
|
273
|
-
Requires-Dist:
|
274
|
-
Requires-Dist: pytest>=8.3.4; extra == 'test'
|
263
|
+
Provides-Extra: sqlite
|
264
|
+
Requires-Dist: aiosqlite>=0.21.0; extra == 'sqlite'
|
275
265
|
Provides-Extra: tools
|
276
|
-
Requires-Dist: docling>=2.15.
|
266
|
+
Requires-Dist: docling>=2.15.0; extra == 'tools'
|
277
267
|
Description-Content-Type: text/markdown
|
278
268
|
|
279
269
|

|
@@ -305,7 +295,9 @@ integrations, and custom validations in a single coherent pipeline.
|
|
305
295
|
## Installation
|
306
296
|
|
307
297
|
```
|
308
|
-
|
298
|
+
uv add lionagi # recommended to use pyproject and uv for dependency management
|
299
|
+
|
300
|
+
pip install lionagi # or install directly
|
309
301
|
```
|
310
302
|
|
311
303
|
## Quick Start
|
@@ -314,12 +306,12 @@ pip install lionagi
|
|
314
306
|
from lionagi import Branch, iModel
|
315
307
|
|
316
308
|
# Pick a model
|
317
|
-
|
309
|
+
gpt41 = iModel(provider="openai", model="gpt-4.1-mini")
|
318
310
|
|
319
311
|
# Create a Branch (conversation context)
|
320
312
|
hunter = Branch(
|
321
313
|
system="you are a hilarious dragon hunter who responds in 10 words rhymes.",
|
322
|
-
chat_model=
|
314
|
+
chat_model=gpt41,
|
323
315
|
)
|
324
316
|
|
325
317
|
# Communicate asynchronously
|
@@ -400,41 +392,75 @@ print(df.tail())
|
|
400
392
|
```python
|
401
393
|
from lionagi import Branch, iModel
|
402
394
|
|
403
|
-
gpt4o = iModel(provider="openai", model="gpt-4o")
|
404
395
|
sonnet = iModel(
|
405
396
|
provider="anthropic",
|
406
397
|
model="claude-3-5-sonnet-20241022",
|
407
398
|
max_tokens=1000, # max_tokens is required for anthropic models
|
408
399
|
)
|
409
400
|
|
410
|
-
branch = Branch(chat_model=
|
411
|
-
# Switch mid-flow
|
412
|
-
analysis = await branch.communicate("Analyze these stats", imodel=sonnet)
|
401
|
+
branch = Branch(chat_model=gpt41)
|
402
|
+
analysis = await branch.communicate("Analyze these stats", chat_model=sonnet) # Switch mid-flow
|
413
403
|
```
|
414
404
|
|
415
405
|
Seamlessly route to different models in the same workflow.
|
416
406
|
|
417
407
|
### Claude Code Integration
|
418
408
|
|
419
|
-
LionAGI now supports Anthropic's
|
409
|
+
LionAGI now supports Anthropic's Claude Code [Python SDK](https://github.com/anthropics/claude-code-sdk-python), and [CLI SDK](https://docs.anthropic.com/en/docs/claude-code/sdk) enabling autonomous coding capabilities with persistent session management. The CLI endpoint
|
410
|
+
directly connects to claude code, and is recommended, you can either use it via a [proxy server](https://github.com/khive-ai/lionagi/tree/main/cookbooks/claude_proxy) or directly with `query_cli` endpoint, provided you have already logged onto claude code cli in your terminal.
|
420
411
|
|
421
412
|
```python
|
422
413
|
from lionagi import iModel, Branch
|
423
414
|
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
verbose_output=True, # Enable detailed output for debugging
|
432
|
-
)
|
415
|
+
def create_cc_model():
|
416
|
+
return iModel(
|
417
|
+
provider="claude_code",
|
418
|
+
endpoint="query_cli",
|
419
|
+
model="sonnet",
|
420
|
+
verbose_output=True, # Enable detailed output for debugging
|
421
|
+
)
|
433
422
|
|
434
423
|
# Start a coding session
|
435
|
-
|
436
|
-
response = await
|
437
|
-
|
424
|
+
orchestrator = Branch(chat_model=create_cc_model())
|
425
|
+
response = await orchestrator.communicate("Explain the architecture of protocols, operations, and branch")
|
426
|
+
|
427
|
+
# continue the session with more queries
|
428
|
+
response2 = await orchestrator.communicate("how do these parts form lionagi system")
|
429
|
+
```
|
430
|
+
|
431
|
+
### Fan out fan in pattern orchestration with claude code
|
432
|
+
|
433
|
+
```python
|
434
|
+
# use structured outputs with claude code
|
435
|
+
from lionagi.fields import LIST_INSTRUCT_FIELD_MODEL, Instruct
|
436
|
+
|
437
|
+
response3 = await orchestrator.operate(
|
438
|
+
instruct=Instruct(
|
439
|
+
instruction="create 4 research questions for parallel discovery",
|
440
|
+
guidance="put into `instruct_models` field as part of your structured result message",
|
441
|
+
context="I'd like to create an orchestration system for AI agents using lionagi"
|
442
|
+
),
|
443
|
+
field_models=[LIST_INSTRUCT_FIELD_MODEL],
|
444
|
+
)
|
445
|
+
|
446
|
+
len(response3.instruct_models) # should be 4
|
447
|
+
|
448
|
+
async def handle_instruct(instruct):
|
449
|
+
sub_branch = Branch(
|
450
|
+
system="You are an diligent research expert.",
|
451
|
+
chat_model=create_cc_model(),
|
452
|
+
)
|
453
|
+
return await sub_branch.operate(instruct=instruct)
|
454
|
+
|
455
|
+
# run in parallel across all instruct models
|
456
|
+
from lionagi.utils import alcall
|
457
|
+
responses = await alcall(response3.instruct_models, handle_instruct)
|
458
|
+
|
459
|
+
# now hand these reports back to the orchestrator
|
460
|
+
final_response = await orchestrator.communicate(
|
461
|
+
"please synthesize these research findings into a final report",
|
462
|
+
context=responses,
|
463
|
+
)
|
438
464
|
```
|
439
465
|
|
440
466
|
Key features:
|
@@ -446,9 +472,14 @@ Key features:
|
|
446
472
|
### optional dependencies
|
447
473
|
|
448
474
|
```
|
449
|
-
|
450
|
-
|
451
|
-
|
475
|
+
"lionagi[reader]" - Reader tool for any unstructured data and web pages
|
476
|
+
"lionagi[ollama]" - Ollama model support for local inference
|
477
|
+
"lionagi[claude-code]" - Claude code python SDK integration (cli endpoint does not require this)
|
478
|
+
"lionagi[rich]" - Rich output formatting for better console display
|
479
|
+
"lionagi[schema]" - Convert pydantic schema to make the Model class persistent
|
480
|
+
"lionagi[postgres]" - Postgres database support for storing and retrieving structured data
|
481
|
+
"lionagi[graph]" - Graph display for visualizing complex workflows
|
482
|
+
"lionagi[sqlite]" - SQLite database support for lightweight data storage (also need `postgres` option)
|
452
483
|
```
|
453
484
|
|
454
485
|
## Community & Contributing
|
@@ -27,7 +27,9 @@ integrations, and custom validations in a single coherent pipeline.
|
|
27
27
|
## Installation
|
28
28
|
|
29
29
|
```
|
30
|
-
|
30
|
+
uv add lionagi # recommended to use pyproject and uv for dependency management
|
31
|
+
|
32
|
+
pip install lionagi # or install directly
|
31
33
|
```
|
32
34
|
|
33
35
|
## Quick Start
|
@@ -36,12 +38,12 @@ pip install lionagi
|
|
36
38
|
from lionagi import Branch, iModel
|
37
39
|
|
38
40
|
# Pick a model
|
39
|
-
|
41
|
+
gpt41 = iModel(provider="openai", model="gpt-4.1-mini")
|
40
42
|
|
41
43
|
# Create a Branch (conversation context)
|
42
44
|
hunter = Branch(
|
43
45
|
system="you are a hilarious dragon hunter who responds in 10 words rhymes.",
|
44
|
-
chat_model=
|
46
|
+
chat_model=gpt41,
|
45
47
|
)
|
46
48
|
|
47
49
|
# Communicate asynchronously
|
@@ -122,41 +124,75 @@ print(df.tail())
|
|
122
124
|
```python
|
123
125
|
from lionagi import Branch, iModel
|
124
126
|
|
125
|
-
gpt4o = iModel(provider="openai", model="gpt-4o")
|
126
127
|
sonnet = iModel(
|
127
128
|
provider="anthropic",
|
128
129
|
model="claude-3-5-sonnet-20241022",
|
129
130
|
max_tokens=1000, # max_tokens is required for anthropic models
|
130
131
|
)
|
131
132
|
|
132
|
-
branch = Branch(chat_model=
|
133
|
-
# Switch mid-flow
|
134
|
-
analysis = await branch.communicate("Analyze these stats", imodel=sonnet)
|
133
|
+
branch = Branch(chat_model=gpt41)
|
134
|
+
analysis = await branch.communicate("Analyze these stats", chat_model=sonnet) # Switch mid-flow
|
135
135
|
```
|
136
136
|
|
137
137
|
Seamlessly route to different models in the same workflow.
|
138
138
|
|
139
139
|
### Claude Code Integration
|
140
140
|
|
141
|
-
LionAGI now supports Anthropic's
|
141
|
+
LionAGI now supports Anthropic's Claude Code [Python SDK](https://github.com/anthropics/claude-code-sdk-python), and [CLI SDK](https://docs.anthropic.com/en/docs/claude-code/sdk) enabling autonomous coding capabilities with persistent session management. The CLI endpoint
|
142
|
+
directly connects to claude code, and is recommended, you can either use it via a [proxy server](https://github.com/khive-ai/lionagi/tree/main/cookbooks/claude_proxy) or directly with `query_cli` endpoint, provided you have already logged onto claude code cli in your terminal.
|
142
143
|
|
143
144
|
```python
|
144
145
|
from lionagi import iModel, Branch
|
145
146
|
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
verbose_output=True, # Enable detailed output for debugging
|
154
|
-
)
|
147
|
+
def create_cc_model():
|
148
|
+
return iModel(
|
149
|
+
provider="claude_code",
|
150
|
+
endpoint="query_cli",
|
151
|
+
model="sonnet",
|
152
|
+
verbose_output=True, # Enable detailed output for debugging
|
153
|
+
)
|
155
154
|
|
156
155
|
# Start a coding session
|
157
|
-
|
158
|
-
response = await
|
159
|
-
|
156
|
+
orchestrator = Branch(chat_model=create_cc_model())
|
157
|
+
response = await orchestrator.communicate("Explain the architecture of protocols, operations, and branch")
|
158
|
+
|
159
|
+
# continue the session with more queries
|
160
|
+
response2 = await orchestrator.communicate("how do these parts form lionagi system")
|
161
|
+
```
|
162
|
+
|
163
|
+
### Fan out fan in pattern orchestration with claude code
|
164
|
+
|
165
|
+
```python
|
166
|
+
# use structured outputs with claude code
|
167
|
+
from lionagi.fields import LIST_INSTRUCT_FIELD_MODEL, Instruct
|
168
|
+
|
169
|
+
response3 = await orchestrator.operate(
|
170
|
+
instruct=Instruct(
|
171
|
+
instruction="create 4 research questions for parallel discovery",
|
172
|
+
guidance="put into `instruct_models` field as part of your structured result message",
|
173
|
+
context="I'd like to create an orchestration system for AI agents using lionagi"
|
174
|
+
),
|
175
|
+
field_models=[LIST_INSTRUCT_FIELD_MODEL],
|
176
|
+
)
|
177
|
+
|
178
|
+
len(response3.instruct_models) # should be 4
|
179
|
+
|
180
|
+
async def handle_instruct(instruct):
|
181
|
+
sub_branch = Branch(
|
182
|
+
system="You are an diligent research expert.",
|
183
|
+
chat_model=create_cc_model(),
|
184
|
+
)
|
185
|
+
return await sub_branch.operate(instruct=instruct)
|
186
|
+
|
187
|
+
# run in parallel across all instruct models
|
188
|
+
from lionagi.utils import alcall
|
189
|
+
responses = await alcall(response3.instruct_models, handle_instruct)
|
190
|
+
|
191
|
+
# now hand these reports back to the orchestrator
|
192
|
+
final_response = await orchestrator.communicate(
|
193
|
+
"please synthesize these research findings into a final report",
|
194
|
+
context=responses,
|
195
|
+
)
|
160
196
|
```
|
161
197
|
|
162
198
|
Key features:
|
@@ -168,9 +204,14 @@ Key features:
|
|
168
204
|
### optional dependencies
|
169
205
|
|
170
206
|
```
|
171
|
-
|
172
|
-
|
173
|
-
|
207
|
+
"lionagi[reader]" - Reader tool for any unstructured data and web pages
|
208
|
+
"lionagi[ollama]" - Ollama model support for local inference
|
209
|
+
"lionagi[claude-code]" - Claude code python SDK integration (cli endpoint does not require this)
|
210
|
+
"lionagi[rich]" - Rich output formatting for better console display
|
211
|
+
"lionagi[schema]" - Convert pydantic schema to make the Model class persistent
|
212
|
+
"lionagi[postgres]" - Postgres database support for storing and retrieving structured data
|
213
|
+
"lionagi[graph]" - Graph display for visualizing complex workflows
|
214
|
+
"lionagi[sqlite]" - SQLite database support for lightweight data storage (also need `postgres` option)
|
174
215
|
```
|
175
216
|
|
176
217
|
## Community & Contributing
|
@@ -0,0 +1,110 @@
|
|
1
|
+
from lionagi import Branch, Builder, Session, iModel
|
2
|
+
from lionagi.fields import LIST_INSTRUCT_FIELD_MODEL, Instruct
|
3
|
+
|
4
|
+
CC_WORKSPACE = ".khive/workspace"
|
5
|
+
|
6
|
+
|
7
|
+
def create_cc(
|
8
|
+
subdir: str,
|
9
|
+
model: str = "sonnet",
|
10
|
+
verbose_output: bool = True,
|
11
|
+
permission_mode="default",
|
12
|
+
auto_finish: bool = False,
|
13
|
+
):
|
14
|
+
return iModel(
|
15
|
+
provider="claude_code",
|
16
|
+
endpoint="query_cli",
|
17
|
+
model=model,
|
18
|
+
api_key="dummy_api_key",
|
19
|
+
ws=f"{CC_WORKSPACE}/{subdir}",
|
20
|
+
verbose_output=verbose_output,
|
21
|
+
add_dir="../../../",
|
22
|
+
permission_mode=permission_mode,
|
23
|
+
cli_display_theme="dark",
|
24
|
+
auto_finish=auto_finish,
|
25
|
+
)
|
26
|
+
|
27
|
+
|
28
|
+
prompt = """
|
29
|
+
Task: Investigate the codebase in the specified directory and provide a comprehensive overview.
|
30
|
+
|
31
|
+
---START
|
32
|
+
read into the specified dir, glance over the key components and pay attention to architecture,
|
33
|
+
design patterns, and any notable features. Think deeply about the codebase and give three parallel
|
34
|
+
instructions, as part of the structured output (`instruct_models`) in the final response message.
|
35
|
+
|
36
|
+
---Then
|
37
|
+
The instruct models will be run in parallel by each researcher branch, and I will provide you with
|
38
|
+
the researchers' findings for you to continue your investigation.
|
39
|
+
|
40
|
+
---Finally
|
41
|
+
Once the researchers have completed their tasks, synthesize the information they provided into a cohesive
|
42
|
+
overview of the codebase, including:
|
43
|
+
1. Key components and their roles
|
44
|
+
2. Architectural patterns used
|
45
|
+
3. Design patterns and notable features
|
46
|
+
---END
|
47
|
+
"""
|
48
|
+
|
49
|
+
|
50
|
+
async def main():
|
51
|
+
try:
|
52
|
+
orc_cc = create_cc("orchestrator")
|
53
|
+
orc_branch = Branch(
|
54
|
+
chat_model=orc_cc,
|
55
|
+
parse_model=orc_cc,
|
56
|
+
use_lion_system_message=True,
|
57
|
+
system_datetime=True,
|
58
|
+
name="orchestrator",
|
59
|
+
)
|
60
|
+
session = Session(default_branch=orc_branch)
|
61
|
+
|
62
|
+
builder = Builder("CodeInvestigator")
|
63
|
+
root = builder.add_operation(
|
64
|
+
"operate",
|
65
|
+
instruct=Instruct(
|
66
|
+
instruction=prompt,
|
67
|
+
context="lionagi",
|
68
|
+
),
|
69
|
+
reason=True,
|
70
|
+
field_models=[LIST_INSTRUCT_FIELD_MODEL],
|
71
|
+
)
|
72
|
+
|
73
|
+
result = await session.flow(builder.get_graph())
|
74
|
+
|
75
|
+
instruct_models: list[Instruct] = result["operation_results"][
|
76
|
+
root
|
77
|
+
].instruct_models
|
78
|
+
research_nodes = []
|
79
|
+
|
80
|
+
for i in instruct_models:
|
81
|
+
node = builder.add_operation(
|
82
|
+
"communicate",
|
83
|
+
depends_on=[root],
|
84
|
+
chat_model=create_cc("researcher"),
|
85
|
+
**i.to_dict(),
|
86
|
+
)
|
87
|
+
research_nodes.append(node)
|
88
|
+
|
89
|
+
synthesis = builder.add_aggregation(
|
90
|
+
"communicate",
|
91
|
+
source_node_ids=research_nodes,
|
92
|
+
branch=orc_branch,
|
93
|
+
instruction="Synthesize the information from the researcher branches.",
|
94
|
+
)
|
95
|
+
|
96
|
+
result2 = await session.flow(builder.get_graph())
|
97
|
+
result_synthesis = result2["operation_results"][synthesis]
|
98
|
+
print(result_synthesis)
|
99
|
+
|
100
|
+
except Exception as e:
|
101
|
+
print(f"Error: {e}")
|
102
|
+
import traceback
|
103
|
+
|
104
|
+
traceback.print_exc()
|
105
|
+
|
106
|
+
|
107
|
+
if __name__ == "__main__":
|
108
|
+
import anyio
|
109
|
+
|
110
|
+
anyio.run(main)
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# LionAGI Claude Code Proxy
|
2
|
+
|
3
|
+
to use please first install `lionagi` and `fastapi`
|
4
|
+
|
5
|
+
```bash
|
6
|
+
uv add lionagi fastapi loguru
|
7
|
+
```
|
8
|
+
|
9
|
+
then run the proxy with:
|
10
|
+
|
11
|
+
```bash
|
12
|
+
uv run cookbooks/claude_proxy/claude_code_proxy.py --port 8000
|
13
|
+
```
|
14
|
+
|
15
|
+
Next, configure a cutsom endpoint
|
16
|
+
|
17
|
+
```python
|
18
|
+
from lionagi.service import Endpoint, EndpointConfig, iModel
|
19
|
+
claude_code_config = EndpointConfig(
|
20
|
+
name="claude_code_cli_proxy",
|
21
|
+
provider="claude_code_proxy",
|
22
|
+
base_url="http://localhost:8000/v1",
|
23
|
+
endpoint="query",
|
24
|
+
api_key="dummy_api_key",
|
25
|
+
kwargs={"model": "sonnet"},
|
26
|
+
)
|
27
|
+
cc_proxy_endpoint = Endpoint(claude_code_config)
|
28
|
+
claude_code = iModel(endpoint=cc_proxy_endpoint)
|
29
|
+
```
|
30
|
+
|
31
|
+
Done, now you can run `claude code` in jupyter or any other environment that supports `lionagi`.
|
@@ -0,0 +1,132 @@
|
|
1
|
+
#!/usr/bin/env python3
|
2
|
+
"""
|
3
|
+
Claude Code Proxy API Server - OpenAI Compatible
|
4
|
+
A FastAPI server that proxies requests to Claude Code CLI using OpenAI API format.
|
5
|
+
Compatible with Roo Code, Cline, and other OpenAI API clients.
|
6
|
+
"""
|
7
|
+
|
8
|
+
from __future__ import annotations
|
9
|
+
|
10
|
+
import json
|
11
|
+
import subprocess
|
12
|
+
import sys
|
13
|
+
from contextlib import asynccontextmanager
|
14
|
+
|
15
|
+
import uvicorn
|
16
|
+
from fastapi import FastAPI, HTTPException, Request, Response
|
17
|
+
from loguru import logger
|
18
|
+
|
19
|
+
from lionagi.service.connections.providers.claude_code_cli import (
|
20
|
+
ClaudeCodeCLIEndpoint,
|
21
|
+
ClaudeCodeRequest,
|
22
|
+
)
|
23
|
+
|
24
|
+
# Configure logging
|
25
|
+
logger.remove()
|
26
|
+
logger.add(sys.stderr, level="INFO")
|
27
|
+
|
28
|
+
|
29
|
+
@asynccontextmanager
|
30
|
+
async def lifespan(app: FastAPI):
|
31
|
+
check_claude_code()
|
32
|
+
logger.info("Claude Code CLI Proxy API started successfully")
|
33
|
+
yield
|
34
|
+
pass
|
35
|
+
|
36
|
+
|
37
|
+
# FastAPI app
|
38
|
+
app = FastAPI(
|
39
|
+
title="Claude Code Proxy API - OpenAI Compatible",
|
40
|
+
description="Proxy server for Claude Code CLI - Personal Development Use",
|
41
|
+
version="1.0.0",
|
42
|
+
lifespan=lifespan,
|
43
|
+
)
|
44
|
+
|
45
|
+
|
46
|
+
# Check if Claude Code is available
|
47
|
+
def check_claude_code():
|
48
|
+
"""Verify Claude Code CLI is installed and accessible"""
|
49
|
+
try:
|
50
|
+
from lionagi.service.connections.providers._claude_code.stream_cli import (
|
51
|
+
CLAUDE,
|
52
|
+
)
|
53
|
+
|
54
|
+
result = subprocess.run(
|
55
|
+
[CLAUDE, "--version"], capture_output=True, text=True
|
56
|
+
)
|
57
|
+
if result.returncode != 0:
|
58
|
+
raise RuntimeError(
|
59
|
+
f"Claude Code not found, please install it first:\n"
|
60
|
+
)
|
61
|
+
logger.info(f"Claude Code found: {result.stdout.strip()}")
|
62
|
+
except Exception as e:
|
63
|
+
logger.error(f"Claude Code check failed: {e}")
|
64
|
+
raise RuntimeError(
|
65
|
+
"Claude Code CLI not found. Please install it first:\n"
|
66
|
+
"npm install -g @anthropic-ai/claude-code"
|
67
|
+
)
|
68
|
+
|
69
|
+
|
70
|
+
# Health check
|
71
|
+
@app.get("/health")
|
72
|
+
async def health_check():
|
73
|
+
return {"status": "healthy", "service": "claude-code-cli-proxy"}
|
74
|
+
|
75
|
+
|
76
|
+
@app.post("/v1/query")
|
77
|
+
async def query(request: ClaudeCodeRequest):
|
78
|
+
|
79
|
+
endpoint = ClaudeCodeCLIEndpoint()
|
80
|
+
try:
|
81
|
+
return await endpoint._call(payload={"request": request}, headers={})
|
82
|
+
except Exception as e:
|
83
|
+
logger.error(f"Error processing request: {e}")
|
84
|
+
raise HTTPException(
|
85
|
+
status_code=500, detail=f"Internal server error: {str(e)}"
|
86
|
+
)
|
87
|
+
|
88
|
+
|
89
|
+
# Error handling
|
90
|
+
@app.exception_handler(Exception)
|
91
|
+
async def general_exception_handler(request: Request, exc: Exception):
|
92
|
+
logger.error(f"Unhandled exception: {exc}")
|
93
|
+
return Response(
|
94
|
+
content=json.dumps(
|
95
|
+
{
|
96
|
+
"error": {
|
97
|
+
"message": str(exc),
|
98
|
+
"type": "internal_error",
|
99
|
+
"param": None,
|
100
|
+
"code": None,
|
101
|
+
}
|
102
|
+
}
|
103
|
+
),
|
104
|
+
status_code=500,
|
105
|
+
media_type="application/json",
|
106
|
+
)
|
107
|
+
|
108
|
+
|
109
|
+
if __name__ == "__main__":
|
110
|
+
# Parse command line arguments
|
111
|
+
import argparse
|
112
|
+
|
113
|
+
parser = argparse.ArgumentParser(
|
114
|
+
description="Claude Code Proxy API Server"
|
115
|
+
)
|
116
|
+
parser.add_argument("--host", default="127.0.0.1", help="Host to bind to")
|
117
|
+
parser.add_argument(
|
118
|
+
"--port", type=int, default=8000, help="Port to bind to"
|
119
|
+
)
|
120
|
+
parser.add_argument(
|
121
|
+
"--reload", action="store_true", help="Enable auto-reload"
|
122
|
+
)
|
123
|
+
args = parser.parse_args()
|
124
|
+
|
125
|
+
# Run server
|
126
|
+
uvicorn.run(
|
127
|
+
"claude_code_proxy:app" if args.reload else app,
|
128
|
+
host=args.host,
|
129
|
+
port=args.port,
|
130
|
+
reload=args.reload,
|
131
|
+
log_level="info",
|
132
|
+
)
|