lionagi 0.10.2__tar.gz → 0.10.4__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.
Files changed (282) hide show
  1. {lionagi-0.10.2 → lionagi-0.10.4}/PKG-INFO +3 -3
  2. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/adapters/toml_adapter.py +1 -1
  3. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/fields/__init__.py +5 -10
  4. lionagi-0.10.4/lionagi/fields/code.py +236 -0
  5. lionagi-0.10.4/lionagi/fields/file.py +231 -0
  6. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/fields/reason.py +5 -6
  7. lionagi-0.10.4/lionagi/fields/research.py +49 -0
  8. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/token_transform/synthlang_/base.py +1 -1
  9. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/token_transform/synthlang_/resources/frameworks/framework_options.json +1 -1
  10. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/token_transform/synthlang_/resources/mapping/lion_emoji_mapping.toml +1 -1
  11. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/token_transform/synthlang_/resources/mapping/python_math_mapping.toml +1 -1
  12. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/token_transform/synthlang_/resources/mapping/rust_chinese_mapping.toml +1 -1
  13. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/ReAct/utils.py +36 -15
  14. lionagi-0.10.4/lionagi/version.py +1 -0
  15. {lionagi-0.10.2 → lionagi-0.10.4}/pyproject.toml +3 -3
  16. {lionagi-0.10.2 → lionagi-0.10.4}/uv.lock +6 -6
  17. lionagi-0.10.2/lionagi/fields/file.py +0 -130
  18. lionagi-0.10.2/lionagi/version.py +0 -1
  19. {lionagi-0.10.2 → lionagi-0.10.4}/.env.example +0 -0
  20. {lionagi-0.10.2 → lionagi-0.10.4}/.github/FUNDING.yml +0 -0
  21. {lionagi-0.10.2 → lionagi-0.10.4}/.github/dependabot.yml +0 -0
  22. {lionagi-0.10.2 → lionagi-0.10.4}/.github/workflows/ci.yml +0 -0
  23. {lionagi-0.10.2 → lionagi-0.10.4}/.github/workflows/codeql.yml +0 -0
  24. {lionagi-0.10.2 → lionagi-0.10.4}/.github/workflows/docs.yml +0 -0
  25. {lionagi-0.10.2 → lionagi-0.10.4}/.github/workflows/release.yml +0 -0
  26. {lionagi-0.10.2 → lionagi-0.10.4}/.gitignore +0 -0
  27. {lionagi-0.10.2 → lionagi-0.10.4}/.pre-commit-config.yaml +0 -0
  28. {lionagi-0.10.2 → lionagi-0.10.4}/CODE_OF_CONDUCT.md +0 -0
  29. {lionagi-0.10.2 → lionagi-0.10.4}/CONTRIBUTING.md +0 -0
  30. {lionagi-0.10.2 → lionagi-0.10.4}/LICENSE +0 -0
  31. {lionagi-0.10.2 → lionagi-0.10.4}/README.md +0 -0
  32. {lionagi-0.10.2 → lionagi-0.10.4}/cookbooks/ch01_get_started.md +0 -0
  33. {lionagi-0.10.2 → lionagi-0.10.4}/cookbooks/ch02_concepts.md +0 -0
  34. {lionagi-0.10.2 → lionagi-0.10.4}/dev_tools/count_code_base_lines.py +0 -0
  35. {lionagi-0.10.2 → lionagi-0.10.4}/docs/Makefile +0 -0
  36. {lionagi-0.10.2 → lionagi-0.10.4}/docs/_static/custom.css +0 -0
  37. {lionagi-0.10.2 → lionagi-0.10.4}/docs/_templates/layout.html +0 -0
  38. {lionagi-0.10.2 → lionagi-0.10.4}/docs/conf.py +0 -0
  39. {lionagi-0.10.2 → lionagi-0.10.4}/docs/index.rst +0 -0
  40. {lionagi-0.10.2 → lionagi-0.10.4}/docs/modules/action.rst +0 -0
  41. {lionagi-0.10.2 → lionagi-0.10.4}/docs/modules/adapter.rst +0 -0
  42. {lionagi-0.10.2 → lionagi-0.10.4}/docs/modules/branch.rst +0 -0
  43. {lionagi-0.10.2 → lionagi-0.10.4}/docs/modules/branch_operations.rst +0 -0
  44. {lionagi-0.10.2 → lionagi-0.10.4}/docs/modules/concepts.rst +0 -0
  45. {lionagi-0.10.2 → lionagi-0.10.4}/docs/modules/element_id.rst +0 -0
  46. {lionagi-0.10.2 → lionagi-0.10.4}/docs/modules/event.rst +0 -0
  47. {lionagi-0.10.2 → lionagi-0.10.4}/docs/modules/form.rst +0 -0
  48. {lionagi-0.10.2 → lionagi-0.10.4}/docs/modules/graph.rst +0 -0
  49. {lionagi-0.10.2 → lionagi-0.10.4}/docs/modules/index.rst +0 -0
  50. {lionagi-0.10.2 → lionagi-0.10.4}/docs/modules/instruct.rst +0 -0
  51. {lionagi-0.10.2 → lionagi-0.10.4}/docs/modules/lib_file.rst +0 -0
  52. {lionagi-0.10.2 → lionagi-0.10.4}/docs/modules/lib_nested.rst +0 -0
  53. {lionagi-0.10.2 → lionagi-0.10.4}/docs/modules/lib_package.rst +0 -0
  54. {lionagi-0.10.2 → lionagi-0.10.4}/docs/modules/lib_schema.rst +0 -0
  55. {lionagi-0.10.2 → lionagi-0.10.4}/docs/modules/lib_validate.rst +0 -0
  56. {lionagi-0.10.2 → lionagi-0.10.4}/docs/modules/log.rst +0 -0
  57. {lionagi-0.10.2 → lionagi-0.10.4}/docs/modules/mail.rst +0 -0
  58. {lionagi-0.10.2 → lionagi-0.10.4}/docs/modules/message.rst +0 -0
  59. {lionagi-0.10.2 → lionagi-0.10.4}/docs/modules/models.rst +0 -0
  60. {lionagi-0.10.2 → lionagi-0.10.4}/docs/modules/operative_step.rst +0 -0
  61. {lionagi-0.10.2 → lionagi-0.10.4}/docs/modules/pile.rst +0 -0
  62. {lionagi-0.10.2 → lionagi-0.10.4}/docs/modules/processor.rst +0 -0
  63. {lionagi-0.10.2 → lionagi-0.10.4}/docs/modules/progression.rst +0 -0
  64. {lionagi-0.10.2 → lionagi-0.10.4}/docs/modules/service.rst +0 -0
  65. {lionagi-0.10.2 → lionagi-0.10.4}/docs/modules/session.rst +0 -0
  66. {lionagi-0.10.2 → lionagi-0.10.4}/docs/modules/utils.rst +0 -0
  67. {lionagi-0.10.2 → lionagi-0.10.4}/docs/tutorials/get_started.rst +0 -0
  68. {lionagi-0.10.2 → lionagi-0.10.4}/docs/tutorials/get_started_pt2.rst +0 -0
  69. {lionagi-0.10.2 → lionagi-0.10.4}/docs/tutorials/get_started_pt3.rst +0 -0
  70. {lionagi-0.10.2 → lionagi-0.10.4}/docs/tutorials/index.rst +0 -0
  71. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/__init__.py +0 -0
  72. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/_class_registry.py +0 -0
  73. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/_errors.py +0 -0
  74. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/_types.py +0 -0
  75. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/adapters/__init__.py +0 -0
  76. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/adapters/adapter.py +0 -0
  77. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/adapters/json_adapter.py +0 -0
  78. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/adapters/pandas_/__init__.py +0 -0
  79. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/adapters/pandas_/csv_adapter.py +0 -0
  80. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/adapters/pandas_/excel_adapter.py +0 -0
  81. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/adapters/pandas_/pd_dataframe_adapter.py +0 -0
  82. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/adapters/pandas_/pd_series_adapter.py +0 -0
  83. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/adapters/types.py +0 -0
  84. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/fields/action.py +0 -0
  85. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/fields/base.py +0 -0
  86. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/fields/instruct.py +0 -0
  87. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/__init__.py +0 -0
  88. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/file/__init__.py +0 -0
  89. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/file/chunk.py +0 -0
  90. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/file/concat_files.py +0 -0
  91. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/file/file_ops.py +0 -0
  92. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/file/params.py +0 -0
  93. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/file/process.py +0 -0
  94. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/file/save.py +0 -0
  95. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/nested/__init__.py +0 -0
  96. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/nested/flatten.py +0 -0
  97. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/nested/nfilter.py +0 -0
  98. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/nested/nget.py +0 -0
  99. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/nested/ninsert.py +0 -0
  100. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/nested/nmerge.py +0 -0
  101. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/nested/npop.py +0 -0
  102. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/nested/nset.py +0 -0
  103. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/nested/unflatten.py +0 -0
  104. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/nested/utils.py +0 -0
  105. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/package/__init__.py +0 -0
  106. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/package/imports.py +0 -0
  107. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/package/management.py +0 -0
  108. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/package/params.py +0 -0
  109. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/package/system.py +0 -0
  110. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/parse.py +0 -0
  111. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/schema/__init__.py +0 -0
  112. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/schema/as_readable.py +0 -0
  113. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/schema/extract_code_block.py +0 -0
  114. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/schema/extract_docstring.py +0 -0
  115. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/schema/function_to_schema.py +0 -0
  116. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/schema/json_schema.py +0 -0
  117. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/token_transform/__init__.py +0 -0
  118. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/token_transform/base.py +0 -0
  119. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/token_transform/llmlingua.py +0 -0
  120. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/token_transform/perplexity.py +0 -0
  121. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/token_transform/symbolic_compress_context.py +0 -0
  122. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/token_transform/synthlang.py +0 -0
  123. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/token_transform/synthlang_/resources/frameworks/abstract_algebra.toml +0 -0
  124. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/token_transform/synthlang_/resources/frameworks/category_theory.toml +0 -0
  125. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/token_transform/synthlang_/resources/frameworks/complex_analysis.toml +0 -0
  126. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/token_transform/synthlang_/resources/frameworks/group_theory.toml +0 -0
  127. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/token_transform/synthlang_/resources/frameworks/math_logic.toml +0 -0
  128. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/token_transform/synthlang_/resources/frameworks/reflective_patterns.toml +0 -0
  129. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/token_transform/synthlang_/resources/frameworks/set_theory.toml +0 -0
  130. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/token_transform/synthlang_/resources/frameworks/topology_fundamentals.toml +0 -0
  131. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/token_transform/synthlang_/resources/utility/base_synthlang_system_prompt.toml +0 -0
  132. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/token_transform/synthlang_/translate_to_synthlang.py +0 -0
  133. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/token_transform/types.py +0 -0
  134. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/validate/__init__.py +0 -0
  135. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/validate/common_field_validators.py +0 -0
  136. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/validate/fuzzy_match_keys.py +0 -0
  137. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/validate/fuzzy_validate_mapping.py +0 -0
  138. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/validate/string_similarity.py +0 -0
  139. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/libs/validate/validate_boolean.py +0 -0
  140. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/models/__init__.py +0 -0
  141. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/models/field_model.py +0 -0
  142. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/models/hashable_model.py +0 -0
  143. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/models/model_params.py +0 -0
  144. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/models/note.py +0 -0
  145. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/models/operable_model.py +0 -0
  146. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/models/schema_model.py +0 -0
  147. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/ReAct/ReAct.py +0 -0
  148. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/ReAct/__init__.py +0 -0
  149. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/__init__.py +0 -0
  150. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/_act/__init__.py +0 -0
  151. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/_act/act.py +0 -0
  152. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/brainstorm/__init__.py +0 -0
  153. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/brainstorm/brainstorm.py +0 -0
  154. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/brainstorm/prompt.py +0 -0
  155. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/chat/__init__.py +0 -0
  156. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/chat/chat.py +0 -0
  157. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/communicate/__init__.py +0 -0
  158. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/communicate/communicate.py +0 -0
  159. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/instruct/__init__.py +0 -0
  160. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/instruct/instruct.py +0 -0
  161. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/interpret/__init__.py +0 -0
  162. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/interpret/interpret.py +0 -0
  163. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/manager.py +0 -0
  164. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/operate/__init__.py +0 -0
  165. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/operate/operate.py +0 -0
  166. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/parse/__init__.py +0 -0
  167. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/parse/parse.py +0 -0
  168. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/plan/__init__.py +0 -0
  169. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/plan/plan.py +0 -0
  170. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/plan/prompt.py +0 -0
  171. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/select/__init__.py +0 -0
  172. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/select/select.py +0 -0
  173. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/select/utils.py +0 -0
  174. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/translate/__init__.py +0 -0
  175. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/translate/translate.py +0 -0
  176. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/types.py +0 -0
  177. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/operations/utils.py +0 -0
  178. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/__init__.py +0 -0
  179. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/_concepts.py +0 -0
  180. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/action/__init__.py +0 -0
  181. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/action/function_calling.py +0 -0
  182. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/action/manager.py +0 -0
  183. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/action/tool.py +0 -0
  184. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/forms/__init__.py +0 -0
  185. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/forms/base.py +0 -0
  186. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/forms/flow.py +0 -0
  187. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/forms/form.py +0 -0
  188. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/forms/report.py +0 -0
  189. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/generic/__init__.py +0 -0
  190. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/generic/element.py +0 -0
  191. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/generic/event.py +0 -0
  192. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/generic/log.py +0 -0
  193. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/generic/pile.py +0 -0
  194. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/generic/processor.py +0 -0
  195. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/generic/progression.py +0 -0
  196. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/graph/__init__.py +0 -0
  197. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/graph/edge.py +0 -0
  198. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/graph/graph.py +0 -0
  199. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/graph/node.py +0 -0
  200. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/mail/__init__.py +0 -0
  201. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/mail/exchange.py +0 -0
  202. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/mail/mail.py +0 -0
  203. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/mail/mailbox.py +0 -0
  204. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/mail/manager.py +0 -0
  205. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/mail/package.py +0 -0
  206. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/messages/__init__.py +0 -0
  207. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/messages/action_request.py +0 -0
  208. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/messages/action_response.py +0 -0
  209. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/messages/assistant_response.py +0 -0
  210. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/messages/base.py +0 -0
  211. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/messages/instruction.py +0 -0
  212. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/messages/manager.py +0 -0
  213. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/messages/message.py +0 -0
  214. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/messages/system.py +0 -0
  215. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/messages/templates/README.md +0 -0
  216. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/messages/templates/action_request.jinja2 +0 -0
  217. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/messages/templates/action_response.jinja2 +0 -0
  218. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/messages/templates/assistant_response.jinja2 +0 -0
  219. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/messages/templates/instruction_message.jinja2 +0 -0
  220. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/messages/templates/system_message.jinja2 +0 -0
  221. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/messages/templates/tool_schemas.jinja2 +0 -0
  222. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/operatives/__init__.py +0 -0
  223. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/operatives/operative.py +0 -0
  224. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/operatives/step.py +0 -0
  225. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/protocols/types.py +0 -0
  226. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/__init__.py +0 -0
  227. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/endpoints/__init__.py +0 -0
  228. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/endpoints/base.py +0 -0
  229. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/endpoints/chat_completion.py +0 -0
  230. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/endpoints/match_endpoint.py +0 -0
  231. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/endpoints/rate_limited_processor.py +0 -0
  232. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/endpoints/token_calculator.py +0 -0
  233. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/imodel.py +0 -0
  234. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/manager.py +0 -0
  235. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/providers/__init__.py +0 -0
  236. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/providers/anthropic_/__init__.py +0 -0
  237. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/providers/anthropic_/messages.py +0 -0
  238. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/providers/exa_/__init__.py +0 -0
  239. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/providers/exa_/models.py +0 -0
  240. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/providers/exa_/search.py +0 -0
  241. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/providers/exa_/types.py +0 -0
  242. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/providers/groq_/__init__.py +0 -0
  243. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/providers/groq_/chat_completions.py +0 -0
  244. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/providers/ollama_/__init__.py +0 -0
  245. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/providers/ollama_/chat_completions.py +0 -0
  246. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/providers/openai_/__init__.py +0 -0
  247. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/providers/openai_/chat_completions.py +0 -0
  248. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/providers/openai_/spec.py +0 -0
  249. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/providers/openrouter_/__init__.py +0 -0
  250. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/providers/openrouter_/chat_completions.py +0 -0
  251. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/providers/perplexity_/__init__.py +0 -0
  252. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/providers/perplexity_/chat_completions.py +0 -0
  253. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/providers/perplexity_/models.py +0 -0
  254. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/providers/types.py +0 -0
  255. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/service/types.py +0 -0
  256. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/session/__init__.py +0 -0
  257. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/session/branch.py +0 -0
  258. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/session/prompts.py +0 -0
  259. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/session/session.py +0 -0
  260. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/settings.py +0 -0
  261. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/tools/__init__.py +0 -0
  262. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/tools/base.py +0 -0
  263. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/tools/browser/__init__.py +0 -0
  264. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/tools/browser/providers/__init__.py +0 -0
  265. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/tools/browser/providers/browser_use_.py +0 -0
  266. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/tools/code/__init__.py +0 -0
  267. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/tools/code/coder.py +0 -0
  268. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/tools/code/manager.py +0 -0
  269. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/tools/code/providers/__init__.py +0 -0
  270. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/tools/code/providers/aider_.py +0 -0
  271. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/tools/code/providers/e2b_.py +0 -0
  272. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/tools/code/sandbox.py +0 -0
  273. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/tools/file/__init__.py +0 -0
  274. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/tools/file/manager.py +0 -0
  275. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/tools/file/providers/__init__.py +0 -0
  276. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/tools/file/providers/docling_.py +0 -0
  277. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/tools/file/reader.py +0 -0
  278. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/tools/file/writer.py +0 -0
  279. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/tools/query/__init__.py +0 -0
  280. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/tools/types.py +0 -0
  281. {lionagi-0.10.2 → lionagi-0.10.4}/lionagi/utils.py +0 -0
  282. {lionagi-0.10.2 → lionagi-0.10.4}/prompts/doc_style.md +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lionagi
