versionhq 1.2.4.1__tar.gz → 1.2.4.3__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 (167) hide show
  1. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/PKG-INFO +3 -8
  2. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/docs/core/agent-network/ref.md +29 -28
  3. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/docs/core/task/reference.md +4 -1
  4. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/docs/core/task/task-execution.md +29 -17
  5. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/docs/core/task/task-output.md +11 -0
  6. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/pyproject.toml +3 -8
  7. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/requirements.txt +0 -5
  8. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/__init__.py +3 -2
  9. versionhq-1.2.4.3/src/versionhq/_prompt/auto_feedback.py +103 -0
  10. versionhq-1.2.4.3/src/versionhq/_prompt/constants.py +30 -0
  11. versionhq-1.2.4.3/src/versionhq/_prompt/model.py +218 -0
  12. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/_utils/__init__.py +1 -0
  13. versionhq-1.2.4.3/src/versionhq/_utils/usage_metrics.py +72 -0
  14. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/agent/model.py +31 -80
  15. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/agent_network/formation.py +14 -28
  16. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/agent_network/model.py +0 -1
  17. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/llm/model.py +3 -6
  18. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/storage/task_output_storage.py +2 -2
  19. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/task/model.py +112 -161
  20. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/task_graph/draft.py +4 -14
  21. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/task_graph/model.py +104 -44
  22. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq.egg-info/PKG-INFO +3 -8
  23. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq.egg-info/SOURCES.txt +4 -0
  24. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq.egg-info/requires.txt +0 -5
  25. versionhq-1.2.4.3/tests/_prompt/auto_feedback_test.py +34 -0
  26. versionhq-1.2.4.3/tests/_prompt/prompt_test.py +67 -0
  27. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/agent/agent_test.py +10 -0
  28. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/agent_network/agent_network_test.py +3 -33
  29. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/doc_test.py +1 -1
  30. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/task/doc_taskoutput_test.py +6 -5
  31. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/task/doc_test.py +22 -16
  32. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/task/eval_test.py +1 -2
  33. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/task/task_test.py +54 -3
  34. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/task_graph/doc_test.py +5 -0
  35. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/task_graph/task_graph_test.py +11 -5
  36. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/tool/rag_tool_test.py +1 -1
  37. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/usecase_test.py +1 -1
  38. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/uv.lock +294 -351
  39. versionhq-1.2.4.1/src/versionhq/_prompt/model.py +0 -147
  40. versionhq-1.2.4.1/src/versionhq/_utils/usage_metrics.py +0 -55
  41. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/.env.sample +0 -0
  42. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/.github/workflows/deploy_docs.yml +0 -0
  43. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/.github/workflows/publish.yml +0 -0
  44. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/.github/workflows/publish_testpypi.yml +0 -0
  45. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/.github/workflows/run_tests.yml +0 -0
  46. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/.github/workflows/security_check.yml +0 -0
  47. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/.gitignore +0 -0
  48. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/.pre-commit-config.yaml +0 -0
  49. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/.python-version +0 -0
  50. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/LICENSE +0 -0
  51. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/README.md +0 -0
  52. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/SECURITY.md +0 -0
  53. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/db/preprocess.py +0 -0
  54. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/docs/CNAME +0 -0
  55. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/docs/_logos/favicon.ico +0 -0
  56. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/docs/_logos/logo192.png +0 -0
  57. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/docs/core/agent/config.md +0 -0
  58. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/docs/core/agent/index.md +0 -0
  59. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/docs/core/agent/task-handling.md +0 -0
  60. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/docs/core/agent-network/config.md +0 -0
  61. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/docs/core/agent-network/form.md +0 -0
  62. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/docs/core/agent-network/index.md +0 -0
  63. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/docs/core/knowledge.md +0 -0
  64. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/docs/core/llm/index.md +0 -0
  65. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/docs/core/memory.md +0 -0
  66. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/docs/core/rag-tool.md +0 -0
  67. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/docs/core/task/evaluation.md +0 -0
  68. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/docs/core/task/index.md +0 -0
  69. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/docs/core/task/response-field.md +0 -0
  70. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/docs/core/task/task-strc-response.md +0 -0
  71. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/docs/core/task-graph/index.md +0 -0
  72. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/docs/core/tool.md +0 -0
  73. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/docs/index.md +0 -0
  74. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/docs/quickstart.md +0 -0
  75. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/docs/stylesheets/main.css +0 -0
  76. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/docs/tags.md +0 -0
  77. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/mkdocs.yml +0 -0
  78. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/requirements-dev.txt +0 -0
  79. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/runtime.txt +0 -0
  80. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/setup.cfg +0 -0
  81. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/_utils/i18n.py +0 -0
  82. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/_utils/is_valid_url.py +0 -0
  83. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/_utils/llm_as_a_judge.py +0 -0
  84. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/_utils/logger.py +0 -0
  85. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/_utils/process_config.py +0 -0
  86. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/_utils/vars.py +0 -0
  87. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/agent/TEMPLATES/Backstory.py +0 -0
  88. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/agent/TEMPLATES/__init__.py +0 -0
  89. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/agent/__init__.py +0 -0
  90. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/agent/inhouse_agents.py +0 -0
  91. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/agent/parser.py +0 -0
  92. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/agent/rpm_controller.py +0 -0
  93. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/agent_network/__init__.py +0 -0
  94. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/cli/__init__.py +0 -0
  95. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/clients/__init__.py +0 -0
  96. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/clients/customer/__init__.py +0 -0
  97. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/clients/customer/model.py +0 -0
  98. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/clients/product/__init__.py +0 -0
  99. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/clients/product/model.py +0 -0
  100. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/clients/workflow/__init__.py +0 -0
  101. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/clients/workflow/model.py +0 -0
  102. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/knowledge/__init__.py +0 -0
  103. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/knowledge/_utils.py +0 -0
  104. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/knowledge/embedding.py +0 -0
  105. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/knowledge/model.py +0 -0
  106. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/knowledge/source.py +0 -0
  107. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/knowledge/source_docling.py +0 -0
  108. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/knowledge/storage.py +0 -0
  109. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/llm/__init__.py +0 -0
  110. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/llm/llm_vars.py +0 -0
  111. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/memory/__init__.py +0 -0
  112. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/memory/contextual_memory.py +0 -0
  113. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/memory/model.py +0 -0
  114. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/storage/__init__.py +0 -0
  115. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/storage/base.py +0 -0
  116. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/storage/ltm_sqlite_storage.py +0 -0
  117. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/storage/mem0_storage.py +0 -0
  118. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/storage/rag_storage.py +0 -0
  119. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/storage/utils.py +0 -0
  120. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/task/TEMPLATES/Description.py +0 -0
  121. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/task/__init__.py +0 -0
  122. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/task/evaluation.py +0 -0
  123. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/task/formatter.py +0 -0
  124. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/task/structured_response.py +0 -0
  125. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/task_graph/__init__.py +0 -0
  126. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/task_graph/colors.py +0 -0
  127. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/tool/__init__.py +0 -0
  128. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/tool/cache_handler.py +0 -0
  129. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/tool/composio_tool.py +0 -0
  130. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/tool/composio_tool_vars.py +0 -0
  131. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/tool/decorator.py +0 -0
  132. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/tool/model.py +0 -0
  133. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/tool/rag_tool.py +0 -0
  134. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq/tool/tool_handler.py +0 -0
  135. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq.egg-info/dependency_links.txt +0 -0
  136. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/src/versionhq.egg-info/top_level.txt +0 -0
  137. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/__init__.py +0 -0
  138. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/_sample/sample.csv +0 -0
  139. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/_sample/sample.json +0 -0
  140. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/_sample/sample.mp3 +0 -0
  141. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/_sample/screenshot.png +0 -0
  142. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/agent/__init__.py +0 -0
  143. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/agent/doc_test.py +0 -0
  144. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/agent_network/Prompts/Demo_test.py +0 -0
  145. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/agent_network/__init__.py +0 -0
  146. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/agent_network/doc_test.py +0 -0
  147. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/cli/__init__.py +0 -0
  148. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/clients/customer_test.py +0 -0
  149. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/clients/product_test.py +0 -0
  150. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/clients/workflow_test.py +0 -0
  151. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/conftest.py +0 -0
  152. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/formation_test.py +0 -0
  153. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/knowledge/__init__.py +0 -0
  154. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/knowledge/knowledge_test.py +0 -0
  155. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/knowledge/mock_report_compressed.pdf +0 -0
  156. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/llm/__init__.py +0 -0
  157. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/llm/llm_connection_test.py +0 -0
  158. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/llm/llm_test.py +0 -0
  159. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/memory/__init__.py +0 -0
  160. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/memory/memory_test.py +0 -0
  161. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/task/__init__.py +0 -0
  162. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/task/doc_eval_test.py +0 -0
  163. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/task_graph/__init__.py +0 -0
  164. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/tool/__init__.py +0 -0
  165. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/tool/composio_test.py +0 -0
  166. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/tool/doc_test.py +0 -0
  167. {versionhq-1.2.4.1 → versionhq-1.2.4.3}/tests/tool/tool_test.py +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: versionhq
