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,384 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Optional
6
+
7
+ import httpx
8
+
9
+ from ..types import tracker_list_params, tracker_update_params
10
+ from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
11
+ from .._utils import maybe_transform, async_maybe_transform
12
+ from .._compat import cached_property
13
+ from .._resource import SyncAPIResource, AsyncAPIResource
14
+ from .._response import (
15
+ to_raw_response_wrapper,
16
+ to_streamed_response_wrapper,
17
+ async_to_raw_response_wrapper,
18
+ async_to_streamed_response_wrapper,
19
+ )
20
+ from .._base_client import make_request_options
21
+ from ..types.agent_task_tracker import AgentTaskTracker
22
+ from ..types.tracker_list_response import TrackerListResponse
23
+
24
+ __all__ = ["TrackerResource", "AsyncTrackerResource"]
25
+
26
+
27
+ class TrackerResource(SyncAPIResource):
28
+ @cached_property
29
+ def with_raw_response(self) -> TrackerResourceWithRawResponse:
30
+ """
31
+ This property can be used as a prefix for any HTTP method call to return
32
+ the raw response object instead of the parsed content.
33
+
34
+ For more information, see https://www.github.com/scaleapi/agentex-python#accessing-raw-response-data-eg-headers
35
+ """
36
+ return TrackerResourceWithRawResponse(self)
37
+
38
+ @cached_property
39
+ def with_streaming_response(self) -> TrackerResourceWithStreamingResponse:
40
+ """
41
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
42
+
43
+ For more information, see https://www.github.com/scaleapi/agentex-python#with_streaming_response
44
+ """
45
+ return TrackerResourceWithStreamingResponse(self)
46
+
47
+ def retrieve(
48
+ self,
49
+ tracker_id: str,
50
+ *,
51
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
52
+ # The extra values given here take precedence over values defined on the client or passed to this method.
53
+ extra_headers: Headers | None = None,
54
+ extra_query: Query | None = None,
55
+ extra_body: Body | None = None,
56
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
57
+ ) -> AgentTaskTracker:
58
+ """
59
+ Get agent task tracker by tracker ID
60
+
61
+ Args:
62
+ extra_headers: Send extra headers
63
+
64
+ extra_query: Add additional query parameters to the request
65
+
66
+ extra_body: Add additional JSON properties to the request
67
+
68
+ timeout: Override the client-level default timeout for this request, in seconds
69
+ """
70
+ if not tracker_id:
71
+ raise ValueError(f"Expected a non-empty value for `tracker_id` but received {tracker_id!r}")
72
+ return self._get(
73
+ f"/tracker/{tracker_id}",
74
+ options=make_request_options(
75
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
76
+ ),
77
+ cast_to=AgentTaskTracker,
78
+ )
79
+
80
+ def update(
81
+ self,
82
+ tracker_id: str,
83
+ *,
84
+ last_processed_event_id: Optional[str] | NotGiven = NOT_GIVEN,
85
+ status: Optional[str] | NotGiven = NOT_GIVEN,
86
+ status_reason: Optional[str] | NotGiven = NOT_GIVEN,
87
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
88
+ # The extra values given here take precedence over values defined on the client or passed to this method.
89
+ extra_headers: Headers | None = None,
90
+ extra_query: Query | None = None,
91
+ extra_body: Body | None = None,
92
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
93
+ ) -> AgentTaskTracker:
94
+ """
95
+ Update agent task tracker by tracker ID
96
+
97
+ Args:
98
+ last_processed_event_id: The most recent processed event ID (omit to leave unchanged)
99
+
100
+ status: Processing status
101
+
102
+ status_reason: Optional status reason
103
+
104
+ extra_headers: Send extra headers
105
+
106
+ extra_query: Add additional query parameters to the request
107
+
108
+ extra_body: Add additional JSON properties to the request
109
+
110
+ timeout: Override the client-level default timeout for this request, in seconds
111
+ """
112
+ if not tracker_id:
113
+ raise ValueError(f"Expected a non-empty value for `tracker_id` but received {tracker_id!r}")
114
+ return self._put(
115
+ f"/tracker/{tracker_id}",
116
+ body=maybe_transform(
117
+ {
118
+ "last_processed_event_id": last_processed_event_id,
119
+ "status": status,
120
+ "status_reason": status_reason,
121
+ },
122
+ tracker_update_params.TrackerUpdateParams,
123
+ ),
124
+ options=make_request_options(
125
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
126
+ ),
127
+ cast_to=AgentTaskTracker,
128
+ )
129
+
130
+ def list(
131
+ self,
132
+ *,
133
+ agent_id: Optional[str] | NotGiven = NOT_GIVEN,
134
+ task_id: Optional[str] | NotGiven = NOT_GIVEN,
135
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
136
+ # The extra values given here take precedence over values defined on the client or passed to this method.
137
+ extra_headers: Headers | None = None,
138
+ extra_query: Query | None = None,
139
+ extra_body: Body | None = None,
140
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
141
+ ) -> TrackerListResponse:
142
+ """
143
+ List all agent task trackers, optionally filtered by query parameters.
144
+
145
+ Args:
146
+ agent_id: Agent ID
147
+
148
+ task_id: Task ID
149
+
150
+ extra_headers: Send extra headers
151
+
152
+ extra_query: Add additional query parameters to the request
153
+
154
+ extra_body: Add additional JSON properties to the request
155
+
156
+ timeout: Override the client-level default timeout for this request, in seconds
157
+ """
158
+ return self._get(
159
+ "/tracker",
160
+ options=make_request_options(
161
+ extra_headers=extra_headers,
162
+ extra_query=extra_query,
163
+ extra_body=extra_body,
164
+ timeout=timeout,
165
+ query=maybe_transform(
166
+ {
167
+ "agent_id": agent_id,
168
+ "task_id": task_id,
169
+ },
170
+ tracker_list_params.TrackerListParams,
171
+ ),
172
+ ),
173
+ cast_to=TrackerListResponse,
174
+ )
175
+
176
+
177
+ class AsyncTrackerResource(AsyncAPIResource):
178
+ @cached_property
179
+ def with_raw_response(self) -> AsyncTrackerResourceWithRawResponse:
180
+ """
181
+ This property can be used as a prefix for any HTTP method call to return
182
+ the raw response object instead of the parsed content.
183
+
184
+ For more information, see https://www.github.com/scaleapi/agentex-python#accessing-raw-response-data-eg-headers
185
+ """
186
+ return AsyncTrackerResourceWithRawResponse(self)
187
+
188
+ @cached_property
189
+ def with_streaming_response(self) -> AsyncTrackerResourceWithStreamingResponse:
190
+ """
191
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
192
+
193
+ For more information, see https://www.github.com/scaleapi/agentex-python#with_streaming_response
194
+ """
195
+ return AsyncTrackerResourceWithStreamingResponse(self)
196
+
197
+ async def retrieve(
198
+ self,
199
+ tracker_id: str,
200
+ *,
201
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
202
+ # The extra values given here take precedence over values defined on the client or passed to this method.
203
+ extra_headers: Headers | None = None,
204
+ extra_query: Query | None = None,
205
+ extra_body: Body | None = None,
206
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
207
+ ) -> AgentTaskTracker:
208
+ """
209
+ Get agent task tracker by tracker ID
210
+
211
+ Args:
212
+ extra_headers: Send extra headers
213
+
214
+ extra_query: Add additional query parameters to the request
215
+
216
+ extra_body: Add additional JSON properties to the request
217
+
218
+ timeout: Override the client-level default timeout for this request, in seconds
219
+ """
220
+ if not tracker_id:
221
+ raise ValueError(f"Expected a non-empty value for `tracker_id` but received {tracker_id!r}")
222
+ return await self._get(
223
+ f"/tracker/{tracker_id}",
224
+ options=make_request_options(
225
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
226
+ ),
227
+ cast_to=AgentTaskTracker,
228
+ )
229
+
230
+ async def update(
231
+ self,
232
+ tracker_id: str,
233
+ *,
234
+ last_processed_event_id: Optional[str] | NotGiven = NOT_GIVEN,
235
+ status: Optional[str] | NotGiven = NOT_GIVEN,
236
+ status_reason: Optional[str] | NotGiven = NOT_GIVEN,
237
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
238
+ # The extra values given here take precedence over values defined on the client or passed to this method.
239
+ extra_headers: Headers | None = None,
240
+ extra_query: Query | None = None,
241
+ extra_body: Body | None = None,
242
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
243
+ ) -> AgentTaskTracker:
244
+ """
245
+ Update agent task tracker by tracker ID
246
+
247
+ Args:
248
+ last_processed_event_id: The most recent processed event ID (omit to leave unchanged)
249
+
250
+ status: Processing status
251
+
252
+ status_reason: Optional status reason
253
+
254
+ extra_headers: Send extra headers
255
+
256
+ extra_query: Add additional query parameters to the request
257
+
258
+ extra_body: Add additional JSON properties to the request
259
+
260
+ timeout: Override the client-level default timeout for this request, in seconds
261
+ """
262
+ if not tracker_id:
263
+ raise ValueError(f"Expected a non-empty value for `tracker_id` but received {tracker_id!r}")
264
+ return await self._put(
265
+ f"/tracker/{tracker_id}",
266
+ body=await async_maybe_transform(
267
+ {
268
+ "last_processed_event_id": last_processed_event_id,
269
+ "status": status,
270
+ "status_reason": status_reason,
271
+ },
272
+ tracker_update_params.TrackerUpdateParams,
273
+ ),
274
+ options=make_request_options(
275
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
276
+ ),
277
+ cast_to=AgentTaskTracker,
278
+ )
279
+
280
+ async def list(
281
+ self,
282
+ *,
283
+ agent_id: Optional[str] | NotGiven = NOT_GIVEN,
284
+ task_id: Optional[str] | NotGiven = NOT_GIVEN,
285
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
286
+ # The extra values given here take precedence over values defined on the client or passed to this method.
287
+ extra_headers: Headers | None = None,
288
+ extra_query: Query | None = None,
289
+ extra_body: Body | None = None,
290
+ timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
291
+ ) -> TrackerListResponse:
292
+ """
293
+ List all agent task trackers, optionally filtered by query parameters.
294
+
295
+ Args:
296
+ agent_id: Agent ID
297
+
298
+ task_id: Task ID
299
+
300
+ extra_headers: Send extra headers
301
+
302
+ extra_query: Add additional query parameters to the request
303
+
304
+ extra_body: Add additional JSON properties to the request
305
+
306
+ timeout: Override the client-level default timeout for this request, in seconds
307
+ """
308
+ return await self._get(
309
+ "/tracker",
310
+ options=make_request_options(
311
+ extra_headers=extra_headers,
312
+ extra_query=extra_query,
313
+ extra_body=extra_body,
314
+ timeout=timeout,
315
+ query=await async_maybe_transform(
316
+ {
317
+ "agent_id": agent_id,
318
+ "task_id": task_id,
319
+ },
320
+ tracker_list_params.TrackerListParams,
321
+ ),
322
+ ),
323
+ cast_to=TrackerListResponse,
324
+ )
325
+
326
+
327
+ class TrackerResourceWithRawResponse:
328
+ def __init__(self, tracker: TrackerResource) -> None:
329
+ self._tracker = tracker
330
+
331
+ self.retrieve = to_raw_response_wrapper(
332
+ tracker.retrieve,
333
+ )
334
+ self.update = to_raw_response_wrapper(
335
+ tracker.update,
336
+ )
337
+ self.list = to_raw_response_wrapper(
338
+ tracker.list,
339
+ )
340
+
341
+
342
+ class AsyncTrackerResourceWithRawResponse:
343
+ def __init__(self, tracker: AsyncTrackerResource) -> None:
344
+ self._tracker = tracker
345
+
346
+ self.retrieve = async_to_raw_response_wrapper(
347
+ tracker.retrieve,
348
+ )
349
+ self.update = async_to_raw_response_wrapper(
350
+ tracker.update,
351
+ )
352
+ self.list = async_to_raw_response_wrapper(
353
+ tracker.list,
354
+ )
355
+
356
+
357
+ class TrackerResourceWithStreamingResponse:
358
+ def __init__(self, tracker: TrackerResource) -> None:
359
+ self._tracker = tracker
360
+
361
+ self.retrieve = to_streamed_response_wrapper(
362
+ tracker.retrieve,
363
+ )
364
+ self.update = to_streamed_response_wrapper(
365
+ tracker.update,
366
+ )
367
+ self.list = to_streamed_response_wrapper(
368
+ tracker.list,
369
+ )
370
+
371
+
372
+ class AsyncTrackerResourceWithStreamingResponse:
373
+ def __init__(self, tracker: AsyncTrackerResource) -> None:
374
+ self._tracker = tracker
375
+
376
+ self.retrieve = async_to_streamed_response_wrapper(
377
+ tracker.retrieve,
378
+ )
379
+ self.update = async_to_streamed_response_wrapper(
380
+ tracker.update,
381
+ )
382
+ self.list = async_to_streamed_response_wrapper(
383
+ tracker.list,
384
+ )
@@ -0,0 +1,56 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from .span import Span as Span
6
+ from .task import Task as Task
7
+ from .agent import Agent as Agent
8
+ from .event import Event as Event
9
+ from .state import State as State
10
+ from .shared import TaskMessageUpdate as TaskMessageUpdate
11
+ from .acp_type import AcpType as AcpType
12
+ from .data_delta import DataDelta as DataDelta
13
+ from .text_delta import TextDelta as TextDelta
14
+ from .data_content import DataContent as DataContent
15
+ from .task_message import TaskMessage as TaskMessage
16
+ from .text_content import TextContent as TextContent
17
+ from .message_style import MessageStyle as MessageStyle
18
+ from .message_author import MessageAuthor as MessageAuthor
19
+ from .agent_rpc_params import AgentRpcParams as AgentRpcParams
20
+ from .agent_rpc_result import AgentRpcResult as AgentRpcResult
21
+ from .span_list_params import SpanListParams as SpanListParams
22
+ from .agent_list_params import AgentListParams as AgentListParams
23
+ from .event_list_params import EventListParams as EventListParams
24
+ from .state_list_params import StateListParams as StateListParams
25
+ from .agent_rpc_response import AgentRpcResponse as AgentRpcResponse
26
+ from .agent_task_tracker import AgentTaskTracker as AgentTaskTracker
27
+ from .data_content_param import DataContentParam as DataContentParam
28
+ from .span_create_params import SpanCreateParams as SpanCreateParams
29
+ from .span_list_response import SpanListResponse as SpanListResponse
30
+ from .span_update_params import SpanUpdateParams as SpanUpdateParams
31
+ from .task_list_response import TaskListResponse as TaskListResponse
32
+ from .task_message_delta import TaskMessageDelta as TaskMessageDelta
33
+ from .text_content_param import TextContentParam as TextContentParam
34
+ from .tool_request_delta import ToolRequestDelta as ToolRequestDelta
35
+ from .agent_list_response import AgentListResponse as AgentListResponse
36
+ from .event_list_response import EventListResponse as EventListResponse
37
+ from .message_list_params import MessageListParams as MessageListParams
38
+ from .state_create_params import StateCreateParams as StateCreateParams
39
+ from .state_list_response import StateListResponse as StateListResponse
40
+ from .state_update_params import StateUpdateParams as StateUpdateParams
41
+ from .tool_response_delta import ToolResponseDelta as ToolResponseDelta
42
+ from .tracker_list_params import TrackerListParams as TrackerListParams
43
+ from .task_delete_response import TaskDeleteResponse as TaskDeleteResponse
44
+ from .task_message_content import TaskMessageContent as TaskMessageContent
45
+ from .tool_request_content import ToolRequestContent as ToolRequestContent
46
+ from .message_create_params import MessageCreateParams as MessageCreateParams
47
+ from .message_list_response import MessageListResponse as MessageListResponse
48
+ from .message_update_params import MessageUpdateParams as MessageUpdateParams
49
+ from .tool_response_content import ToolResponseContent as ToolResponseContent
50
+ from .tracker_list_response import TrackerListResponse as TrackerListResponse
51
+ from .tracker_update_params import TrackerUpdateParams as TrackerUpdateParams
52
+ from .agent_rpc_by_name_params import AgentRpcByNameParams as AgentRpcByNameParams
53
+ from .task_message_content_param import TaskMessageContentParam as TaskMessageContentParam
54
+ from .tool_request_content_param import ToolRequestContentParam as ToolRequestContentParam
55
+ from .tool_response_content_param import ToolResponseContentParam as ToolResponseContentParam
56
+ from .task_delete_by_name_response import TaskDeleteByNameResponse as TaskDeleteByNameResponse
@@ -0,0 +1,7 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing_extensions import Literal, TypeAlias
4
+
5
+ __all__ = ["AcpType"]
6
+
7
+ AcpType: TypeAlias = Literal["sync", "agentic"]
agentex/types/agent.py ADDED
@@ -0,0 +1,29 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Optional
4
+ from typing_extensions import Literal
5
+
6
+ from .._models import BaseModel
7
+ from .acp_type import AcpType
8
+
9
+ __all__ = ["Agent"]
10
+
11
+
12
+ class Agent(BaseModel):
13
+ id: str
14
+ """The unique identifier of the agent."""
15
+
16
+ acp_type: AcpType
17
+ """The type of the ACP Server (Either sync or agentic)"""
18
+
19
+ description: str
20
+ """The description of the action."""
21
+
22
+ name: str
23
+ """The unique name of the agent."""
24
+
25
+ status: Optional[Literal["Pending", "Building", "Ready", "Failed", "Unknown"]] = None
26
+ """The status of the action, indicating if it's building, ready, failed, etc."""
27
+
28
+ status_reason: Optional[str] = None
29
+ """The reason for the status of the action."""
@@ -0,0 +1,13 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Optional
6
+ from typing_extensions import TypedDict
7
+
8
+ __all__ = ["AgentListParams"]
9
+
10
+
11
+ class AgentListParams(TypedDict, total=False):
12
+ task_id: Optional[str]
13
+ """Task ID"""
@@ -0,0 +1,10 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import List
4
+ from typing_extensions import TypeAlias
5
+
6
+ from .agent import Agent
7
+
8
+ __all__ = ["AgentListResponse"]
9
+
10
+ AgentListResponse: TypeAlias = List[Agent]
@@ -0,0 +1,21 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Union
6
+ from typing_extensions import Literal, Required, TypedDict
7
+
8
+ from .agent_rpc_params import AgentRpcParams
9
+
10
+ __all__ = ["AgentRpcByNameParams"]
11
+
12
+
13
+ class AgentRpcByNameParams(TypedDict, total=False):
14
+ method: Required[Literal["event/send", "task/create", "message/send", "task/cancel"]]
15
+
16
+ params: Required[AgentRpcParams]
17
+ """The parameters for the agent RPC request"""
18
+
19
+ id: Union[int, str, None]
20
+
21
+ jsonrpc: Literal["2.0"]
@@ -0,0 +1,51 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Dict, Union, Optional
6
+ from typing_extensions import Required, TypeAlias, TypedDict
7
+
8
+ from .task_message_content_param import TaskMessageContentParam
9
+
10
+ __all__ = ["AgentRpcParams", "CreateTaskRequest", "CancelTaskRequest", "SendMessageRequest", "SendEventRequest"]
11
+
12
+
13
+ class CreateTaskRequest(TypedDict, total=False):
14
+ name: Optional[str]
15
+ """The name of the task to create"""
16
+
17
+ params: Optional[Dict[str, object]]
18
+ """The parameters for the task"""
19
+
20
+
21
+ class CancelTaskRequest(TypedDict, total=False):
22
+ task_id: Optional[str]
23
+ """The ID of the task to cancel. Either this or task_name must be provided."""
24
+
25
+ task_name: Optional[str]
26
+ """The name of the task to cancel. Either this or task_id must be provided."""
27
+
28
+
29
+ class SendMessageRequest(TypedDict, total=False):
30
+ content: Required[TaskMessageContentParam]
31
+ """The message that was sent to the agent"""
32
+
33
+ stream: bool
34
+ """Whether to stream the response message back to the client"""
35
+
36
+ task_id: Optional[str]
37
+ """The ID of the task that the message was sent to"""
38
+
39
+
40
+ class SendEventRequest(TypedDict, total=False):
41
+ content: Optional[TaskMessageContentParam]
42
+ """The content to send to the event"""
43
+
44
+ task_id: Optional[str]
45
+ """The ID of the task that the event was sent to"""
46
+
47
+ task_name: Optional[str]
48
+ """The name of the task that the event was sent to"""
49
+
50
+
51
+ AgentRpcParams: TypeAlias = Union[CreateTaskRequest, CancelTaskRequest, SendMessageRequest, SendEventRequest]
@@ -0,0 +1,21 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Union
6
+ from typing_extensions import Literal, Required, TypedDict
7
+
8
+ from . import agent_rpc_params
9
+
10
+ __all__ = ["AgentRpcParams"]
11
+
12
+
13
+ class AgentRpcParams(TypedDict, total=False):
14
+ method: Required[Literal["event/send", "task/create", "message/send", "task/cancel"]]
15
+
16
+ params: Required[agent_rpc_params.AgentRpcParams]
17
+ """The parameters for the agent RPC request"""
18
+
19
+ id: Union[int, str, None]
20
+
21
+ jsonrpc: Literal["2.0"]
@@ -0,0 +1,20 @@
1
+ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ from typing import Union, Optional
4
+ from typing_extensions import Literal
5
+
6
+ from .._models import BaseModel
7
+ from .agent_rpc_result import AgentRpcResult
8
+
9
+ __all__ = ["AgentRpcResponse"]
10
+
11
+
12
+ class AgentRpcResponse(BaseModel):
13
+ result: Optional[AgentRpcResult] = None
14
+ """The result of the agent RPC request"""
15
+
16
+ id: Union[int, str, None] = None
17
+
18
+ error: Optional[object] = None
19
+
20
+ jsonrpc: Optional[Literal["2.0"]] = None