agentex-sdk 0.1.0a6__py3-none-any.whl

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 (289) hide show
  1. agentex/__init__.py +103 -0
  2. agentex/_base_client.py +1992 -0
  3. agentex/_client.py +506 -0
  4. agentex/_compat.py +219 -0
  5. agentex/_constants.py +14 -0
  6. agentex/_exceptions.py +108 -0
  7. agentex/_files.py +123 -0
  8. agentex/_models.py +829 -0
  9. agentex/_qs.py +150 -0
  10. agentex/_resource.py +43 -0
  11. agentex/_response.py +830 -0
  12. agentex/_streaming.py +333 -0
  13. agentex/_types.py +219 -0
  14. agentex/_utils/__init__.py +57 -0
  15. agentex/_utils/_logs.py +25 -0
  16. agentex/_utils/_proxy.py +65 -0
  17. agentex/_utils/_reflection.py +42 -0
  18. agentex/_utils/_resources_proxy.py +24 -0
  19. agentex/_utils/_streams.py +12 -0
  20. agentex/_utils/_sync.py +86 -0
  21. agentex/_utils/_transform.py +447 -0
  22. agentex/_utils/_typing.py +151 -0
  23. agentex/_utils/_utils.py +422 -0
  24. agentex/_version.py +4 -0
  25. agentex/lib/.keep +4 -0
  26. agentex/lib/__init__.py +0 -0
  27. agentex/lib/adk/__init__.py +41 -0
  28. agentex/lib/adk/_modules/__init__.py +0 -0
  29. agentex/lib/adk/_modules/acp.py +247 -0
  30. agentex/lib/adk/_modules/agent_task_tracker.py +176 -0
  31. agentex/lib/adk/_modules/agents.py +77 -0
  32. agentex/lib/adk/_modules/events.py +141 -0
  33. agentex/lib/adk/_modules/messages.py +285 -0
  34. agentex/lib/adk/_modules/state.py +291 -0
  35. agentex/lib/adk/_modules/streaming.py +75 -0
  36. agentex/lib/adk/_modules/tasks.py +124 -0
  37. agentex/lib/adk/_modules/tracing.py +194 -0
  38. agentex/lib/adk/providers/__init__.py +9 -0
  39. agentex/lib/adk/providers/_modules/__init__.py +0 -0
  40. agentex/lib/adk/providers/_modules/litellm.py +232 -0
  41. agentex/lib/adk/providers/_modules/openai.py +416 -0
  42. agentex/lib/adk/providers/_modules/sgp.py +85 -0
  43. agentex/lib/adk/utils/__init__.py +5 -0
  44. agentex/lib/adk/utils/_modules/__init__.py +0 -0
  45. agentex/lib/adk/utils/_modules/templating.py +94 -0
  46. agentex/lib/cli/__init__.py +0 -0
  47. agentex/lib/cli/commands/__init__.py +0 -0
  48. agentex/lib/cli/commands/agents.py +328 -0
  49. agentex/lib/cli/commands/init.py +227 -0
  50. agentex/lib/cli/commands/main.py +33 -0
  51. agentex/lib/cli/commands/secrets.py +169 -0
  52. agentex/lib/cli/commands/tasks.py +118 -0
  53. agentex/lib/cli/commands/uv.py +133 -0
  54. agentex/lib/cli/handlers/__init__.py +0 -0
  55. agentex/lib/cli/handlers/agent_handlers.py +160 -0
  56. agentex/lib/cli/handlers/cleanup_handlers.py +186 -0
  57. agentex/lib/cli/handlers/deploy_handlers.py +351 -0
  58. agentex/lib/cli/handlers/run_handlers.py +452 -0
  59. agentex/lib/cli/handlers/secret_handlers.py +670 -0
  60. agentex/lib/cli/templates/default/.dockerignore.j2 +43 -0
  61. agentex/lib/cli/templates/default/Dockerfile-uv.j2 +42 -0
  62. agentex/lib/cli/templates/default/Dockerfile.j2 +42 -0
  63. agentex/lib/cli/templates/default/README.md.j2 +193 -0
  64. agentex/lib/cli/templates/default/deploy/example.yaml.j2 +55 -0
  65. agentex/lib/cli/templates/default/manifest.yaml.j2 +116 -0
  66. agentex/lib/cli/templates/default/project/acp.py.j2 +29 -0
  67. agentex/lib/cli/templates/default/pyproject.toml.j2 +33 -0
  68. agentex/lib/cli/templates/default/requirements.txt.j2 +5 -0
  69. agentex/lib/cli/templates/deploy/Screenshot 2025-03-19 at 10.36.57/342/200/257AM.png +0 -0
  70. agentex/lib/cli/templates/deploy/example.yaml.j2 +55 -0
  71. agentex/lib/cli/templates/sync/.dockerignore.j2 +43 -0
  72. agentex/lib/cli/templates/sync/Dockerfile-uv.j2 +42 -0
  73. agentex/lib/cli/templates/sync/Dockerfile.j2 +42 -0
  74. agentex/lib/cli/templates/sync/README.md.j2 +293 -0
  75. agentex/lib/cli/templates/sync/deploy/example.yaml.j2 +55 -0
  76. agentex/lib/cli/templates/sync/manifest.yaml.j2 +116 -0
  77. agentex/lib/cli/templates/sync/project/acp.py.j2 +26 -0
  78. agentex/lib/cli/templates/sync/pyproject.toml.j2 +33 -0
  79. agentex/lib/cli/templates/sync/requirements.txt.j2 +5 -0
  80. agentex/lib/cli/templates/temporal/.dockerignore.j2 +43 -0
  81. agentex/lib/cli/templates/temporal/Dockerfile-uv.j2 +48 -0
  82. agentex/lib/cli/templates/temporal/Dockerfile.j2 +48 -0
  83. agentex/lib/cli/templates/temporal/README.md.j2 +316 -0
  84. agentex/lib/cli/templates/temporal/deploy/example.yaml.j2 +55 -0
  85. agentex/lib/cli/templates/temporal/manifest.yaml.j2 +137 -0
  86. agentex/lib/cli/templates/temporal/project/acp.py.j2 +30 -0
  87. agentex/lib/cli/templates/temporal/project/run_worker.py.j2 +33 -0
  88. agentex/lib/cli/templates/temporal/project/workflow.py.j2 +66 -0
  89. agentex/lib/cli/templates/temporal/pyproject.toml.j2 +34 -0
  90. agentex/lib/cli/templates/temporal/requirements.txt.j2 +5 -0
  91. agentex/lib/cli/utils/cli_utils.py +14 -0
  92. agentex/lib/cli/utils/credential_utils.py +103 -0
  93. agentex/lib/cli/utils/exceptions.py +6 -0
  94. agentex/lib/cli/utils/kubectl_utils.py +135 -0
  95. agentex/lib/cli/utils/kubernetes_secrets_utils.py +185 -0
  96. agentex/lib/core/__init__.py +0 -0
  97. agentex/lib/core/adapters/__init__.py +0 -0
  98. agentex/lib/core/adapters/llm/__init__.py +1 -0
  99. agentex/lib/core/adapters/llm/adapter_litellm.py +46 -0
  100. agentex/lib/core/adapters/llm/adapter_sgp.py +55 -0
  101. agentex/lib/core/adapters/llm/port.py +24 -0
  102. agentex/lib/core/adapters/streams/adapter_redis.py +128 -0
  103. agentex/lib/core/adapters/streams/port.py +50 -0
  104. agentex/lib/core/clients/__init__.py +1 -0
  105. agentex/lib/core/clients/temporal/__init__.py +0 -0
  106. agentex/lib/core/clients/temporal/temporal_client.py +181 -0
  107. agentex/lib/core/clients/temporal/types.py +47 -0
  108. agentex/lib/core/clients/temporal/utils.py +56 -0
  109. agentex/lib/core/services/__init__.py +0 -0
  110. agentex/lib/core/services/adk/__init__.py +0 -0
  111. agentex/lib/core/services/adk/acp/__init__.py +0 -0
  112. agentex/lib/core/services/adk/acp/acp.py +210 -0
  113. agentex/lib/core/services/adk/agent_task_tracker.py +85 -0
  114. agentex/lib/core/services/adk/agents.py +43 -0
  115. agentex/lib/core/services/adk/events.py +61 -0
  116. agentex/lib/core/services/adk/messages.py +164 -0
  117. agentex/lib/core/services/adk/providers/__init__.py +0 -0
  118. agentex/lib/core/services/adk/providers/litellm.py +256 -0
  119. agentex/lib/core/services/adk/providers/openai.py +723 -0
  120. agentex/lib/core/services/adk/providers/sgp.py +99 -0
  121. agentex/lib/core/services/adk/state.py +120 -0
  122. agentex/lib/core/services/adk/streaming.py +262 -0
  123. agentex/lib/core/services/adk/tasks.py +69 -0
  124. agentex/lib/core/services/adk/tracing.py +36 -0
  125. agentex/lib/core/services/adk/utils/__init__.py +0 -0
  126. agentex/lib/core/services/adk/utils/templating.py +58 -0
  127. agentex/lib/core/temporal/__init__.py +0 -0
  128. agentex/lib/core/temporal/activities/__init__.py +207 -0
  129. agentex/lib/core/temporal/activities/activity_helpers.py +37 -0
  130. agentex/lib/core/temporal/activities/adk/__init__.py +0 -0
  131. agentex/lib/core/temporal/activities/adk/acp/__init__.py +0 -0
  132. agentex/lib/core/temporal/activities/adk/acp/acp_activities.py +86 -0
  133. agentex/lib/core/temporal/activities/adk/agent_task_tracker_activities.py +76 -0
  134. agentex/lib/core/temporal/activities/adk/agents_activities.py +35 -0
  135. agentex/lib/core/temporal/activities/adk/events_activities.py +50 -0
  136. agentex/lib/core/temporal/activities/adk/messages_activities.py +94 -0
  137. agentex/lib/core/temporal/activities/adk/providers/__init__.py +0 -0
  138. agentex/lib/core/temporal/activities/adk/providers/litellm_activities.py +71 -0
  139. agentex/lib/core/temporal/activities/adk/providers/openai_activities.py +210 -0
  140. agentex/lib/core/temporal/activities/adk/providers/sgp_activities.py +42 -0
  141. agentex/lib/core/temporal/activities/adk/state_activities.py +85 -0
  142. agentex/lib/core/temporal/activities/adk/streaming_activities.py +33 -0
  143. agentex/lib/core/temporal/activities/adk/tasks_activities.py +48 -0
  144. agentex/lib/core/temporal/activities/adk/tracing_activities.py +55 -0
  145. agentex/lib/core/temporal/activities/adk/utils/__init__.py +0 -0
  146. agentex/lib/core/temporal/activities/adk/utils/templating_activities.py +41 -0
  147. agentex/lib/core/temporal/services/__init__.py +0 -0
  148. agentex/lib/core/temporal/services/temporal_task_service.py +69 -0
  149. agentex/lib/core/temporal/types/__init__.py +0 -0
  150. agentex/lib/core/temporal/types/workflow.py +5 -0
  151. agentex/lib/core/temporal/workers/__init__.py +0 -0
  152. agentex/lib/core/temporal/workers/worker.py +162 -0
  153. agentex/lib/core/temporal/workflows/workflow.py +26 -0
  154. agentex/lib/core/tracing/__init__.py +5 -0
  155. agentex/lib/core/tracing/processors/agentex_tracing_processor.py +117 -0
  156. agentex/lib/core/tracing/processors/sgp_tracing_processor.py +119 -0
  157. agentex/lib/core/tracing/processors/tracing_processor_interface.py +40 -0
  158. agentex/lib/core/tracing/trace.py +311 -0
  159. agentex/lib/core/tracing/tracer.py +70 -0
  160. agentex/lib/core/tracing/tracing_processor_manager.py +62 -0
  161. agentex/lib/environment_variables.py +87 -0
  162. agentex/lib/py.typed +0 -0
  163. agentex/lib/sdk/__init__.py +0 -0
  164. agentex/lib/sdk/config/__init__.py +0 -0
  165. agentex/lib/sdk/config/agent_config.py +61 -0
  166. agentex/lib/sdk/config/agent_manifest.py +219 -0
  167. agentex/lib/sdk/config/build_config.py +35 -0
  168. agentex/lib/sdk/config/deployment_config.py +117 -0
  169. agentex/lib/sdk/config/local_development_config.py +56 -0
  170. agentex/lib/sdk/config/project_config.py +103 -0
  171. agentex/lib/sdk/fastacp/__init__.py +3 -0
  172. agentex/lib/sdk/fastacp/base/base_acp_server.py +406 -0
  173. agentex/lib/sdk/fastacp/fastacp.py +74 -0
  174. agentex/lib/sdk/fastacp/impl/agentic_base_acp.py +72 -0
  175. agentex/lib/sdk/fastacp/impl/sync_acp.py +109 -0
  176. agentex/lib/sdk/fastacp/impl/temporal_acp.py +97 -0
  177. agentex/lib/sdk/fastacp/tests/README.md +297 -0
  178. agentex/lib/sdk/fastacp/tests/conftest.py +307 -0
  179. agentex/lib/sdk/fastacp/tests/pytest.ini +10 -0
  180. agentex/lib/sdk/fastacp/tests/run_tests.py +227 -0
  181. agentex/lib/sdk/fastacp/tests/test_base_acp_server.py +450 -0
  182. agentex/lib/sdk/fastacp/tests/test_fastacp_factory.py +344 -0
  183. agentex/lib/sdk/fastacp/tests/test_integration.py +477 -0
  184. agentex/lib/sdk/state_machine/__init__.py +6 -0
  185. agentex/lib/sdk/state_machine/noop_workflow.py +21 -0
  186. agentex/lib/sdk/state_machine/state.py +10 -0
  187. agentex/lib/sdk/state_machine/state_machine.py +189 -0
  188. agentex/lib/sdk/state_machine/state_workflow.py +16 -0
  189. agentex/lib/sdk/utils/__init__.py +0 -0
  190. agentex/lib/sdk/utils/messages.py +223 -0
  191. agentex/lib/types/__init__.py +0 -0
  192. agentex/lib/types/acp.py +94 -0
  193. agentex/lib/types/agent_configs.py +79 -0
  194. agentex/lib/types/agent_results.py +29 -0
  195. agentex/lib/types/credentials.py +34 -0
  196. agentex/lib/types/fastacp.py +61 -0
  197. agentex/lib/types/files.py +13 -0
  198. agentex/lib/types/json_rpc.py +49 -0
  199. agentex/lib/types/llm_messages.py +354 -0
  200. agentex/lib/types/task_message_updates.py +171 -0
  201. agentex/lib/types/tracing.py +34 -0
  202. agentex/lib/utils/__init__.py +0 -0
  203. agentex/lib/utils/completions.py +131 -0
  204. agentex/lib/utils/console.py +14 -0
  205. agentex/lib/utils/io.py +29 -0
  206. agentex/lib/utils/iterables.py +14 -0
  207. agentex/lib/utils/json_schema.py +23 -0
  208. agentex/lib/utils/logging.py +31 -0
  209. agentex/lib/utils/mcp.py +17 -0
  210. agentex/lib/utils/model_utils.py +46 -0
  211. agentex/lib/utils/parsing.py +15 -0
  212. agentex/lib/utils/regex.py +6 -0
  213. agentex/lib/utils/temporal.py +13 -0
  214. agentex/py.typed +0 -0
  215. agentex/resources/__init__.py +103 -0
  216. agentex/resources/agents.py +707 -0
  217. agentex/resources/events.py +294 -0
  218. agentex/resources/messages/__init__.py +33 -0
  219. agentex/resources/messages/batch.py +271 -0
  220. agentex/resources/messages/messages.py +492 -0
  221. agentex/resources/spans.py +557 -0
  222. agentex/resources/states.py +544 -0
  223. agentex/resources/tasks.py +615 -0
  224. agentex/resources/tracker.py +384 -0
  225. agentex/types/__init__.py +56 -0
  226. agentex/types/acp_type.py +7 -0
  227. agentex/types/agent.py +29 -0
  228. agentex/types/agent_list_params.py +13 -0
  229. agentex/types/agent_list_response.py +10 -0
  230. agentex/types/agent_rpc_by_name_params.py +21 -0
  231. agentex/types/agent_rpc_params.py +51 -0
  232. agentex/types/agent_rpc_params1.py +21 -0
  233. agentex/types/agent_rpc_response.py +20 -0
  234. agentex/types/agent_rpc_result.py +90 -0
  235. agentex/types/agent_task_tracker.py +34 -0
  236. agentex/types/data_content.py +30 -0
  237. agentex/types/data_content_param.py +31 -0
  238. agentex/types/data_delta.py +14 -0
  239. agentex/types/event.py +29 -0
  240. agentex/types/event_list_params.py +22 -0
  241. agentex/types/event_list_response.py +10 -0
  242. agentex/types/message_author.py +7 -0
  243. agentex/types/message_create_params.py +18 -0
  244. agentex/types/message_list_params.py +14 -0
  245. agentex/types/message_list_response.py +10 -0
  246. agentex/types/message_style.py +7 -0
  247. agentex/types/message_update_params.py +18 -0
  248. agentex/types/messages/__init__.py +8 -0
  249. agentex/types/messages/batch_create_params.py +16 -0
  250. agentex/types/messages/batch_create_response.py +10 -0
  251. agentex/types/messages/batch_update_params.py +16 -0
  252. agentex/types/messages/batch_update_response.py +10 -0
  253. agentex/types/shared/__init__.py +3 -0
  254. agentex/types/shared/task_message_update.py +83 -0
  255. agentex/types/span.py +36 -0
  256. agentex/types/span_create_params.py +40 -0
  257. agentex/types/span_list_params.py +12 -0
  258. agentex/types/span_list_response.py +10 -0
  259. agentex/types/span_update_params.py +37 -0
  260. agentex/types/state.py +25 -0
  261. agentex/types/state_create_params.py +16 -0
  262. agentex/types/state_list_params.py +16 -0
  263. agentex/types/state_list_response.py +10 -0
  264. agentex/types/state_update_params.py +16 -0
  265. agentex/types/task.py +23 -0
  266. agentex/types/task_delete_by_name_response.py +8 -0
  267. agentex/types/task_delete_response.py +8 -0
  268. agentex/types/task_list_response.py +10 -0
  269. agentex/types/task_message.py +33 -0
  270. agentex/types/task_message_content.py +16 -0
  271. agentex/types/task_message_content_param.py +17 -0
  272. agentex/types/task_message_delta.py +16 -0
  273. agentex/types/text_content.py +53 -0
  274. agentex/types/text_content_param.py +54 -0
  275. agentex/types/text_delta.py +14 -0
  276. agentex/types/tool_request_content.py +36 -0
  277. agentex/types/tool_request_content_param.py +37 -0
  278. agentex/types/tool_request_delta.py +18 -0
  279. agentex/types/tool_response_content.py +36 -0
  280. agentex/types/tool_response_content_param.py +36 -0
  281. agentex/types/tool_response_delta.py +18 -0
  282. agentex/types/tracker_list_params.py +16 -0
  283. agentex/types/tracker_list_response.py +10 -0
  284. agentex/types/tracker_update_params.py +19 -0
  285. agentex_sdk-0.1.0a6.dist-info/METADATA +426 -0
  286. agentex_sdk-0.1.0a6.dist-info/RECORD +289 -0
  287. agentex_sdk-0.1.0a6.dist-info/WHEEL +4 -0
  288. agentex_sdk-0.1.0a6.dist-info/entry_points.txt +2 -0
  289. agentex_sdk-0.1.0a6.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,43 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ *.egg-info/