3
- Version: 1.2.4.1
4
- Summary: A Python framework for autonomous agent networks that handle task automation with multi-step reasoning.
3
+ Version: 1.2.4.3
4
+ Summary: Autonomous agent networks for task automation with multi-step reasoning.
5
5
  Author-email: Kuriko Iwai <kuriko@versi0n.io>
6
6
  License: MIT License
7
7
 
@@ -29,7 +29,7 @@ Project-URL: Homepage, https://versi0n.io
29
29
  Project-URL: Documentation, https://docs.versi0n.io
30
30
  Project-URL: Repository, https://github.com/versionHQ/multi-agent-system
31
31
  Project-URL: Issues, https://github.com/versionHQ/multi-agent-system/issues
32
- Keywords: orchestration framework,orchestration,ai agent,multi-agent system,RAG,agent,agentic orchestration,llm
32
+ Keywords: autonomic agent networks,deep agent,agentic orchestration framework
33
33
  Classifier: Programming Language :: Python
34
34
  Classifier: Programming Language :: Python :: 3
35
35
  Classifier: Programming Language :: Python :: 3.11
@@ -47,12 +47,9 @@ License-File: LICENSE
47
47
  Requires-Dist: regex==2024.11.6
48
48
  Requires-Dist: requests>=2.32.3
