hanzo-agent 0.0.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 (222) hide show
  1. hanzo_agent-0.0.4/.dockerignore +55 -0
  2. hanzo_agent-0.0.4/.gitignore +144 -0
  3. hanzo_agent-0.0.4/.prettierrc +11 -0
  4. hanzo_agent-0.0.4/Dockerfile +58 -0
  5. hanzo_agent-0.0.4/LICENSE +21 -0
  6. hanzo_agent-0.0.4/Makefile +57 -0
  7. hanzo_agent-0.0.4/PKG-INFO +380 -0
  8. hanzo_agent-0.0.4/README.md +338 -0
  9. hanzo_agent-0.0.4/docs/assets/images/favicon-platform.svg +16 -0
  10. hanzo_agent-0.0.4/docs/assets/images/orchestration.png +0 -0
  11. hanzo_agent-0.0.4/docs/assets/logo.svg +15 -0
  12. hanzo_agent-0.0.4/docs/config.md +94 -0
  13. hanzo_agent-0.0.4/docs/context.md +77 -0
  14. hanzo_agent-0.0.4/docs/guardrails.md +154 -0
  15. hanzo_agent-0.0.4/docs/handoffs.md +113 -0
  16. hanzo_agent-0.0.4/docs/hanzo-backend-integration.md +326 -0
  17. hanzo_agent-0.0.4/docs/index.md +52 -0
  18. hanzo_agent-0.0.4/docs/models.md +93 -0
  19. hanzo_agent-0.0.4/docs/multi_agent.md +37 -0
  20. hanzo_agent-0.0.4/docs/networks-and-orchestration.md +316 -0
  21. hanzo_agent-0.0.4/docs/quickstart.md +189 -0
  22. hanzo_agent-0.0.4/docs/ref/agent.md +3 -0
  23. hanzo_agent-0.0.4/docs/ref/agent_output.md +3 -0
  24. hanzo_agent-0.0.4/docs/ref/exceptions.md +3 -0
  25. hanzo_agent-0.0.4/docs/ref/extensions/handoff_filters.md +3 -0
  26. hanzo_agent-0.0.4/docs/ref/extensions/handoff_prompt.md +8 -0
  27. hanzo_agent-0.0.4/docs/ref/function_schema.md +3 -0
  28. hanzo_agent-0.0.4/docs/ref/guardrail.md +3 -0
  29. hanzo_agent-0.0.4/docs/ref/handoffs.md +3 -0
  30. hanzo_agent-0.0.4/docs/ref/index.md +13 -0
  31. hanzo_agent-0.0.4/docs/ref/items.md +3 -0
  32. hanzo_agent-0.0.4/docs/ref/lifecycle.md +6 -0
  33. hanzo_agent-0.0.4/docs/ref/model_settings.md +3 -0
  34. hanzo_agent-0.0.4/docs/ref/models/interface.md +3 -0
  35. hanzo_agent-0.0.4/docs/ref/models/openai_chatcompletions.md +3 -0
  36. hanzo_agent-0.0.4/docs/ref/models/openai_responses.md +3 -0
  37. hanzo_agent-0.0.4/docs/ref/result.md +3 -0
  38. hanzo_agent-0.0.4/docs/ref/run.md +8 -0
  39. hanzo_agent-0.0.4/docs/ref/run_context.md +3 -0
  40. hanzo_agent-0.0.4/docs/ref/stream_events.md +3 -0
  41. hanzo_agent-0.0.4/docs/ref/tool.md +3 -0
  42. hanzo_agent-0.0.4/docs/ref/tracing/create.md +3 -0
  43. hanzo_agent-0.0.4/docs/ref/tracing/index.md +3 -0
  44. hanzo_agent-0.0.4/docs/ref/tracing/processor_interface.md +3 -0
  45. hanzo_agent-0.0.4/docs/ref/tracing/processors.md +3 -0
  46. hanzo_agent-0.0.4/docs/ref/tracing/scope.md +3 -0
  47. hanzo_agent-0.0.4/docs/ref/tracing/setup.md +3 -0
  48. hanzo_agent-0.0.4/docs/ref/tracing/span_data.md +3 -0
  49. hanzo_agent-0.0.4/docs/ref/tracing/spans.md +9 -0
  50. hanzo_agent-0.0.4/docs/ref/tracing/traces.md +3 -0
  51. hanzo_agent-0.0.4/docs/ref/tracing/util.md +3 -0
  52. hanzo_agent-0.0.4/docs/ref/usage.md +3 -0
  53. hanzo_agent-0.0.4/docs/results.md +52 -0
  54. hanzo_agent-0.0.4/docs/running_agents.md +95 -0
  55. hanzo_agent-0.0.4/docs/streaming.md +87 -0
  56. hanzo_agent-0.0.4/docs/stylesheets/extra.css +194 -0
  57. hanzo_agent-0.0.4/docs/tools.md +270 -0
  58. hanzo_agent-0.0.4/docs/tracing.md +97 -0
  59. hanzo_agent-0.0.4/examples/__init__.py +3 -0
  60. hanzo_agent-0.0.4/examples/agent_patterns/README.md +54 -0
  61. hanzo_agent-0.0.4/examples/agent_patterns/agents_as_tools.py +79 -0
  62. hanzo_agent-0.0.4/examples/agent_patterns/deterministic.py +82 -0
  63. hanzo_agent-0.0.4/examples/agent_patterns/input_guardrails.py +107 -0
  64. hanzo_agent-0.0.4/examples/agent_patterns/llm_as_a_judge.py +80 -0
  65. hanzo_agent-0.0.4/examples/agent_patterns/output_guardrails.py +84 -0
  66. hanzo_agent-0.0.4/examples/agent_patterns/parallelization.py +61 -0
  67. hanzo_agent-0.0.4/examples/agent_patterns/routing.py +70 -0
  68. hanzo_agent-0.0.4/examples/autonomous_bug_solver.py +478 -0
  69. hanzo_agent-0.0.4/examples/basic/agent_lifecycle_example.py +120 -0
  70. hanzo_agent-0.0.4/examples/basic/dynamic_system_prompt.py +71 -0
  71. hanzo_agent-0.0.4/examples/basic/hello_world.py +20 -0
  72. hanzo_agent-0.0.4/examples/basic/hello_world_jupyter.py +11 -0
  73. hanzo_agent-0.0.4/examples/basic/lifecycle_example.py +130 -0
  74. hanzo_agent-0.0.4/examples/basic/stream_items.py +67 -0
  75. hanzo_agent-0.0.4/examples/basic/stream_text.py +23 -0
  76. hanzo_agent-0.0.4/examples/customer_service/main.py +174 -0
  77. hanzo_agent-0.0.4/examples/handoffs/message_filter.py +183 -0
  78. hanzo_agent-0.0.4/examples/handoffs/message_filter_streaming.py +183 -0
  79. hanzo_agent-0.0.4/examples/hanzo_backend_example.py +206 -0
  80. hanzo_agent-0.0.4/examples/model_providers/README.md +19 -0
  81. hanzo_agent-0.0.4/examples/model_providers/custom_example_agent.py +55 -0
  82. hanzo_agent-0.0.4/examples/model_providers/custom_example_global.py +63 -0
  83. hanzo_agent-0.0.4/examples/model_providers/custom_example_provider.py +77 -0
  84. hanzo_agent-0.0.4/examples/network_example.py +325 -0
  85. hanzo_agent-0.0.4/examples/research_bot/README.md +25 -0
  86. hanzo_agent-0.0.4/examples/research_bot/__init__.py +1 -0
  87. hanzo_agent-0.0.4/examples/research_bot/agents/__init__.py +0 -0
  88. hanzo_agent-0.0.4/examples/research_bot/agents/planner_agent.py +29 -0
  89. hanzo_agent-0.0.4/examples/research_bot/agents/search_agent.py +18 -0
  90. hanzo_agent-0.0.4/examples/research_bot/agents/writer_agent.py +33 -0
  91. hanzo_agent-0.0.4/examples/research_bot/main.py +12 -0
  92. hanzo_agent-0.0.4/examples/research_bot/manager.py +121 -0
  93. hanzo_agent-0.0.4/examples/research_bot/printer.py +45 -0
  94. hanzo_agent-0.0.4/examples/research_bot/sample_outputs/product_recs.md +180 -0
  95. hanzo_agent-0.0.4/examples/research_bot/sample_outputs/product_recs.txt +212 -0
  96. hanzo_agent-0.0.4/examples/research_bot/sample_outputs/vacation.md +177 -0
  97. hanzo_agent-0.0.4/examples/research_bot/sample_outputs/vacation.txt +206 -0
  98. hanzo_agent-0.0.4/examples/tools/computer_use.py +168 -0
  99. hanzo_agent-0.0.4/examples/tools/file_search.py +36 -0
  100. hanzo_agent-0.0.4/examples/tools/web_search.py +25 -0
  101. hanzo_agent-0.0.4/mkdocs.yml +121 -0
  102. hanzo_agent-0.0.4/pyproject.toml +149 -0
  103. hanzo_agent-0.0.4/src/agents/__init__.py +332 -0
  104. hanzo_agent-0.0.4/src/agents/_config.py +26 -0
  105. hanzo_agent-0.0.4/src/agents/_debug.py +19 -0
  106. hanzo_agent-0.0.4/src/agents/_run_impl.py +825 -0
  107. hanzo_agent-0.0.4/src/agents/_utils.py +63 -0
  108. hanzo_agent-0.0.4/src/agents/agent.py +173 -0
  109. hanzo_agent-0.0.4/src/agents/agent_output.py +146 -0
  110. hanzo_agent-0.0.4/src/agents/computer.py +107 -0
  111. hanzo_agent-0.0.4/src/agents/exceptions.py +63 -0
  112. hanzo_agent-0.0.4/src/agents/extensions/__init__.py +12 -0
  113. hanzo_agent-0.0.4/src/agents/extensions/cli/__init__.py +11 -0
  114. hanzo_agent-0.0.4/src/agents/extensions/cli/cli_agent.py +255 -0
  115. hanzo_agent-0.0.4/src/agents/extensions/handoff_filters.py +71 -0
  116. hanzo_agent-0.0.4/src/agents/extensions/handoff_prompt.py +19 -0
  117. hanzo_agent-0.0.4/src/agents/extensions/marketplace/__init__.py +24 -0
  118. hanzo_agent-0.0.4/src/agents/extensions/marketplace/marketplace.py +418 -0
  119. hanzo_agent-0.0.4/src/agents/extensions/tee/__init__.py +26 -0
  120. hanzo_agent-0.0.4/src/agents/extensions/tee/tee.py +429 -0
  121. hanzo_agent-0.0.4/src/agents/extensions/web3/__init__.py +27 -0
  122. hanzo_agent-0.0.4/src/agents/extensions/web3/wallet.py +389 -0
  123. hanzo_agent-0.0.4/src/agents/extensions/web3/web3_agent.py +383 -0
  124. hanzo_agent-0.0.4/src/agents/extensions/web3/web3_network.py +447 -0
  125. hanzo_agent-0.0.4/src/agents/function_schema.py +347 -0
  126. hanzo_agent-0.0.4/src/agents/guardrail.py +342 -0
  127. hanzo_agent-0.0.4/src/agents/handoffs.py +242 -0
  128. hanzo_agent-0.0.4/src/agents/items.py +249 -0
  129. hanzo_agent-0.0.4/src/agents/lifecycle.py +107 -0
  130. hanzo_agent-0.0.4/src/agents/logger.py +3 -0
  131. hanzo_agent-0.0.4/src/agents/memory/__init__.py +28 -0
  132. hanzo_agent-0.0.4/src/agents/memory/memory.py +349 -0
  133. hanzo_agent-0.0.4/src/agents/memory/retriever.py +205 -0
  134. hanzo_agent-0.0.4/src/agents/memory/store.py +458 -0
  135. hanzo_agent-0.0.4/src/agents/memory/types.py +70 -0
  136. hanzo_agent-0.0.4/src/agents/model_settings.py +57 -0
  137. hanzo_agent-0.0.4/src/agents/models/__init__.py +0 -0
  138. hanzo_agent-0.0.4/src/agents/models/_openai_shared.py +34 -0
  139. hanzo_agent-0.0.4/src/agents/models/fake_id.py +5 -0
  140. hanzo_agent-0.0.4/src/agents/models/hanzo_node_provider.py +104 -0
  141. hanzo_agent-0.0.4/src/agents/models/interface.py +107 -0
  142. hanzo_agent-0.0.4/src/agents/models/openai_chatcompletions.py +1063 -0
  143. hanzo_agent-0.0.4/src/agents/models/openai_provider.py +97 -0
  144. hanzo_agent-0.0.4/src/agents/models/openai_responses.py +411 -0
  145. hanzo_agent-0.0.4/src/agents/network/__init__.py +32 -0
  146. hanzo_agent-0.0.4/src/agents/network/network.py +437 -0
  147. hanzo_agent-0.0.4/src/agents/network/node.py +77 -0
  148. hanzo_agent-0.0.4/src/agents/network/router.py +408 -0
  149. hanzo_agent-0.0.4/src/agents/orchestration/__init__.py +24 -0
  150. hanzo_agent-0.0.4/src/agents/orchestration/executor.py +492 -0
  151. hanzo_agent-0.0.4/src/agents/orchestration/orchestrator.py +335 -0
  152. hanzo_agent-0.0.4/src/agents/orchestration/ui_stream.py +377 -0
  153. hanzo_agent-0.0.4/src/agents/orchestration/workflow.py +512 -0
  154. hanzo_agent-0.0.4/src/agents/reflexion.py +78 -0
  155. hanzo_agent-0.0.4/src/agents/result.py +224 -0
  156. hanzo_agent-0.0.4/src/agents/run.py +931 -0
  157. hanzo_agent-0.0.4/src/agents/run_context.py +26 -0
  158. hanzo_agent-0.0.4/src/agents/state/__init__.py +20 -0
  159. hanzo_agent-0.0.4/src/agents/state/namespace.py +62 -0
  160. hanzo_agent-0.0.4/src/agents/state/serializer.py +60 -0
  161. hanzo_agent-0.0.4/src/agents/state/store.py +346 -0
  162. hanzo_agent-0.0.4/src/agents/stream_events.py +60 -0
  163. hanzo_agent-0.0.4/src/agents/strict_schema.py +184 -0
  164. hanzo_agent-0.0.4/src/agents/tool.py +290 -0
  165. hanzo_agent-0.0.4/src/agents/tool_enhanced.py +392 -0
  166. hanzo_agent-0.0.4/src/agents/tracing/__init__.py +97 -0
  167. hanzo_agent-0.0.4/src/agents/tracing/create.py +312 -0
  168. hanzo_agent-0.0.4/src/agents/tracing/logger.py +3 -0
  169. hanzo_agent-0.0.4/src/agents/tracing/processor_interface.py +69 -0
  170. hanzo_agent-0.0.4/src/agents/tracing/processors.py +267 -0
  171. hanzo_agent-0.0.4/src/agents/tracing/scope.py +49 -0
  172. hanzo_agent-0.0.4/src/agents/tracing/setup.py +215 -0
  173. hanzo_agent-0.0.4/src/agents/tracing/span_data.py +188 -0
  174. hanzo_agent-0.0.4/src/agents/tracing/spans.py +264 -0
  175. hanzo_agent-0.0.4/src/agents/tracing/traces.py +195 -0
  176. hanzo_agent-0.0.4/src/agents/tracing/util.py +17 -0
  177. hanzo_agent-0.0.4/src/agents/usage.py +22 -0
  178. hanzo_agent-0.0.4/src/agents/version.py +7 -0
  179. hanzo_agent-0.0.4/test_hanzo_backend.py +246 -0
  180. hanzo_agent-0.0.4/test_hanzo_node.py +165 -0
  181. hanzo_agent-0.0.4/test_quick.py +52 -0
  182. hanzo_agent-0.0.4/test_simple_anthropic.py +121 -0
  183. hanzo_agent-0.0.4/tests/__init__.py +0 -0
  184. hanzo_agent-0.0.4/tests/conftest.py +117 -0
  185. hanzo_agent-0.0.4/tests/fake_model.py +123 -0
  186. hanzo_agent-0.0.4/tests/test_agent_config.py +169 -0
  187. hanzo_agent-0.0.4/tests/test_agent_hooks.py +428 -0
  188. hanzo_agent-0.0.4/tests/test_agent_runner.py +601 -0
  189. hanzo_agent-0.0.4/tests/test_agent_runner_streamed.py +732 -0
  190. hanzo_agent-0.0.4/tests/test_agent_tracing.py +326 -0
  191. hanzo_agent-0.0.4/tests/test_agentkit_features.py +544 -0
  192. hanzo_agent-0.0.4/tests/test_computer_action.py +330 -0
  193. hanzo_agent-0.0.4/tests/test_config.py +68 -0
  194. hanzo_agent-0.0.4/tests/test_doc_parsing.py +130 -0
  195. hanzo_agent-0.0.4/tests/test_extension_filters.py +194 -0
  196. hanzo_agent-0.0.4/tests/test_function_schema.py +449 -0
  197. hanzo_agent-0.0.4/tests/test_function_tool.py +261 -0
  198. hanzo_agent-0.0.4/tests/test_function_tool_decorator.py +146 -0
  199. hanzo_agent-0.0.4/tests/test_global_hooks.py +373 -0
  200. hanzo_agent-0.0.4/tests/test_guardrails.py +304 -0
  201. hanzo_agent-0.0.4/tests/test_handoff_tool.py +284 -0
  202. hanzo_agent-0.0.4/tests/test_items_helpers.py +318 -0
  203. hanzo_agent-0.0.4/tests/test_max_turns.py +142 -0
  204. hanzo_agent-0.0.4/tests/test_openai_chatcompletions.py +296 -0
  205. hanzo_agent-0.0.4/tests/test_openai_chatcompletions_converter.py +433 -0
  206. hanzo_agent-0.0.4/tests/test_openai_chatcompletions_stream.py +289 -0
  207. hanzo_agent-0.0.4/tests/test_openai_responses_converter.py +213 -0
  208. hanzo_agent-0.0.4/tests/test_output_tool.py +134 -0
  209. hanzo_agent-0.0.4/tests/test_responses.py +78 -0
  210. hanzo_agent-0.0.4/tests/test_responses_tracing.py +272 -0
  211. hanzo_agent-0.0.4/tests/test_result_cast.py +58 -0
  212. hanzo_agent-0.0.4/tests/test_run_config.py +88 -0
  213. hanzo_agent-0.0.4/tests/test_run_step_execution.py +313 -0
  214. hanzo_agent-0.0.4/tests/test_run_step_processing.py +433 -0
  215. hanzo_agent-0.0.4/tests/test_strict_schema.py +129 -0
  216. hanzo_agent-0.0.4/tests/test_tool_converter.py +58 -0
  217. hanzo_agent-0.0.4/tests/test_trace_processor.py +286 -0
  218. hanzo_agent-0.0.4/tests/test_tracing.py +436 -0
  219. hanzo_agent-0.0.4/tests/test_tracing_errors.py +336 -0
  220. hanzo_agent-0.0.4/tests/test_tracing_errors_streamed.py +406 -0
  221. hanzo_agent-0.0.4/tests/testing_processor.py +79 -0
  222. hanzo_agent-0.0.4/uv.lock +4804 -0
