agentex-sdk 0.4.22__py3-none-any.whl → 0.4.24__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 +3 -1
- agentex/_base_client.py +9 -9
- agentex/_client.py +12 -12
- agentex/_models.py +10 -4
- agentex/_qs.py +7 -7
- agentex/_types.py +18 -11
- agentex/_utils/_transform.py +2 -2
- agentex/_utils/_utils.py +4 -4
- agentex/_version.py +1 -1
- agentex/lib/cli/handlers/deploy_handlers.py +1 -1
- agentex/lib/cli/handlers/run_handlers.py +4 -0
- agentex/lib/cli/templates/temporal/manifest.yaml.j2 +4 -0
- agentex/lib/core/services/adk/providers/openai.py +56 -83
- agentex/lib/core/temporal/workers/worker.py +2 -2
- agentex/lib/core/tracing/processors/sgp_tracing_processor.py +33 -0
- agentex/lib/environment_variables.py +5 -0
- agentex/lib/types/agent_configs.py +5 -0
- agentex/lib/utils/dev_tools/async_messages.py +13 -6
- agentex/resources/agents.py +25 -25
- agentex/resources/events.py +9 -9
- agentex/resources/messages/batch.py +5 -5
- agentex/resources/messages/messages.py +15 -15
- agentex/resources/spans.py +39 -39
- agentex/resources/states.py +15 -15
- agentex/resources/tasks.py +19 -19
- agentex/resources/tracker.py +17 -17
- {agentex_sdk-0.4.22.dist-info → agentex_sdk-0.4.24.dist-info}/METADATA +3 -3
- {agentex_sdk-0.4.22.dist-info → agentex_sdk-0.4.24.dist-info}/RECORD +31 -31
- {agentex_sdk-0.4.22.dist-info → agentex_sdk-0.4.24.dist-info}/WHEEL +0 -0
- {agentex_sdk-0.4.22.dist-info → agentex_sdk-0.4.24.dist-info}/entry_points.txt +0 -0
- {agentex_sdk-0.4.22.dist-info → agentex_sdk-0.4.24.dist-info}/licenses/LICENSE +0 -0
@@ -8,6 +8,7 @@ from scale_gp_beta.lib.tracing.span import Span as SGPSpan
|
|
8
8
|
from agentex.types.span import Span
|
9
9
|
from agentex.lib.types.tracing import SGPTracingProcessorConfig
|
10
10
|
from agentex.lib.utils.logging import make_logger
|
11
|
+
from agentex.lib.environment_variables import EnvironmentVariables
|
11
12
|
from agentex.lib.core.tracing.processors.tracing_processor_interface import (
|
12
13
|
SyncTracingProcessor,
|
13
14
|
AsyncTracingProcessor,
|
@@ -24,9 +25,24 @@ class SGPSyncTracingProcessor(SyncTracingProcessor):
|
|
24
25
|
disabled=disabled,
|
25
26
|
)
|
26
27
|
self._spans: dict[str, SGPSpan] = {}
|
28
|
+
self.env_vars = EnvironmentVariables.refresh()
|
29
|
+
|
30
|
+
def _add_source_to_span(self, span: Span) -> None:
|
31
|
+
if span.data is None:
|
32
|
+
span.data = {}
|
33
|
+
if isinstance(span.data, dict):
|
34
|
+
span.data["__source__"] = "agentex"
|
35
|
+
if self.env_vars.ACP_TYPE is not None:
|
36
|
+
span.data["__acp_type__"] = self.env_vars.ACP_TYPE
|
37
|
+
if self.env_vars.AGENT_NAME is not None:
|
38
|
+
span.data["__agent_name__"] = self.env_vars.AGENT_NAME
|
39
|
+
if self.env_vars.AGENT_ID is not None:
|
40
|
+
span.data["__agent_id__"] = self.env_vars.AGENT_ID
|
27
41
|
|
28
42
|
@override
|
29
43
|
def on_span_start(self, span: Span) -> None:
|
44
|
+
self._add_source_to_span(span)
|
45
|
+
|
30
46
|
sgp_span = create_span(
|
31
47
|
name=span.name,
|
32
48
|
span_id=span.id,
|
@@ -50,6 +66,7 @@ class SGPSyncTracingProcessor(SyncTracingProcessor):
|
|
50
66
|
)
|
51
67
|
return
|
52
68
|
|
69
|
+
self._add_source_to_span(span)
|
53
70
|
sgp_span.output = span.output # type: ignore[assignment]
|
54
71
|
sgp_span.metadata = span.data # type: ignore[assignment]
|
55
72
|
sgp_span.end_time = span.end_time.isoformat() # type: ignore[union-attr]
|
@@ -70,9 +87,23 @@ class SGPAsyncTracingProcessor(AsyncTracingProcessor):
|
|
70
87
|
if not self.disabled
|
71
88
|
else None
|
72
89
|
)
|
90
|
+
self.env_vars = EnvironmentVariables.refresh()
|
91
|
+
|
92
|
+
def _add_source_to_span(self, span: Span) -> None:
|
93
|
+
if span.data is None:
|
94
|
+
span.data = {}
|
95
|
+
if isinstance(span.data, dict):
|
96
|
+
span.data["__source__"] = "agentex"
|
97
|
+
if self.env_vars.ACP_TYPE is not None:
|
98
|
+
span.data["__acp_type__"] = self.env_vars.ACP_TYPE
|
99
|
+
if self.env_vars.AGENT_NAME is not None:
|
100
|
+
span.data["__agent_name__"] = self.env_vars.AGENT_NAME
|
101
|
+
if self.env_vars.AGENT_ID is not None:
|
102
|
+
span.data["__agent_id__"] = self.env_vars.AGENT_ID
|
73
103
|
|
74
104
|
@override
|
75
105
|
async def on_span_start(self, span: Span) -> None:
|
106
|
+
self._add_source_to_span(span)
|
76
107
|
sgp_span = create_span(
|
77
108
|
name=span.name,
|
78
109
|
span_id=span.id,
|
@@ -85,6 +116,7 @@ class SGPAsyncTracingProcessor(AsyncTracingProcessor):
|
|
85
116
|
sgp_span.start_time = span.start_time.isoformat() # type: ignore[union-attr]
|
86
117
|
|
87
118
|
if self.disabled:
|
119
|
+
logger.warning("SGP is disabled, skipping span upsert")
|
88
120
|
return
|
89
121
|
await self.sgp_async_client.spans.upsert_batch( # type: ignore[union-attr]
|
90
122
|
items=[sgp_span.to_request_params()]
|
@@ -101,6 +133,7 @@ class SGPAsyncTracingProcessor(AsyncTracingProcessor):
|
|
101
133
|
)
|
102
134
|
return
|
103
135
|
|
136
|
+
self._add_source_to_span(span)
|
104
137
|
sgp_span.output = span.output # type: ignore[assignment]
|
105
138
|
sgp_span.metadata = span.data # type: ignore[assignment]
|
106
139
|
sgp_span.end_time = span.end_time.isoformat() # type: ignore[union-attr]
|
@@ -32,6 +32,8 @@ class EnvVarKeys(str, Enum):
|
|
32
32
|
# Workflow Configuration
|
33
33
|
WORKFLOW_NAME = "WORKFLOW_NAME"
|
34
34
|
WORKFLOW_TASK_QUEUE = "WORKFLOW_TASK_QUEUE"
|
35
|
+
# Temporal Worker Configuration
|
36
|
+
HEALTH_CHECK_PORT = "HEALTH_CHECK_PORT"
|
35
37
|
# Auth Configuration
|
36
38
|
AUTH_PRINCIPAL_B64 = "AUTH_PRINCIPAL_B64"
|
37
39
|
# Build Information
|
@@ -65,6 +67,9 @@ class EnvironmentVariables(BaseModel):
|
|
65
67
|
# Workflow Configuration
|
66
68
|
WORKFLOW_TASK_QUEUE: str | None = None
|
67
69
|
WORKFLOW_NAME: str | None = None
|
70
|
+
# Temporal Worker Configuration
|
71
|
+
HEALTH_CHECK_PORT: int = 80
|
72
|
+
# Auth Configuration
|
68
73
|
AUTH_PRINCIPAL_B64: str | None = None
|
69
74
|
# Build Information
|
70
75
|
BUILD_INFO_PATH: str | None = None
|
@@ -45,6 +45,7 @@ class TemporalConfig(BaseModel):
|
|
45
45
|
enabled: Whether this agent uses Temporal workflows
|
46
46
|
workflow: The temporal workflow configuration
|
47
47
|
workflows: The list of temporal workflow configurations
|
48
|
+
health_check_port: Port for temporal worker health check endpoint
|
48
49
|
"""
|
49
50
|
|
50
51
|
enabled: bool = Field(
|
@@ -58,6 +59,10 @@ class TemporalConfig(BaseModel):
|
|
58
59
|
default=None,
|
59
60
|
description="List of temporal workflow configurations. Used when enabled=true.",
|
60
61
|
)
|
62
|
+
health_check_port: int | None = Field(
|
63
|
+
default=None,
|
64
|
+
description="Port for temporal worker health check endpoint. Defaults to 80 if not specified.",
|
65
|
+
)
|
61
66
|
|
62
67
|
@validator("workflows")
|
63
68
|
def validate_workflows_not_empty(cls, v):
|
@@ -49,8 +49,8 @@ def print_task_message(
|
|
49
49
|
|
50
50
|
# Skip empty reasoning messages
|
51
51
|
if isinstance(message.content, ReasoningContent):
|
52
|
-
has_summary = message.content.summary and any(s for s in message.content.summary if s)
|
53
|
-
has_content = message.content.content and any(c for c in message.content.content if c)
|
52
|
+
has_summary = bool(message.content.summary) and any(s for s in message.content.summary if s)
|
53
|
+
has_content = bool(message.content.content) and any(c for c in message.content.content if c) if message.content.content is not None else False
|
54
54
|
if not has_summary and not has_content:
|
55
55
|
return
|
56
56
|
|
@@ -135,18 +135,19 @@ def print_task_message(
|
|
135
135
|
|
136
136
|
if rich_print and console:
|
137
137
|
author_color = "bright_cyan" if message.content.author == "user" else "green"
|
138
|
-
title = f"[bold {author_color}]{message.content.author.upper()}[/bold {author_color}] [{timestamp}]"
|
139
138
|
|
140
|
-
# Use different border styles for
|
139
|
+
# Use different border styles and colors for different content types
|
141
140
|
if content_type == "tool_request":
|
142
141
|
border_style = "yellow"
|
143
142
|
elif content_type == "tool_response":
|
144
143
|
border_style = "bright_green"
|
145
144
|
elif content_type == "reasoning":
|
146
145
|
border_style = "bright_magenta"
|
146
|
+
author_color = "bright_magenta" # Also make the author text magenta
|
147
147
|
else:
|
148
148
|
border_style = author_color
|
149
|
-
|
149
|
+
|
150
|
+
title = f"[bold {author_color}]{message.content.author.upper()}[/bold {author_color}] [{timestamp}]"
|
150
151
|
panel = Panel(Markdown(content), title=title, border_style=border_style, width=80)
|
151
152
|
console.print(panel)
|
152
153
|
else:
|
@@ -329,7 +330,7 @@ def subscribe_to_async_task_messages(
|
|
329
330
|
|
330
331
|
# Deserialize the discriminated union TaskMessageUpdate based on the "type" field
|
331
332
|
message_type = task_message_update_data.get("type", "unknown")
|
332
|
-
|
333
|
+
|
333
334
|
# Handle different message types for streaming progress
|
334
335
|
if message_type == "start":
|
335
336
|
task_message_update = StreamTaskMessageStart.model_validate(task_message_update_data)
|
@@ -359,6 +360,9 @@ def subscribe_to_async_task_messages(
|
|
359
360
|
if index in active_spinners:
|
360
361
|
active_spinners[index].stop()
|
361
362
|
del active_spinners[index]
|
363
|
+
# Ensure clean line after spinner
|
364
|
+
if print_messages:
|
365
|
+
print()
|
362
366
|
|
363
367
|
if task_message_update.parent_task_message and task_message_update.parent_task_message.id:
|
364
368
|
finished_message = client.messages.retrieve(task_message_update.parent_task_message.id)
|
@@ -373,6 +377,9 @@ def subscribe_to_async_task_messages(
|
|
373
377
|
if index in active_spinners:
|
374
378
|
active_spinners[index].stop()
|
375
379
|
del active_spinners[index]
|
380
|
+
# Ensure clean line after spinner
|
381
|
+
if print_messages:
|
382
|
+
print()
|
376
383
|
|
377
384
|
if task_message_update.parent_task_message and task_message_update.parent_task_message.id:
|
378
385
|
finished_message = client.messages.retrieve(task_message_update.parent_task_message.id)
|
agentex/resources/agents.py
CHANGED
@@ -10,7 +10,7 @@ import httpx
|
|
10
10
|
from pydantic import ValidationError
|
11
11
|
|
12
12
|
from ..types import agent_rpc_params, agent_list_params, agent_rpc_by_name_params
|
13
|
-
from .._types import
|
13
|
+
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
14
14
|
from .._utils import maybe_transform, async_maybe_transform
|
15
15
|
from .._compat import cached_property
|
16
16
|
from .._resource import SyncAPIResource, AsyncAPIResource
|
@@ -65,7 +65,7 @@ class AgentsResource(SyncAPIResource):
|
|
65
65
|
extra_headers: Headers | None = None,
|
66
66
|
extra_query: Query | None = None,
|
67
67
|
extra_body: Body | None = None,
|
68
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
68
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
69
69
|
) -> Agent:
|
70
70
|
"""
|
71
71
|
Get an agent by its unique ID.
|
@@ -92,13 +92,13 @@ class AgentsResource(SyncAPIResource):
|
|
92
92
|
def list(
|
93
93
|
self,
|
94
94
|
*,
|
95
|
-
task_id: Optional[str] |
|
95
|
+
task_id: Optional[str] | Omit = omit,
|
96
96
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
97
97
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
98
98
|
extra_headers: Headers | None = None,
|
99
99
|
extra_query: Query | None = None,
|
100
100
|
extra_body: Body | None = None,
|
101
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
101
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
102
102
|
) -> AgentListResponse:
|
103
103
|
"""
|
104
104
|
List all registered agents, optionally filtered by query parameters.
|
@@ -135,7 +135,7 @@ class AgentsResource(SyncAPIResource):
|
|
135
135
|
extra_headers: Headers | None = None,
|
136
136
|
extra_query: Query | None = None,
|
137
137
|
extra_body: Body | None = None,
|
138
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
138
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
139
139
|
) -> DeleteResponse:
|
140
140
|
"""
|
141
141
|
Delete an agent by its unique ID.
|
@@ -168,7 +168,7 @@ class AgentsResource(SyncAPIResource):
|
|
168
168
|
extra_headers: Headers | None = None,
|
169
169
|
extra_query: Query | None = None,
|
170
170
|
extra_body: Body | None = None,
|
171
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
171
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
172
172
|
) -> DeleteResponse:
|
173
173
|
"""
|
174
174
|
Delete an agent by its unique name.
|
@@ -201,7 +201,7 @@ class AgentsResource(SyncAPIResource):
|
|
201
201
|
extra_headers: Headers | None = None,
|
202
202
|
extra_query: Query | None = None,
|
203
203
|
extra_body: Body | None = None,
|
204
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
204
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
205
205
|
) -> Agent:
|
206
206
|
"""
|
207
207
|
Get an agent by its unique name.
|
@@ -231,14 +231,14 @@ class AgentsResource(SyncAPIResource):
|
|
231
231
|
*,
|
232
232
|
method: Literal["event/send", "task/create", "message/send", "task/cancel"],
|
233
233
|
params: agent_rpc_params.Params,
|
234
|
-
id: Union[int, str, None] |
|
235
|
-
jsonrpc: Literal["2.0"] |
|
234
|
+
id: Union[int, str, None] | Omit = omit,
|
235
|
+
jsonrpc: Literal["2.0"] | Omit = omit,
|
236
236
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
237
237
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
238
238
|
extra_headers: Headers | None = None,
|
239
239
|
extra_query: Query | None = None,
|
240
240
|
extra_body: Body | None = None,
|
241
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
241
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
242
242
|
) -> AgentRpcResponse:
|
243
243
|
"""
|
244
244
|
Handle JSON-RPC requests for an agent by its unique ID.
|
@@ -279,14 +279,14 @@ class AgentsResource(SyncAPIResource):
|
|
279
279
|
*,
|
280
280
|
method: Literal["event/send", "task/create", "message/send", "task/cancel"],
|
281
281
|
params: agent_rpc_by_name_params.Params,
|
282
|
-
id: Union[int, str, None] |
|
283
|
-
jsonrpc: Literal["2.0"] |
|
282
|
+
id: Union[int, str, None] | Omit = omit,
|
283
|
+
jsonrpc: Literal["2.0"] | Omit = omit,
|
284
284
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
285
285
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
286
286
|
extra_headers: Headers | None = None,
|
287
287
|
extra_query: Query | None = None,
|
288
288
|
extra_body: Body | None = None,
|
289
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
289
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
290
290
|
) -> AgentRpcResponse:
|
291
291
|
"""
|
292
292
|
Handle JSON-RPC requests for an agent by its unique name.
|
@@ -612,7 +612,7 @@ class AsyncAgentsResource(AsyncAPIResource):
|
|
612
612
|
extra_headers: Headers | None = None,
|
613
613
|
extra_query: Query | None = None,
|
614
614
|
extra_body: Body | None = None,
|
615
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
615
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
616
616
|
) -> Agent:
|
617
617
|
"""
|
618
618
|
Get an agent by its unique ID.
|
@@ -639,13 +639,13 @@ class AsyncAgentsResource(AsyncAPIResource):
|
|
639
639
|
async def list(
|
640
640
|
self,
|
641
641
|
*,
|
642
|
-
task_id: Optional[str] |
|
642
|
+
task_id: Optional[str] | Omit = omit,
|
643
643
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
644
644
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
645
645
|
extra_headers: Headers | None = None,
|
646
646
|
extra_query: Query | None = None,
|
647
647
|
extra_body: Body | None = None,
|
648
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
648
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
649
649
|
) -> AgentListResponse:
|
650
650
|
"""
|
651
651
|
List all registered agents, optionally filtered by query parameters.
|
@@ -682,7 +682,7 @@ class AsyncAgentsResource(AsyncAPIResource):
|
|
682
682
|
extra_headers: Headers | None = None,
|
683
683
|
extra_query: Query | None = None,
|
684
684
|
extra_body: Body | None = None,
|
685
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
685
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
686
686
|
) -> DeleteResponse:
|
687
687
|
"""
|
688
688
|
Delete an agent by its unique ID.
|
@@ -715,7 +715,7 @@ class AsyncAgentsResource(AsyncAPIResource):
|
|
715
715
|
extra_headers: Headers | None = None,
|
716
716
|
extra_query: Query | None = None,
|
717
717
|
extra_body: Body | None = None,
|
718
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
718
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
719
719
|
) -> DeleteResponse:
|
720
720
|
"""
|
721
721
|
Delete an agent by its unique name.
|
@@ -748,7 +748,7 @@ class AsyncAgentsResource(AsyncAPIResource):
|
|
748
748
|
extra_headers: Headers | None = None,
|
749
749
|
extra_query: Query | None = None,
|
750
750
|
extra_body: Body | None = None,
|
751
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
751
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
752
752
|
) -> Agent:
|
753
753
|
"""
|
754
754
|
Get an agent by its unique name.
|
@@ -778,14 +778,14 @@ class AsyncAgentsResource(AsyncAPIResource):
|
|
778
778
|
*,
|
779
779
|
method: Literal["event/send", "task/create", "message/send", "task/cancel"],
|
780
780
|
params: agent_rpc_params.Params,
|
781
|
-
id: Union[int, str, None] |
|
782
|
-
jsonrpc: Literal["2.0"] |
|
781
|
+
id: Union[int, str, None] | Omit = omit,
|
782
|
+
jsonrpc: Literal["2.0"] | Omit = omit,
|
783
783
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
784
784
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
785
785
|
extra_headers: Headers | None = None,
|
786
786
|
extra_query: Query | None = None,
|
787
787
|
extra_body: Body | None = None,
|
788
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
788
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
789
789
|
) -> AgentRpcResponse:
|
790
790
|
"""
|
791
791
|
Handle JSON-RPC requests for an agent by its unique ID.
|
@@ -826,14 +826,14 @@ class AsyncAgentsResource(AsyncAPIResource):
|
|
826
826
|
*,
|
827
827
|
method: Literal["event/send", "task/create", "message/send", "task/cancel"],
|
828
828
|
params: agent_rpc_by_name_params.Params,
|
829
|
-
id: Union[int, str, None] |
|
830
|
-
jsonrpc: Literal["2.0"] |
|
829
|
+
id: Union[int, str, None] | Omit = omit,
|
830
|
+
jsonrpc: Literal["2.0"] | Omit = omit,
|
831
831
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
832
832
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
833
833
|
extra_headers: Headers | None = None,
|
834
834
|
extra_query: Query | None = None,
|
835
835
|
extra_body: Body | None = None,
|
836
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
836
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
837
837
|
) -> AgentRpcResponse:
|
838
838
|
"""
|
839
839
|
Handle JSON-RPC requests for an agent by its unique name.
|
agentex/resources/events.py
CHANGED
@@ -7,7 +7,7 @@ from typing import Optional
|
|
7
7
|
import httpx
|
8
8
|
|
9
9
|
from ..types import event_list_params
|
10
|
-
from .._types import
|
10
|
+
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
11
11
|
from .._utils import maybe_transform, async_maybe_transform
|
12
12
|
from .._compat import cached_property
|
13
13
|
from .._resource import SyncAPIResource, AsyncAPIResource
|
@@ -53,7 +53,7 @@ class EventsResource(SyncAPIResource):
|
|
53
53
|
extra_headers: Headers | None = None,
|
54
54
|
extra_query: Query | None = None,
|
55
55
|
extra_body: Body | None = None,
|
56
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
56
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
57
57
|
) -> Event:
|
58
58
|
"""
|
59
59
|
Get Event
|
@@ -82,14 +82,14 @@ class EventsResource(SyncAPIResource):
|
|
82
82
|
*,
|
83
83
|
agent_id: str,
|
84
84
|
task_id: str,
|
85
|
-
last_processed_event_id: Optional[str] |
|
86
|
-
limit: Optional[int] |
|
85
|
+
last_processed_event_id: Optional[str] | Omit = omit,
|
86
|
+
limit: Optional[int] | Omit = omit,
|
87
87
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
88
88
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
89
89
|
extra_headers: Headers | None = None,
|
90
90
|
extra_query: Query | None = None,
|
91
91
|
extra_body: Body | None = None,
|
92
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
92
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
93
93
|
) -> EventListResponse:
|
94
94
|
"""
|
95
95
|
List events for a specific task and agent.
|
@@ -164,7 +164,7 @@ class AsyncEventsResource(AsyncAPIResource):
|
|
164
164
|
extra_headers: Headers | None = None,
|
165
165
|
extra_query: Query | None = None,
|
166
166
|
extra_body: Body | None = None,
|
167
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
167
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
168
168
|
) -> Event:
|
169
169
|
"""
|
170
170
|
Get Event
|
@@ -193,14 +193,14 @@ class AsyncEventsResource(AsyncAPIResource):
|
|
193
193
|
*,
|
194
194
|
agent_id: str,
|
195
195
|
task_id: str,
|
196
|
-
last_processed_event_id: Optional[str] |
|
197
|
-
limit: Optional[int] |
|
196
|
+
last_processed_event_id: Optional[str] | Omit = omit,
|
197
|
+
limit: Optional[int] | Omit = omit,
|
198
198
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
199
199
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
200
200
|
extra_headers: Headers | None = None,
|
201
201
|
extra_query: Query | None = None,
|
202
202
|
extra_body: Body | None = None,
|
203
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
203
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
204
204
|
) -> EventListResponse:
|
205
205
|
"""
|
206
206
|
List events for a specific task and agent.
|
@@ -6,7 +6,7 @@ from typing import Dict, Iterable
|
|
6
6
|
|
7
7
|
import httpx
|
8
8
|
|
9
|
-
from ..._types import
|
9
|
+
from ..._types import Body, Query, Headers, NotGiven, not_given
|
10
10
|
from ..._utils import maybe_transform, async_maybe_transform
|
11
11
|
from ..._compat import cached_property
|
12
12
|
from ..._resource import SyncAPIResource, AsyncAPIResource
|
@@ -55,7 +55,7 @@ class BatchResource(SyncAPIResource):
|
|
55
55
|
extra_headers: Headers | None = None,
|
56
56
|
extra_query: Query | None = None,
|
57
57
|
extra_body: Body | None = None,
|
58
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
58
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
59
59
|
) -> BatchCreateResponse:
|
60
60
|
"""
|
61
61
|
Batch Create Messages
|
@@ -94,7 +94,7 @@ class BatchResource(SyncAPIResource):
|
|
94
94
|
extra_headers: Headers | None = None,
|
95
95
|
extra_query: Query | None = None,
|
96
96
|
extra_body: Body | None = None,
|
97
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
97
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
98
98
|
) -> BatchUpdateResponse:
|
99
99
|
"""
|
100
100
|
Batch Update Messages
|
@@ -154,7 +154,7 @@ class AsyncBatchResource(AsyncAPIResource):
|
|
154
154
|
extra_headers: Headers | None = None,
|
155
155
|
extra_query: Query | None = None,
|
156
156
|
extra_body: Body | None = None,
|
157
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
157
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
158
158
|
) -> BatchCreateResponse:
|
159
159
|
"""
|
160
160
|
Batch Create Messages
|
@@ -193,7 +193,7 @@ class AsyncBatchResource(AsyncAPIResource):
|
|
193
193
|
extra_headers: Headers | None = None,
|
194
194
|
extra_query: Query | None = None,
|
195
195
|
extra_body: Body | None = None,
|
196
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
196
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
197
197
|
) -> BatchUpdateResponse:
|
198
198
|
"""
|
199
199
|
Batch Update Messages
|
@@ -16,7 +16,7 @@ from .batch import (
|
|
16
16
|
AsyncBatchResourceWithStreamingResponse,
|
17
17
|
)
|
18
18
|
from ...types import message_list_params, message_create_params, message_update_params
|
19
|
-
from ..._types import
|
19
|
+
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
20
20
|
from ..._utils import maybe_transform, async_maybe_transform
|
21
21
|
from ..._compat import cached_property
|
22
22
|
from ..._resource import SyncAPIResource, AsyncAPIResource
|
@@ -63,13 +63,13 @@ class MessagesResource(SyncAPIResource):
|
|
63
63
|
*,
|
64
64
|
content: TaskMessageContentParam,
|
65
65
|
task_id: str,
|
66
|
-
streaming_status: Optional[Literal["IN_PROGRESS", "DONE"]] |
|
66
|
+
streaming_status: Optional[Literal["IN_PROGRESS", "DONE"]] | Omit = omit,
|
67
67
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
68
68
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
69
69
|
extra_headers: Headers | None = None,
|
70
70
|
extra_query: Query | None = None,
|
71
71
|
extra_body: Body | None = None,
|
72
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
72
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
73
73
|
) -> TaskMessage:
|
74
74
|
"""
|
75
75
|
Create Message
|
@@ -108,7 +108,7 @@ class MessagesResource(SyncAPIResource):
|
|
108
108
|
extra_headers: Headers | None = None,
|
109
109
|
extra_query: Query | None = None,
|
110
110
|
extra_body: Body | None = None,
|
111
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
111
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
112
112
|
) -> TaskMessage:
|
113
113
|
"""
|
114
114
|
Get Message
|
@@ -138,13 +138,13 @@ class MessagesResource(SyncAPIResource):
|
|
138
138
|
*,
|
139
139
|
content: TaskMessageContentParam,
|
140
140
|
task_id: str,
|
141
|
-
streaming_status: Optional[Literal["IN_PROGRESS", "DONE"]] |
|
141
|
+
streaming_status: Optional[Literal["IN_PROGRESS", "DONE"]] | Omit = omit,
|
142
142
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
143
143
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
144
144
|
extra_headers: Headers | None = None,
|
145
145
|
extra_query: Query | None = None,
|
146
146
|
extra_body: Body | None = None,
|
147
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
147
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
148
148
|
) -> TaskMessage:
|
149
149
|
"""
|
150
150
|
Update Message
|
@@ -180,13 +180,13 @@ class MessagesResource(SyncAPIResource):
|
|
180
180
|
self,
|
181
181
|
*,
|
182
182
|
task_id: str,
|
183
|
-
limit: Optional[int] |
|
183
|
+
limit: Optional[int] | Omit = omit,
|
184
184
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
185
185
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
186
186
|
extra_headers: Headers | None = None,
|
187
187
|
extra_query: Query | None = None,
|
188
188
|
extra_body: Body | None = None,
|
189
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
189
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
190
190
|
) -> MessageListResponse:
|
191
191
|
"""
|
192
192
|
List Messages
|
@@ -250,13 +250,13 @@ class AsyncMessagesResource(AsyncAPIResource):
|
|
250
250
|
*,
|
251
251
|
content: TaskMessageContentParam,
|
252
252
|
task_id: str,
|
253
|
-
streaming_status: Optional[Literal["IN_PROGRESS", "DONE"]] |
|
253
|
+
streaming_status: Optional[Literal["IN_PROGRESS", "DONE"]] | Omit = omit,
|
254
254
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
255
255
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
256
256
|
extra_headers: Headers | None = None,
|
257
257
|
extra_query: Query | None = None,
|
258
258
|
extra_body: Body | None = None,
|
259
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
259
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
260
260
|
) -> TaskMessage:
|
261
261
|
"""
|
262
262
|
Create Message
|
@@ -295,7 +295,7 @@ class AsyncMessagesResource(AsyncAPIResource):
|
|
295
295
|
extra_headers: Headers | None = None,
|
296
296
|
extra_query: Query | None = None,
|
297
297
|
extra_body: Body | None = None,
|
298
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
298
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
299
299
|
) -> TaskMessage:
|
300
300
|
"""
|
301
301
|
Get Message
|
@@ -325,13 +325,13 @@ class AsyncMessagesResource(AsyncAPIResource):
|
|
325
325
|
*,
|
326
326
|
content: TaskMessageContentParam,
|
327
327
|
task_id: str,
|
328
|
-
streaming_status: Optional[Literal["IN_PROGRESS", "DONE"]] |
|
328
|
+
streaming_status: Optional[Literal["IN_PROGRESS", "DONE"]] | Omit = omit,
|
329
329
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
330
330
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
331
331
|
extra_headers: Headers | None = None,
|
332
332
|
extra_query: Query | None = None,
|
333
333
|
extra_body: Body | None = None,
|
334
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
334
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
335
335
|
) -> TaskMessage:
|
336
336
|
"""
|
337
337
|
Update Message
|
@@ -367,13 +367,13 @@ class AsyncMessagesResource(AsyncAPIResource):
|
|
367
367
|
self,
|
368
368
|
*,
|
369
369
|
task_id: str,
|
370
|
-
limit: Optional[int] |
|
370
|
+
limit: Optional[int] | Omit = omit,
|
371
371
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
372
372
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
373
373
|
extra_headers: Headers | None = None,
|
374
374
|
extra_query: Query | None = None,
|
375
375
|
extra_body: Body | None = None,
|
376
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
376
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
377
377
|
) -> MessageListResponse:
|
378
378
|
"""
|
379
379
|
List Messages
|