49
49
  Requires-Dist: pydantic>=2.10.6
50
- Requires-Dist: werkzeug>=3.1.3
51
50
  Requires-Dist: typing>=0.0.0
52
51
  Requires-Dist: json-repair>=0.0.0
53
52
  Requires-Dist: litellm>=1.55.8
54
- Requires-Dist: openai>=1.64.0
55
- Requires-Dist: composio-openai>=0.6.9
56
53
  Requires-Dist: composio>=0.1.0
57
54
  Requires-Dist: setuptools>=75.6.0
58
55
  Requires-Dist: wheel>=0.45.1
@@ -60,10 +57,8 @@ Requires-Dist: python-dotenv>=1.0.0
60
57
  Requires-Dist: appdirs>=1.4.4
61
58
  Requires-Dist: langchain>=0.3.14
62
59
  Requires-Dist: langchain-openai>=0.2.14
63
- Requires-Dist: composio-langchain>=0.6.12
64
60
  Requires-Dist: chromadb>=0.6.3
65
61
  Requires-Dist: wheel>=0.45.1
66
- Requires-Dist: envoy>=0.0.3
67
62
  Requires-Dist: composio-core==0.7.0
68
63
  Requires-Dist: networkx>=3.4.2
69
64
  Requires-Dist: matplotlib>=3.10.0
@@ -72,34 +72,35 @@ tags:
72
72
  ### Variables
73
73
 
74
74
  | <div style="width:200px">**Variable**</div> | **Data Type** | **Default** | **Description** |