20
+ .installed.cfg
21
+ *.egg
22
+
23
+ # Environments
24
+ .env**
25
+ .venv
26
+ env/
27
+ venv/
28
+ ENV/
29
+ env.bak/
30
+ venv.bak/
31
+
32
+ # IDE
33
+ .idea/
34
+ .vscode/
35
+ *.swp
36
+ *.swo
37
+
38
+ # Git
39
+ .git
40
+ .gitignore
41
+
42
+ # Misc
43
+ .DS_Store
@@ -0,0 +1,42 @@
1
+ # syntax=docker/dockerfile:1.3
2
+ FROM python:3.12-slim
3
+ COPY --from=ghcr.io/astral-sh/uv:0.6.4 /uv /uvx /bin/
4
+
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ htop \
8
+ vim \
9
+ curl \
10
+ tar \
11
+ python3-dev \
12
+ postgresql-client \
13
+ build-essential \
14
+ libpq-dev \
15
+ gcc \
16
+ cmake \
17
+ netcat-openbsd \
18
+ && apt-get clean \
19
+ && rm -rf /var/lib/apt/lists/*
20
+
21
+ RUN uv pip install --system --upgrade pip setuptools wheel
22
+
23
+ ENV UV_HTTP_TIMEOUT=1000
24
+
25
+ # Copy just the pyproject.toml file to optimize caching
26
+ COPY {{ project_path_from_build_root }}/pyproject.toml /app/{{ project_path_from_build_root }}/pyproject.toml
27
+
28
+ WORKDIR /app/{{ project_path_from_build_root }}
29
+
30
+ # Install the required Python packages using uv
31
+ RUN uv pip install --system .
32
+
33
+ # Copy the project code
34
+ COPY {{ project_path_from_build_root }}/project /app/{{ project_path_from_build_root }}/project
35
+
36
+ WORKDIR /app/{{ project_path_from_build_root }}/project
37
+
38
+ # Set environment variables
39
+ ENV PYTHONPATH=/app
40
+
41
+ # Run the agent using uvicorn
42
+ CMD ["uvicorn", "acp:acp", "--host", "0.0.0.0", "--port", "8000"]
@@ -0,0 +1,42 @@
1
+ # syntax=docker/dockerfile:1.3
2
+ FROM python:3.12-slim
3
+ COPY --from=ghcr.io/astral-sh/uv:0.6.4 /uv /uvx /bin/
4
+
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ htop \
8
+ vim \
9
+ curl \
10
+ tar \
11
+ python3-dev \
12
+ postgresql-client \
13
+ build-essential \
14
+ libpq-dev \
15
+ gcc \
16
+ cmake \
17
+ netcat-openbsd \
18
+ && apt-get clean \
19
+ && rm -rf /var/lib/apt/lists/*
20
+
21
+ RUN uv pip install --system --upgrade pip setuptools wheel
22
+
23
+ ENV UV_HTTP_TIMEOUT=1000
24
+
25
+ # Copy just the requirements file to optimize caching
26
+ COPY {{ project_path_from_build_root }}/requirements.txt /app/{{ project_path_from_build_root }}/requirements.txt
27
+
28
+ WORKDIR /app/{{ project_path_from_build_root }}
29
+
30
+ # Install the required Python packages
31
+ RUN uv pip install --system -r requirements.txt
32
+
33
+ # Copy the project code
34
+ COPY {{ project_path_from_build_root }}/project /app/{{ project_path_from_build_root }}/project
35
+
36
+ WORKDIR /app/{{ project_path_from_build_root }}/project
37
+
38
+ # Set environment variables
39
+ ENV PYTHONPATH=/app
40
+
41
+ # Run the agent using uvicorn
42
+ CMD ["uvicorn", "acp:acp", "--host", "0.0.0.0", "--port", "8000"]
@@ -0,0 +1,193 @@
1
+ # {{ agent_name }} - AgentEx Starter Template
2
+
3
+ This is a generic starter template for building agents with the AgentEx framework. It provides a basic implementation of the Agent 2 Client Protocol (ACP) to help you get started quickly.
4
+
5
+ ## What You'll Learn
6
+
7
+ - **Tasks**: A task is a grouping mechanism for related messages. Think of it as a conversation thread or a session.
8
+ - **Messages**: Messages are communication objects within a task. They can contain text, data, or instructions.
9
+ - **ACP Events**: The agent responds to four main events:
10
+ - `task_received`: When a new task is created
11
+ - `task_message_received`: When a message is sent within a task
12
+ - `task_approved`: When a task is approved
13
+ - `task_canceled`: When a task is canceled
14
+
15
+ ## Running the Agent
16
+
17
+ 1. Run the agent locally:
18
+ ```bash
19
+ agentex agents run --manifest manifest.yaml
20
+ ```
21
+
22
+ The agent will start on port 8000 and print messages whenever it receives any of the ACP events.
23
+
24
+ ## What's Inside
25
+
26
+ This template:
27
+ - Sets up a basic ACP server
28
+ - Handles each of the required ACP events with simple print statements
29
+ - Provides a foundation for building more complex agents
30
+
31
+ ## Next Steps
32
+
33
+ For more advanced agent development, check out the AgentEx tutorials:
34
+
35
+ - **Tutorials 00-08**: Learn about building synchronous agents with ACP
36
+ - **Tutorials 09-10**: Learn how to use Temporal to power asynchronous agents
37
+ - Tutorial 09: Basic Temporal workflow setup
38
+ - Tutorial 10: Advanced Temporal patterns and best practices
39
+
40
+ These tutorials will help you understand:
41
+ - How to handle long-running tasks
42
+ - Implementing state machines
43
+ - Managing complex workflows
44
+ - Best practices for async agent development
45
+
46
+ ## The Manifest File
47
+
48
+ The `manifest.yaml` file is your agent's configuration file. It defines:
49
+ - How your agent should be built and packaged
50
+ - What files are included in your agent's Docker image
51
+ - Your agent's name and description
52
+ - Local development settings (like the port your agent runs on)
53
+
54
+ This file is essential for both local development and deployment of your agent.
55
+
56
+ ## Project Structure
57
+
58
+ ```
59
+ {{ project_name }}/
60
+ ├── project/ # Your agent's code
61
+ │ ├── __init__.py
62
+ │ └── acp.py # ACP server and event handlers
63
+ ├── Dockerfile # Container definition
64
+ ├── manifest.yaml # Deployment config
65
+ {% if use_uv %}
66
+ └── pyproject.toml # Dependencies (uv)
67
+ {% else %}
68
+ └── requirements.txt # Dependencies (pip)
69
+ {% endif %}
70
+ ```
71
+
72
+ ## Development
73
+
74
+ ### 1. Customize Event Handlers
75
+ - Modify the handlers in `acp.py` to implement your agent's logic
76
+ - Add your own tools and capabilities
77
+ - Implement custom state management
78
+
79
+ ### 2. Manage Dependencies
80
+
81
+ {% if use_uv %}
82
+ You chose **uv** for package management. Here's how to work with dependencies:
83
+
84
+ ```bash
85
+ # Add new dependencies
86
+ agentex uv add requests openai anthropic
87
+
88
+ # Install/sync dependencies
89
+ agentex uv sync
90
+
91
+ # Run commands with uv
92
+ uv run agentex agents run --manifest manifest.yaml
93
+ ```
94
+
95
+ **Benefits of uv:**
96
+ - Faster dependency resolution and installation
97
+ - Better dependency isolation
98
+ - Modern Python packaging standards
99
+
100
+ {% else %}
101
+ You chose **pip** for package management. Here's how to work with dependencies:
102
+
103
+ ```bash
104
+ # Edit requirements.txt manually to add dependencies
105
+ echo "requests" >> requirements.txt
106
+ echo "openai" >> requirements.txt
107
+
108
+ # Install dependencies
109
+ pip install -r requirements.txt
110
+ ```
111
+
112
+ **Benefits of pip:**
113
+ - Familiar workflow for most Python developers
114
+ - Simple requirements.txt management
115
+ - Wide compatibility
116
+ {% endif %}
117
+
118
+ ### 3. Configure Credentials
119
+ Options:
120
+ 1. Add any required credentials to your manifest.yaml via the `env` section
121
+ 2. Export them in your shell: `export OPENAI_API_KEY=...`
122
+ 3. For local development, create a `.env.local` file in the project directory
123
+
124
+ ```python
125
+ import os
126
+ from dotenv import load_dotenv
127
+
128
+ if os.environ.get("ENVIRONMENT") == "development":
129
+ load_dotenv()
130
+ ```
131
+
132
+ ## Local Development
133
+
134
+
135
+ ### 1. Start the Agentex Backend
136
+ ```bash
137
+ # Navigate to the backend directory
138
+ cd agentex
139
+
140
+ # Start all services using Docker Compose
141
+ make dev
142
+
143
+ # Optional: In a separate terminal, use lazydocker for a better UI (everything should say "healthy")
144
+ lzd
145
+ ```
146
+
147
+ ### 2. Setup Your Agent's requirements/pyproject.toml
148
+ ```bash
149
+ agentex uv sync [--group editable-apy]
150
+ source .venv/bin/activate
151
+
152
+ # OR
153
+ conda create -n {{ project_name }} python=3.12
154
+ conda activate {{ project_name }}
155
+ pip install -r requirements.txt
156
+ ```
157
+ ### 3. Run Your Agent
158
+ ```bash
159
+ # From this directory
160
+ export ENVIRONMENT=development && [uv run] agentex agents run --manifest manifest.yaml
161
+ ```
162
+
163
+ ### 4. Interact with Your Agent
164
+
165
+ Option 0: CLI (deprecated - to be replaced once a new CLI is implemented - please use the web UI for now!)
166
+ ```bash
167
+ # Submit a task via CLI
168
+ agentex tasks submit --agent {{ agent_name }} --task "Your task here"
169
+ ```
170
+
171
+ Option 1: Web UI
172
+ ```bash
173
+ # Start the local web interface
174
+ cd agentex-web
175
+ make dev
176
+
177
+ # Then open http://localhost:3000 in your browser to chat with your agent
178
+ ```
179
+
180
+ ## Development Tips
181
+
182
+ ### Environment Variables
183
+ - Set environment variables in project/.env for any required credentials
184
+ - Or configure them in the manifest.yaml under the `env` section
185
+ - The `.env` file is automatically loaded in development mode
186
+
187
+ ### To build the agent Docker image locally (normally not necessary):
188
+
189
+ 1. Build the agent image:
190
+ ```bash
191
+ agentex agents build --manifest manifest.yaml
192
+ ```
193
+
@@ -0,0 +1,55 @@
1
+ # Example Override Configuration
2
+ # =============================
3
+ # This file shows how to override deployment settings from the global defaults in manifest.yaml.
4
+ # You can create multiple override files for different environments (e.g., staging.yaml, prod.yaml, dev.yaml)
5
+ # Only specify values that differ from the global defaults in manifest.yaml
6
+
7
+ # Override image tag
8
+ # image:
9
+ # tag: "v1.2.3"
10
+
11
+ # Override replica count
12
+ # replicaCount: 2
13
+
14
+ # Environment-specific environment variables
15
+ # env:
16
+ # - name: LOG_LEVEL
17
+ # value: "DEBUG"
18
+ # - name: ENVIRONMENT
19
+ # value: "staging"
20
+
21
+ # Override resource requirements
22
+ # resources:
23
+ # requests:
24
+ # cpu: "250m"
25
+ # memory: "512Mi"
26
+ # limits:
27
+ # cpu: "500m"
28
+ # memory: "1Gi"
29
+
30
+ # Advanced: Additional helm chart value overrides
31
+ # Use this for any helm chart values not covered by the simple options above
32
+ # additional_overrides:
33
+ # autoscaling:
34
+ # enabled: true
35
+ # minReplicas: 2
36
+ # maxReplicas: 10
37
+ # targetCPUUtilizationPercentage: 70
38
+ #
39
+ # service:
40
+ # type: LoadBalancer
41
+ #
42
+ # ingress:
43
+ # enabled: true
44
+ # annotations:
45
+ # kubernetes.io/ingress.class: "nginx"
46
+ # hosts:
47
+ # - host: {{ agent_name }}.example.com
48
+ # paths:
49
+ # - path: /
50
+ # pathType: Prefix
51
+
52
+ # To use this configuration:
53
+ # 1. Copy this file to a new file (e.g., staging.yaml, prod.yaml)
54
+ # 2. Uncomment and modify the values you want to override
55
+ # 3. Deploy with: agentex agents deploy --cluster your-cluster --namespace your-namespace --override-file staging.yaml
@@ -0,0 +1,116 @@
1
+ # Agent Manifest Configuration
2
+ # ---------------------------
3
+ # This file defines how your agent should be built and deployed.
4
+
5
+ # Build Configuration
6
+ # ------------------
7
+ # The build config defines what gets packaged into your agent's Docker image.
8
+ # This same configuration is used whether building locally or remotely.
9
+ #
10
+ # When building:
11
+ # 1. All files from include_paths are collected into a build context
12
+ # 2. The context is filtered by dockerignore rules
13
+ # 3. The Dockerfile uses this context to build your agent's image
14
+ # 4. The image is pushed to a registry and used to run your agent
15
+ build:
16
+ context:
17
+ # Root directory for the build context
18
+ root: ../ # Keep this as the default root
19
+
20
+ # Paths to include in the Docker build context
21
+ # Must include:
22
+ # - Your agent's directory (your custom agent code)
23
+ # These paths are collected and sent to the Docker daemon for building
24
+ include_paths:
25
+ - {{ project_path_from_build_root }}
26
+
27
+ # Path to your agent's Dockerfile
28
+ # This defines how your agent's image is built from the context
29
+ # Relative to the root directory
30
+ dockerfile: {{ project_path_from_build_root }}/Dockerfile
31
+
32
+ # Path to your agent's .dockerignore
33
+ # Filters unnecessary files from the build context
34
+ # Helps keep build context small and builds fast
35
+ dockerignore: {{ project_path_from_build_root }}/.dockerignore
36
+
37
+
38
+ # Local Development Configuration
39
+ # -----------------------------
40
+ # Only used when running the agent locally
41
+ local_development:
42
+ agent:
43
+ port: 8000 # Port where your local ACP server is running
44
+ host_address: host.docker.internal # Host address for Docker networking (host.docker.internal for Docker, localhost for direct)
45
+
46
+ # File paths for local development (relative to this manifest.yaml)
47
+ paths:
48
+ # Path to ACP server file
49
+ # Examples:
50
+ # project/acp.py (standard)
51
+ # src/server.py (custom structure)
52
+ # ../shared/acp.py (shared across projects)
53
+ # /absolute/path/acp.py (absolute path)
54
+ acp: project/acp.py
55
+
56
+
57
+ # Agent Configuration
58
+ # -----------------
59
+ agent:
60
+ acp_type: agentic
61
+
62
+ # Unique name for your agent
63
+ # Used for task routing and monitoring
64
+ name: {{ agent_name }}
65
+
66
+ # Description of what your agent does
67
+ # Helps with documentation and discovery
68
+ description: {{ description }}
69
+
70
+ # Temporal workflow configuration
71
+ # Set enabled: true to use Temporal workflows for long-running tasks
72
+ temporal:
73
+ enabled: false
74
+
75
+ # Optional: Credentials mapping
76
+ # Maps Kubernetes secrets to environment variables
77
+ # Common credentials include:
78
+ # credentials:
79
+ # - env_var_name: OPENAI_API_KEY
80
+ # secret_name: openai-api-key
81
+ # secret_key: api-key
82
+
83
+ # Optional: Set Environment variables for running your agent locally as well
84
+ # as for deployment later on
85
+ # env:
86
+ # OPENAI_API_KEY: "<YOUR_OPENAI_API_KEY_HERE>"
87
+ # OPENAI_BASE_URL: "<YOUR_OPENAI_BASE_URL_HERE>"
88
+ # OPENAI_ORG_ID: "<YOUR_OPENAI_ORG_ID_HERE>"
89
+
90
+ # Deployment Configuration
91
+ # -----------------------
92
+ # Configuration for deploying your agent to Kubernetes clusters
93
+ deployment:
94
+ # Container image configuration
95
+ image:
96
+ repository: "" # Update with your container registry
97
+ tag: "latest" # Default tag, should be versioned in production
98
+
99
+ # Global deployment settings that apply to all clusters
100
+ # These can be overridden in cluster-specific files (deploy/*.yaml)
101
+ global:
102
+ agent:
103
+ name: "{{ agent_name }}"
104
+ description: "{{ description }}"
105
+
106
+ # Default replica count
107
+ replicaCount: 1
108
+
109
+ # Default resource requirements
110
+ resources:
111
+ requests:
112
+ cpu: "500m"
113
+ memory: "1Gi"
114
+ limits:
115
+ cpu: "1000m"
116
+ memory: "2Gi"
@@ -0,0 +1,29 @@
1
+ from agentex.lib.sdk.fastacp.fastacp import FastACP
2
+ from agentex.lib.types.fastacp import AgenticACPConfig
3
+ from agentex.lib.types.acp import SendEventParams, CancelTaskParams, CreateTaskParams
4
+
5
+
6
+ # Create an ACP server
7
+ acp = FastACP.create(
8
+ acp_type="agentic",
9
+ config=AgenticACPConfig(type="base")
10
+ )
11
+
12
+
13
+ @acp.on_task_event_send
14
+ async def handle_task_event_send(params: SendEventParams):
15
+ # For this tutorial, we print the parameters sent to the handler
16
+ # so you can see where and how messages within a task are handled
17
+ print(f"Hello world! I just received this message: {params}")
18
+
19
+ @acp.on_task_cancel
20
+ async def handle_task_canceled(params: CancelTaskParams):
21
+ # For this tutorial, we print the parameters sent to the handler
22
+ # so you can see where and how task cancellation is handled
23
+ print(f"Hello world! Task canceled: {params.task.id}")
24
+
25
+ @acp.on_task_create
26
+ async def handle_task_create(params: CreateTaskParams):
27
+ # For this tutorial, we print the parameters sent to the handler
28
+ # so you can see where and how task creation is handled
29
+ print(f"Hello world! Task created: {params.task.id}")
@@ -0,0 +1,33 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "{{ project_name }}"
7
+ version = "0.1.0"
8
+ description = "{{ description }}"
9
+ readme = "README.md"
10
+ requires-python = ">=3.12"
11
+ dependencies = [
12
+ "agentex-sdk",
13
+ "scale-gp",
14
+ ]
15
+
16
+ [project.optional-dependencies]
17
+ dev = [
18
+ "pytest",
19
+ "black",
20
+ "isort",
21
+ "flake8",
22
+ ]
23
+
24
+ [tool.hatch.build.targets.wheel]
25
+ packages = ["project"]
26
+
27
+ [tool.black]
28
+ line-length = 88
29
+ target-version = ['py312']
30
+
31
+ [tool.isort]
32
+ profile = "black"
33
+ line_length = 88
@@ -0,0 +1,5 @@
1
+ # Install agentex-sdk from local path
2
+ agentex-sdk
3
+
4
+ # Scale GenAI Platform Python SDK
5
+ scale-gp
@@ -0,0 +1,55 @@
1
+ # Example Override Configuration
2
+ # =============================
3
+ # This file shows how to override deployment settings from the global defaults in manifest.yaml.
4
+ # You can create multiple override files for different environments (e.g., staging.yaml, prod.yaml, dev.yaml)
5
+ # Only specify values that differ from the global defaults in manifest.yaml
6
+
7
+ # Override image tag
8
+ # image:
9
+ # tag: "v1.2.3"
10
+
11
+ # Override replica count
12
+ # replicaCount: 2
13
+
14
+ # Environment-specific environment variables
15
+ # env:
16
+ # - name: LOG_LEVEL
17
+ # value: "DEBUG"
18
+ # - name: ENVIRONMENT
19
+ # value: "staging"
20
+
21
+ # Override resource requirements
22
+ # resources:
23
+ # requests:
24
+ # cpu: "250m"
25
+ # memory: "512Mi"
26
+ # limits:
27
+ # cpu: "500m"
28
+ # memory: "1Gi"
29
+
30
+ # Advanced: Additional helm chart value overrides
31
+ # Use this for any helm chart values not covered by the simple options above
32
+ # additional_overrides:
33
+ # autoscaling:
34
+ # enabled: true
35
+ # minReplicas: 2
36
+ # maxReplicas: 10
37
+ # targetCPUUtilizationPercentage: 70
38
+ #
39
+ # service:
40
+ # type: LoadBalancer
41
+ #
42
+ # ingress:
43
+ # enabled: true
44
+ # annotations:
45
+ # kubernetes.io/ingress.class: "nginx"
46
+ # hosts:
47
+ # - host: {{ agent_name }}.example.com
48
+ # paths:
49
+ # - path: /
50
+ # pathType: Prefix
51
+
52
+ # To use this configuration:
53
+ # 1. Copy this file to a new file (e.g., staging.yaml, prod.yaml)
54
+ # 2. Uncomment and modify the values you want to override
55
+ # 3. Deploy with: agentex agents deploy --cluster your-cluster --namespace your-namespace --override-file staging.yaml
@@ -0,0 +1,43 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ *.egg-info/
20
+ .installed.cfg
21
+ *.egg
22
+
23
+ # Environments
24
+ .env**
25
+ .venv
26
+ env/
27
+ venv/
28
+ ENV/
29
+ env.bak/
30
+ venv.bak/
31
+
32
+ # IDE
33
+ .idea/
34
+ .vscode/
35
+ *.swp
36
+ *.swo
37
+
38
+ # Git
39
+ .git
40
+ .gitignore
41
+
42
+ # Misc
43
+ .DS_Store