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.
- agentex/__init__.py +103 -0
- agentex/_base_client.py +1992 -0
- agentex/_client.py +506 -0
- agentex/_compat.py +219 -0
- agentex/_constants.py +14 -0
- agentex/_exceptions.py +108 -0
- agentex/_files.py +123 -0
- agentex/_models.py +829 -0
- agentex/_qs.py +150 -0
- agentex/_resource.py +43 -0
- agentex/_response.py +830 -0
- agentex/_streaming.py +333 -0
- agentex/_types.py +219 -0
- agentex/_utils/__init__.py +57 -0
- agentex/_utils/_logs.py +25 -0
- agentex/_utils/_proxy.py +65 -0
- agentex/_utils/_reflection.py +42 -0
- agentex/_utils/_resources_proxy.py +24 -0
- agentex/_utils/_streams.py +12 -0
- agentex/_utils/_sync.py +86 -0
- agentex/_utils/_transform.py +447 -0
- agentex/_utils/_typing.py +151 -0
- agentex/_utils/_utils.py +422 -0
- agentex/_version.py +4 -0
- agentex/lib/.keep +4 -0
- agentex/lib/__init__.py +0 -0
- agentex/lib/adk/__init__.py +41 -0
- agentex/lib/adk/_modules/__init__.py +0 -0
- agentex/lib/adk/_modules/acp.py +247 -0
- agentex/lib/adk/_modules/agent_task_tracker.py +176 -0
- agentex/lib/adk/_modules/agents.py +77 -0
- agentex/lib/adk/_modules/events.py +141 -0
- agentex/lib/adk/_modules/messages.py +285 -0
- agentex/lib/adk/_modules/state.py +291 -0
- agentex/lib/adk/_modules/streaming.py +75 -0
- agentex/lib/adk/_modules/tasks.py +124 -0
- agentex/lib/adk/_modules/tracing.py +194 -0
- agentex/lib/adk/providers/__init__.py +9 -0
- agentex/lib/adk/providers/_modules/__init__.py +0 -0
- agentex/lib/adk/providers/_modules/litellm.py +232 -0
- agentex/lib/adk/providers/_modules/openai.py +416 -0
- agentex/lib/adk/providers/_modules/sgp.py +85 -0
- agentex/lib/adk/utils/__init__.py +5 -0
- agentex/lib/adk/utils/_modules/__init__.py +0 -0
- agentex/lib/adk/utils/_modules/templating.py +94 -0
- agentex/lib/cli/__init__.py +0 -0
- agentex/lib/cli/commands/__init__.py +0 -0
- agentex/lib/cli/commands/agents.py +328 -0
- agentex/lib/cli/commands/init.py +227 -0
- agentex/lib/cli/commands/main.py +33 -0
- agentex/lib/cli/commands/secrets.py +169 -0
- agentex/lib/cli/commands/tasks.py +118 -0
- agentex/lib/cli/commands/uv.py +133 -0
- agentex/lib/cli/handlers/__init__.py +0 -0
- agentex/lib/cli/handlers/agent_handlers.py +160 -0
- agentex/lib/cli/handlers/cleanup_handlers.py +186 -0
- agentex/lib/cli/handlers/deploy_handlers.py +351 -0
- agentex/lib/cli/handlers/run_handlers.py +452 -0
- agentex/lib/cli/handlers/secret_handlers.py +670 -0
- agentex/lib/cli/templates/default/.dockerignore.j2 +43 -0
- agentex/lib/cli/templates/default/Dockerfile-uv.j2 +42 -0
- agentex/lib/cli/templates/default/Dockerfile.j2 +42 -0
- agentex/lib/cli/templates/default/README.md.j2 +193 -0
- agentex/lib/cli/templates/default/deploy/example.yaml.j2 +55 -0
- agentex/lib/cli/templates/default/manifest.yaml.j2 +116 -0
- agentex/lib/cli/templates/default/project/acp.py.j2 +29 -0
- agentex/lib/cli/templates/default/pyproject.toml.j2 +33 -0
- agentex/lib/cli/templates/default/requirements.txt.j2 +5 -0
- agentex/lib/cli/templates/deploy/Screenshot 2025-03-19 at 10.36.57/342/200/257AM.png +0 -0
- agentex/lib/cli/templates/deploy/example.yaml.j2 +55 -0
- agentex/lib/cli/templates/sync/.dockerignore.j2 +43 -0
- agentex/lib/cli/templates/sync/Dockerfile-uv.j2 +42 -0
- agentex/lib/cli/templates/sync/Dockerfile.j2 +42 -0
- agentex/lib/cli/templates/sync/README.md.j2 +293 -0
- agentex/lib/cli/templates/sync/deploy/example.yaml.j2 +55 -0
- agentex/lib/cli/templates/sync/manifest.yaml.j2 +116 -0
- agentex/lib/cli/templates/sync/project/acp.py.j2 +26 -0
- agentex/lib/cli/templates/sync/pyproject.toml.j2 +33 -0
- agentex/lib/cli/templates/sync/requirements.txt.j2 +5 -0
- agentex/lib/cli/templates/temporal/.dockerignore.j2 +43 -0
- agentex/lib/cli/templates/temporal/Dockerfile-uv.j2 +48 -0
- agentex/lib/cli/templates/temporal/Dockerfile.j2 +48 -0
- agentex/lib/cli/templates/temporal/README.md.j2 +316 -0
- agentex/lib/cli/templates/temporal/deploy/example.yaml.j2 +55 -0
- agentex/lib/cli/templates/temporal/manifest.yaml.j2 +137 -0
- agentex/lib/cli/templates/temporal/project/acp.py.j2 +30 -0
- agentex/lib/cli/templates/temporal/project/run_worker.py.j2 +33 -0
- agentex/lib/cli/templates/temporal/project/workflow.py.j2 +66 -0
- agentex/lib/cli/templates/temporal/pyproject.toml.j2 +34 -0
- agentex/lib/cli/templates/temporal/requirements.txt.j2 +5 -0
- agentex/lib/cli/utils/cli_utils.py +14 -0
- agentex/lib/cli/utils/credential_utils.py +103 -0
- agentex/lib/cli/utils/exceptions.py +6 -0
- agentex/lib/cli/utils/kubectl_utils.py +135 -0
- agentex/lib/cli/utils/kubernetes_secrets_utils.py +185 -0
- agentex/lib/core/__init__.py +0 -0
- agentex/lib/core/adapters/__init__.py +0 -0
- agentex/lib/core/adapters/llm/__init__.py +1 -0
- agentex/lib/core/adapters/llm/adapter_litellm.py +46 -0
- agentex/lib/core/adapters/llm/adapter_sgp.py +55 -0
- agentex/lib/core/adapters/llm/port.py +24 -0
- agentex/lib/core/adapters/streams/adapter_redis.py +128 -0
- agentex/lib/core/adapters/streams/port.py +50 -0
- agentex/lib/core/clients/__init__.py +1 -0
- agentex/lib/core/clients/temporal/__init__.py +0 -0
- agentex/lib/core/clients/temporal/temporal_client.py +181 -0
- agentex/lib/core/clients/temporal/types.py +47 -0
- agentex/lib/core/clients/temporal/utils.py +56 -0
- agentex/lib/core/services/__init__.py +0 -0
- agentex/lib/core/services/adk/__init__.py +0 -0
- agentex/lib/core/services/adk/acp/__init__.py +0 -0
- agentex/lib/core/services/adk/acp/acp.py +210 -0
- agentex/lib/core/services/adk/agent_task_tracker.py +85 -0
- agentex/lib/core/services/adk/agents.py +43 -0
- agentex/lib/core/services/adk/events.py +61 -0
- agentex/lib/core/services/adk/messages.py +164 -0
- agentex/lib/core/services/adk/providers/__init__.py +0 -0
- agentex/lib/core/services/adk/providers/litellm.py +256 -0
- agentex/lib/core/services/adk/providers/openai.py +723 -0
- agentex/lib/core/services/adk/providers/sgp.py +99 -0
- agentex/lib/core/services/adk/state.py +120 -0
- agentex/lib/core/services/adk/streaming.py +262 -0
- agentex/lib/core/services/adk/tasks.py +69 -0
- agentex/lib/core/services/adk/tracing.py +36 -0
- agentex/lib/core/services/adk/utils/__init__.py +0 -0
- agentex/lib/core/services/adk/utils/templating.py +58 -0
- agentex/lib/core/temporal/__init__.py +0 -0
- agentex/lib/core/temporal/activities/__init__.py +207 -0
- agentex/lib/core/temporal/activities/activity_helpers.py +37 -0
- agentex/lib/core/temporal/activities/adk/__init__.py +0 -0
- agentex/lib/core/temporal/activities/adk/acp/__init__.py +0 -0
- agentex/lib/core/temporal/activities/adk/acp/acp_activities.py +86 -0
- agentex/lib/core/temporal/activities/adk/agent_task_tracker_activities.py +76 -0
- agentex/lib/core/temporal/activities/adk/agents_activities.py +35 -0
- agentex/lib/core/temporal/activities/adk/events_activities.py +50 -0
- agentex/lib/core/temporal/activities/adk/messages_activities.py +94 -0
- agentex/lib/core/temporal/activities/adk/providers/__init__.py +0 -0
- agentex/lib/core/temporal/activities/adk/providers/litellm_activities.py +71 -0
- agentex/lib/core/temporal/activities/adk/providers/openai_activities.py +210 -0
- agentex/lib/core/temporal/activities/adk/providers/sgp_activities.py +42 -0
- agentex/lib/core/temporal/activities/adk/state_activities.py +85 -0
- agentex/lib/core/temporal/activities/adk/streaming_activities.py +33 -0
- agentex/lib/core/temporal/activities/adk/tasks_activities.py +48 -0
- agentex/lib/core/temporal/activities/adk/tracing_activities.py +55 -0
- agentex/lib/core/temporal/activities/adk/utils/__init__.py +0 -0
- agentex/lib/core/temporal/activities/adk/utils/templating_activities.py +41 -0
- agentex/lib/core/temporal/services/__init__.py +0 -0
- agentex/lib/core/temporal/services/temporal_task_service.py +69 -0
- agentex/lib/core/temporal/types/__init__.py +0 -0
- agentex/lib/core/temporal/types/workflow.py +5 -0
- agentex/lib/core/temporal/workers/__init__.py +0 -0
- agentex/lib/core/temporal/workers/worker.py +162 -0
- agentex/lib/core/temporal/workflows/workflow.py +26 -0
- agentex/lib/core/tracing/__init__.py +5 -0
- agentex/lib/core/tracing/processors/agentex_tracing_processor.py +117 -0
- agentex/lib/core/tracing/processors/sgp_tracing_processor.py +119 -0
- agentex/lib/core/tracing/processors/tracing_processor_interface.py +40 -0
- agentex/lib/core/tracing/trace.py +311 -0
- agentex/lib/core/tracing/tracer.py +70 -0
- agentex/lib/core/tracing/tracing_processor_manager.py +62 -0
- agentex/lib/environment_variables.py +87 -0
- agentex/lib/py.typed +0 -0
- agentex/lib/sdk/__init__.py +0 -0
- agentex/lib/sdk/config/__init__.py +0 -0
- agentex/lib/sdk/config/agent_config.py +61 -0
- agentex/lib/sdk/config/agent_manifest.py +219 -0
- agentex/lib/sdk/config/build_config.py +35 -0
- agentex/lib/sdk/config/deployment_config.py +117 -0
- agentex/lib/sdk/config/local_development_config.py +56 -0
- agentex/lib/sdk/config/project_config.py +103 -0
- agentex/lib/sdk/fastacp/__init__.py +3 -0
- agentex/lib/sdk/fastacp/base/base_acp_server.py +406 -0
- agentex/lib/sdk/fastacp/fastacp.py +74 -0
- agentex/lib/sdk/fastacp/impl/agentic_base_acp.py +72 -0
- agentex/lib/sdk/fastacp/impl/sync_acp.py +109 -0
- agentex/lib/sdk/fastacp/impl/temporal_acp.py +97 -0
- agentex/lib/sdk/fastacp/tests/README.md +297 -0
- agentex/lib/sdk/fastacp/tests/conftest.py +307 -0
- agentex/lib/sdk/fastacp/tests/pytest.ini +10 -0
- agentex/lib/sdk/fastacp/tests/run_tests.py +227 -0
- agentex/lib/sdk/fastacp/tests/test_base_acp_server.py +450 -0
- agentex/lib/sdk/fastacp/tests/test_fastacp_factory.py +344 -0
- agentex/lib/sdk/fastacp/tests/test_integration.py +477 -0
- agentex/lib/sdk/state_machine/__init__.py +6 -0
- agentex/lib/sdk/state_machine/noop_workflow.py +21 -0
- agentex/lib/sdk/state_machine/state.py +10 -0
- agentex/lib/sdk/state_machine/state_machine.py +189 -0
- agentex/lib/sdk/state_machine/state_workflow.py +16 -0
- agentex/lib/sdk/utils/__init__.py +0 -0
- agentex/lib/sdk/utils/messages.py +223 -0
- agentex/lib/types/__init__.py +0 -0
- agentex/lib/types/acp.py +94 -0
- agentex/lib/types/agent_configs.py +79 -0
- agentex/lib/types/agent_results.py +29 -0
- agentex/lib/types/credentials.py +34 -0
- agentex/lib/types/fastacp.py +61 -0
- agentex/lib/types/files.py +13 -0
- agentex/lib/types/json_rpc.py +49 -0
- agentex/lib/types/llm_messages.py +354 -0
- agentex/lib/types/task_message_updates.py +171 -0
- agentex/lib/types/tracing.py +34 -0
- agentex/lib/utils/__init__.py +0 -0
- agentex/lib/utils/completions.py +131 -0
- agentex/lib/utils/console.py +14 -0
- agentex/lib/utils/io.py +29 -0
- agentex/lib/utils/iterables.py +14 -0
- agentex/lib/utils/json_schema.py +23 -0
- agentex/lib/utils/logging.py +31 -0
- agentex/lib/utils/mcp.py +17 -0
- agentex/lib/utils/model_utils.py +46 -0
- agentex/lib/utils/parsing.py +15 -0
- agentex/lib/utils/regex.py +6 -0
- agentex/lib/utils/temporal.py +13 -0
- agentex/py.typed +0 -0
- agentex/resources/__init__.py +103 -0
- agentex/resources/agents.py +707 -0
- agentex/resources/events.py +294 -0
- agentex/resources/messages/__init__.py +33 -0
- agentex/resources/messages/batch.py +271 -0
- agentex/resources/messages/messages.py +492 -0
- agentex/resources/spans.py +557 -0
- agentex/resources/states.py +544 -0
- agentex/resources/tasks.py +615 -0
- agentex/resources/tracker.py +384 -0
- agentex/types/__init__.py +56 -0
- agentex/types/acp_type.py +7 -0
- agentex/types/agent.py +29 -0
- agentex/types/agent_list_params.py +13 -0
- agentex/types/agent_list_response.py +10 -0
- agentex/types/agent_rpc_by_name_params.py +21 -0
- agentex/types/agent_rpc_params.py +51 -0
- agentex/types/agent_rpc_params1.py +21 -0
- agentex/types/agent_rpc_response.py +20 -0
- agentex/types/agent_rpc_result.py +90 -0
- agentex/types/agent_task_tracker.py +34 -0
- agentex/types/data_content.py +30 -0
- agentex/types/data_content_param.py +31 -0
- agentex/types/data_delta.py +14 -0
- agentex/types/event.py +29 -0
- agentex/types/event_list_params.py +22 -0
- agentex/types/event_list_response.py +10 -0
- agentex/types/message_author.py +7 -0
- agentex/types/message_create_params.py +18 -0
- agentex/types/message_list_params.py +14 -0
- agentex/types/message_list_response.py +10 -0
- agentex/types/message_style.py +7 -0
- agentex/types/message_update_params.py +18 -0
- agentex/types/messages/__init__.py +8 -0
- agentex/types/messages/batch_create_params.py +16 -0
- agentex/types/messages/batch_create_response.py +10 -0
- agentex/types/messages/batch_update_params.py +16 -0
- agentex/types/messages/batch_update_response.py +10 -0
- agentex/types/shared/__init__.py +3 -0
- agentex/types/shared/task_message_update.py +83 -0
- agentex/types/span.py +36 -0
- agentex/types/span_create_params.py +40 -0
- agentex/types/span_list_params.py +12 -0
- agentex/types/span_list_response.py +10 -0
- agentex/types/span_update_params.py +37 -0
- agentex/types/state.py +25 -0
- agentex/types/state_create_params.py +16 -0
- agentex/types/state_list_params.py +16 -0
- agentex/types/state_list_response.py +10 -0
- agentex/types/state_update_params.py +16 -0
- agentex/types/task.py +23 -0
- agentex/types/task_delete_by_name_response.py +8 -0
- agentex/types/task_delete_response.py +8 -0
- agentex/types/task_list_response.py +10 -0
- agentex/types/task_message.py +33 -0
- agentex/types/task_message_content.py +16 -0
- agentex/types/task_message_content_param.py +17 -0
- agentex/types/task_message_delta.py +16 -0
- agentex/types/text_content.py +53 -0
- agentex/types/text_content_param.py +54 -0
- agentex/types/text_delta.py +14 -0
- agentex/types/tool_request_content.py +36 -0
- agentex/types/tool_request_content_param.py +37 -0
- agentex/types/tool_request_delta.py +18 -0
- agentex/types/tool_response_content.py +36 -0
- agentex/types/tool_response_content_param.py +36 -0
- agentex/types/tool_response_delta.py +18 -0
- agentex/types/tracker_list_params.py +16 -0
- agentex/types/tracker_list_response.py +10 -0
- agentex/types/tracker_update_params.py +19 -0
- agentex_sdk-0.1.0a6.dist-info/METADATA +426 -0
- agentex_sdk-0.1.0a6.dist-info/RECORD +289 -0
- agentex_sdk-0.1.0a6.dist-info/WHEEL +4 -0
- agentex_sdk-0.1.0a6.dist-info/entry_points.txt +2 -0
- agentex_sdk-0.1.0a6.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,615 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
import httpx
|
6
|
+
|
7
|
+
from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven
|
8
|
+
from .._compat import cached_property
|
9
|
+
from .._resource import SyncAPIResource, AsyncAPIResource
|
10
|
+
from .._response import (
|
11
|
+
to_raw_response_wrapper,
|
12
|
+
to_streamed_response_wrapper,
|
13
|
+
async_to_raw_response_wrapper,
|
14
|
+
async_to_streamed_response_wrapper,
|
15
|
+
)
|
16
|
+
from .._streaming import Stream, AsyncStream
|
17
|
+
from ..types.task import Task
|
18
|
+
from .._base_client import make_request_options
|
19
|
+
from ..types.task_list_response import TaskListResponse
|
20
|
+
from ..types.task_delete_response import TaskDeleteResponse
|
21
|
+
from ..types.task_delete_by_name_response import TaskDeleteByNameResponse
|
22
|
+
|
23
|
+
__all__ = ["TasksResource", "AsyncTasksResource"]
|
24
|
+
|
25
|
+
|
26
|
+
class TasksResource(SyncAPIResource):
|
27
|
+
@cached_property
|
28
|
+
def with_raw_response(self) -> TasksResourceWithRawResponse:
|
29
|
+
"""
|
30
|
+
This property can be used as a prefix for any HTTP method call to return
|
31
|
+
the raw response object instead of the parsed content.
|
32
|
+
|
33
|
+
For more information, see https://www.github.com/scaleapi/agentex-python#accessing-raw-response-data-eg-headers
|
34
|
+
"""
|
35
|
+
return TasksResourceWithRawResponse(self)
|
36
|
+
|
37
|
+
@cached_property
|
38
|
+
def with_streaming_response(self) -> TasksResourceWithStreamingResponse:
|
39
|
+
"""
|
40
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
41
|
+
|
42
|
+
For more information, see https://www.github.com/scaleapi/agentex-python#with_streaming_response
|
43
|
+
"""
|
44
|
+
return TasksResourceWithStreamingResponse(self)
|
45
|
+
|
46
|
+
def retrieve(
|
47
|
+
self,
|
48
|
+
task_id: str,
|
49
|
+
*,
|
50
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
51
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
52
|
+
extra_headers: Headers | None = None,
|
53
|
+
extra_query: Query | None = None,
|
54
|
+
extra_body: Body | None = None,
|
55
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
56
|
+
) -> Task:
|
57
|
+
"""
|
58
|
+
Get a task by its unique ID.
|
59
|
+
|
60
|
+
Args:
|
61
|
+
extra_headers: Send extra headers
|
62
|
+
|
63
|
+
extra_query: Add additional query parameters to the request
|
64
|
+
|
65
|
+
extra_body: Add additional JSON properties to the request
|
66
|
+
|
67
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
68
|
+
"""
|
69
|
+
if not task_id:
|
70
|
+
raise ValueError(f"Expected a non-empty value for `task_id` but received {task_id!r}")
|
71
|
+
return self._get(
|
72
|
+
f"/tasks/{task_id}",
|
73
|
+
options=make_request_options(
|
74
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
75
|
+
),
|
76
|
+
cast_to=Task,
|
77
|
+
)
|
78
|
+
|
79
|
+
def list(
|
80
|
+
self,
|
81
|
+
*,
|
82
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
83
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
84
|
+
extra_headers: Headers | None = None,
|
85
|
+
extra_query: Query | None = None,
|
86
|
+
extra_body: Body | None = None,
|
87
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
88
|
+
) -> TaskListResponse:
|
89
|
+
"""List all tasks."""
|
90
|
+
return self._get(
|
91
|
+
"/tasks",
|
92
|
+
options=make_request_options(
|
93
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
94
|
+
),
|
95
|
+
cast_to=TaskListResponse,
|
96
|
+
)
|
97
|
+
|
98
|
+
def delete(
|
99
|
+
self,
|
100
|
+
task_id: str,
|
101
|
+
*,
|
102
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
103
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
104
|
+
extra_headers: Headers | None = None,
|
105
|
+
extra_query: Query | None = None,
|
106
|
+
extra_body: Body | None = None,
|
107
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
108
|
+
) -> TaskDeleteResponse:
|
109
|
+
"""
|
110
|
+
Delete a task by its unique ID.
|
111
|
+
|
112
|
+
Args:
|
113
|
+
extra_headers: Send extra headers
|
114
|
+
|
115
|
+
extra_query: Add additional query parameters to the request
|
116
|
+
|
117
|
+
extra_body: Add additional JSON properties to the request
|
118
|
+
|
119
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
120
|
+
"""
|
121
|
+
if not task_id:
|
122
|
+
raise ValueError(f"Expected a non-empty value for `task_id` but received {task_id!r}")
|
123
|
+
return self._delete(
|
124
|
+
f"/tasks/{task_id}",
|
125
|
+
options=make_request_options(
|
126
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
127
|
+
),
|
128
|
+
cast_to=TaskDeleteResponse,
|
129
|
+
)
|
130
|
+
|
131
|
+
def delete_by_name(
|
132
|
+
self,
|
133
|
+
task_name: str,
|
134
|
+
*,
|
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
|
+
) -> TaskDeleteByNameResponse:
|
142
|
+
"""
|
143
|
+
Delete a task by its unique name.
|
144
|
+
|
145
|
+
Args:
|
146
|
+
extra_headers: Send extra headers
|
147
|
+
|
148
|
+
extra_query: Add additional query parameters to the request
|
149
|
+
|
150
|
+
extra_body: Add additional JSON properties to the request
|
151
|
+
|
152
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
153
|
+
"""
|
154
|
+
if not task_name:
|
155
|
+
raise ValueError(f"Expected a non-empty value for `task_name` but received {task_name!r}")
|
156
|
+
return self._delete(
|
157
|
+
f"/tasks/name/{task_name}",
|
158
|
+
options=make_request_options(
|
159
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
160
|
+
),
|
161
|
+
cast_to=TaskDeleteByNameResponse,
|
162
|
+
)
|
163
|
+
|
164
|
+
def retrieve_by_name(
|
165
|
+
self,
|
166
|
+
task_name: str,
|
167
|
+
*,
|
168
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
169
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
170
|
+
extra_headers: Headers | None = None,
|
171
|
+
extra_query: Query | None = None,
|
172
|
+
extra_body: Body | None = None,
|
173
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
174
|
+
) -> Task:
|
175
|
+
"""
|
176
|
+
Get a task by its unique name.
|
177
|
+
|
178
|
+
Args:
|
179
|
+
extra_headers: Send extra headers
|
180
|
+
|
181
|
+
extra_query: Add additional query parameters to the request
|
182
|
+
|
183
|
+
extra_body: Add additional JSON properties to the request
|
184
|
+
|
185
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
186
|
+
"""
|
187
|
+
if not task_name:
|
188
|
+
raise ValueError(f"Expected a non-empty value for `task_name` but received {task_name!r}")
|
189
|
+
return self._get(
|
190
|
+
f"/tasks/name/{task_name}",
|
191
|
+
options=make_request_options(
|
192
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
193
|
+
),
|
194
|
+
cast_to=Task,
|
195
|
+
)
|
196
|
+
|
197
|
+
def stream_events(
|
198
|
+
self,
|
199
|
+
task_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
|
+
) -> Stream[object]:
|
208
|
+
"""
|
209
|
+
Stream events for a task by its unique 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 task_id:
|
221
|
+
raise ValueError(f"Expected a non-empty value for `task_id` but received {task_id!r}")
|
222
|
+
return self._get(
|
223
|
+
f"/tasks/{task_id}/stream",
|
224
|
+
options=make_request_options(
|
225
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
226
|
+
),
|
227
|
+
cast_to=object,
|
228
|
+
stream=True,
|
229
|
+
stream_cls=Stream[object],
|
230
|
+
)
|
231
|
+
|
232
|
+
def stream_events_by_name(
|
233
|
+
self,
|
234
|
+
task_name: str,
|
235
|
+
*,
|
236
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
237
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
238
|
+
extra_headers: Headers | None = None,
|
239
|
+
extra_query: Query | None = None,
|
240
|
+
extra_body: Body | None = None,
|
241
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
242
|
+
) -> Stream[object]:
|
243
|
+
"""
|
244
|
+
Stream events for a task by its unique name.
|
245
|
+
|
246
|
+
Args:
|
247
|
+
extra_headers: Send extra headers
|
248
|
+
|
249
|
+
extra_query: Add additional query parameters to the request
|
250
|
+
|
251
|
+
extra_body: Add additional JSON properties to the request
|
252
|
+
|
253
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
254
|
+
"""
|
255
|
+
if not task_name:
|
256
|
+
raise ValueError(f"Expected a non-empty value for `task_name` but received {task_name!r}")
|
257
|
+
return self._get(
|
258
|
+
f"/tasks/name/{task_name}/stream",
|
259
|
+
options=make_request_options(
|
260
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
261
|
+
),
|
262
|
+
cast_to=object,
|
263
|
+
stream=True,
|
264
|
+
stream_cls=Stream[object],
|
265
|
+
)
|
266
|
+
|
267
|
+
|
268
|
+
class AsyncTasksResource(AsyncAPIResource):
|
269
|
+
@cached_property
|
270
|
+
def with_raw_response(self) -> AsyncTasksResourceWithRawResponse:
|
271
|
+
"""
|
272
|
+
This property can be used as a prefix for any HTTP method call to return
|
273
|
+
the raw response object instead of the parsed content.
|
274
|
+
|
275
|
+
For more information, see https://www.github.com/scaleapi/agentex-python#accessing-raw-response-data-eg-headers
|
276
|
+
"""
|
277
|
+
return AsyncTasksResourceWithRawResponse(self)
|
278
|
+
|
279
|
+
@cached_property
|
280
|
+
def with_streaming_response(self) -> AsyncTasksResourceWithStreamingResponse:
|
281
|
+
"""
|
282
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
283
|
+
|
284
|
+
For more information, see https://www.github.com/scaleapi/agentex-python#with_streaming_response
|
285
|
+
"""
|
286
|
+
return AsyncTasksResourceWithStreamingResponse(self)
|
287
|
+
|
288
|
+
async def retrieve(
|
289
|
+
self,
|
290
|
+
task_id: str,
|
291
|
+
*,
|
292
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
293
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
294
|
+
extra_headers: Headers | None = None,
|
295
|
+
extra_query: Query | None = None,
|
296
|
+
extra_body: Body | None = None,
|
297
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
298
|
+
) -> Task:
|
299
|
+
"""
|
300
|
+
Get a task by its unique ID.
|
301
|
+
|
302
|
+
Args:
|
303
|
+
extra_headers: Send extra headers
|
304
|
+
|
305
|
+
extra_query: Add additional query parameters to the request
|
306
|
+
|
307
|
+
extra_body: Add additional JSON properties to the request
|
308
|
+
|
309
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
310
|
+
"""
|
311
|
+
if not task_id:
|
312
|
+
raise ValueError(f"Expected a non-empty value for `task_id` but received {task_id!r}")
|
313
|
+
return await self._get(
|
314
|
+
f"/tasks/{task_id}",
|
315
|
+
options=make_request_options(
|
316
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
317
|
+
),
|
318
|
+
cast_to=Task,
|
319
|
+
)
|
320
|
+
|
321
|
+
async def list(
|
322
|
+
self,
|
323
|
+
*,
|
324
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
325
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
326
|
+
extra_headers: Headers | None = None,
|
327
|
+
extra_query: Query | None = None,
|
328
|
+
extra_body: Body | None = None,
|
329
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
330
|
+
) -> TaskListResponse:
|
331
|
+
"""List all tasks."""
|
332
|
+
return await self._get(
|
333
|
+
"/tasks",
|
334
|
+
options=make_request_options(
|
335
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
336
|
+
),
|
337
|
+
cast_to=TaskListResponse,
|
338
|
+
)
|
339
|
+
|
340
|
+
async def delete(
|
341
|
+
self,
|
342
|
+
task_id: str,
|
343
|
+
*,
|
344
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
345
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
346
|
+
extra_headers: Headers | None = None,
|
347
|
+
extra_query: Query | None = None,
|
348
|
+
extra_body: Body | None = None,
|
349
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
350
|
+
) -> TaskDeleteResponse:
|
351
|
+
"""
|
352
|
+
Delete a task by its unique ID.
|
353
|
+
|
354
|
+
Args:
|
355
|
+
extra_headers: Send extra headers
|
356
|
+
|
357
|
+
extra_query: Add additional query parameters to the request
|
358
|
+
|
359
|
+
extra_body: Add additional JSON properties to the request
|
360
|
+
|
361
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
362
|
+
"""
|
363
|
+
if not task_id:
|
364
|
+
raise ValueError(f"Expected a non-empty value for `task_id` but received {task_id!r}")
|
365
|
+
return await self._delete(
|
366
|
+
f"/tasks/{task_id}",
|
367
|
+
options=make_request_options(
|
368
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
369
|
+
),
|
370
|
+
cast_to=TaskDeleteResponse,
|
371
|
+
)
|
372
|
+
|
373
|
+
async def delete_by_name(
|
374
|
+
self,
|
375
|
+
task_name: str,
|
376
|
+
*,
|
377
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
378
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
379
|
+
extra_headers: Headers | None = None,
|
380
|
+
extra_query: Query | None = None,
|
381
|
+
extra_body: Body | None = None,
|
382
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
383
|
+
) -> TaskDeleteByNameResponse:
|
384
|
+
"""
|
385
|
+
Delete a task by its unique name.
|
386
|
+
|
387
|
+
Args:
|
388
|
+
extra_headers: Send extra headers
|
389
|
+
|
390
|
+
extra_query: Add additional query parameters to the request
|
391
|
+
|
392
|
+
extra_body: Add additional JSON properties to the request
|
393
|
+
|
394
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
395
|
+
"""
|
396
|
+
if not task_name:
|
397
|
+
raise ValueError(f"Expected a non-empty value for `task_name` but received {task_name!r}")
|
398
|
+
return await self._delete(
|
399
|
+
f"/tasks/name/{task_name}",
|
400
|
+
options=make_request_options(
|
401
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
402
|
+
),
|
403
|
+
cast_to=TaskDeleteByNameResponse,
|
404
|
+
)
|
405
|
+
|
406
|
+
async def retrieve_by_name(
|
407
|
+
self,
|
408
|
+
task_name: str,
|
409
|
+
*,
|
410
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
411
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
412
|
+
extra_headers: Headers | None = None,
|
413
|
+
extra_query: Query | None = None,
|
414
|
+
extra_body: Body | None = None,
|
415
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
416
|
+
) -> Task:
|
417
|
+
"""
|
418
|
+
Get a task by its unique name.
|
419
|
+
|
420
|
+
Args:
|
421
|
+
extra_headers: Send extra headers
|
422
|
+
|
423
|
+
extra_query: Add additional query parameters to the request
|
424
|
+
|
425
|
+
extra_body: Add additional JSON properties to the request
|
426
|
+
|
427
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
428
|
+
"""
|
429
|
+
if not task_name:
|
430
|
+
raise ValueError(f"Expected a non-empty value for `task_name` but received {task_name!r}")
|
431
|
+
return await self._get(
|
432
|
+
f"/tasks/name/{task_name}",
|
433
|
+
options=make_request_options(
|
434
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
435
|
+
),
|
436
|
+
cast_to=Task,
|
437
|
+
)
|
438
|
+
|
439
|
+
async def stream_events(
|
440
|
+
self,
|
441
|
+
task_id: str,
|
442
|
+
*,
|
443
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
444
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
445
|
+
extra_headers: Headers | None = None,
|
446
|
+
extra_query: Query | None = None,
|
447
|
+
extra_body: Body | None = None,
|
448
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
449
|
+
) -> AsyncStream[object]:
|
450
|
+
"""
|
451
|
+
Stream events for a task by its unique ID.
|
452
|
+
|
453
|
+
Args:
|
454
|
+
extra_headers: Send extra headers
|
455
|
+
|
456
|
+
extra_query: Add additional query parameters to the request
|
457
|
+
|
458
|
+
extra_body: Add additional JSON properties to the request
|
459
|
+
|
460
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
461
|
+
"""
|
462
|
+
if not task_id:
|
463
|
+
raise ValueError(f"Expected a non-empty value for `task_id` but received {task_id!r}")
|
464
|
+
return await self._get(
|
465
|
+
f"/tasks/{task_id}/stream",
|
466
|
+
options=make_request_options(
|
467
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
468
|
+
),
|
469
|
+
cast_to=object,
|
470
|
+
stream=True,
|
471
|
+
stream_cls=AsyncStream[object],
|
472
|
+
)
|
473
|
+
|
474
|
+
async def stream_events_by_name(
|
475
|
+
self,
|
476
|
+
task_name: str,
|
477
|
+
*,
|
478
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
479
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
480
|
+
extra_headers: Headers | None = None,
|
481
|
+
extra_query: Query | None = None,
|
482
|
+
extra_body: Body | None = None,
|
483
|
+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
|
484
|
+
) -> AsyncStream[object]:
|
485
|
+
"""
|
486
|
+
Stream events for a task by its unique name.
|
487
|
+
|
488
|
+
Args:
|
489
|
+
extra_headers: Send extra headers
|
490
|
+
|
491
|
+
extra_query: Add additional query parameters to the request
|
492
|
+
|
493
|
+
extra_body: Add additional JSON properties to the request
|
494
|
+
|
495
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
496
|
+
"""
|
497
|
+
if not task_name:
|
498
|
+
raise ValueError(f"Expected a non-empty value for `task_name` but received {task_name!r}")
|
499
|
+
return await self._get(
|
500
|
+
f"/tasks/name/{task_name}/stream",
|
501
|
+
options=make_request_options(
|
502
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
503
|
+
),
|
504
|
+
cast_to=object,
|
505
|
+
stream=True,
|
506
|
+
stream_cls=AsyncStream[object],
|
507
|
+
)
|
508
|
+
|
509
|
+
|
510
|
+
class TasksResourceWithRawResponse:
|
511
|
+
def __init__(self, tasks: TasksResource) -> None:
|
512
|
+
self._tasks = tasks
|
513
|
+
|
514
|
+
self.retrieve = to_raw_response_wrapper(
|
515
|
+
tasks.retrieve,
|
516
|
+
)
|
517
|
+
self.list = to_raw_response_wrapper(
|
518
|
+
tasks.list,
|
519
|
+
)
|
520
|
+
self.delete = to_raw_response_wrapper(
|
521
|
+
tasks.delete,
|
522
|
+
)
|
523
|
+
self.delete_by_name = to_raw_response_wrapper(
|
524
|
+
tasks.delete_by_name,
|
525
|
+
)
|
526
|
+
self.retrieve_by_name = to_raw_response_wrapper(
|
527
|
+
tasks.retrieve_by_name,
|
528
|
+
)
|
529
|
+
self.stream_events = to_raw_response_wrapper(
|
530
|
+
tasks.stream_events,
|
531
|
+
)
|
532
|
+
self.stream_events_by_name = to_raw_response_wrapper(
|
533
|
+
tasks.stream_events_by_name,
|
534
|
+
)
|
535
|
+
|
536
|
+
|
537
|
+
class AsyncTasksResourceWithRawResponse:
|
538
|
+
def __init__(self, tasks: AsyncTasksResource) -> None:
|
539
|
+
self._tasks = tasks
|
540
|
+
|
541
|
+
self.retrieve = async_to_raw_response_wrapper(
|
542
|
+
tasks.retrieve,
|
543
|
+
)
|
544
|
+
self.list = async_to_raw_response_wrapper(
|
545
|
+
tasks.list,
|
546
|
+
)
|
547
|
+
self.delete = async_to_raw_response_wrapper(
|
548
|
+
tasks.delete,
|
549
|
+
)
|
550
|
+
self.delete_by_name = async_to_raw_response_wrapper(
|
551
|
+
tasks.delete_by_name,
|
552
|
+
)
|
553
|
+
self.retrieve_by_name = async_to_raw_response_wrapper(
|
554
|
+
tasks.retrieve_by_name,
|
555
|
+
)
|
556
|
+
self.stream_events = async_to_raw_response_wrapper(
|
557
|
+
tasks.stream_events,
|
558
|
+
)
|
559
|
+
self.stream_events_by_name = async_to_raw_response_wrapper(
|
560
|
+
tasks.stream_events_by_name,
|
561
|
+
)
|
562
|
+
|
563
|
+
|
564
|
+
class TasksResourceWithStreamingResponse:
|
565
|
+
def __init__(self, tasks: TasksResource) -> None:
|
566
|
+
self._tasks = tasks
|
567
|
+
|
568
|
+
self.retrieve = to_streamed_response_wrapper(
|
569
|
+
tasks.retrieve,
|
570
|
+
)
|
571
|
+
self.list = to_streamed_response_wrapper(
|
572
|
+
tasks.list,
|
573
|
+
)
|
574
|
+
self.delete = to_streamed_response_wrapper(
|
575
|
+
tasks.delete,
|
576
|
+
)
|
577
|
+
self.delete_by_name = to_streamed_response_wrapper(
|
578
|
+
tasks.delete_by_name,
|
579
|
+
)
|
580
|
+
self.retrieve_by_name = to_streamed_response_wrapper(
|
581
|
+
tasks.retrieve_by_name,
|
582
|
+
)
|
583
|
+
self.stream_events = to_streamed_response_wrapper(
|
584
|
+
tasks.stream_events,
|
585
|
+
)
|
586
|
+
self.stream_events_by_name = to_streamed_response_wrapper(
|
587
|
+
tasks.stream_events_by_name,
|
588
|
+
)
|
589
|
+
|
590
|
+
|
591
|
+
class AsyncTasksResourceWithStreamingResponse:
|
592
|
+
def __init__(self, tasks: AsyncTasksResource) -> None:
|
593
|
+
self._tasks = tasks
|
594
|
+
|
595
|
+
self.retrieve = async_to_streamed_response_wrapper(
|
596
|
+
tasks.retrieve,
|
597
|
+
)
|
598
|
+
self.list = async_to_streamed_response_wrapper(
|
599
|
+
tasks.list,
|
600
|
+
)
|
601
|
+
self.delete = async_to_streamed_response_wrapper(
|
602
|
+
tasks.delete,
|
603
|
+
)
|
604
|
+
self.delete_by_name = async_to_streamed_response_wrapper(
|
605
|
+
tasks.delete_by_name,
|
606
|
+
)
|
607
|
+
self.retrieve_by_name = async_to_streamed_response_wrapper(
|
608
|
+
tasks.retrieve_by_name,
|
609
|
+
)
|
610
|
+
self.stream_events = async_to_streamed_response_wrapper(
|
611
|
+
tasks.stream_events,
|
612
|
+
)
|
613
|
+
self.stream_events_by_name = async_to_streamed_response_wrapper(
|
614
|
+
tasks.stream_events_by_name,
|
615
|
+
)
|