75
- | :--- | :--- | :--- | :--- |
76
- | **`id`** | UUID4 | uuid.uuid4() | Stores auto-generated ID as identifier. Not editable. |
77
- | **`role`** | str | None | Stores a role of the agent. |
78
- | **`goal`** | str | None | Stores a goal of the agent. |
79
- | **`backstory`** | str | None | Stores backstory of the agent. Utilized as system prompt. |
80
- | **`tools`** | List[InstanceOf[`Tool` \| `ToolSet`] \| Type[`Tool`]] | None | Stores tools to be used when executing a task. |
81
- | **`knowledge_sources`** | List[`BaseKnowledgeSource` \| Any] | None | Stores knowledge sources in text, file path, or url. |
82
- | **`embedder_config`** | Dict[str, Any] | None | Stores embedding configuration for storing knowledge sources. |
83
- | **`with_memory`** | bool | False | Whether to store tasks and results in memory. |
84
- | **`memory_config`** | Dict[str, Any] | None | Stores configuration of the memory. |
85
- | **`short_term_memory`** | InstanceOf[`ShortTermMemory`] | None | Stores `ShortTermMemory` object. |
86
- | **`long_term_memory`** | InstanceOf[`LongTermMemory`] | None | Stores `LongTermMemory` object. |
87
- | **`user_memory`** | InstanceOf[`UserMemory`] | None | Stores `UserMemory` object. |
88
- | **`use_developer_prompt`** | bool | True | Whether to use the system (developer) prompt when calling the model. |
89
- | **`developer_promt_template`** | str | None | File path to the prompt template. |
90
- | **`user_promt_template`** | str | None | File path to the prompt template. |
91
- | **`networks`** | List[Any] | list() | Stores a list of agent networks that the agent belongs to. |
92
- | **`allow_delegation`** | bool | False | Whether the agent can delegate assinged tasks to another agent. |
93
- | **`max_retry_limit`** | int | 2 | Maximum number of retries when the task execution failed. |
94
- | **`maxit`** | int | 25 | Maximum number of total optimization loops conducted when an error occues during the task execution. |
95
- | **`callbacks`** | List[Callabale] | None | Stores a list of callback functions that must be called after every task execution completed.|
96
- | **`llm`** | str \| InstanceOf[`LLM`] \| Dict[str, Any] | None | Stores the main model that the agent runs on. |
97
- | **`func_calling_llm`** | str \| InstanceOf[`LLM`] \| Dict[str, Any] | None | Stores the function calling model that the agent runs on. |
98
- | **`respect_context_window`** | bool | True | Whether to follow the main model's maximum context window size. |
99
- | **`max_execution_time`** | int | None | Stores maximum execution time in seconds. |
100
- | **`max_rpm`** | int | None | Stores maximum number of requests per minute. |
101
- | **`llm_config`** | Dict[str, Any] | None | Stores configuration of `LLM` object. |
102
- | **`config`** | Dict[str, Any] | None | Stores model config. |
75
+ | :--- | :--- | :--- | :--- |
76
+ | **`id`** | UUID4 | uuid.uuid4() | Stores auto-generated ID as identifier. Not editable. |
77
+ | **`role`** | str | None | Stores a role of the agent. |
78
+ | **`goal`** | str | None | Stores a goal of the agent. |
79
+ | **`backstory`** | str | None | Stores backstory of the agent. Utilized as system prompt. |
80
+ | **`self_learn`** | bool | False | Whether to self-learn|
81
+ | **`tools`** | List[InstanceOf[`ToolSet`] \| Type[`Tool`]] | None | Stores tools to be used when executing a task. |
82
+ | **`knowledge_sources`** | List[`BaseKnowledgeSource` \| Any] | None | Stores knowledge sources in text, file path, or url. |
83
+ | **`embedder_config`** | Dict[str, Any] | None | Stores embedding configuration for storing knowledge sources. |
84
+ | **`with_memory`** | bool | False | Whether to store tasks and results in memory. |
85
+ | **`memory_config`** | Dict[str, Any] | None | Stores configuration of the memory. |
86
+ | **`short_term_memory`** | InstanceOf[`ShortTermMemory`] | None | Stores `ShortTermMemory` object. |
87
+ | **`long_term_memory`** | InstanceOf[`LongTermMemory`] | None | Stores `LongTermMemory` object. |
88
+ | **`user_memory`** | InstanceOf[`UserMemory`] | None | Stores `UserMemory` object. |
89
+ | **`use_developer_prompt`** | bool | True | Whether to use the system (developer) prompt when calling the model. |
90
+ | **`developer_promt_template`** | str | None | File path to the prompt template. |
91
+ | **`user_promt_template`** | str | None | File path to the prompt template. |
92
+ | **`networks`** | List[Any] | list() | Stores a list of agent networks that the agent belongs to. |
93
+ | **`allow_delegation`** | bool | False | Whether the agent can delegate assinged tasks to another agent. |
94
+ | **`max_retry_limit`** | int | 2 | Maximum number of retries when the task execution failed. |
95
+ | **`maxit`** | int | 25 | Maximum number of total optimization loops during error handling. |
96
+ | **`callbacks`** | List[Callabale] | None | Stores a list of step callback functions. |
97
+ | **`llm`** | str \| InstanceOf[`LLM`] \| Dict[str, Any] | None | Stores the main LLM. |
98
+ | **`func_calling_llm`** | str \| InstanceOf[`LLM`] \| Dict[str, Any] | None | Stores the function calling LLM. |
99
+ | **`respect_context_window`** | bool | True | Whether to follow the main model's maximum context window size. |
100
+ | **`max_execution_time`** | int | None | Stores maximum execution time in seconds. |
101
+ | **`max_rpm`** | int | None | Stores maximum number of requests per minute. |
102
+ | **`llm_config`** | Dict[str, Any] | None | Stores configuration of `LLM` object. |
103
+ | **`config`** | Dict[str, Any] | None | Stores model config. |
103
104
 
