lionagi 0.6.1__tar.gz → 0.7.1__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (275) hide show
  1. {lionagi-0.6.1 → lionagi-0.7.1}/PKG-INFO +1 -1
  2. lionagi-0.7.1/docs/Makefile +23 -0
  3. lionagi-0.7.1/docs/_static/custom.css +89 -0
  4. {lionagi-0.6.1 → lionagi-0.7.1}/docs/_templates/layout.html +23 -14
  5. lionagi-0.7.1/docs/conf.py +52 -0
  6. lionagi-0.7.1/docs/index.rst +37 -0
  7. lionagi-0.7.1/docs/modules/action.rst +128 -0
  8. lionagi-0.7.1/docs/modules/adapter.rst +120 -0
  9. lionagi-0.7.1/docs/modules/branch.rst +74 -0
  10. lionagi-0.7.1/docs/modules/branch_operations.rst +216 -0
  11. lionagi-0.7.1/docs/modules/concepts.rst +221 -0
  12. lionagi-0.7.1/docs/modules/element_id.rst +230 -0
  13. lionagi-0.7.1/docs/modules/event.rst +173 -0
  14. {lionagi-0.6.1 → lionagi-0.7.1}/docs/modules/form.rst +7 -7
  15. lionagi-0.7.1/docs/modules/graph.rst +277 -0
  16. {lionagi-0.6.1 → lionagi-0.7.1}/docs/modules/index.rst +6 -3
  17. {lionagi-0.6.1 → lionagi-0.7.1}/docs/modules/instruct.rst +4 -4
  18. {lionagi-0.6.1 → lionagi-0.7.1}/docs/modules/lib_nested.rst +3 -3
  19. {lionagi-0.6.1 → lionagi-0.7.1}/docs/modules/lib_validate.rst +1 -1
  20. lionagi-0.7.1/docs/modules/log.rst +240 -0
  21. lionagi-0.7.1/docs/modules/mail.rst +150 -0
  22. lionagi-0.7.1/docs/modules/message.rst +162 -0
  23. {lionagi-0.6.1 → lionagi-0.7.1}/docs/modules/models.rst +2 -2
  24. lionagi-0.7.1/docs/modules/pile.rst +341 -0
  25. lionagi-0.7.1/docs/modules/processor.rst +236 -0
  26. lionagi-0.7.1/docs/modules/progression.rst +261 -0
  27. {lionagi-0.6.1 → lionagi-0.7.1}/docs/modules/service.rst +3 -3
  28. {lionagi-0.6.1 → lionagi-0.7.1}/docs/modules/session.rst +2 -2
  29. lionagi-0.7.1/lionagi/libs/token_transform/llmlingua.py +1 -0
  30. lionagi-0.7.1/lionagi/libs/token_transform/perplexity.py +439 -0
  31. lionagi-0.7.1/lionagi/libs/token_transform/synthlang.py +409 -0
  32. lionagi-0.7.1/lionagi/operations/ReAct/ReAct.py +126 -0
  33. lionagi-0.7.1/lionagi/operations/ReAct/utils.py +28 -0
  34. lionagi-0.7.1/lionagi/operations/__init__.py +5 -0
  35. lionagi-0.7.1/lionagi/operations/_act/act.py +73 -0
  36. lionagi-0.7.1/lionagi/operations/chat/chat.py +173 -0
  37. lionagi-0.7.1/lionagi/operations/communicate/communicate.py +108 -0
  38. lionagi-0.7.1/lionagi/operations/instruct/instruct.py +29 -0
  39. lionagi-0.7.1/lionagi/operations/interpret/interpret.py +39 -0
  40. lionagi-0.7.1/lionagi/operations/operate/operate.py +194 -0
  41. lionagi-0.7.1/lionagi/operations/parse/parse.py +89 -0
  42. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operations/plan/plan.py +3 -3
  43. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operations/select/select.py +11 -30
  44. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operations/select/utils.py +13 -2
  45. lionagi-0.7.1/lionagi/operations/translate/__init__.py +0 -0
  46. lionagi-0.7.1/lionagi/operations/translate/translate.py +47 -0
  47. lionagi-0.7.1/lionagi/operations/types.py +29 -0
  48. lionagi-0.7.1/lionagi/operatives/action/manager.py +258 -0
  49. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operatives/action/request_response_model.py +31 -0
  50. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operatives/action/tool.py +50 -20
  51. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/_concepts.py +1 -1
  52. lionagi-0.7.1/lionagi/protocols/adapters/__init__.py +0 -0
  53. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/adapters/adapter.py +25 -0
  54. lionagi-0.7.1/lionagi/protocols/adapters/json_adapter.py +181 -0
  55. lionagi-0.7.1/lionagi/protocols/adapters/pandas_/__init__.py +0 -0
  56. lionagi-0.7.1/lionagi/protocols/adapters/pandas_/csv_adapter.py +94 -0
  57. lionagi-0.7.1/lionagi/protocols/adapters/pandas_/excel_adapter.py +94 -0
  58. lionagi-0.7.1/lionagi/protocols/adapters/pandas_/pd_dataframe_adapter.py +81 -0
  59. lionagi-0.7.1/lionagi/protocols/adapters/pandas_/pd_series_adapter.py +57 -0
  60. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/generic/element.py +1 -1
  61. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/generic/pile.py +5 -8
  62. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/graph/edge.py +1 -1
  63. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/graph/graph.py +16 -8
  64. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/graph/node.py +1 -1
  65. lionagi-0.7.1/lionagi/protocols/mail/exchange.py +227 -0
  66. lionagi-0.7.1/lionagi/protocols/mail/mail.py +58 -0
  67. lionagi-0.7.1/lionagi/protocols/mail/mailbox.py +109 -0
  68. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/mail/manager.py +97 -41
  69. lionagi-0.7.1/lionagi/protocols/mail/package.py +109 -0
  70. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/messages/action_request.py +77 -26
  71. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/messages/action_response.py +55 -26
  72. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/messages/assistant_response.py +50 -15
  73. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/messages/base.py +36 -0
  74. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/messages/instruction.py +175 -145
  75. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/messages/manager.py +152 -56
  76. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/messages/message.py +61 -25
  77. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/messages/system.py +54 -19
  78. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/service/imodel.py +24 -0
  79. lionagi-0.7.1/lionagi/service/providers/__init__.py +3 -0
  80. lionagi-0.7.1/lionagi/service/providers/anthropic_/__init__.py +3 -0
  81. lionagi-0.7.1/lionagi/service/providers/groq_/__init__.py +3 -0
  82. lionagi-0.7.1/lionagi/service/providers/openai_/__init__.py +3 -0
  83. lionagi-0.7.1/lionagi/service/providers/openrouter_/__init__.py +3 -0
  84. lionagi-0.7.1/lionagi/service/providers/perplexity_/__init__.py +3 -0
  85. lionagi-0.7.1/lionagi/session/__init__.py +3 -0
  86. lionagi-0.7.1/lionagi/session/branch.py +1464 -0
  87. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/utils.py +1 -0
  88. lionagi-0.7.1/lionagi/version.py +1 -0
  89. lionagi-0.7.1/prompts/doc_style.md +239 -0
  90. {lionagi-0.6.1 → lionagi-0.7.1}/pyproject.toml +9 -1
  91. {lionagi-0.6.1 → lionagi-0.7.1}/uv.lock +349 -1
  92. lionagi-0.6.1/docs/Makefile +0 -20
  93. lionagi-0.6.1/docs/_static/custom.css +0 -59
  94. lionagi-0.6.1/docs/conf.py +0 -56
  95. lionagi-0.6.1/docs/index.rst +0 -35
  96. lionagi-0.6.1/docs/modules/action.rst +0 -339
  97. lionagi-0.6.1/docs/modules/adapter.rst +0 -241
  98. lionagi-0.6.1/docs/modules/branch.rst +0 -215
  99. lionagi-0.6.1/docs/modules/concepts.rst +0 -214
  100. lionagi-0.6.1/docs/modules/event.rst +0 -38
  101. lionagi-0.6.1/docs/modules/graph.rst +0 -238
  102. lionagi-0.6.1/docs/modules/mail.rst +0 -303
  103. lionagi-0.6.1/docs/modules/message.rst +0 -295
  104. lionagi-0.6.1/docs/modules/operations.rst +0 -111
  105. lionagi-0.6.1/docs/modules/pile_progression.rst +0 -324
  106. lionagi-0.6.1/docs/modules/strategies.rst +0 -140
  107. lionagi-0.6.1/docs/operations/core_operations.rst +0 -23
  108. lionagi-0.6.1/docs/operations/index.rst +0 -13
  109. lionagi-0.6.1/docs/operations/strategies.rst +0 -37
  110. lionagi-0.6.1/lionagi/libs/compress/models.py +0 -66
  111. lionagi-0.6.1/lionagi/libs/compress/utils.py +0 -69
  112. lionagi-0.6.1/lionagi/operations/__init__.py +0 -13
  113. lionagi-0.6.1/lionagi/operations/select/__init__.py +0 -7
  114. lionagi-0.6.1/lionagi/operations/select/prompt.py +0 -5
  115. lionagi-0.6.1/lionagi/operations/types.py +0 -13
  116. lionagi-0.6.1/lionagi/operatives/action/manager.py +0 -236
  117. lionagi-0.6.1/lionagi/protocols/adapters/json_adapter.py +0 -101
  118. lionagi-0.6.1/lionagi/protocols/adapters/pandas_/csv_adapter.py +0 -50
  119. lionagi-0.6.1/lionagi/protocols/adapters/pandas_/excel_adapter.py +0 -52
  120. lionagi-0.6.1/lionagi/protocols/adapters/pandas_/pd_dataframe_adapter.py +0 -31
  121. lionagi-0.6.1/lionagi/protocols/adapters/pandas_/pd_series_adapter.py +0 -17
  122. lionagi-0.6.1/lionagi/protocols/mail/exchange.py +0 -116
  123. lionagi-0.6.1/lionagi/protocols/mail/mail.py +0 -25
  124. lionagi-0.6.1/lionagi/protocols/mail/mailbox.py +0 -47
  125. lionagi-0.6.1/lionagi/protocols/mail/package.py +0 -55
  126. lionagi-0.6.1/lionagi/session/branch.py +0 -1287
  127. lionagi-0.6.1/lionagi/version.py +0 -1
  128. {lionagi-0.6.1 → lionagi-0.7.1}/.env.example +0 -0
  129. {lionagi-0.6.1 → lionagi-0.7.1}/.github/FUNDING.yml +0 -0
  130. {lionagi-0.6.1 → lionagi-0.7.1}/.github/dependabot.yml +0 -0
  131. {lionagi-0.6.1 → lionagi-0.7.1}/.github/workflows/ci.yml +0 -0
  132. {lionagi-0.6.1 → lionagi-0.7.1}/.github/workflows/codeql.yml +0 -0
  133. {lionagi-0.6.1 → lionagi-0.7.1}/.github/workflows/docs.yml +0 -0
  134. {lionagi-0.6.1 → lionagi-0.7.1}/.github/workflows/release.yml +0 -0
  135. {lionagi-0.6.1 → lionagi-0.7.1}/.gitignore +0 -0
  136. {lionagi-0.6.1 → lionagi-0.7.1}/.pre-commit-config.yaml +0 -0
  137. {lionagi-0.6.1 → lionagi-0.7.1}/.python-version +0 -0
  138. {lionagi-0.6.1 → lionagi-0.7.1}/CODE_OF_CONDUCT.md +0 -0
  139. {lionagi-0.6.1 → lionagi-0.7.1}/CONTRIBUTING.md +0 -0
  140. {lionagi-0.6.1 → lionagi-0.7.1}/LICENSE +0 -0
  141. {lionagi-0.6.1 → lionagi-0.7.1}/README.md +0 -0
  142. {lionagi-0.6.1 → lionagi-0.7.1}/dev_tools/count_code_base_lines.py +0 -0
  143. {lionagi-0.6.1 → lionagi-0.7.1}/docs/modules/lib_file.rst +0 -0
  144. {lionagi-0.6.1 → lionagi-0.7.1}/docs/modules/lib_package.rst +0 -0
  145. {lionagi-0.6.1 → lionagi-0.7.1}/docs/modules/lib_schema.rst +0 -0
  146. {lionagi-0.6.1 → lionagi-0.7.1}/docs/modules/operative_step.rst +0 -0
  147. {lionagi-0.6.1 → lionagi-0.7.1}/docs/modules/utils.rst +0 -0
  148. {lionagi-0.6.1 → lionagi-0.7.1}/docs/tutorials/get_started.rst +0 -0
  149. {lionagi-0.6.1 → lionagi-0.7.1}/docs/tutorials/get_started_pt2.rst +0 -0
  150. {lionagi-0.6.1 → lionagi-0.7.1}/docs/tutorials/get_started_pt3.rst +0 -0
  151. {lionagi-0.6.1 → lionagi-0.7.1}/docs/tutorials/index.rst +0 -0
  152. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/__init__.py +0 -0
  153. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/_class_registry.py +0 -0
  154. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/_errors.py +0 -0
  155. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/__init__.py +0 -0
  156. {lionagi-0.6.1/lionagi/libs/compress → lionagi-0.7.1/lionagi/libs/file}/__init__.py +0 -0
  157. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/file/chunk.py +0 -0
  158. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/file/file_ops.py +0 -0
  159. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/file/params.py +0 -0
  160. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/file/process.py +0 -0
  161. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/file/save.py +0 -0
  162. {lionagi-0.6.1/lionagi/libs/file → lionagi-0.7.1/lionagi/libs/nested}/__init__.py +0 -0
  163. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/nested/flatten.py +0 -0
  164. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/nested/nfilter.py +0 -0
  165. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/nested/nget.py +0 -0
  166. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/nested/ninsert.py +0 -0
  167. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/nested/nmerge.py +0 -0
  168. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/nested/npop.py +0 -0
  169. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/nested/nset.py +0 -0
  170. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/nested/unflatten.py +0 -0
  171. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/nested/utils.py +0 -0
  172. {lionagi-0.6.1/lionagi/libs/nested → lionagi-0.7.1/lionagi/libs/package}/__init__.py +0 -0
  173. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/package/imports.py +0 -0
  174. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/package/management.py +0 -0
  175. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/package/params.py +0 -0
  176. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/package/system.py +0 -0
  177. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/parse.py +0 -0
  178. {lionagi-0.6.1/lionagi/libs/package → lionagi-0.7.1/lionagi/libs/schema}/__init__.py +0 -0
  179. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/schema/as_readable.py +0 -0
  180. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/schema/extract_code_block.py +0 -0
  181. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/schema/extract_docstring.py +0 -0
  182. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/schema/function_to_schema.py +0 -0
  183. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/schema/json_schema.py +0 -0
  184. {lionagi-0.6.1/lionagi/protocols/adapters → lionagi-0.7.1/lionagi/libs/token_transform}/__init__.py +0 -0
  185. {lionagi-0.6.1/lionagi/libs/schema → lionagi-0.7.1/lionagi/libs/validate}/__init__.py +0 -0
  186. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/validate/common_field_validators.py +0 -0
  187. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/validate/fuzzy_match_keys.py +0 -0
  188. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/validate/fuzzy_validate_mapping.py +0 -0
  189. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/validate/string_similarity.py +0 -0
  190. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/libs/validate/validate_boolean.py +0 -0
  191. {lionagi-0.6.1/lionagi/libs/validate → lionagi-0.7.1/lionagi/operations/ReAct}/__init__.py +0 -0
  192. {lionagi-0.6.1/lionagi/operations/brainstorm → lionagi-0.7.1/lionagi/operations/_act}/__init__.py +0 -0
  193. {lionagi-0.6.1/lionagi/operations/strategies → lionagi-0.7.1/lionagi/operations/brainstorm}/__init__.py +0 -0
  194. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operations/brainstorm/brainstorm.py +0 -0
  195. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operations/brainstorm/prompt.py +0 -0
  196. {lionagi-0.6.1/lionagi/operatives → lionagi-0.7.1/lionagi/operations/chat}/__init__.py +0 -0
  197. {lionagi-0.6.1/lionagi/protocols/adapters/pandas_ → lionagi-0.7.1/lionagi/operations/communicate}/__init__.py +0 -0
  198. {lionagi-0.6.1/lionagi/operatives/action → lionagi-0.7.1/lionagi/operations/instruct}/__init__.py +0 -0
  199. {lionagi-0.6.1/lionagi/operatives/forms → lionagi-0.7.1/lionagi/operations/interpret}/__init__.py +0 -0
  200. {lionagi-0.6.1/lionagi/operatives/instruct → lionagi-0.7.1/lionagi/operations/operate}/__init__.py +0 -0
  201. {lionagi-0.6.1/lionagi/operatives/models → lionagi-0.7.1/lionagi/operations/parse}/__init__.py +0 -0
  202. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operations/plan/__init__.py +0 -0
  203. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operations/plan/prompt.py +0 -0
  204. {lionagi-0.6.1/lionagi/protocols → lionagi-0.7.1/lionagi/operations/select}/__init__.py +0 -0
  205. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operations/utils.py +0 -0
  206. {lionagi-0.6.1/lionagi/protocols/generic → lionagi-0.7.1/lionagi/operatives}/__init__.py +0 -0
  207. {lionagi-0.6.1/lionagi/protocols/graph → lionagi-0.7.1/lionagi/operatives/action}/__init__.py +0 -0
  208. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operatives/action/function_calling.py +0 -0
  209. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operatives/action/utils.py +0 -0
  210. {lionagi-0.6.1/lionagi/protocols/mail → lionagi-0.7.1/lionagi/operatives/forms}/__init__.py +0 -0
  211. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operatives/forms/base.py +0 -0
  212. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operatives/forms/form.py +0 -0
  213. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operatives/forms/report.py +0 -0
  214. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operatives/forms/utils.py +0 -0
  215. {lionagi-0.6.1/lionagi/protocols/messages → lionagi-0.7.1/lionagi/operatives/instruct}/__init__.py +0 -0
  216. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operatives/instruct/base.py +0 -0
  217. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operatives/instruct/instruct.py +0 -0
  218. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operatives/instruct/instruct_collection.py +0 -0
  219. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operatives/instruct/node.py +0 -0
  220. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operatives/instruct/prompts.py +0 -0
  221. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operatives/instruct/reason.py +0 -0
  222. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operatives/manager.py +0 -0
  223. {lionagi-0.6.1/lionagi/service/endpoints → lionagi-0.7.1/lionagi/operatives/models}/__init__.py +0 -0
  224. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operatives/models/field_model.py +0 -0
  225. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operatives/models/model_params.py +0 -0
  226. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operatives/models/note.py +0 -0
  227. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operatives/models/operable_model.py +0 -0
  228. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operatives/models/schema_model.py +0 -0
  229. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operatives/operative.py +0 -0
  230. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operatives/step.py +0 -0
  231. {lionagi-0.6.1/lionagi/service/providers → lionagi-0.7.1/lionagi/operatives/strategies}/__init__.py +0 -0
  232. {lionagi-0.6.1/lionagi/operations → lionagi-0.7.1/lionagi/operatives}/strategies/base.py +0 -0
  233. {lionagi-0.6.1/lionagi/operations → lionagi-0.7.1/lionagi/operatives}/strategies/concurrent.py +0 -0
  234. {lionagi-0.6.1/lionagi/operations → lionagi-0.7.1/lionagi/operatives}/strategies/concurrent_chunk.py +0 -0
  235. {lionagi-0.6.1/lionagi/operations → lionagi-0.7.1/lionagi/operatives}/strategies/concurrent_sequential_chunk.py +0 -0
  236. {lionagi-0.6.1/lionagi/operations → lionagi-0.7.1/lionagi/operatives}/strategies/params.py +0 -0
  237. {lionagi-0.6.1/lionagi/operations → lionagi-0.7.1/lionagi/operatives}/strategies/sequential.py +0 -0
  238. {lionagi-0.6.1/lionagi/operations → lionagi-0.7.1/lionagi/operatives}/strategies/sequential_chunk.py +0 -0
  239. {lionagi-0.6.1/lionagi/operations → lionagi-0.7.1/lionagi/operatives}/strategies/sequential_concurrent_chunk.py +0 -0
  240. {lionagi-0.6.1/lionagi/operations → lionagi-0.7.1/lionagi/operatives}/strategies/utils.py +0 -0
  241. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/operatives/types.py +0 -0
  242. {lionagi-0.6.1/lionagi/service/providers/anthropic_ → lionagi-0.7.1/lionagi/protocols}/__init__.py +0 -0
  243. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/adapters/types.py +0 -0
  244. {lionagi-0.6.1/lionagi/service/providers/groq_ → lionagi-0.7.1/lionagi/protocols/generic}/__init__.py +0 -0
  245. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/generic/event.py +0 -0
  246. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/generic/log.py +0 -0
  247. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/generic/processor.py +0 -0
  248. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/generic/progression.py +0 -0
  249. {lionagi-0.6.1/lionagi/service/providers/openai_ → lionagi-0.7.1/lionagi/protocols/graph}/__init__.py +0 -0
  250. {lionagi-0.6.1/lionagi/service/providers/openrouter_ → lionagi-0.7.1/lionagi/protocols/mail}/__init__.py +0 -0
  251. {lionagi-0.6.1/lionagi/service/providers/perplexity_ → lionagi-0.7.1/lionagi/protocols/messages}/__init__.py +0 -0
  252. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/messages/templates/README.md +0 -0
  253. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/messages/templates/action_request.jinja2 +0 -0
  254. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/messages/templates/action_response.jinja2 +0 -0
  255. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/messages/templates/assistant_response.jinja2 +0 -0
  256. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/messages/templates/instruction_message.jinja2 +0 -0
  257. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/messages/templates/system_message.jinja2 +0 -0
  258. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/messages/templates/tool_schemas.jinja2 +0 -0
  259. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/protocols/types.py +0 -0
  260. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/service/__init__.py +0 -0
  261. {lionagi-0.6.1/lionagi/session → lionagi-0.7.1/lionagi/service/endpoints}/__init__.py +0 -0
  262. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/service/endpoints/base.py +0 -0
  263. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/service/endpoints/chat_completion.py +0 -0
  264. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/service/endpoints/match_endpoint.py +0 -0
  265. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/service/endpoints/rate_limited_processor.py +0 -0
  266. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/service/endpoints/token_calculator.py +0 -0
  267. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/service/manager.py +0 -0
  268. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/service/providers/anthropic_/messages.py +0 -0
  269. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/service/providers/groq_/chat_completions.py +0 -0
  270. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/service/providers/openai_/chat_completions.py +0 -0
  271. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/service/providers/openrouter_/chat_completions.py +0 -0
  272. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/service/providers/perplexity_/chat_completions.py +0 -0
  273. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/service/types.py +0 -0
  274. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/session/session.py +0 -0
  275. {lionagi-0.6.1 → lionagi-0.7.1}/lionagi/settings.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lionagi
3
- Version: 0.6.1
3
+ Version: 0.7.1
4
4
  Summary: An AGentic Intelligence Operating System.
5
5
  Author-email: HaiyangLi <quantocean.li@gmail.com>
6
6
  License: Apache License
@@ -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/lion-agi/lionagi"
6
+ href="https://github.com/your-org/your-repo"
9
7
  target="_blank"
10
8
  rel="noopener noreferrer"
11
- title="View this project on GitHub">
12
- <!-- Optional: embed an inline GitHub icon using an SVG -->
13
- <svg class="gh-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor">
14
- <path
15
- d="M12 .297c-6.63 0-12 5.373-12 12 0 5.303
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
- </svg>
30
- <span>View on GitHub</span>
31
- </a>
32
- </div>
33
- {{ super() }}
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``