@@ -0,0 +1,55 @@
1
+ # Git
2
+ .git/
3
+ .gitignore
4
+ .github/
5
+
6
+ # Python
7
+ __pycache__/
8
+ *.py[cod]
9
+ *$py.class
10
+ *.so
11
+ .Python
12
+ .env
13
+ .venv/
14
+ env/
15
+ venv/
16
+ ENV/
17
+ env.bak/
18
+ venv.bak/
19
+ .pytest_cache/
20
+ .coverage
21
+ .coverage.*
22
+ htmlcov/
23
+ .tox/
24
+ .mypy_cache/
25
+ .dmypy.json
26
+ dmypy.json
27
+ .ruff_cache/
28
+ *.egg-info/
29
+ dist/
30
+ build/
31
+
32
+ # IDE
33
+ .vscode/
34
+ .idea/
35
+ *.swp
36
+ *.swo
37
+ *~
38
+ .DS_Store
39
+
40
+ # Documentation
41
+ docs/_build/
42
+ *.md
43
+ !README.md
44
+
45
+ # Tests
46
+ tests/
47
+ test_*.py
48
+ *_test.py
49
+
50
+ # Development
51
+ .dockerignore
52
+ Dockerfile
53
+ docker-compose*.yml
54
+ Makefile
55
+ *.log
@@ -0,0 +1,144 @@
1
+ # macOS Files
2
+ .DS_Store
3
+
4
+ # Byte-compiled / optimized / DLL files
5
+ __pycache__/
6
+ **/__pycache__/
7
+ *.py[cod]
8
+ *$py.class
9
+
10
+ # C extensions
11
+ *.so
12
+
13
+ # Distribution / packaging
14
+ .Python
15
+ build/
16
+ develop-eggs/
17
+ dist/
18
+ downloads/
19
+ eggs/
20
+ .eggs/
21
+ lib/
22
+ lib64/
23
+ parts/
24
+ sdist/
25
+ var/
26
+ wheels/
27
+ share/python-wheels/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+ MANIFEST
32
+
33
+ # PyInstaller
34
+ *.manifest
35
+ *.spec
36
+
37
+ # Installer logs
38
+ pip-log.txt
39
+ pip-delete-this-directory.txt
40
+
41
+ # Unit test / coverage reports
42
+ htmlcov/
43
+ .tox/
44
+ .nox/
45
+ .coverage
46
+ .coverage.*
47
+ .cache
48
+ nosetests.xml
49
+ coverage.xml
50
+ *.cover
51
+ *.py,cover
52
+ .hypothesis/
53
+ .pytest_cache/
54
+ cover/
55
+
56
+ # Translations
57
+ *.mo
58
+ *.pot
59
+
60
+ # Django stuff:
61
+ *.log
62
+ local_settings.py
63
+ db.sqlite3
64
+ db.sqlite3-journal
65
+
66
+ # Flask stuff:
67
+ instance/
68
+ .webassets-cache
69
+
70
+ # Scrapy stuff:
71
+ .scrapy
72
+
73
+ # Sphinx documentation
74
+ docs/_build/
75
+
76
+ # PyBuilder
77
+ .pybuilder/
78
+ target/
79
+
80
+ # Jupyter Notebook
81
+ .ipynb_checkpoints
82
+
83
+ # IPython
84
+ profile_default/
85
+ ipython_config.py
86
+
87
+ # pdm
88
+ .pdm.toml
89
+ .pdm-python
90
+ .pdm-build/
91
+
92
+ # PEP 582
93
+ __pypackages__/
94
+
95
+ # Celery stuff
96
+ celerybeat-schedule
97
+ celerybeat.pid
98
+
99
+ # SageMath parsed files
100
+ *.sage.py
101
+
102
+ # Environments
103
+ .env
104
+ .venv
105
+ env/
106
+ venv/
107
+ ENV/
108
+ env.bak/
109
+ venv.bak/
110
+ .venv39
111
+ .venv_res
112
+
113
+ # Spyder project settings
114
+ .spyderproject
115
+ .spyproject
116
+
117
+ # Rope project settings
118
+ .ropeproject
119
+
120
+ # mkdocs documentation
121
+ /site
122
+
123
+ # mypy
124
+ .mypy_cache/
125
+ .dmypy.json
126
+ dmypy.json
127
+
128
+ # Pyre type checker
129
+ .pyre/
130
+
131
+ # pytype static type analyzer
132
+ .pytype/
133
+
134
+ # Cython debug symbols
135
+ cython_debug/
136
+
137
+ # PyCharm
138
+ #.idea/
139
+
140
+ # Ruff stuff:
141
+ .ruff_cache/
142
+
143
+ # PyPI configuration file
144
+ .pypirc
@@ -0,0 +1,11 @@
1
+ {
2
+ "tabWidth": 4,
3
+ "overrides": [
4
+ {
5
+ "files": "*.yml",
6
+ "options": {
7
+ "tabWidth": 2
8
+ }
9
+ }
10
+ ]
11
+ }
@@ -0,0 +1,58 @@
1
+ # Multi-stage Dockerfile for Hanzo Agent SDK
2
+ # This Dockerfile creates a production-ready image for the Hanzo AI SDK
3
+
4
+ # Build stage
5
+ FROM python:3.12-slim AS builder
6
+
7
+ # Install system dependencies
8
+ RUN apt-get update && apt-get install -y --no-install-recommends \
9
+ curl \
10
+ && rm -rf /var/lib/apt/lists/*
11
+
12
+ # Install uv for fast Python package management
13
+ RUN curl -LsSf https://astral.sh/uv/install.sh | sh
14
+ ENV PATH="/root/.cargo/bin:${PATH}"
15
+
16
+ # Set working directory
17
+ WORKDIR /app
18
+
19
+ # Copy dependency files
20
+ COPY pyproject.toml uv.lock ./
21
+
22
+ # Install dependencies
23
+ RUN uv sync --frozen --no-dev
24
+
25
+ # Production stage
26
+ FROM python:3.12-slim
27
+
28
+ # Install runtime dependencies
29
+ RUN apt-get update && apt-get install -y --no-install-recommends \
30
+ ca-certificates \
31
+ && rm -rf /var/lib/apt/lists/*
32
+
33
+ # Create non-root user
34
+ RUN groupadd -r hanzo && useradd -r -g hanzo hanzo
35
+
36
+ # Set working directory
37
+ WORKDIR /app
38
+
39
+ # Copy virtual environment from builder
40
+ COPY --from=builder /app/.venv /app/.venv
41
+
42
+ # Copy application code
43
+ COPY --chown=hanzo:hanzo . .
44
+
45
+ # Set environment variables
46
+ ENV PATH="/app/.venv/bin:${PATH}"
47
+ ENV PYTHONUNBUFFERED=1
48
+ ENV PYTHONDONTWRITEBYTECODE=1
49
+
50
+ # Switch to non-root user
51
+ USER hanzo
52
+
53
+ # Health check
54
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
55
+ CMD python -c "import agents; print('OK')" || exit 1
56
+
57
+ # Default command (can be overridden)
58
+ CMD ["python", "-m", "agents"]
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Hanzo Industries, Inc
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,57 @@
1
+ .PHONY: sync
2
+ sync:
3
+ uv sync --all-extras --all-packages --group dev
4
+
5
+ .PHONY: format
6
+ format:
7
+ uv run ruff format
8
+
9
+ .PHONY: lint
10
+ lint:
11
+ uv run ruff check
12
+
13
+ .PHONY: mypy
14
+ mypy:
15
+ uv run mypy .
16
+
17
+ .PHONY: tests
18
+ tests:
19
+ uv run pytest
20
+
21
+ .PHONY: old_version_tests
22
+ old_version_tests:
23
+ UV_PROJECT_ENVIRONMENT=.venv_39 uv run --python 3.9 -m pytest
24
+ UV_PROJECT_ENVIRONMENT=.venv_39 uv run --python 3.9 -m mypy .
25
+
26
+ .PHONY: build-docs
27
+ build-docs:
28
+ uv run mkdocs build
29
+
30
+ .PHONY: serve-docs
31
+ serve-docs:
32
+ uv run mkdocs serve
33
+
34
+ .PHONY: deploy-docs
35
+ deploy-docs:
36
+ uv run mkdocs gh-deploy --force --verbose
37
+
38
+ .PHONY: test-backend
39
+ test-backend:
40
+ @echo "Testing Hanzo Agent SDK with local backend..."
41
+ @echo "Make sure Router is running at http://localhost:4000"
42
+ @echo "----------------------------------------"
43
+ uv run python test_hanzo_backend.py
44
+
45
+ .PHONY: example-backend
46
+ example-backend:
47
+ @echo "Running Hanzo backend integration example..."
48
+ uv run python examples/hanzo_backend_example.py
49
+
50
+ .PHONY: setup-backend
51
+ setup-backend:
52
+ @echo "Setting up Hanzo backend environment..."
53
+ @echo "export HANZO_ROUTER_URL=http://localhost:4000/v1"
54
+ @echo "export HANZO_API_KEY=sk-1234"
55
+ @echo "----------------------------------------"
56
+ @echo "Add these to your shell profile or .env file"
57
+