104
105
 
105
106
  ### Class Methods
@@ -15,6 +15,8 @@
15
15
  | **`image`** | Optional[str] | None | Stores an absolute file path or URL to the image file in string |
16
16
  | **`file`** | Optional[str] | None | Stores an absolute file path or URL to the file in string |
17
17
  | **`audio`** | Optional[str] | None | Stores an absolute file path or URL to the audio file in string |
18
+ | **`should_test_run`** | bool | False | Whether to turn on auto-feedback learning |
19
+ | **`human`** | bool | False | Whether to ask human input during the task execution |
18
20
  | **`execution_type`** | TaskExecutionType | TaskExecutionType.SYNC | Sync or async execution |
19
21
  | **`allow_delegation`** | bool | False | Whether to allow the agent to delegate the task to another agent |
20
22
  | **`callback`** | Optional[Callable] | None | Callback function to be executed after LLM calling |
@@ -85,6 +87,7 @@
85
87
 
86
88
  | <div style="width:160px">**Property**</div> | **Data_Type** | **Description** |
87
89
  | :--- | :--- | :--- |
90
+ | **`final`** | Any | Returns the final output of the task |
88
91
  | **`aggregate_score`** | float | Calucurates weighted average eval scores of the task output. |
89
92
  | **`json_string`** | str | Returns `json_dict` in string format. |
90
93
 
@@ -111,7 +114,7 @@
111
114
 
112
115
  <hr>
113
116
 
114
- ## SubClass `EvaluationItem`
117
+ ## Sub-class `EvaluationItem`
115
118
 
116
119
  ### Variables
117
120
 
@@ -3,39 +3,51 @@
3
3
 
4
4
  ## Prompt Engineering
5
5
 
6
- Prompts are generated automatically based on the task `description`, response format, context, agent `role`, and `goal`.
6
+ Prompt messages are generated automatically based on the task `description`, response format, context, agent `role`, and `goal`.
7
7
 
8
8
 
9
9
  **Context**
10
10
 
11
- The following snippet demonstrates how to add `context` to the prompt.
11
+ The following snippet demonstrates adding `context` from tools and sub tasks as well as `multi-modal content` to the prompt.
12
12
 
13
13
  ```python
14
14
  import versionhq as vhq
15
15
 
16
- sub_task_1 = vhq.Task(description="Run a sub demo part 1")
17
- sub_res = sub_task_1.execute()
16
+ agent = vhq.Agent(llm="gemini-2.0", role="Content Interpretator", tools=[rag_tool])
17
+ task = vhq.Task(description="dummy task", image="image file path")
18
+ sub_task = vhq.Task(description="sub task")
19
+ rag_tool = vhq.RagTool(url="https://github.com/chroma-core/chroma/issues/3233", query="What is the next action plan?")
18
20
 
19
- sub_task_2 = vhq.Task(description="Run a sub demo part 2")
20
21
 
21
- task = vhq.Task(description="Run a main demo")
22
+ # Explicitly mentioned for explanation purpose. By default, `task.execute()` will trigger this formula.
23
+ from versionhq._prompt.model import Prompt
24
+ _, _, messages = Prompt(task=main_task, agent=agent, context=["context 1", "context 2", sub_task]).format_core()
22
25
 
23
- context = [sub_res, sub_task_2, "context to add in string"]
24
- res = task.execute(context=context)
25
-
26
- # Explicitly mentioned. `task.execute()` will trigger the following:
27
- task_prompt = task._user_prompt(context=context)
28
-
29
- assert sub_res._to_context_prompt() in task_prompt
30
- assert sub_task_2.output and sub_task_2.output._to_context_prompt() in task_prompt # sub tasks' outputs are included in the task prompt.
31
- assert "context to add in string" in task_promp
32
- assert res
26
+ assert messages[0]["role"] == "user"
27
+ assert isinstance(messages[0]["content"], list) # adding context and image, file, audio data to the prompt
28
+ assert messages[1]["role"] == "developer" # adding developer prompt
29
+ assert messages[1]["content"] == agent.backstory
33
30
  ```
