lionagi 0.13.5__tar.gz → 0.13.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lionagi-0.13.6/.github/workflows/docs.yml +58 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/PKG-INFO +4 -1
- lionagi-0.13.6/cookbooks/001_branch_converse.ipynb +415 -0
- lionagi-0.13.6/cookbooks/002_branch_interact.ipynb +1018 -0
- lionagi-0.13.6/cookbooks/003_branch_info.ipynb +275 -0
- lionagi-0.13.6/cookbooks/004_conversation_patterns.ipynb +313 -0
- lionagi-0.13.6/cookbooks/005_react_basics.ipynb +864 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/schema/load_pydantic_model_from_schema.py +4 -6
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/flow.py +7 -21
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/utils.py +3 -1
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/service/connections/endpoint_config.py +12 -1
- lionagi-0.13.6/lionagi/version.py +1 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/pyproject.toml +6 -2
- {lionagi-0.13.5 → lionagi-0.13.6}/uv.lock +81 -2
- lionagi-0.13.5/.github/workflows/docs.yml +0 -34
- lionagi-0.13.5/cookbooks/ch01_get_started.md +0 -398
- lionagi-0.13.5/cookbooks/ch02_concepts.md +0 -268
- lionagi-0.13.5/lionagi/version.py +0 -1
- {lionagi-0.13.5 → lionagi-0.13.6}/.coveragerc +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/.env.example +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/.github/FUNDING.yml +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/.github/dependabot.yml +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/.github/workflows/ci.yml +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/.github/workflows/codeql.yml +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/.github/workflows/release.yml +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/.gitignore +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/.pre-commit-config.yaml +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/.python-version +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/CODE_OF_CONDUCT.md +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/CONTRIBUTING.md +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/LICENSE +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/README.md +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/assets/operation_builder.gif +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/cookbooks/using_claude_code.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/Makefile +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/_static/custom.css +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/_templates/layout.html +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/conf.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/index.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/modules/action.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/modules/adapter.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/modules/branch.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/modules/branch_operations.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/modules/concepts.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/modules/element_id.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/modules/event.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/modules/form.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/modules/graph.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/modules/index.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/modules/instruct.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/modules/lib_file.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/modules/lib_nested.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/modules/lib_package.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/modules/lib_schema.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/modules/lib_validate.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/modules/log.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/modules/mail.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/modules/message.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/modules/models.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/modules/operative_step.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/modules/pile.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/modules/processor.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/modules/progression.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/modules/service.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/modules/session.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/modules/utils.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/tutorials/get_started.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/tutorials/get_started_pt2.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/tutorials/get_started_pt3.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/docs/tutorials/index.rst +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/_class_registry.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/_errors.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/_types.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/config.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/fields/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/fields/action.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/fields/base.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/fields/code.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/fields/file.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/fields/instruct.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/fields/reason.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/fields/research.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/file/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/file/chunk.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/file/concat.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/file/concat_files.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/file/file_ops.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/file/params.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/file/process.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/file/save.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/nested/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/nested/flatten.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/nested/nfilter.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/nested/nget.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/nested/ninsert.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/nested/nmerge.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/nested/npop.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/nested/nset.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/nested/unflatten.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/nested/utils.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/package/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/package/imports.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/package/management.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/package/params.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/package/system.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/parse.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/schema/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/schema/as_readable.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/schema/extract_code_block.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/schema/extract_docstring.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/schema/function_to_schema.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/schema/json_schema.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/token_transform/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/token_transform/base.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/token_transform/llmlingua.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/token_transform/perplexity.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/token_transform/symbolic_compress_context.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/token_transform/synthlang.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/token_transform/synthlang_/base.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/token_transform/synthlang_/resources/frameworks/abstract_algebra.toml +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/token_transform/synthlang_/resources/frameworks/category_theory.toml +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/token_transform/synthlang_/resources/frameworks/complex_analysis.toml +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/token_transform/synthlang_/resources/frameworks/framework_options.json +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/token_transform/synthlang_/resources/frameworks/group_theory.toml +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/token_transform/synthlang_/resources/frameworks/math_logic.toml +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/token_transform/synthlang_/resources/frameworks/reflective_patterns.toml +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/token_transform/synthlang_/resources/frameworks/set_theory.toml +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/token_transform/synthlang_/resources/frameworks/topology_fundamentals.toml +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/token_transform/synthlang_/resources/mapping/lion_emoji_mapping.toml +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/token_transform/synthlang_/resources/mapping/python_math_mapping.toml +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/token_transform/synthlang_/resources/mapping/rust_chinese_mapping.toml +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/token_transform/synthlang_/resources/utility/base_synthlang_system_prompt.toml +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/token_transform/synthlang_/translate_to_synthlang.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/token_transform/types.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/validate/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/validate/common_field_validators.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/validate/fuzzy_match_keys.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/validate/fuzzy_validate_mapping.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/validate/string_similarity.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/libs/validate/validate_boolean.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/models/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/models/field_model.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/models/hashable_model.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/models/model_params.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/models/note.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/models/operable_model.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/models/schema_model.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/ReAct/ReAct.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/ReAct/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/ReAct/utils.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/_act/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/_act/act.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/brainstorm/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/brainstorm/brainstorm.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/brainstorm/prompt.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/builder.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/chat/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/chat/chat.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/communicate/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/communicate/communicate.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/instruct/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/instruct/instruct.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/interpret/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/interpret/interpret.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/manager.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/node.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/operate/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/operate/operate.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/parse/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/parse/parse.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/plan/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/plan/plan.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/plan/prompt.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/select/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/select/select.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/select/utils.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/translate/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/translate/translate.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/operations/types.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/_concepts.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/action/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/action/function_calling.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/action/manager.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/action/tool.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/forms/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/forms/base.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/forms/flow.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/forms/form.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/forms/report.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/generic/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/generic/element.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/generic/event.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/generic/log.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/generic/pile.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/generic/processor.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/generic/progression.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/graph/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/graph/edge.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/graph/graph.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/graph/node.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/mail/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/mail/exchange.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/mail/mail.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/mail/mailbox.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/mail/manager.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/mail/package.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/messages/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/messages/action_request.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/messages/action_response.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/messages/assistant_response.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/messages/base.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/messages/instruction.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/messages/manager.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/messages/message.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/messages/system.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/messages/templates/README.md +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/messages/templates/action_request.jinja2 +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/messages/templates/action_response.jinja2 +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/messages/templates/assistant_response.jinja2 +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/messages/templates/instruction_message.jinja2 +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/messages/templates/system_message.jinja2 +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/messages/templates/tool_schemas.jinja2 +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/operatives/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/operatives/operative.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/operatives/step.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/protocols/types.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/py.typed +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/service/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/service/connections/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/service/connections/api_calling.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/service/connections/endpoint.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/service/connections/header_factory.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/service/connections/match_endpoint.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/service/connections/providers/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/service/connections/providers/anthropic_.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/service/connections/providers/claude_code_.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/service/connections/providers/claude_code_cli.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/service/connections/providers/exa_.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/service/connections/providers/oai_.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/service/connections/providers/ollama_.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/service/connections/providers/perplexity_.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/service/imodel.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/service/manager.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/service/rate_limited_processor.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/service/resilience.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/service/third_party/README.md +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/service/third_party/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/service/third_party/anthropic_models.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/service/third_party/exa_models.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/service/third_party/openai_models.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/service/third_party/pplx_models.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/service/token_calculator.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/service/types.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/session/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/session/branch.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/session/prompts.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/session/session.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/settings.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/tools/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/tools/base.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/tools/file/__init__.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/tools/file/reader.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/tools/memory/tools.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/tools/types.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/lionagi/utils.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/main.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/scripts/README.md +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/scripts/concat.py +0 -0
- {lionagi-0.13.5 → lionagi-0.13.6}/scripts/config.py +0 -0
@@ -0,0 +1,58 @@
|
|
1
|
+
name: Build and Deploy Documentation
|
2
|
+
|
3
|
+
on:
|
4
|
+
push:
|
5
|
+
branches: [ "main" ]
|
6
|
+
pull_request:
|
7
|
+
branches: [ "main" ]
|
8
|
+
|
9
|
+
permissions:
|
10
|
+
contents: read
|
11
|
+
pages: write
|
12
|
+
id-token: write
|
13
|
+
|
14
|
+
concurrency:
|
15
|
+
group: "pages"
|
16
|
+
cancel-in-progress: false
|
17
|
+
|
18
|
+
jobs:
|
19
|
+
build:
|
20
|
+
runs-on: ubuntu-latest
|
21
|
+
steps:
|
22
|
+
- name: Checkout repository
|
23
|
+
uses: actions/checkout@v4
|
24
|
+
|
25
|
+
- name: Install uv
|
26
|
+
uses: astral-sh/setup-uv@v4
|
27
|
+
with:
|
28
|
+
version: "latest"
|
29
|
+
|
30
|
+
- name: Set up Python
|
31
|
+
run: uv python install 3.10
|
32
|
+
|
33
|
+
- name: Install dependencies
|
34
|
+
run: |
|
35
|
+
uv sync --group docs
|
36
|
+
uv add --group docs sphinx-autobuild
|
37
|
+
|
38
|
+
- name: Build documentation
|
39
|
+
run: |
|
40
|
+
cd docs
|
41
|
+
uv run sphinx-build -M html "." "_build" --keep-going
|
42
|
+
|
43
|
+
- name: Upload documentation artifacts
|
44
|
+
uses: actions/upload-pages-artifact@v3
|
45
|
+
with:
|
46
|
+
path: docs/_build/html
|
47
|
+
|
48
|
+
deploy:
|
49
|
+
environment:
|
50
|
+
name: github-pages
|
51
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
52
|
+
runs-on: ubuntu-latest
|
53
|
+
needs: build
|
54
|
+
if: github.ref == 'refs/heads/main'
|
55
|
+
steps:
|
56
|
+
- name: Deploy to GitHub Pages
|
57
|
+
id: deployment
|
58
|
+
uses: actions/deploy-pages@v4
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: lionagi
|
3
|
-
Version: 0.13.
|
3
|
+
Version: 0.13.6
|
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
|
@@ -235,6 +235,7 @@ Requires-Dist: tiktoken>=0.8.0
|
|
235
235
|
Requires-Dist: toml>=0.9.0
|
236
236
|
Provides-Extra: all
|
237
237
|
Requires-Dist: claude-code-sdk>=0.0.14; extra == 'all'
|
238
|
+
Requires-Dist: datamodel-code-generator>=0.31.2; extra == 'all'
|
238
239
|
Requires-Dist: docling>=2.15.1; extra == 'all'
|
239
240
|
Requires-Dist: fastmcp>=2.10.5; extra == 'all'
|
240
241
|
Requires-Dist: ollama>=0.4.0; extra == 'all'
|
@@ -257,6 +258,8 @@ Provides-Extra: reader
|
|
257
258
|
Requires-Dist: docling>=2.15.1; extra == 'reader'
|
258
259
|
Provides-Extra: rich
|
259
260
|
Requires-Dist: rich>=13.0.0; extra == 'rich'
|
261
|
+
Provides-Extra: schema
|
262
|
+
Requires-Dist: datamodel-code-generator>=0.31.2; extra == 'schema'
|
260
263
|
Provides-Extra: test
|
261
264
|
Requires-Dist: pytest-asyncio>=1.0.0; extra == 'test'
|
262
265
|
Requires-Dist: pytest>=8.3.4; extra == 'test'
|
@@ -0,0 +1,415 @@
|
|
1
|
+
{
|
2
|
+
"cells": [
|
3
|
+
{
|
4
|
+
"cell_type": "markdown",
|
5
|
+
"metadata": {},
|
6
|
+
"source": [
|
7
|
+
"# Start a chat with LLM"
|
8
|
+
]
|
9
|
+
},
|
10
|
+
{
|
11
|
+
"cell_type": "markdown",
|
12
|
+
"metadata": {},
|
13
|
+
"source": [
|
14
|
+
"The `Branch` object is the foundational building block of lionagi, serving as your primary interface for AI model interactions.\n",
|
15
|
+
"\n",
|
16
|
+
"Think of a Branch as a conversation thread that:\n",
|
17
|
+
"- **Manages messages**: Automatically handles system prompts, user inputs, and AI responses in a structured conversation flow\n",
|
18
|
+
"- **Enables multi-turn conversations**: Maintains context across multiple exchanges, allowing for natural back-and-forth dialogue\n",
|
19
|
+
"- **Handles advanced features**: Supports structured outputs, tool usage, and sophisticated context management out of the box\n",
|
20
|
+
"\n",
|
21
|
+
"**Architecture Overview:**\n",
|
22
|
+
"- A `Session` can contain multiple branches, but every session starts with a default `'main'` branch\n",
|
23
|
+
"- Each branch maintains its own conversation history in `branch.messages`\n",
|
24
|
+
"\n",
|
25
|
+
"This design allows you to organize complex AI workflows into logical conversation threads, each with their own context and purpose."
|
26
|
+
]
|
27
|
+
},
|
28
|
+
{
|
29
|
+
"cell_type": "markdown",
|
30
|
+
"metadata": {},
|
31
|
+
"source": [
|
32
|
+
"**Configuration and Model Selection:**\n",
|
33
|
+
"\n",
|
34
|
+
"lionagi comes with sensible defaults for popular AI providers. You can explore these configurations in `lionagi.integrations.config` to understand available models and their settings.\n",
|
35
|
+
"\n",
|
36
|
+
"The framework supports multiple AI providers through a unified interface, making it easy to switch between different models without changing your core application logic."
|
37
|
+
]
|
38
|
+
},
|
39
|
+
{
|
40
|
+
"cell_type": "markdown",
|
41
|
+
"metadata": {},
|
42
|
+
"source": [
|
43
|
+
"### 1. Using `chat()` - Stateless Interactions\n",
|
44
|
+
"\n",
|
45
|
+
"The `chat()` method provides **stateless** communication with AI models. Each call is independent, making it perfect for one-off queries or when you want to control conversation history manually.\n",
|
46
|
+
"\n",
|
47
|
+
"**When to use `chat()`:**\n",
|
48
|
+
"- Single-shot questions that don't require conversation context\n",
|
49
|
+
"- When you want to manually manage conversation state\n",
|
50
|
+
"- For parallel processing of independent queries"
|
51
|
+
]
|
52
|
+
},
|
53
|
+
{
|
54
|
+
"cell_type": "code",
|
55
|
+
"execution_count": 1,
|
56
|
+
"metadata": {},
|
57
|
+
"outputs": [],
|
58
|
+
"source": [
|
59
|
+
"from lionagi import iModel, Branch\n",
|
60
|
+
"from IPython.display import Markdown"
|
61
|
+
]
|
62
|
+
},
|
63
|
+
{
|
64
|
+
"cell_type": "code",
|
65
|
+
"execution_count": 2,
|
66
|
+
"metadata": {},
|
67
|
+
"outputs": [],
|
68
|
+
"source": [
|
69
|
+
"SYSTEM = \"As a comedian, you are sarcastically funny\"\n",
|
70
|
+
"prompt1 = \"short joke: a blue whale and a big shark meet at the bar and start dancing\""
|
71
|
+
]
|
72
|
+
},
|
73
|
+
{
|
74
|
+
"cell_type": "code",
|
75
|
+
"execution_count": 3,
|
76
|
+
"metadata": {},
|
77
|
+
"outputs": [
|
78
|
+
{
|
79
|
+
"data": {
|
80
|
+
"text/markdown": [
|
81
|
+
"**comedian1**: A blue whale and a big shark walk into a bar. They start dancing—turns out, even in the ocean, they're just trying to groove away from their terrible dating profiles."
|
82
|
+
],
|
83
|
+
"text/plain": [
|
84
|
+
"<IPython.core.display.Markdown object>"
|
85
|
+
]
|
86
|
+
},
|
87
|
+
"execution_count": 3,
|
88
|
+
"metadata": {},
|
89
|
+
"output_type": "execute_result"
|
90
|
+
}
|
91
|
+
],
|
92
|
+
"source": [
|
93
|
+
"# create a branch with gpt-4.1-nano model, need an OpenAI API key\n",
|
94
|
+
"comedian1 = Branch(\n",
|
95
|
+
" chat_model=iModel(model=\"openai/gpt-4.1-nano\"), system=SYSTEM\n",
|
96
|
+
")\n",
|
97
|
+
"joke1 = await comedian1.chat(prompt1)\n",
|
98
|
+
"\n",
|
99
|
+
"Markdown(f\"**comedian1**: {joke1}\")"
|
100
|
+
]
|
101
|
+
},
|
102
|
+
{
|
103
|
+
"cell_type": "markdown",
|
104
|
+
"metadata": {},
|
105
|
+
"source": [
|
106
|
+
"**Model Provider Flexibility:**\n",
|
107
|
+
"\n",
|
108
|
+
"lionagi's unified interface allows you to seamlessly switch between different AI providers. Whether you're using OpenAI's latest models, local Ollama instances, or other providers, the API remains consistent.\n",
|
109
|
+
"\n",
|
110
|
+
"This provider-agnostic approach gives you the flexibility to:\n",
|
111
|
+
"- Choose the best model for your specific use case\n",
|
112
|
+
"- Switch providers based on cost, performance, or availability\n",
|
113
|
+
"- Test the same logic across different AI models"
|
114
|
+
]
|
115
|
+
},
|
116
|
+
{
|
117
|
+
"cell_type": "markdown",
|
118
|
+
"metadata": {},
|
119
|
+
"source": [
|
120
|
+
"### 2. Using `communicate()` - Stateful Conversations\n",
|
121
|
+
"\n",
|
122
|
+
"The `communicate()` method provides **stateful** interactions where each message builds upon the previous conversation history. This is ideal for multi-turn dialogues and complex reasoning tasks.\n",
|
123
|
+
"\n",
|
124
|
+
"**Key Difference from `chat()`:**\n",
|
125
|
+
"- `chat()` is **stateless**: Each call is independent, no memory between calls\n",
|
126
|
+
"- `communicate()` is **stateful**: Automatically maintains conversation history, enabling context-aware responses\n",
|
127
|
+
"\n",
|
128
|
+
"**When to use `communicate()`:**\n",
|
129
|
+
"- Multi-turn conversations where context matters\n",
|
130
|
+
"- Building up complex reasoning over multiple exchanges\n",
|
131
|
+
"- When you want automatic conversation memory management"
|
132
|
+
]
|
133
|
+
},
|
134
|
+
{
|
135
|
+
"cell_type": "code",
|
136
|
+
"execution_count": 4,
|
137
|
+
"metadata": {},
|
138
|
+
"outputs": [
|
139
|
+
{
|
140
|
+
"data": {
|
141
|
+
"text/markdown": [
|
142
|
+
"**comedian2**: <think>\n",
|
143
|
+
"Okay, so I have this user query. Let's see what they're asking for. They want me to be a comedian who’s sarcastically funny and come up with a joke based on them. The setup is that a blue whale and a big shark meet at the bar and start dancing. Hmm.\n",
|
144
|
+
"\n",
|
145
|
+
"Alright, I need to think about how a blue whale and a shark can go smoothly or maybe accidentally dance together in a bar. Well, they're both water-based creatures. That could be a funny angle. Maybe the idea of them being on the water side? \n",
|
146
|
+
"\n",
|
147
|
+
"So, starting with that theme, maybe something about not wanting to be too far from shorelines because there’s a lot of activity when they’re out. That ties into their characteristics. Also, considering the bar itself—sharks can be seen drinking, etc.\n",
|
148
|
+
"\n",
|
149
|
+
"Putting it all together, I should avoid sounding too serious and add some humor through their behaviors. Maybe include something playful like swishing arms or bellowing in fits. \n",
|
150
|
+
"\n",
|
151
|
+
"The user also mentioned a short joke, so keeping it concise is key. I need to make sure it's clear and gets the point across without being too wordy.\n",
|
152
|
+
"\n",
|
153
|
+
"Alright, let me try formulating that. Maybe something about not wanting to be too far from shorelines because there’s a lot of activities out. That ties into both the blue whale and shark characteristics. \n",
|
154
|
+
"\n",
|
155
|
+
"Then have them start dancing together at the bar, keeping it humorous yet appropriate, adding some flair to make it light despite being the opposite in many ways.\n",
|
156
|
+
"</think>\n",
|
157
|
+
"\n",
|
158
|
+
"The blue whale and the big shark aren’t exactly on the same boat when they pop into the bar. They’re both waterberms, like moths trapped under a glass. You know what happens next? They’ll start bellowing in fits and swishing arms like they’ve seen too many fish in total."
|
159
|
+
],
|
160
|
+
"text/plain": [
|
161
|
+
"<IPython.core.display.Markdown object>"
|
162
|
+
]
|
163
|
+
},
|
164
|
+
"execution_count": 4,
|
165
|
+
"metadata": {},
|
166
|
+
"output_type": "execute_result"
|
167
|
+
}
|
168
|
+
],
|
169
|
+
"source": [
|
170
|
+
"# Need to install \"lionagi[ollama]\" to use Ollama models\n",
|
171
|
+
"\n",
|
172
|
+
"comedian2 = Branch(\n",
|
173
|
+
" chat_model=iModel(model=\"ollama/deepseek-r1:1.5b\"), system=SYSTEM\n",
|
174
|
+
")\n",
|
175
|
+
"joke2 = await comedian2.communicate(prompt1)\n",
|
176
|
+
"\n",
|
177
|
+
"Markdown(f\"**comedian2**: {joke2}\")"
|
178
|
+
]
|
179
|
+
},
|
180
|
+
{
|
181
|
+
"cell_type": "code",
|
182
|
+
"execution_count": null,
|
183
|
+
"metadata": {},
|
184
|
+
"outputs": [
|
185
|
+
{
|
186
|
+
"data": {
|
187
|
+
"text/html": [
|
188
|
+
"<div>\n",
|
189
|
+
"<style scoped>\n",
|
190
|
+
" .dataframe tbody tr th:only-of-type {\n",
|
191
|
+
" vertical-align: middle;\n",
|
192
|
+
" }\n",
|
193
|
+
"\n",
|
194
|
+
" .dataframe tbody tr th {\n",
|
195
|
+
" vertical-align: top;\n",
|
196
|
+
" }\n",
|
197
|
+
"\n",
|
198
|
+
" .dataframe thead th {\n",
|
199
|
+
" text-align: right;\n",
|
200
|
+
" }\n",
|
201
|
+
"</style>\n",
|
202
|
+
"<table border=\"1\" class=\"dataframe\">\n",
|
203
|
+
" <thead>\n",
|
204
|
+
" <tr style=\"text-align: right;\">\n",
|
205
|
+
" <th></th>\n",
|
206
|
+
" <th>created_at</th>\n",
|
207
|
+
" <th>role</th>\n",
|
208
|
+
" <th>content</th>\n",
|
209
|
+
" <th>id</th>\n",
|
210
|
+
" <th>sender</th>\n",
|
211
|
+
" <th>recipient</th>\n",
|
212
|
+
" <th>metadata</th>\n",
|
213
|
+
" </tr>\n",
|
214
|
+
" </thead>\n",
|
215
|
+
" <tbody>\n",
|
216
|
+
" <tr>\n",
|
217
|
+
" <th>0</th>\n",
|
218
|
+
" <td>1.753069e+09</td>\n",
|
219
|
+
" <td>system</td>\n",
|
220
|
+
" <td>{'system_message': 'As a comedian, you are sar...</td>\n",
|
221
|
+
" <td>935c1318-3f5a-4172-b4c4-728bb8948880</td>\n",
|
222
|
+
" <td>system</td>\n",
|
223
|
+
" <td>6e490b3f-7b51-4657-95b6-6e66362338b3</td>\n",
|
224
|
+
" <td>{'lion_class': 'lionagi.protocols.messages.sys...</td>\n",
|
225
|
+
" </tr>\n",
|
226
|
+
" </tbody>\n",
|
227
|
+
"</table>\n",
|
228
|
+
"</div>"
|
229
|
+
],
|
230
|
+
"text/plain": [
|
231
|
+
" created_at role content \\\n",
|
232
|
+
"0 1.753069e+09 system {'system_message': 'As a comedian, you are sar... \n",
|
233
|
+
"\n",
|
234
|
+
" id sender \\\n",
|
235
|
+
"0 935c1318-3f5a-4172-b4c4-728bb8948880 system \n",
|
236
|
+
"\n",
|
237
|
+
" recipient \\\n",
|
238
|
+
"0 6e490b3f-7b51-4657-95b6-6e66362338b3 \n",
|
239
|
+
"\n",
|
240
|
+
" metadata \n",
|
241
|
+
"0 {'lion_class': 'lionagi.protocols.messages.sys... "
|
242
|
+
]
|
243
|
+
},
|
244
|
+
"execution_count": 9,
|
245
|
+
"metadata": {},
|
246
|
+
"output_type": "execute_result"
|
247
|
+
}
|
248
|
+
],
|
249
|
+
"source": [
|
250
|
+
"# One message, only the system\n",
|
251
|
+
"\n",
|
252
|
+
"comedian1.to_df()"
|
253
|
+
]
|
254
|
+
},
|
255
|
+
{
|
256
|
+
"cell_type": "code",
|
257
|
+
"execution_count": null,
|
258
|
+
"metadata": {},
|
259
|
+
"outputs": [
|
260
|
+
{
|
261
|
+
"data": {
|
262
|
+
"text/html": [
|
263
|
+
"<div>\n",
|
264
|
+
"<style scoped>\n",
|
265
|
+
" .dataframe tbody tr th:only-of-type {\n",
|
266
|
+
" vertical-align: middle;\n",
|
267
|
+
" }\n",
|
268
|
+
"\n",
|
269
|
+
" .dataframe tbody tr th {\n",
|
270
|
+
" vertical-align: top;\n",
|
271
|
+
" }\n",
|
272
|
+
"\n",
|
273
|
+
" .dataframe thead th {\n",
|
274
|
+
" text-align: right;\n",
|
275
|
+
" }\n",
|
276
|
+
"</style>\n",
|
277
|
+
"<table border=\"1\" class=\"dataframe\">\n",
|
278
|
+
" <thead>\n",
|
279
|
+
" <tr style=\"text-align: right;\">\n",
|
280
|
+
" <th></th>\n",
|
281
|
+
" <th>created_at</th>\n",
|
282
|
+
" <th>role</th>\n",
|
283
|
+
" <th>content</th>\n",
|
284
|
+
" <th>id</th>\n",
|
285
|
+
" <th>sender</th>\n",
|
286
|
+
" <th>recipient</th>\n",
|
287
|
+
" <th>metadata</th>\n",
|
288
|
+
" </tr>\n",
|
289
|
+
" </thead>\n",
|
290
|
+
" <tbody>\n",
|
291
|
+
" <tr>\n",
|
292
|
+
" <th>0</th>\n",
|
293
|
+
" <td>1.753069e+09</td>\n",
|
294
|
+
" <td>system</td>\n",
|
295
|
+
" <td>{'system_message': 'As a comedian, you are sar...</td>\n",
|
296
|
+
" <td>6c39df29-c90e-4a74-a404-7678d6f1f9bd</td>\n",
|
297
|
+
" <td>system</td>\n",
|
298
|
+
" <td>3c5be94e-00b2-46d7-9f0f-7715e768c7c7</td>\n",
|
299
|
+
" <td>{'lion_class': 'lionagi.protocols.messages.sys...</td>\n",
|
300
|
+
" </tr>\n",
|
301
|
+
" <tr>\n",
|
302
|
+
" <th>1</th>\n",
|
303
|
+
" <td>1.753069e+09</td>\n",
|
304
|
+
" <td>user</td>\n",
|
305
|
+
" <td>{'context': [], 'instruction': 'short joke: a ...</td>\n",
|
306
|
+
" <td>41ca3cce-a47e-4496-88c7-fd31a34eefb7</td>\n",
|
307
|
+
" <td>user</td>\n",
|
308
|
+
" <td>3c5be94e-00b2-46d7-9f0f-7715e768c7c7</td>\n",
|
309
|
+
" <td>{'lion_class': 'lionagi.protocols.messages.ins...</td>\n",
|
310
|
+
" </tr>\n",
|
311
|
+
" <tr>\n",
|
312
|
+
" <th>2</th>\n",
|
313
|
+
" <td>1.753069e+09</td>\n",
|
314
|
+
" <td>assistant</td>\n",
|
315
|
+
" <td>{'assistant_response': '<think>\n",
|
316
|
+
"Okay, so I hav...</td>\n",
|
317
|
+
" <td>eac70edd-6338-40eb-8525-a8bd25ee5836</td>\n",
|
318
|
+
" <td>3c5be94e-00b2-46d7-9f0f-7715e768c7c7</td>\n",
|
319
|
+
" <td>user</td>\n",
|
320
|
+
" <td>{'model_response': {'id': 'chatcmpl-198', 'obj...</td>\n",
|
321
|
+
" </tr>\n",
|
322
|
+
" </tbody>\n",
|
323
|
+
"</table>\n",
|
324
|
+
"</div>"
|
325
|
+
],
|
326
|
+
"text/plain": [
|
327
|
+
" created_at role content \\\n",
|
328
|
+
"0 1.753069e+09 system {'system_message': 'As a comedian, you are sar... \n",
|
329
|
+
"1 1.753069e+09 user {'context': [], 'instruction': 'short joke: a ... \n",
|
330
|
+
"2 1.753069e+09 assistant {'assistant_response': '<think>\n",
|
331
|
+
"Okay, so I hav... \n",
|
332
|
+
"\n",
|
333
|
+
" id sender \\\n",
|
334
|
+
"0 6c39df29-c90e-4a74-a404-7678d6f1f9bd system \n",
|
335
|
+
"1 41ca3cce-a47e-4496-88c7-fd31a34eefb7 user \n",
|
336
|
+
"2 eac70edd-6338-40eb-8525-a8bd25ee5836 3c5be94e-00b2-46d7-9f0f-7715e768c7c7 \n",
|
337
|
+
"\n",
|
338
|
+
" recipient \\\n",
|
339
|
+
"0 3c5be94e-00b2-46d7-9f0f-7715e768c7c7 \n",
|
340
|
+
"1 3c5be94e-00b2-46d7-9f0f-7715e768c7c7 \n",
|
341
|
+
"2 user \n",
|
342
|
+
"\n",
|
343
|
+
" metadata \n",
|
344
|
+
"0 {'lion_class': 'lionagi.protocols.messages.sys... \n",
|
345
|
+
"1 {'lion_class': 'lionagi.protocols.messages.ins... \n",
|
346
|
+
"2 {'model_response': {'id': 'chatcmpl-198', 'obj... "
|
347
|
+
]
|
348
|
+
},
|
349
|
+
"execution_count": 6,
|
350
|
+
"metadata": {},
|
351
|
+
"output_type": "execute_result"
|
352
|
+
}
|
353
|
+
],
|
354
|
+
"source": [
|
355
|
+
"# Three messages, system + user + assistant\n",
|
356
|
+
"\n",
|
357
|
+
"comedian2.to_df()"
|
358
|
+
]
|
359
|
+
},
|
360
|
+
{
|
361
|
+
"cell_type": "code",
|
362
|
+
"execution_count": null,
|
363
|
+
"metadata": {},
|
364
|
+
"outputs": [
|
365
|
+
{
|
366
|
+
"data": {
|
367
|
+
"text/plain": [
|
368
|
+
"{'model_response': {'id': 'chatcmpl-198',\n",
|
369
|
+
" 'object': 'chat.completion',\n",
|
370
|
+
" 'created': 1753069177,\n",
|
371
|
+
" 'model': 'deepseek-r1:1.5b',\n",
|
372
|
+
" 'system_fingerprint': 'fp_ollama',\n",
|
373
|
+
" 'choices': [{'index': 0,\n",
|
374
|
+
" 'message': {'role': 'assistant',\n",
|
375
|
+
" 'content': \"<think>\\nOkay, so I have this user query. Let's see what they're asking for. They want me to be a comedian who’s sarcastically funny and come up with a joke based on them. The setup is that a blue whale and a big shark meet at the bar and start dancing. Hmm.\\n\\nAlright, I need to think about how a blue whale and a shark can go smoothly or maybe accidentally dance together in a bar. Well, they're both water-based creatures. That could be a funny angle. Maybe the idea of them being on the water side? \\n\\nSo, starting with that theme, maybe something about not wanting to be too far from shorelines because there’s a lot of activity when they’re out. That ties into their characteristics. Also, considering the bar itself—sharks can be seen drinking, etc.\\n\\nPutting it all together, I should avoid sounding too serious and add some humor through their behaviors. Maybe include something playful like swishing arms or bellowing in fits. \\n\\nThe user also mentioned a short joke, so keeping it concise is key. I need to make sure it's clear and gets the point across without being too wordy.\\n\\nAlright, let me try formulating that. Maybe something about not wanting to be too far from shorelines because there’s a lot of activities out. That ties into both the blue whale and shark characteristics. \\n\\nThen have them start dancing together at the bar, keeping it humorous yet appropriate, adding some flair to make it light despite being the opposite in many ways.\\n</think>\\n\\nThe blue whale and the big shark aren’t exactly on the same boat when they pop into the bar. They’re both waterberms, like moths trapped under a glass. You know what happens next? They’ll start bellowing in fits and swishing arms like they’ve seen too many fish in total.\"},\n",
|
376
|
+
" 'finish_reason': 'stop'}],\n",
|
377
|
+
" 'usage': {'prompt_tokens': 40,\n",
|
378
|
+
" 'completion_tokens': 379,\n",
|
379
|
+
" 'total_tokens': 419}}}"
|
380
|
+
]
|
381
|
+
},
|
382
|
+
"execution_count": 7,
|
383
|
+
"metadata": {},
|
384
|
+
"output_type": "execute_result"
|
385
|
+
}
|
386
|
+
],
|
387
|
+
"source": [
|
388
|
+
"# Review the entire model response from LLMs\n",
|
389
|
+
"\n",
|
390
|
+
"comedian2.messages[-1].metadata"
|
391
|
+
]
|
392
|
+
}
|
393
|
+
],
|
394
|
+
"metadata": {
|
395
|
+
"kernelspec": {
|
396
|
+
"display_name": "lionagi",
|
397
|
+
"language": "python",
|
398
|
+
"name": "python3"
|
399
|
+
},
|
400
|
+
"language_info": {
|
401
|
+
"codemirror_mode": {
|
402
|
+
"name": "ipython",
|
403
|
+
"version": 3
|
404
|
+
},
|
405
|
+
"file_extension": ".py",
|
406
|
+
"mimetype": "text/x-python",
|
407
|
+
"name": "python",
|
408
|
+
"nbconvert_exporter": "python",
|
409
|
+
"pygments_lexer": "ipython3",
|
410
|
+
"version": "3.10.15"
|
411
|
+
}
|
412
|
+
},
|
413
|
+
"nbformat": 4,
|
414
|
+
"nbformat_minor": 2
|
415
|
+
}
|