3
- Version: 0.10.2
3
+ Version: 0.10.4
4
4
  Summary: An Intelligence Operating System.
5
5
  Author-email: HaiyangLi <quantocean.li@gmail.com>
6
6
  License: Apache License
@@ -221,11 +221,11 @@ Classifier: Programming Language :: Python :: 3.13
221
221
  Requires-Python: >=3.10
222
222
  Requires-Dist: aiocache>=0.12.0
223
223
  Requires-Dist: aiohttp>=3.11.0
224
- Requires-Dist: jinja2>=3.1.0
224
+ Requires-Dist: jinja2>=3.0.0
225
225
  Requires-Dist: pandas>=2.0.0
226
226
  Requires-Dist: pillow>=10.0.0
227
227
  Requires-Dist: pydantic>=2.0.0
228
- Requires-Dist: python-dotenv>=1.0.1
228
+ Requires-Dist: python-dotenv>=1.1.0
229
229
  Requires-Dist: tiktoken>=0.8.0
230
230
  Requires-Dist: toml>=0.9.0
231
231
  Provides-Extra: llms
@@ -141,7 +141,7 @@ class TomlFileAdapter(Adapter):
141
141
  dict | list[dict]
142
142
  The loaded data from file.
143
143
  """
144
- with open(obj, "r", encoding="utf-8") as f:
144
+ with open(obj, encoding="utf-8") as f:
145
145
  result = toml.load(f, **kwargs)
146
146
 
147
147
  # Handle array of tables in TOML for "many" case
@@ -1,7 +1,4 @@
1
- from .action import (
2
- ActionRequestModel,
3
- ActionResponseModel,
4
- )
1
+ from .action import ActionRequestModel, ActionResponseModel
5
2
  from .base import (
6
3
  CodeSnippet,
7
4
  Outline,
@@ -10,11 +7,8 @@ from .base import (
10
7
  Source,
11
8
  TextSnippet,
12
9
  )
13
- from .file import CodeFile, Documentation, File
14
- from .instruct import (
15
- Instruct,
16
- InstructResponse,
17
- )
10
+ from .file import Documentation, File, Module, ResearchSummary
11
+ from .instruct import Instruct, InstructResponse
18
12
  from .reason import Reason
19
13
 
20
14
  __all__ = (
@@ -27,7 +21,8 @@ __all__ = (
27
21
  "OutlineItem",
28
22
  "Outline",
29
23
  "File",
30
- "CodeFile",
24
+ "Module",
25
+ "ResearchSummary",
31
26
  "Documentation",
32
27
  "Instruct",
33
28
  "InstructResponse",
@@ -0,0 +1,236 @@
1
+ from enum import Enum
2
+
3
+ from pydantic import Field
4
+
5
+ from lionagi.models import HashableModel
6
+
7
+ __all__ = (
8
+ "ParameterKind",
9
+ "Parameter",
10
+ "Decorator",
11
+ "Import",
12
+ "Attribute",
13
+ "Function",
14
+ "Method",
15
+ "Class",
16
+ "Module",
17
+ )
18
+
19
+
20
+ class ParameterKind(str, Enum):
21
+ """
22
+ Distinguishes how a function/method parameter is used.
23
+ Primarily inspired by Python's param categories, but can be ignored by simpler languages.
24
+ Pay attention to the languege's own conventions for parameter handling.
25
+ """
26
+
27
+ POSITIONAL_ONLY = "positional_only" # E.g. Python's '/'-based params
28
+ POSITIONAL_OR_KEYWORD = "positional_or_keyword" # Default for many
29
+ VAR_POSITIONAL = "var_positional" # *args-like
30
+ KEYWORD_ONLY = "keyword_only" # Python's '*' marker
31
+ VAR_KEYWORD = "var_keyword" # **kwargs-like
32
+
33
+
34
+ class Parameter(HashableModel):
35
+ """
36
+ Represents one parameter in a function or method signature.
37
+ """
38
+
39
+ name: str = Field(
40
+ ...,
41
+ description="Exact identifier for the parameter (e.g., 'user_id', 'self', 'arg').",
42
+ )
43
+ type: str | None = Field(
44
+ default=None,
45
+ description=(
46
+ "Type annotation as a string (e.g., 'str', 'int', 'SomeClass'). None if untyped or not declared."
47
+ ),
48
+ )
49
+ default_value_repr: str | None = Field(
50
+ default=None,
51
+ description=(
52
+ "String representation of default value if present (e.g., 'None', '10', '\"hi\"'). "
53
+ "None if parameter is required with no default."
54
+ ),
55
+ )
56
+ kind: ParameterKind = Field(
57
+ default=ParameterKind.POSITIONAL_OR_KEYWORD,
58
+ description=(
59
+ "Parameter's calling convention category. 'positional_or_keyword' is typical if unspecified."
60
+ ),
61
+ )
62
+
63
+
64
+ class Decorator(HashableModel):
65
+ """
66
+ A decorator or annotation attached to a function, class, or method.
67
+ Common in Python (@deco), Java (@Override), .NET ([Attribute]), etc.
68
+ """
69
+
70
+ name: str = Field(
71
+ ...,
72
+ description="Decorator/annotation name (e.g., '@staticmethod', '[ApiController]', '@Override').",
73
+ )
74
+ arguments_repr: list[str] | None = Field(
75
+ default=None,
76
+ description=(
77
+ "If this decorator/annotation is called with arguments, provide them as a list of string expressions "
78
+ "(e.g., `['\"/home\"', 'methods=[\"GET\"]']`). None if no arguments."
79
+ ),
80
+ )
81
+
82
+
83
+ class Import(HashableModel):
84
+ """
85
+ Represents an import/using/include statement. Merges Python's 'import X' and 'from Y import Z' logic.
86
+ Other languages can interpret accordingly.
87
+ """
88
+
89
+ module: str | None = Field(
90
+ default=None,
91
+ description=(
92
+ "The module/package/namespace from which symbols are imported (e.g., 'os.path', 'java.util'). "
93
+ "None for a direct import statement like 'import X' if no sub-path is specified."
94
+ ),
95
+ )
96
+ name: str = Field(
97
+ ...,
98
+ description=(
99
+ "The symbol or module being imported (e.g., 'os', 'List', 'time', '*')."
100
+ ),
101
+ )
102
+ alias: str | None = Field(
103
+ default=None,
104
+ description="Alias name if used ('import X as Y'), else None.",
105
+ )
106
+ level: int = Field(
107
+ default=0,
108
+ description=(
109
+ "For Pythonic relative imports. Number of leading dots. 0 if absolute or not applicable."
110
+ ),
111
+ )
112
+
113
+
114
+ class Attribute(HashableModel):
115
+ """
116
+ A variable/constant/field at class or module level. Possibly static/final, with an initial value.
117
+ """
118
+
119
+ name: str = Field(
120
+ ...,
121
+ description="Identifier for this attribute/field (e.g., 'MAX_CONNECTIONS', 'version').",
122
+ )
123
+ type: str | None = Field(
124
+ default=None,
125
+ description="String type annotation if declared. None if untyped.",
126
+ )
127
+ initial_value_repr: str | None = Field(
128
+ default=None,
129
+ description="String representation of any initial value (e.g., '100', 'true', 'None'). None if uninitialized.",
130
+ )
131
+ is_static: bool = Field(
132
+ default=False,
133
+ description="True if this is a static (class-level) attribute. Otherwise instance-level or module-level.",
134
+ )
135
+ is_final: bool = Field(
136
+ default=False,
137
+ description="True if this attribute/field is read-only/const/final after initialization.",
138
+ )
139
+ visibility: str | None = Field(
140
+ default=None,
141
+ description="Optional access modifier (e.g., 'public', 'private', 'protected'). None if default or not applicable.",
142
+ )
143
+
144
+
145
+ class Function(HashableModel):
146
+ """
147
+ Represents a standalone function or procedure.
148
+ For methods (attached to classes), see 'Method' below.
149
+ """
150
+
151
+ name: str = Field(
152
+ ..., description="Function name identifier (e.g., 'process_data')."
153
+ )
154
+ parameters: list[Parameter] = Field(
155
+ default_factory=list,
156
+ description="Ordered list of Parameter objects for this function.",
157
+ )
158
+ return_type: str | None = Field(
159
+ default=None,
160
+ description="Return type string if declared. None if not declared or no explicit type.",
161
+ )
162
+ is_async: bool = Field(
163
+ default=False,
164
+ description="True if an 'async' function in languages that support it. Else False.",
165
+ )
166
+ docstring: str | None = Field(
167
+ default=None,
168
+ description="Documentation string or comment describing this function.",
169
+ )
170
+ decorators: list[Decorator] = Field(
171
+ default_factory=list,
172
+ description="List of decorators/annotations on this function (e.g., @staticmethod).",
173
+ )
174
+
175
+
176
+ class Method(Function):
177
+ """
178
+ A function bound to a class, including potential method-specific flags (static, abstract, etc.).
179
+ Inherits fields from 'Function.'
180
+ """
181
+
182
+ is_static: bool = Field(
183
+ default=False,
184
+ description="True if method is static (no instance or 'self' needed).",
185
+ )
186
+ is_classmethod: bool = Field(
187
+ default=False,
188
+ description="True if method is recognized as a class method (receives class as first arg).",
189
+ )
190
+ is_abstract: bool = Field(
191
+ default=False,
192
+ description="True if the method is abstract (no concrete implementation).",
193
+ )
194
+ visibility: str | None = Field(
195
+ default=None,
196
+ description="Access level like 'public', 'private', etc., if relevant to the language.",
197
+ )
198
+
199
+
200
+ class Class(HashableModel):
201
+ """
202
+ Represents a class, interface, or other composite type, with optional docstring, attributes, methods, etc.
203
+ """
204
+
205
+ name: str = Field(
206
+ ...,
207
+ description="Class/struct/interface name (e.g., 'UserRepository', 'MyDataClass').",
208
+ )
209
+ base_types: list[str] = Field(
210
+ default_factory=list,
211
+ description="List of parent classes or interfaces by name. Empty if none.",
212
+ )
213
+ is_abstract: bool = Field(
214
+ default=False,
215
+ description="True if this is an abstract class (cannot be instantiated directly).",
216
+ )
217
+ is_interface: bool = Field(
218
+ default=False,
219
+ description="True if this represents an interface definition rather than a concrete class.",
220
+ )
221
+ docstring: str | None = Field(
222
+ default=None,
223
+ description="Documentation for the class/interface, if any.",
224
+ )
225
+ decorators: list[Decorator] = Field(
226
+ default_factory=list,
227
+ description="Class-level decorators/annotations (e.g., @dataclass).",
228
+ )
229
+ attributes: list[Attribute] = Field(
230
+ default_factory=list,
231
+ description="Fields or properties declared at class level.",
232
+ )
233
+ methods: list[Method] = Field(
234
+ default_factory=list,
235
+ description="List of Method objects representing this class's methods.",
236
+ )
@@ -0,0 +1,231 @@
1
+ from abc import abstractmethod
2
+ from pathlib import Path
3
+
4
+ from pydantic import Field, field_validator
5
+
6
+ from .base import HashableModel, Source
7
+ from .code import Class, Function, Import
8
+ from .research import PotentialRisk, ResearchFinding
9
+
10
+ __all__ = (
11
+ "File",
12
+ "Documentation",
13
+ "ResearchSummary",
14
+ "Module",
15
+ )
16
+
17
+
18
+ class File(HashableModel):
19
+ """
20
+ Represents a generic file with an optional name, content, and brief
21
+ description. Useful for capturing and validating metadata about any
22
+ kind of file within a project.
23
+ """
24
+
25
+ file_name: str | None = Field(
26
+ default=None,
27
+ description=(
28
+ "Provide the name of the file or its relative path in the "
29
+ "project. If an absolute path is given, it will be converted"
30
+ " to a string. "
31
+ ),
32
+ examples=[
33
+ "session.py",
34
+ "src/components/UserCard.tsx",
35
+ "/absolute/path/to/my_file.txt",
36
+ ],
37
+ )
38
+ description: str | None = Field(
39
+ default=None,
40
+ description=(
41
+ "Briefly explain the file's purpose or function within the "
42
+ "project. This can be a short summary describing why this "
43
+ "file is needed and/or what it does."
44
+ ),
45
+ examples=[
46
+ "Manages user session logic for the LionAGI framework.",
47
+ "Contains CSS styles for the navbar component.",
48
+ ],
49
+ )
50
+
51
+ @field_validator("file_name", mode="before")
52
+ def validate_file_name(cls, value):
53
+ if isinstance(value, Path):
54
+ return str(value)
55
+ return value
56
+
57
+ @abstractmethod
58
+ def render_content(
59
+ self,
60
+ header: str | None = None,
61
+ footer: str | None = None,
62
+ ) -> str:
63
+ pass
64
+
65
+ def persist(
66
+ self,
67
+ directory: Path | str,
68
+ overwrite: bool = True,
69
+ timestamp: bool = False,
70
+ random_hash_digits: int = None,
71
+ header: str | None = None,
72
+ footer: str | None = None,
73
+ ) -> Path:
74
+ from lionagi.utils import create_path
75
+
76
+ fp = create_path(
77
+ directory=directory,
78
+ filename=self.file_name,
79
+ file_exist_ok=overwrite,
80
+ timestamp=timestamp,
81
+ random_hash_digits=random_hash_digits,
82
+ )
83
+ fp.write_text(self.render_content(header=header, footer=footer))
84
+ return fp
85
+
86
+
87
+ class Documentation(File):
88
+ """
89
+ Represents a documentation file, typically Markdown-based, that includes
90
+ a title and main content explaining or describing some aspect of the project.
91
+ """
92
+
93
+ title: str = Field(
94
+ default_factory=str,
95
+ description=(
96
+ "Specify the title of this documentation entry or page. "
97
+ "For instance, this might be the top-level heading in a Markdown file.\n"
98
+ ),
99
+ examples=["Getting Started", "API Reference: LionAGI Session Module"],
100
+ )
101
+ content: str = Field(
102
+ default_factory=str,
103
+ description=(
104
+ "Provide the primary Markdown (or similar) content for the documentation. "
105
+ "This can include headings, bullet points, tables, code snippets, etc.\n"
106
+ ),
107
+ )
108
+ sources: list[Source] | None = Field(
109
+ default=None,
110
+ description=(
111
+ "List of sources or references used to create this documentation. "
112
+ "Each source should include a title and URL to the original content."
113
+ ),
114
+ )
115
+
116
+ def render_content(
117
+ self,
118
+ header: str | None = None,
119
+ footer: str | None = None,
120
+ include_source: bool = True,
121
+ ) -> str:
122
+ """
123
+ Renders the documentation content, optionally including citations for sources.
124
+ """
125
+ footer = footer or ""
126
+ if include_source and self.sources:
127
+ footer = "\n\n## Sources\n"
128
+ for source in self.sources:
129
+ footer += f"- [{source.title}]({source.url})\n"
130
+ footer += f" - {source.note}\n" if source.note else ""
131
+ return (header or "") + self.content + footer
132
+
133
+
134
+ class ResearchSummary(Documentation):
135
+ """
136
+ Captures the final outcome of the deep research process.
137
+ """
138
+
139
+ scope: str | None = Field(
140
+ default=None,
141
+ description="Brief statement of what was investigated. E.g., 'Surveyed python-based ORMs.'",
142
+ )
143
+ main_takeaways: str = Field(
144
+ ...,
145
+ description="High-level summary of the most critical insights for the project.",
146
+ )
147
+ findings: list[ResearchFinding] = Field(
148
+ default_factory=list,
149
+ description="List of key facts or knowledge gained.",
150
+ )
151
+ risks: list[PotentialRisk] = Field(
152
+ default_factory=list,
153
+ description="Identified obstacles or concerns for the project.",
154
+ )
155
+
156
+ def render_content(
157
+ self,
158
+ header: str | None = None,
159
+ footer: str | None = None,
160
+ ) -> str:
161
+ """
162
+ Renders the documentation content, optionally including citations for sources.
163
+ """
164
+ content = self.model_dump(exclude_unset=True, exclude_none=True)
165
+
166
+ from lionagi.libs.schema.as_readable import as_readable
167
+
168
+ text = as_readable(content, md=True, format_curly=True)
169
+
170
+ footer = footer or ""
171
+ if self.sources:
172
+ footer = "\n\n## Sources\n"
173
+ for source in self.sources:
174
+ footer += f"- [{source.title}]({source.url})\n"
175
+ footer += f" - {source.note}\n" if source.note else ""
176
+ return (header or "") + text + footer
177
+
178
+
179
+ class Module(File):
180
+ """
181
+ Represents a single source file: docstring, imports, top-level functions, classes, etc.
182
+ """
183
+
184
+ name: str = Field(
185
+ ...,
186
+ description="Logical name for this file/module (e.g., 'utils', 'main', 'data_models').",
187
+ )
188
+ path: str | None = Field(
189
+ default=None,
190
+ description="Filesystem path if known (e.g., 'src/utils.py').",
191
+ )
192
+ docstring: str | None = Field(
193
+ default=None, description="File-level docstring or comments if any."
194
+ )
195
+ imports: list[Import] = Field(
196
+ default_factory=list,
197
+ description="All import statements / using directives / includes in this file.",
198
+ )
199
+ classes: list[Class] = Field(
200
+ default_factory=list,
201
+ description="All class or interface definitions in this file.",
202
+ )
203
+ functions: list[Function] = Field(
204
+ default_factory=list,
205
+ description="All top-level (non-class) functions in this file.",
206
+ )
207
+ variables: list = Field(
208
+ default_factory=list,
209
+ description="All top-level variables/constants in this file.",
210
+ )
211
+ language: str = Field(
212
+ default_factory=str,
213
+ description=(
214
+ "Indicate the programming language of this code file. e.g., 'python', 'typescript'. "
215
+ "LLMs or humans can use this info to apply specific formatting or syntax analysis."
216
+ ),
217
+ )
218
+
219
+ def render_content(
220
+ self,
221
+ header: str | None = None,
222
+ footer: str | None = None,
223
+ ) -> str:
224
+ """
225
+ Renders the documentation content, optionally including citations for sources.
226
+ """
227
+ text = self.model_dump_json(exclude_none=True, exclude_unset=True)
228
+ return header or "" + text + footer or ""
229
+
230
+
231
+ # File: lionagi/fields/file.py
@@ -2,15 +2,15 @@
2
2
  #
3
3
  # SPDX-License-Identifier: Apache-2.0
4
4
 
5
- from pydantic import BaseModel, Field, field_validator
5
+ from pydantic import Field, field_validator
6
6
 
7
- from lionagi.models import FieldModel
7
+ from lionagi.models import FieldModel, HashableModel
8
8
  from lionagi.utils import to_num
9
9
 
10
10
  __all__ = ("Reason",)
11
11
 
12
12
 
13
- class Reason(BaseModel):
13
+ class Reason(HashableModel):
14
14
 
15
15
  title: str | None = None
16
16
  content: str | None = None
@@ -22,10 +22,9 @@ class Reason(BaseModel):
22
22
  "how well you've met user expectations. Use this guide:\n"
23
23
  " • 1.0: Highly confident\n"
24
24
  " • 0.8-1.0: Reasonably sure\n"
25
- " • 0.5-0.8: Re-check or refine\n"
26
- " • 0.0-0.5: Off track"
25
+ " • 0.5-0.8: Re-check, refine or backtrack\n"
26
+ " • 0.0-0.5: Off track, stop"
27
27
  ),
28
- examples=[0.821, 0.257, 0.923, 0.439],
29
28
  )
30
29
 
31
30
  @field_validator("confidence_score", mode="before")
@@ -0,0 +1,49 @@
1
+ from pydantic import Field
2
+
3
+ from lionagi.models import HashableModel
4
+
5
+ from .base import CodeSnippet, TextSnippet
6
+
7
+ __all__ = (
8
+ "ResearchFinding",
9
+ "PotentialRisk",
10
+ "ResearchSummary",
11
+ )
12
+
13
+
14
+ class ResearchFinding(HashableModel):
15
+ """
16
+ A single piece of information or insight from the research phase.
17
+ """
18
+
19
+ summary: str = Field(
20
+ ...,
21
+ description="Concise text describing the discovered fact, concept, or best practice.",
22
+ )
23
+ snippets: list[TextSnippet | CodeSnippet] = Field(
24
+ default_factory=list,
25
+ description="Ordered list of content snippets (text or code) that illustrate or support the finding.",
26
+ )
27
+ relevance: str | None = Field(
28
+ default=None,
29
+ description="Why this finding matters to the project. E.g., 'Helps solve concurrency issue.'",
30
+ )
31
+
32
+
33
+ class PotentialRisk(HashableModel):
34
+ """
35
+ Identifies a risk or challenge discovered during research.
36
+ """
37
+
38
+ description: str = Field(
39
+ ...,
40
+ description="Short text describing the risk. E.g., 'Scalability concerns with chosen DB'.",
41
+ )
42
+ impact: str | None = Field(
43
+ default=None,
44
+ description="Possible consequences if not mitigated. E.g., 'System slowdown, possible downtime.'",
45
+ )
46
+ mitigation_ideas: str | None = Field(
47
+ default=None,
48
+ description="Preliminary ways to reduce or handle this risk.",
49
+ )
@@ -31,7 +31,7 @@ class SynthlangFramework(Resource):
31
31
  import json
32
32
 
33
33
  fp = here / FRAMEWORK_PATH / "framework_options.json"
34
- with open(fp, "r", encoding="utf-8") as f:
34
+ with open(fp, encoding="utf-8") as f:
35
35
  return json.load(f)
36
36
 
37
37
  @classmethod
@@ -58,4 +58,4 @@ False = "⊭"
58
58
  "⧦⧦⧦" = "⧦"
59
59
  " " = "◻︎"
60
60
  "◻︎◻︎" = "◼︎"
61
- "###" = "#"
61
+ "###" = "#"
@@ -38,4 +38,4 @@ False = "⊭"
38
38
  "⧦⧦⧦" = "⧦"
39
39
  " " = "◻︎"
40
40
  "◻︎◻︎" = "◼︎"
41
- "###" = "#"
41
+ "###" = "#"
@@ -57,4 +57,4 @@ self = "自"
57
57
  Clone = "隆"
58
58
  clone = "隆"
59
59
  derive = "衍"
60
- "println!" = "印"
60
+ "println!" = "印"