34
31
 
35
32
  Context can consist of `Task` objects, `TaskOutput` objects, plain text `strings`, or `lists` containing any of these.
36
33
 
37
34
  In this scenario, `sub_task_2` executes before the main task. Its string output is then incorporated into the main task's context prompt on top of other context before the main task is executed.
38
35
 
36
+
37
+ **Auto Feedback Learning**
38
+
39
+ To automatically improve prompts, trigger `test_run` of the task.
40
+
41
+ ```python
42
+ import versionhq as vhq
43
+
44
+ task = vhq.Task(description="Create a short story.", should_test_run=True, human=True)
45
+ res = task.execute()
46
+
47
+ assert isinstance(res, vhq.TaskOutput)
48
+ ```
49
+
50
+
39
51
  <hr>
40
52
 
41
53
  ## Delegation
@@ -75,7 +87,7 @@ task = vhq.Task(
75
87
  )
76
88
 
77
89
  from unittest.mock import patch
78
- with patch.object(vhq.Agent, "execute_task", return_value="test") as execute:
90
+ with patch.object(vhq.Agent, "execute_task", return_value=("user prompt", "dev prompt", "test")) as execute:
79
91
  res = task.execute()
80
92
  assert res.raw == "test"
81
93
  execute.assert_called_once_with(task=task, context=None, task_tools=list())
@@ -47,4 +47,15 @@ assert res.tool_output is None
47
47
  assert res.evaluation and isinstance(res.evaluation, vhq.Evaluation)
48
48
  ```
49
49
 
50
+
51
+ The `TaskOutput` object has a `final` field that contains the task's definitive result.
52
+
53
+ Result priority is: `callback` > `tool` (when tool_res_as_final is true) > `pydantic` > `json_dict` > `raw` output.
54
+
55
+
56
+ ```python
57
+ assert res.final == res.callback_output
58
+ ```
59
+
60
+
50
61
  Ref. <a href="/core/task/reference/#taskoutput">List of variables and class methods</a>
@@ -15,23 +15,20 @@ exclude = ["test*", "__pycache__", "*.egg-info"]
15
15
 
16
16
  [project]
17
17
  name = "versionhq"
18
- version = "1.2.4.1"
18
+ version = "1.2.4.3"
19
19
  authors = [{ name = "Kuriko Iwai", email = "kuriko@versi0n.io" }]
20
- description = "A Python framework for autonomous agent networks that handle task automation with multi-step reasoning."
20
+ description = "Autonomous agent networks for task automation with multi-step reasoning."
21
21
  readme = "README.md"
22
22
  requires-python = ">=3.11"
23
23
  license = { file = "LICENSE" }
24
- keywords = ["orchestration framework", "orchestration", "ai agent", "multi-agent system", "RAG", "agent", "agentic orchestration", "llm"]
24
+ keywords = ["autonomic agent networks", "deep agent", "agentic orchestration framework", ]
25
25
  dependencies = [
26
26
  "regex==2024.11.6",
27
27
  "requests>=2.32.3",
28
28
  "pydantic>=2.10.6",
29
- "werkzeug>=3.1.3",
30
29
  "typing>=0.0.0",
31
30
  "json-repair>=0.0.0",
32
31
  "litellm>=1.55.8",
33
- "openai>=1.64.0",
34
- "composio-openai>=0.6.9",
35
32
  "composio>=0.1.0",
36
33
  "setuptools>=75.6.0",
37
34
  "wheel>=0.45.1",
@@ -39,10 +36,8 @@ dependencies = [
39
36
  "appdirs>=1.4.4",
40
37
  "langchain>=0.3.14",
41
38
  "langchain-openai>=0.2.14",
42
- "composio-langchain>=0.6.12",
43
39
  "chromadb>=0.6.3",
44
40
  "wheel>=0.45.1",
45
- "envoy>=0.0.3",
46
41
  "composio-core==0.7.0",
47
42
  "networkx>=3.4.2",
48
43
  "matplotlib>=3.10.0",
@@ -1,12 +1,9 @@
1
1
  regex==2024.11.6
2
2
  requests>=2.32.3
3
3
  pydantic>=2.10.6
4
- werkzeug>=3.1.3
5
4
  typing
6
5
  json-repair
7
6
  litellm>=1.55.8
8
- openai>=1.57.0
9
- composio-openai>=0.6.9
10
7
  composio>=0.1.0
11
8
  setuptools>=75.6.0
12
9
  wheel>=0.45.1
@@ -14,10 +11,8 @@ python-dotenv>=1.0.0
14
11
  appdirs>=1.4.4
15
12
  langchain>=0.3.14
16
13
  langchain-openai>=0.2.14
17
- composio-langchain>=0.6.12
18
14
  chromadb>=0.6.3
19
15
  wheel>=0.45.1
20
- envoy>=0.0.3
21
16
  composio-core==0.7.0
22
17
  networkx>=3.4.2
23
18
  matplotlib>=3.10.0
@@ -17,7 +17,7 @@ from versionhq.clients.workflow.model import MessagingWorkflow, MessagingCompone
17
17
  from versionhq.knowledge.model import Knowledge, KnowledgeStorage
18
18
  from versionhq.knowledge.source import PDFKnowledgeSource, CSVKnowledgeSource, JSONKnowledgeSource, TextFileKnowledgeSource, ExcelKnowledgeSource, StringKnowledgeSource
19
19
  from versionhq.knowledge.source_docling import DoclingSource
20
- from versionhq.task_graph.model import TaskStatus, TaskGraph, Node, Edge, DependencyType, Condition, ConditionType
20
+ from versionhq.task_graph.model import TaskStatus, TaskGraph, Node, Edge, DependencyType, Condition, ConditionType, ReformTriggerEvent
21
21
  from versionhq.task.model import Task, TaskOutput, ResponseField, TaskExecutionType
22
22
  from versionhq.task.evaluation import Evaluation, EvaluationItem
23
23
  from versionhq.tool.model import Tool, ToolSet
@@ -32,7 +32,7 @@ from versionhq.agent_network.formation import form_agent_network
32
32
  from versionhq.task_graph.draft import workflow
33
33
 
34
34
 
35
- __version__ = "1.2.4.1"
35
+ __version__ = "1.2.4.3"
36
36
  __all__ = [
37
37
  "Agent",
38
38
 
@@ -70,6 +70,7 @@ __all__ = [
70
70
  "DependencyType",
71
71
  "Condition",
72
72
  "ConditionType",
73
+ "ReformTriggerEvent",
73
74
 
74
75
  "Task",
75
76
  "TaskOutput",
@@ -0,0 +1,103 @@
1
+ from typing import List, Optional, Dict
2
+ from typing_extensions import Self
3
+
4
+ from pydantic import InstanceOf, Field
5
+
6
+ from versionhq.agent.model import Agent
7
+ from versionhq.task.model import Task
8
+ from versionhq.task_graph.model import TaskGraph, Node, DependencyType, ReformTriggerEvent
9
+ from versionhq._prompt.model import Prompt
10
+ from versionhq._prompt.constants import REFLECT, INTEGRATE, parameter_sets
11
+
12
+
13
+ class PromptFeedbackGraph(TaskGraph):
14
+ """A Pydantic class to handle auto prompt feedback cycle."""
15
+
16
+ _times_iteration: int = 0
17
+ user_prompts: Optional[Dict[str, str]] = Field(default_factory=dict) # { "0": "...", "1": "..."}
18
+ dev_prompts: Optional[Dict[str, str]] = Field(default_factory=dict)
19
+ prompts: Optional[Dict[str, InstanceOf[Prompt]]] = Field(default_factory=dict)
20
+
21
+
22
+ def __init__(self, prompt: InstanceOf[Prompt] = None, *args, **kwargs):
23
+ super().__init__(*args, **kwargs)
24
+
25
+ if prompt:
26
+ user_prompt, dev_prompt, _ = prompt.format_core()
27
+ self.prompts = { self.key: prompt }
28
+ self.user_prompts = { self.key: user_prompt }
29
+ self.dev_prompts = { self.key: dev_prompt }
30
+
31
+
32
+ def _fetch_latest_prompt(self) -> InstanceOf[Prompt] | None:
33
+ return self.prompts[self.key] if self.key in self.prompts else None
34
+
35
+
36
+ def _generate_agents(self) -> List[Agent] | None:
37
+ agents = []
38
+ prompt = self._fetch_latest_prompt()
39
+
40
+ if not prompt:
41
+ return None
42
+
43
+ agent = prompt.agent
44
+ agent_params = agent.model_dump(exclude={"id", "llm", "llm_config", "self_learning"})
45
+ for params in parameter_sets:
46
+ agent = Agent(**agent_params, llm=agent.llm.model, llm_config={**params}, self_learning=True)
47
+ agents.append(agent)
48
+ return agents
49
+
50
+
51
+ def _reflect(self, original_response: str) -> Task:
52
+ description = REFLECT.format(original_prompt=self.original_prompt, original_response=original_response)
53
+ return Task(description=description)
54
+
55
+
56
+ def set_up_graph(self, **attributes) -> Self:
57
+ """Sets up a TaskGraph object with nodes and edges."""
58
+
59
+ prompt = self._fetch_latest_prompt()
60
+ base_task = prompt.task if prompt else None
61
+ base_agent = prompt.agent if prompt else None
62
+
63
+ if not base_task or not base_agent:
64
+ return None
65
+
66
+ agents = self._generate_agents()
67
+ if not agents:
68
+ return None
69
+
70
+ self.concl_template = base_task.pydantic_output if base_task.pydantic_output else base_task.response_fields if base_task.response_fields else None
71
+ base_agent.callbacks.append(self._reflect)
72
+ init_node = Node(task=base_task, assigned_to=base_agent)
73
+ self.add_node(init_node)
74
+
75
+ final_task = Task(description=INTEGRATE.format(original_prompt=self.original_prompt, responses=""))
76
+ final_node = Node(task=final_task, agent=base_agent)
77
+ self.add_node(node=final_node)
78
+
79
+ for agent in agents:
80
+ node = Node(task=base_task, assigned_to=agent)
81
+ self.add_node(node=node)
82
+ self.add_dependency(source=init_node.identifier, target=node.identifier, dependency_type=DependencyType.FINISH_TO_START, required=True)
83
+ self.add_dependency(source=node.identifier, target=final_node.identifier, dependency_type=DependencyType.FINISH_TO_START, required=True)
84
+
85
+ if attributes:
86
+ for k, v in attributes.items():
87
+ if hasattr(self, k):
88
+ setattr(self, k, v)
89
+
90
+ return self
91
+
92
+ @property
93
+ def index(self) -> str:
94
+ """Returns an index to add new item."""
95
+ return str(len([k for k in self.user_prompts.keys()]))
96
+
97
+ @property
98
+ def original_prompt(self) -> str:
99
+ return str(self.user_prompts["0"]) + str(self.dev_prompts["0"])
100
+
101
+ @property
102
+ def key(self):
103
+ return str(self._times_iteration)
@@ -0,0 +1,30 @@
1
+ REFLECT = "Here is the orignal prompt: {original_prompt}\nHere is the original response: {original_response}\nAnalyze the original prompt and repsonse, check for any pontential issue, and create an improved response."
2
+
3
+ INTEGRATE = "Here is the original prompt: {original_prompt}\nHere are responses: {responses}. Help integrate them as a single response."
4
+
5
+ parameter_sets = [
6
+ {
7
+ "temperature": 0.2,
8
+ "top_p": 0.5,
9
+ "max_tokens": 5000,
10
+ "frequency_penalty": 0.5,
11
+ "presence_penalty": 0.5,
12
+ "stop": ["\n\n", "###"],
13
+ },
14
+ {
15
+ "temperature": 0.7,
16
+ "top_p": 0.8,
17
+ "max_tokens": 8000,
18
+ "frequency_penalty": 0.3,
19
+ "presence_penalty": 0.3,
20
+ "stop": ["\n\n"],
21
+ },
22
+ {
23
+ "temperature": 1.0,
24
+ "top_p": 0.95,
25
+ "max_tokens": 12000,
26
+ "frequency_penalty": 0.0,
27
+ "presence_penalty": 0.0,
28
+ "stop": [],
29
+ }
30
+ ]