agentex-sdk 0.6.1__py3-none-any.whl → 0.6.3__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/_client.py +15 -1
- agentex/_version.py +1 -1
- agentex/lib/adk/providers/_modules/openai.py +16 -1
- agentex/lib/cli/commands/init.py +3 -3
- agentex/lib/core/temporal/plugins/openai_agents/hooks/hooks.py +19 -11
- agentex/lib/core/temporal/plugins/openai_agents/models/temporal_streaming_model.py +83 -5
- agentex/lib/core/temporal/plugins/openai_agents/models/temporal_tracing_model.py +107 -21
- agentex/resources/__init__.py +14 -0
- agentex/resources/deployment_history.py +272 -0
- agentex/types/__init__.py +3 -0
- agentex/types/deployment_history.py +33 -0
- agentex/types/deployment_history_list_params.py +18 -0
- agentex/types/deployment_history_list_response.py +10 -0
- {agentex_sdk-0.6.1.dist-info → agentex_sdk-0.6.3.dist-info}/METADATA +1 -1
- {agentex_sdk-0.6.1.dist-info → agentex_sdk-0.6.3.dist-info}/RECORD +18 -14
- {agentex_sdk-0.6.1.dist-info → agentex_sdk-0.6.3.dist-info}/WHEEL +0 -0
- {agentex_sdk-0.6.1.dist-info → agentex_sdk-0.6.3.dist-info}/entry_points.txt +0 -0
- {agentex_sdk-0.6.1.dist-info → agentex_sdk-0.6.3.dist-info}/licenses/LICENSE +0 -0
agentex/_client.py
CHANGED
|
@@ -21,7 +21,7 @@ from ._types import (
|
|
|
21
21
|
)
|
|
22
22
|
from ._utils import is_given, get_async_library
|
|
23
23
|
from ._version import __version__
|
|
24
|
-
from .resources import spans, tasks, agents, events, states, tracker
|
|
24
|
+
from .resources import spans, tasks, agents, events, states, tracker, deployment_history
|
|
25
25
|
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
|
|
26
26
|
from ._exceptions import APIStatusError
|
|
27
27
|
from ._base_client import (
|
|
@@ -57,6 +57,7 @@ class Agentex(SyncAPIClient):
|
|
|
57
57
|
states: states.StatesResource
|
|
58
58
|
events: events.EventsResource
|
|
59
59
|
tracker: tracker.TrackerResource
|
|
60
|
+
deployment_history: deployment_history.DeploymentHistoryResource
|
|
60
61
|
with_raw_response: AgentexWithRawResponse
|
|
61
62
|
with_streaming_response: AgentexWithStreamedResponse
|
|
62
63
|
|
|
@@ -141,6 +142,7 @@ class Agentex(SyncAPIClient):
|
|
|
141
142
|
self.states = states.StatesResource(self)
|
|
142
143
|
self.events = events.EventsResource(self)
|
|
143
144
|
self.tracker = tracker.TrackerResource(self)
|
|
145
|
+
self.deployment_history = deployment_history.DeploymentHistoryResource(self)
|
|
144
146
|
self.with_raw_response = AgentexWithRawResponse(self)
|
|
145
147
|
self.with_streaming_response = AgentexWithStreamedResponse(self)
|
|
146
148
|
|
|
@@ -261,6 +263,7 @@ class AsyncAgentex(AsyncAPIClient):
|
|
|
261
263
|
states: states.AsyncStatesResource
|
|
262
264
|
events: events.AsyncEventsResource
|
|
263
265
|
tracker: tracker.AsyncTrackerResource
|
|
266
|
+
deployment_history: deployment_history.AsyncDeploymentHistoryResource
|
|
264
267
|
with_raw_response: AsyncAgentexWithRawResponse
|
|
265
268
|
with_streaming_response: AsyncAgentexWithStreamedResponse
|
|
266
269
|
|
|
@@ -345,6 +348,7 @@ class AsyncAgentex(AsyncAPIClient):
|
|
|
345
348
|
self.states = states.AsyncStatesResource(self)
|
|
346
349
|
self.events = events.AsyncEventsResource(self)
|
|
347
350
|
self.tracker = tracker.AsyncTrackerResource(self)
|
|
351
|
+
self.deployment_history = deployment_history.AsyncDeploymentHistoryResource(self)
|
|
348
352
|
self.with_raw_response = AsyncAgentexWithRawResponse(self)
|
|
349
353
|
self.with_streaming_response = AsyncAgentexWithStreamedResponse(self)
|
|
350
354
|
|
|
@@ -466,6 +470,7 @@ class AgentexWithRawResponse:
|
|
|
466
470
|
self.states = states.StatesResourceWithRawResponse(client.states)
|
|
467
471
|
self.events = events.EventsResourceWithRawResponse(client.events)
|
|
468
472
|
self.tracker = tracker.TrackerResourceWithRawResponse(client.tracker)
|
|
473
|
+
self.deployment_history = deployment_history.DeploymentHistoryResourceWithRawResponse(client.deployment_history)
|
|
469
474
|
|
|
470
475
|
|
|
471
476
|
class AsyncAgentexWithRawResponse:
|
|
@@ -477,6 +482,9 @@ class AsyncAgentexWithRawResponse:
|
|
|
477
482
|
self.states = states.AsyncStatesResourceWithRawResponse(client.states)
|
|
478
483
|
self.events = events.AsyncEventsResourceWithRawResponse(client.events)
|
|
479
484
|
self.tracker = tracker.AsyncTrackerResourceWithRawResponse(client.tracker)
|
|
485
|
+
self.deployment_history = deployment_history.AsyncDeploymentHistoryResourceWithRawResponse(
|
|
486
|
+
client.deployment_history
|
|
487
|
+
)
|
|
480
488
|
|
|
481
489
|
|
|
482
490
|
class AgentexWithStreamedResponse:
|
|
@@ -488,6 +496,9 @@ class AgentexWithStreamedResponse:
|
|
|
488
496
|
self.states = states.StatesResourceWithStreamingResponse(client.states)
|
|
489
497
|
self.events = events.EventsResourceWithStreamingResponse(client.events)
|
|
490
498
|
self.tracker = tracker.TrackerResourceWithStreamingResponse(client.tracker)
|
|
499
|
+
self.deployment_history = deployment_history.DeploymentHistoryResourceWithStreamingResponse(
|
|
500
|
+
client.deployment_history
|
|
501
|
+
)
|
|
491
502
|
|
|
492
503
|
|
|
493
504
|
class AsyncAgentexWithStreamedResponse:
|
|
@@ -499,6 +510,9 @@ class AsyncAgentexWithStreamedResponse:
|
|
|
499
510
|
self.states = states.AsyncStatesResourceWithStreamingResponse(client.states)
|
|
500
511
|
self.events = events.AsyncEventsResourceWithStreamingResponse(client.events)
|
|
501
512
|
self.tracker = tracker.AsyncTrackerResourceWithStreamingResponse(client.tracker)
|
|
513
|
+
self.deployment_history = deployment_history.AsyncDeploymentHistoryResourceWithStreamingResponse(
|
|
514
|
+
client.deployment_history
|
|
515
|
+
)
|
|
502
516
|
|
|
503
517
|
|
|
504
518
|
Client = Agentex
|
agentex/_version.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import sys
|
|
3
4
|
from typing import Any, Literal
|
|
4
5
|
from datetime import timedelta
|
|
5
6
|
|
|
@@ -12,6 +13,12 @@ from temporalio.common import RetryPolicy
|
|
|
12
13
|
from agents.agent_output import AgentOutputSchemaBase
|
|
13
14
|
from agents.model_settings import ModelSettings
|
|
14
15
|
|
|
16
|
+
# Use warnings.deprecated in Python 3.13+, typing_extensions.deprecated for older versions
|
|
17
|
+
if sys.version_info >= (3, 13):
|
|
18
|
+
from warnings import deprecated
|
|
19
|
+
else:
|
|
20
|
+
from typing_extensions import deprecated
|
|
21
|
+
|
|
15
22
|
from agentex.lib.utils.logging import make_logger
|
|
16
23
|
from agentex.lib.utils.temporal import in_temporal_workflow
|
|
17
24
|
from agentex.lib.core.tracing.tracer import AsyncTracer
|
|
@@ -383,6 +390,10 @@ class OpenAIModule:
|
|
|
383
390
|
previous_response_id=previous_response_id,
|
|
384
391
|
)
|
|
385
392
|
|
|
393
|
+
@deprecated(
|
|
394
|
+
"Use the OpenAI Agents SDK integration with Temporal instead. "
|
|
395
|
+
"See examples in tutorials/10_async/10_temporal/ for migration guidance."
|
|
396
|
+
)
|
|
386
397
|
async def run_agent_streamed_auto_send(
|
|
387
398
|
self,
|
|
388
399
|
task_id: str,
|
|
@@ -413,6 +424,10 @@ class OpenAIModule:
|
|
|
413
424
|
"""
|
|
414
425
|
Run an agent with streaming enabled and automatic TaskMessage creation.
|
|
415
426
|
|
|
427
|
+
.. deprecated::
|
|
428
|
+
Use the OpenAI Agents SDK integration with Temporal instead.
|
|
429
|
+
See examples in tutorials/10_async/10_temporal/ for migration guidance.
|
|
430
|
+
|
|
416
431
|
Args:
|
|
417
432
|
task_id: The ID of the task to run the agent for.
|
|
418
433
|
input_list: List of input data for the agent.
|
|
@@ -494,4 +509,4 @@ class OpenAIModule:
|
|
|
494
509
|
output_guardrails=output_guardrails,
|
|
495
510
|
max_turns=max_turns,
|
|
496
511
|
previous_response_id=previous_response_id,
|
|
497
|
-
)
|
|
512
|
+
)
|
agentex/lib/cli/commands/init.py
CHANGED
|
@@ -126,15 +126,15 @@ def init():
|
|
|
126
126
|
table.add_column("Description", style="white")
|
|
127
127
|
table.add_row(
|
|
128
128
|
"[bold cyan]Async - ACP Only[/bold cyan]",
|
|
129
|
-
"
|
|
129
|
+
"Asynchronous, non-blocking agent that can process multiple concurrent requests. Best for straightforward asynchronous agents that don't need durable execution. Good for asynchronous workflows, stateful applications, and multi-step analysis.",
|
|
130
130
|
)
|
|
131
131
|
table.add_row(
|
|
132
132
|
"[bold cyan]Async - Temporal[/bold cyan]",
|
|
133
|
-
"
|
|
133
|
+
"Asynchronous, non-blocking agent with durable execution for all steps. Best for production-grade agents that require complex multi-step tool calls, human-in-the-loop approvals, and long-running processes that require transactional reliability.",
|
|
134
134
|
)
|
|
135
135
|
table.add_row(
|
|
136
136
|
"[bold cyan]Sync ACP[/bold cyan]",
|
|
137
|
-
"
|
|
137
|
+
"Synchronous agent that processes one request per task with a simple request-response pattern. Best for low-latency use cases, FAQ bots, translation services, and data lookups.",
|
|
138
138
|
)
|
|
139
139
|
console.print()
|
|
140
140
|
console.print(table)
|
|
@@ -55,9 +55,8 @@ class TemporalStreamingHooks(RunHooks):
|
|
|
55
55
|
Power users can ignore this class and subclass agents.RunHooks directly for full control.
|
|
56
56
|
|
|
57
57
|
Note:
|
|
58
|
-
Tool arguments are
|
|
59
|
-
|
|
60
|
-
to the actual tool function. This is why arguments={} in ToolRequestContent.
|
|
58
|
+
Tool arguments are extracted from the ToolContext's tool_arguments field,
|
|
59
|
+
which contains a JSON string of the arguments passed to the tool.
|
|
61
60
|
|
|
62
61
|
Attributes:
|
|
63
62
|
task_id: The AgentEx task ID for routing streamed events
|
|
@@ -108,21 +107,30 @@ class TemporalStreamingHooks(RunHooks):
|
|
|
108
107
|
async def on_tool_start(self, context: RunContextWrapper, agent: Agent, tool: Tool) -> None: # noqa: ARG002
|
|
109
108
|
"""Stream tool request when a tool starts execution.
|
|
110
109
|
|
|
111
|
-
Extracts the tool_call_id from the context and streams a
|
|
112
|
-
message to the UI showing that the tool is about to execute.
|
|
113
|
-
|
|
114
|
-
Note: Tool arguments are not available in the hook context due to OpenAI SDK
|
|
115
|
-
design. The hook signature doesn't include tool arguments - they're passed
|
|
116
|
-
directly to the tool function instead. We send an empty dict as a placeholder.
|
|
110
|
+
Extracts the tool_call_id and tool_arguments from the context and streams a
|
|
111
|
+
ToolRequestContent message to the UI showing that the tool is about to execute.
|
|
117
112
|
|
|
118
113
|
Args:
|
|
119
|
-
context: The run context wrapper (will be a ToolContext with tool_call_id)
|
|
114
|
+
context: The run context wrapper (will be a ToolContext with tool_call_id and tool_arguments)
|
|
120
115
|
agent: The agent executing the tool
|
|
121
116
|
tool: The tool being executed
|
|
122
117
|
"""
|
|
118
|
+
import json
|
|
119
|
+
|
|
123
120
|
tool_context = context if isinstance(context, ToolContext) else None
|
|
124
121
|
tool_call_id = tool_context.tool_call_id if tool_context else f"call_{id(tool)}"
|
|
125
122
|
|
|
123
|
+
# Extract tool arguments from context
|
|
124
|
+
tool_arguments = {}
|
|
125
|
+
if tool_context and hasattr(tool_context, 'tool_arguments'):
|
|
126
|
+
try:
|
|
127
|
+
# tool_arguments is a JSON string, parse it
|
|
128
|
+
tool_arguments = json.loads(tool_context.tool_arguments)
|
|
129
|
+
except (json.JSONDecodeError, TypeError):
|
|
130
|
+
# If parsing fails, log and use empty dict
|
|
131
|
+
logger.warning(f"Failed to parse tool arguments: {tool_context.tool_arguments}")
|
|
132
|
+
tool_arguments = {}
|
|
133
|
+
|
|
126
134
|
await workflow.execute_activity_method(
|
|
127
135
|
stream_lifecycle_content,
|
|
128
136
|
args=[
|
|
@@ -131,7 +139,7 @@ class TemporalStreamingHooks(RunHooks):
|
|
|
131
139
|
author="agent",
|
|
132
140
|
tool_call_id=tool_call_id,
|
|
133
141
|
name=tool.name,
|
|
134
|
-
arguments=
|
|
142
|
+
arguments=tool_arguments, # Now properly extracted from context
|
|
135
143
|
),
|
|
136
144
|
],
|
|
137
145
|
start_to_close_timeout=self.timeout,
|
|
@@ -62,13 +62,62 @@ from agentex.lib.core.temporal.plugins.openai_agents.interceptors.context_interc
|
|
|
62
62
|
# Create logger for this module
|
|
63
63
|
logger = logging.getLogger("agentex.temporal.streaming")
|
|
64
64
|
|
|
65
|
+
|
|
66
|
+
def _serialize_item(item: Any) -> dict[str, Any]:
|
|
67
|
+
"""
|
|
68
|
+
Universal serializer for any item type from OpenAI Agents SDK.
|
|
69
|
+
|
|
70
|
+
Uses model_dump() for Pydantic models, otherwise extracts attributes manually.
|
|
71
|
+
Filters out internal Pydantic fields that can't be serialized.
|
|
72
|
+
"""
|
|
73
|
+
if hasattr(item, 'model_dump'):
|
|
74
|
+
# Pydantic model - use model_dump for proper serialization
|
|
75
|
+
try:
|
|
76
|
+
return item.model_dump(mode='json', exclude_unset=True)
|
|
77
|
+
except Exception:
|
|
78
|
+
# Fallback to dict conversion
|
|
79
|
+
return dict(item) if hasattr(item, '__iter__') else {}
|
|
80
|
+
else:
|
|
81
|
+
# Not a Pydantic model - extract attributes manually
|
|
82
|
+
item_dict = {}
|
|
83
|
+
for attr_name in dir(item):
|
|
84
|
+
if not attr_name.startswith('_') and attr_name not in ('model_fields', 'model_config', 'model_computed_fields'):
|
|
85
|
+
try:
|
|
86
|
+
attr_value = getattr(item, attr_name, None)
|
|
87
|
+
# Skip methods and None values
|
|
88
|
+
if attr_value is not None and not callable(attr_value):
|
|
89
|
+
# Convert to JSON-serializable format
|
|
90
|
+
if hasattr(attr_value, 'model_dump'):
|
|
91
|
+
item_dict[attr_name] = attr_value.model_dump()
|
|
92
|
+
elif isinstance(attr_value, (str, int, float, bool, list, dict)):
|
|
93
|
+
item_dict[attr_name] = attr_value
|
|
94
|
+
else:
|
|
95
|
+
item_dict[attr_name] = str(attr_value)
|
|
96
|
+
except Exception:
|
|
97
|
+
# Skip attributes that can't be accessed
|
|
98
|
+
pass
|
|
99
|
+
return item_dict
|
|
100
|
+
|
|
101
|
+
|
|
65
102
|
class TemporalStreamingModel(Model):
|
|
66
103
|
"""Custom model implementation with streaming support."""
|
|
67
104
|
|
|
68
|
-
def __init__(
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
105
|
+
def __init__(
|
|
106
|
+
self,
|
|
107
|
+
model_name: str = "gpt-4o",
|
|
108
|
+
_use_responses_api: bool = True,
|
|
109
|
+
openai_client: Optional[AsyncOpenAI] = None,
|
|
110
|
+
):
|
|
111
|
+
"""Initialize the streaming model with OpenAI client and model name.
|
|
112
|
+
|
|
113
|
+
Args:
|
|
114
|
+
model_name: The name of the OpenAI model to use (default: "gpt-4o")
|
|
115
|
+
_use_responses_api: Internal flag for responses API (deprecated, always True)
|
|
116
|
+
openai_client: Optional custom AsyncOpenAI client. If not provided, a default
|
|
117
|
+
client with max_retries=0 will be created (since Temporal handles retries)
|
|
118
|
+
"""
|
|
119
|
+
# Use provided client or create default (Temporal handles retries)
|
|
120
|
+
self.client = openai_client if openai_client is not None else AsyncOpenAI(max_retries=0)
|
|
72
121
|
self.model_name = model_name
|
|
73
122
|
# Always use Responses API for all models
|
|
74
123
|
self.use_responses_api = True
|
|
@@ -77,7 +126,7 @@ class TemporalStreamingModel(Model):
|
|
|
77
126
|
agentex_client = create_async_agentex_client()
|
|
78
127
|
self.tracer = AsyncTracer(agentex_client)
|
|
79
128
|
|
|
80
|
-
logger.info(f"[TemporalStreamingModel] Initialized model={self.model_name}, use_responses_api={self.use_responses_api}, tracer=initialized")
|
|
129
|
+
logger.info(f"[TemporalStreamingModel] Initialized model={self.model_name}, use_responses_api={self.use_responses_api}, custom_client={openai_client is not None}, tracer=initialized")
|
|
81
130
|
|
|
82
131
|
def _non_null_or_not_given(self, value: Any) -> Any:
|
|
83
132
|
"""Convert None to NOT_GIVEN sentinel, matching OpenAI SDK pattern."""
|
|
@@ -739,6 +788,35 @@ class TemporalStreamingModel(Model):
|
|
|
739
788
|
output_tokens_details=OutputTokensDetails(reasoning_tokens=len(''.join(reasoning_contents)) // 4), # Approximate
|
|
740
789
|
)
|
|
741
790
|
|
|
791
|
+
# Serialize response output items for span tracing
|
|
792
|
+
new_items = []
|
|
793
|
+
final_output = None
|
|
794
|
+
|
|
795
|
+
for item in response_output:
|
|
796
|
+
try:
|
|
797
|
+
item_dict = _serialize_item(item)
|
|
798
|
+
if item_dict:
|
|
799
|
+
new_items.append(item_dict)
|
|
800
|
+
|
|
801
|
+
# Extract final_output from message type if available
|
|
802
|
+
if item_dict.get('type') == 'message' and not final_output:
|
|
803
|
+
content = item_dict.get('content', [])
|
|
804
|
+
if content and isinstance(content, list):
|
|
805
|
+
for content_part in content:
|
|
806
|
+
if isinstance(content_part, dict) and 'text' in content_part:
|
|
807
|
+
final_output = content_part['text']
|
|
808
|
+
break
|
|
809
|
+
except Exception as e:
|
|
810
|
+
logger.warning(f"Failed to serialize item in temporal_streaming_model: {e}")
|
|
811
|
+
continue
|
|
812
|
+
|
|
813
|
+
# Set span output with structured data
|
|
814
|
+
if span:
|
|
815
|
+
span.output = {
|
|
816
|
+
"new_items": new_items,
|
|
817
|
+
"final_output": final_output,
|
|
818
|
+
}
|
|
819
|
+
|
|
742
820
|
# Return the response
|
|
743
821
|
return ModelResponse(
|
|
744
822
|
output=response_output,
|
|
@@ -7,9 +7,10 @@ context interceptor to access task_id, trace_id, and parent_span_id.
|
|
|
7
7
|
The key innovation is that these are thin wrappers around the standard OpenAI models,
|
|
8
8
|
avoiding code duplication while adding tracing capabilities.
|
|
9
9
|
"""
|
|
10
|
+
from __future__ import annotations
|
|
10
11
|
|
|
11
12
|
import logging
|
|
12
|
-
from typing import List, Union, Optional, override
|
|
13
|
+
from typing import Any, List, Union, Optional, override
|
|
13
14
|
|
|
14
15
|
from agents import (
|
|
15
16
|
Tool,
|
|
@@ -22,6 +23,7 @@ from agents import (
|
|
|
22
23
|
TResponseInputItem,
|
|
23
24
|
AgentOutputSchemaBase,
|
|
24
25
|
)
|
|
26
|
+
from openai import AsyncOpenAI
|
|
25
27
|
from openai.types.responses import ResponsePromptParam
|
|
26
28
|
from agents.models.openai_responses import OpenAIResponsesModel
|
|
27
29
|
from agents.models.openai_chatcompletions import OpenAIChatCompletionsModel
|
|
@@ -41,6 +43,42 @@ from agentex.lib.core.temporal.plugins.openai_agents.interceptors.context_interc
|
|
|
41
43
|
logger = logging.getLogger("agentex.temporal.tracing")
|
|
42
44
|
|
|
43
45
|
|
|
46
|
+
def _serialize_item(item: Any) -> dict[str, Any]:
|
|
47
|
+
"""
|
|
48
|
+
Universal serializer for any item type from OpenAI Agents SDK.
|
|
49
|
+
|
|
50
|
+
Uses model_dump() for Pydantic models, otherwise extracts attributes manually.
|
|
51
|
+
Filters out internal Pydantic fields that can't be serialized.
|
|
52
|
+
"""
|
|
53
|
+
if hasattr(item, 'model_dump'):
|
|
54
|
+
# Pydantic model - use model_dump for proper serialization
|
|
55
|
+
try:
|
|
56
|
+
return item.model_dump(mode='json', exclude_unset=True)
|
|
57
|
+
except Exception:
|
|
58
|
+
# Fallback to dict conversion
|
|
59
|
+
return dict(item) if hasattr(item, '__iter__') else {}
|
|
60
|
+
else:
|
|
61
|
+
# Not a Pydantic model - extract attributes manually
|
|
62
|
+
item_dict = {}
|
|
63
|
+
for attr_name in dir(item):
|
|
64
|
+
if not attr_name.startswith('_') and attr_name not in ('model_fields', 'model_config', 'model_computed_fields'):
|
|
65
|
+
try:
|
|
66
|
+
attr_value = getattr(item, attr_name, None)
|
|
67
|
+
# Skip methods and None values
|
|
68
|
+
if attr_value is not None and not callable(attr_value):
|
|
69
|
+
# Convert to JSON-serializable format
|
|
70
|
+
if hasattr(attr_value, 'model_dump'):
|
|
71
|
+
item_dict[attr_name] = attr_value.model_dump()
|
|
72
|
+
elif isinstance(attr_value, (str, int, float, bool, list, dict)):
|
|
73
|
+
item_dict[attr_name] = attr_value
|
|
74
|
+
else:
|
|
75
|
+
item_dict[attr_name] = str(attr_value)
|
|
76
|
+
except Exception:
|
|
77
|
+
# Skip attributes that can't be accessed
|
|
78
|
+
pass
|
|
79
|
+
return item_dict
|
|
80
|
+
|
|
81
|
+
|
|
44
82
|
class TemporalTracingModelProvider(OpenAIProvider):
|
|
45
83
|
"""Model provider that returns OpenAI models wrapped with AgentEx tracing.
|
|
46
84
|
|
|
@@ -49,17 +87,25 @@ class TemporalTracingModelProvider(OpenAIProvider):
|
|
|
49
87
|
the context interceptor enabled.
|
|
50
88
|
"""
|
|
51
89
|
|
|
52
|
-
def __init__(self,
|
|
90
|
+
def __init__(self, openai_client: Optional[AsyncOpenAI] = None, **kwargs):
|
|
53
91
|
"""Initialize the tracing model provider.
|
|
54
92
|
|
|
55
|
-
|
|
93
|
+
Args:
|
|
94
|
+
openai_client: Optional custom AsyncOpenAI client. If provided, this client
|
|
95
|
+
will be used for all model calls. If not provided, OpenAIProvider
|
|
96
|
+
will create a default client.
|
|
97
|
+
**kwargs: All other arguments are passed to OpenAIProvider.
|
|
56
98
|
"""
|
|
57
|
-
|
|
99
|
+
# Pass openai_client to parent if provided
|
|
100
|
+
if openai_client is not None:
|
|
101
|
+
super().__init__(openai_client=openai_client, **kwargs)
|
|
102
|
+
else:
|
|
103
|
+
super().__init__(**kwargs)
|
|
58
104
|
|
|
59
105
|
# Initialize tracer for all models
|
|
60
106
|
agentex_client = create_async_agentex_client()
|
|
61
107
|
self._tracer = AsyncTracer(agentex_client)
|
|
62
|
-
logger.info("[TemporalTracingModelProvider] Initialized with AgentEx tracer")
|
|
108
|
+
logger.info(f"[TemporalTracingModelProvider] Initialized with AgentEx tracer, custom_client={openai_client is not None}")
|
|
63
109
|
|
|
64
110
|
@override
|
|
65
111
|
def get_model(self, model_name: Optional[str]) -> Model:
|
|
@@ -171,15 +217,35 @@ class TemporalTracingResponsesModel(Model):
|
|
|
171
217
|
**kwargs,
|
|
172
218
|
)
|
|
173
219
|
|
|
174
|
-
#
|
|
220
|
+
# Serialize response output items for span tracing
|
|
221
|
+
new_items = []
|
|
222
|
+
final_output = None
|
|
223
|
+
|
|
224
|
+
if hasattr(response, 'output') and response.output:
|
|
225
|
+
response_output = response.output if isinstance(response.output, list) else [response.output]
|
|
226
|
+
|
|
227
|
+
for item in response_output:
|
|
228
|
+
try:
|
|
229
|
+
item_dict = _serialize_item(item)
|
|
230
|
+
if item_dict:
|
|
231
|
+
new_items.append(item_dict)
|
|
232
|
+
|
|
233
|
+
# Extract final_output from message type if available
|
|
234
|
+
if item_dict.get('type') == 'message' and not final_output:
|
|
235
|
+
content = item_dict.get('content', [])
|
|
236
|
+
if content and isinstance(content, list):
|
|
237
|
+
for content_part in content:
|
|
238
|
+
if isinstance(content_part, dict) and 'text' in content_part:
|
|
239
|
+
final_output = content_part['text']
|
|
240
|
+
break
|
|
241
|
+
except Exception as e:
|
|
242
|
+
logger.warning(f"Failed to serialize item in temporal tracing model: {e}")
|
|
243
|
+
continue
|
|
244
|
+
|
|
245
|
+
# Set span output with structured data
|
|
175
246
|
span.output = { # type: ignore[attr-defined]
|
|
176
|
-
"
|
|
177
|
-
"
|
|
178
|
-
"usage": {
|
|
179
|
-
"input_tokens": response.usage.input_tokens if response.usage else None,
|
|
180
|
-
"output_tokens": response.usage.output_tokens if response.usage else None,
|
|
181
|
-
"total_tokens": response.usage.total_tokens if response.usage else None,
|
|
182
|
-
} if response.usage else None,
|
|
247
|
+
"new_items": new_items,
|
|
248
|
+
"final_output": final_output,
|
|
183
249
|
}
|
|
184
250
|
|
|
185
251
|
return response
|
|
@@ -284,15 +350,35 @@ class TemporalTracingChatCompletionsModel(Model):
|
|
|
284
350
|
**kwargs,
|
|
285
351
|
)
|
|
286
352
|
|
|
287
|
-
#
|
|
353
|
+
# Serialize response output items for span tracing
|
|
354
|
+
new_items = []
|
|
355
|
+
final_output = None
|
|
356
|
+
|
|
357
|
+
if hasattr(response, 'output') and response.output:
|
|
358
|
+
response_output = response.output if isinstance(response.output, list) else [response.output]
|
|
359
|
+
|
|
360
|
+
for item in response_output:
|
|
361
|
+
try:
|
|
362
|
+
item_dict = _serialize_item(item)
|
|
363
|
+
if item_dict:
|
|
364
|
+
new_items.append(item_dict)
|
|
365
|
+
|
|
366
|
+
# Extract final_output from message type if available
|
|
367
|
+
if item_dict.get('type') == 'message' and not final_output:
|
|
368
|
+
content = item_dict.get('content', [])
|
|
369
|
+
if content and isinstance(content, list):
|
|
370
|
+
for content_part in content:
|
|
371
|
+
if isinstance(content_part, dict) and 'text' in content_part:
|
|
372
|
+
final_output = content_part['text']
|
|
373
|
+
break
|
|
374
|
+
except Exception as e:
|
|
375
|
+
logger.warning(f"Failed to serialize item in temporal tracing model: {e}")
|
|
376
|
+
continue
|
|
377
|
+
|
|
378
|
+
# Set span output with structured data
|
|
288
379
|
span.output = { # type: ignore[attr-defined]
|
|
289
|
-
"
|
|
290
|
-
"
|
|
291
|
-
"usage": {
|
|
292
|
-
"input_tokens": response.usage.input_tokens if response.usage else None,
|
|
293
|
-
"output_tokens": response.usage.output_tokens if response.usage else None,
|
|
294
|
-
"total_tokens": response.usage.total_tokens if response.usage else None,
|
|
295
|
-
} if response.usage else None,
|
|
380
|
+
"new_items": new_items,
|
|
381
|
+
"final_output": final_output,
|
|
296
382
|
}
|
|
297
383
|
|
|
298
384
|
return response
|
agentex/resources/__init__.py
CHANGED
|
@@ -56,6 +56,14 @@ from .messages import (
|
|
|
56
56
|
MessagesResourceWithStreamingResponse,
|
|
57
57
|
AsyncMessagesResourceWithStreamingResponse,
|
|
58
58
|
)
|
|
59
|
+
from .deployment_history import (
|
|
60
|
+
DeploymentHistoryResource,
|
|
61
|
+
AsyncDeploymentHistoryResource,
|
|
62
|
+
DeploymentHistoryResourceWithRawResponse,
|
|
63
|
+
AsyncDeploymentHistoryResourceWithRawResponse,
|
|
64
|
+
DeploymentHistoryResourceWithStreamingResponse,
|
|
65
|
+
AsyncDeploymentHistoryResourceWithStreamingResponse,
|
|
66
|
+
)
|
|
59
67
|
|
|
60
68
|
__all__ = [
|
|
61
69
|
"AgentsResource",
|
|
@@ -100,4 +108,10 @@ __all__ = [
|
|
|
100
108
|
"AsyncTrackerResourceWithRawResponse",
|
|
101
109
|
"TrackerResourceWithStreamingResponse",
|
|
102
110
|
"AsyncTrackerResourceWithStreamingResponse",
|
|
111
|
+
"DeploymentHistoryResource",
|
|
112
|
+
"AsyncDeploymentHistoryResource",
|
|
113
|
+
"DeploymentHistoryResourceWithRawResponse",
|
|
114
|
+
"AsyncDeploymentHistoryResourceWithRawResponse",
|
|
115
|
+
"DeploymentHistoryResourceWithStreamingResponse",
|
|
116
|
+
"AsyncDeploymentHistoryResourceWithStreamingResponse",
|
|
103
117
|
]
|
|
@@ -0,0 +1,272 @@
|
|
|
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 deployment_history_list_params
|
|
10
|
+
from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
|
|
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.deployment_history import DeploymentHistory
|
|
22
|
+
from ..types.deployment_history_list_response import DeploymentHistoryListResponse
|
|
23
|
+
|
|
24
|
+
__all__ = ["DeploymentHistoryResource", "AsyncDeploymentHistoryResource"]
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
class DeploymentHistoryResource(SyncAPIResource):
|
|
28
|
+
@cached_property
|
|
29
|
+
def with_raw_response(self) -> DeploymentHistoryResourceWithRawResponse:
|
|
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/scale-agentex-python#accessing-raw-response-data-eg-headers
|
|
35
|
+
"""
|
|
36
|
+
return DeploymentHistoryResourceWithRawResponse(self)
|
|
37
|
+
|
|
38
|
+
@cached_property
|
|
39
|
+
def with_streaming_response(self) -> DeploymentHistoryResourceWithStreamingResponse:
|
|
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/scale-agentex-python#with_streaming_response
|
|
44
|
+
"""
|
|
45
|
+
return DeploymentHistoryResourceWithStreamingResponse(self)
|
|
46
|
+
|
|
47
|
+
def retrieve(
|
|
48
|
+
self,
|
|
49
|
+
deployment_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
|
+
) -> DeploymentHistory:
|
|
58
|
+
"""
|
|
59
|
+
Get a deployment record by its unique 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 deployment_id:
|
|
71
|
+
raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}")
|
|
72
|
+
return self._get(
|
|
73
|
+
f"/deployment-history/{deployment_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=DeploymentHistory,
|
|
78
|
+
)
|
|
79
|
+
|
|
80
|
+
def list(
|
|
81
|
+
self,
|
|
82
|
+
*,
|
|
83
|
+
agent_id: Optional[str] | Omit = omit,
|
|
84
|
+
agent_name: Optional[str] | Omit = omit,
|
|
85
|
+
limit: int | Omit = omit,
|
|
86
|
+
page_number: int | Omit = omit,
|
|
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
|
+
) -> DeploymentHistoryListResponse:
|
|
94
|
+
"""
|
|
95
|
+
List deployment history for an agent.
|
|
96
|
+
|
|
97
|
+
Args:
|
|
98
|
+
extra_headers: Send extra headers
|
|
99
|
+
|
|
100
|
+
extra_query: Add additional query parameters to the request
|
|
101
|
+
|
|
102
|
+
extra_body: Add additional JSON properties to the request
|
|
103
|
+
|
|
104
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
105
|
+
"""
|
|
106
|
+
return self._get(
|
|
107
|
+
"/deployment-history",
|
|
108
|
+
options=make_request_options(
|
|
109
|
+
extra_headers=extra_headers,
|
|
110
|
+
extra_query=extra_query,
|
|
111
|
+
extra_body=extra_body,
|
|
112
|
+
timeout=timeout,
|
|
113
|
+
query=maybe_transform(
|
|
114
|
+
{
|
|
115
|
+
"agent_id": agent_id,
|
|
116
|
+
"agent_name": agent_name,
|
|
117
|
+
"limit": limit,
|
|
118
|
+
"page_number": page_number,
|
|
119
|
+
},
|
|
120
|
+
deployment_history_list_params.DeploymentHistoryListParams,
|
|
121
|
+
),
|
|
122
|
+
),
|
|
123
|
+
cast_to=DeploymentHistoryListResponse,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
class AsyncDeploymentHistoryResource(AsyncAPIResource):
|
|
128
|
+
@cached_property
|
|
129
|
+
def with_raw_response(self) -> AsyncDeploymentHistoryResourceWithRawResponse:
|
|
130
|
+
"""
|
|
131
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
132
|
+
the raw response object instead of the parsed content.
|
|
133
|
+
|
|
134
|
+
For more information, see https://www.github.com/scaleapi/scale-agentex-python#accessing-raw-response-data-eg-headers
|
|
135
|
+
"""
|
|
136
|
+
return AsyncDeploymentHistoryResourceWithRawResponse(self)
|
|
137
|
+
|
|
138
|
+
@cached_property
|
|
139
|
+
def with_streaming_response(self) -> AsyncDeploymentHistoryResourceWithStreamingResponse:
|
|
140
|
+
"""
|
|
141
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
142
|
+
|
|
143
|
+
For more information, see https://www.github.com/scaleapi/scale-agentex-python#with_streaming_response
|
|
144
|
+
"""
|
|
145
|
+
return AsyncDeploymentHistoryResourceWithStreamingResponse(self)
|
|
146
|
+
|
|
147
|
+
async def retrieve(
|
|
148
|
+
self,
|
|
149
|
+
deployment_id: str,
|
|
150
|
+
*,
|
|
151
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
152
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
153
|
+
extra_headers: Headers | None = None,
|
|
154
|
+
extra_query: Query | None = None,
|
|
155
|
+
extra_body: Body | None = None,
|
|
156
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
157
|
+
) -> DeploymentHistory:
|
|
158
|
+
"""
|
|
159
|
+
Get a deployment record by its unique ID.
|
|
160
|
+
|
|
161
|
+
Args:
|
|
162
|
+
extra_headers: Send extra headers
|
|
163
|
+
|
|
164
|
+
extra_query: Add additional query parameters to the request
|
|
165
|
+
|
|
166
|
+
extra_body: Add additional JSON properties to the request
|
|
167
|
+
|
|
168
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
169
|
+
"""
|
|
170
|
+
if not deployment_id:
|
|
171
|
+
raise ValueError(f"Expected a non-empty value for `deployment_id` but received {deployment_id!r}")
|
|
172
|
+
return await self._get(
|
|
173
|
+
f"/deployment-history/{deployment_id}",
|
|
174
|
+
options=make_request_options(
|
|
175
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
176
|
+
),
|
|
177
|
+
cast_to=DeploymentHistory,
|
|
178
|
+
)
|
|
179
|
+
|
|
180
|
+
async def list(
|
|
181
|
+
self,
|
|
182
|
+
*,
|
|
183
|
+
agent_id: Optional[str] | Omit = omit,
|
|
184
|
+
agent_name: Optional[str] | Omit = omit,
|
|
185
|
+
limit: int | Omit = omit,
|
|
186
|
+
page_number: int | Omit = omit,
|
|
187
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
188
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
189
|
+
extra_headers: Headers | None = None,
|
|
190
|
+
extra_query: Query | None = None,
|
|
191
|
+
extra_body: Body | None = None,
|
|
192
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
193
|
+
) -> DeploymentHistoryListResponse:
|
|
194
|
+
"""
|
|
195
|
+
List deployment history for an agent.
|
|
196
|
+
|
|
197
|
+
Args:
|
|
198
|
+
extra_headers: Send extra headers
|
|
199
|
+
|
|
200
|
+
extra_query: Add additional query parameters to the request
|
|
201
|
+
|
|
202
|
+
extra_body: Add additional JSON properties to the request
|
|
203
|
+
|
|
204
|
+
timeout: Override the client-level default timeout for this request, in seconds
|
|
205
|
+
"""
|
|
206
|
+
return await self._get(
|
|
207
|
+
"/deployment-history",
|
|
208
|
+
options=make_request_options(
|
|
209
|
+
extra_headers=extra_headers,
|
|
210
|
+
extra_query=extra_query,
|
|
211
|
+
extra_body=extra_body,
|
|
212
|
+
timeout=timeout,
|
|
213
|
+
query=await async_maybe_transform(
|
|
214
|
+
{
|
|
215
|
+
"agent_id": agent_id,
|
|
216
|
+
"agent_name": agent_name,
|
|
217
|
+
"limit": limit,
|
|
218
|
+
"page_number": page_number,
|
|
219
|
+
},
|
|
220
|
+
deployment_history_list_params.DeploymentHistoryListParams,
|
|
221
|
+
),
|
|
222
|
+
),
|
|
223
|
+
cast_to=DeploymentHistoryListResponse,
|
|
224
|
+
)
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
class DeploymentHistoryResourceWithRawResponse:
|
|
228
|
+
def __init__(self, deployment_history: DeploymentHistoryResource) -> None:
|
|
229
|
+
self._deployment_history = deployment_history
|
|
230
|
+
|
|
231
|
+
self.retrieve = to_raw_response_wrapper(
|
|
232
|
+
deployment_history.retrieve,
|
|
233
|
+
)
|
|
234
|
+
self.list = to_raw_response_wrapper(
|
|
235
|
+
deployment_history.list,
|
|
236
|
+
)
|
|
237
|
+
|
|
238
|
+
|
|
239
|
+
class AsyncDeploymentHistoryResourceWithRawResponse:
|
|
240
|
+
def __init__(self, deployment_history: AsyncDeploymentHistoryResource) -> None:
|
|
241
|
+
self._deployment_history = deployment_history
|
|
242
|
+
|
|
243
|
+
self.retrieve = async_to_raw_response_wrapper(
|
|
244
|
+
deployment_history.retrieve,
|
|
245
|
+
)
|
|
246
|
+
self.list = async_to_raw_response_wrapper(
|
|
247
|
+
deployment_history.list,
|
|
248
|
+
)
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
class DeploymentHistoryResourceWithStreamingResponse:
|
|
252
|
+
def __init__(self, deployment_history: DeploymentHistoryResource) -> None:
|
|
253
|
+
self._deployment_history = deployment_history
|
|
254
|
+
|
|
255
|
+
self.retrieve = to_streamed_response_wrapper(
|
|
256
|
+
deployment_history.retrieve,
|
|
257
|
+
)
|
|
258
|
+
self.list = to_streamed_response_wrapper(
|
|
259
|
+
deployment_history.list,
|
|
260
|
+
)
|
|
261
|
+
|
|
262
|
+
|
|
263
|
+
class AsyncDeploymentHistoryResourceWithStreamingResponse:
|
|
264
|
+
def __init__(self, deployment_history: AsyncDeploymentHistoryResource) -> None:
|
|
265
|
+
self._deployment_history = deployment_history
|
|
266
|
+
|
|
267
|
+
self.retrieve = async_to_streamed_response_wrapper(
|
|
268
|
+
deployment_history.retrieve,
|
|
269
|
+
)
|
|
270
|
+
self.list = async_to_streamed_response_wrapper(
|
|
271
|
+
deployment_history.list,
|
|
272
|
+
)
|
agentex/types/__init__.py
CHANGED
|
@@ -28,6 +28,7 @@ from .state_list_params import StateListParams as StateListParams
|
|
|
28
28
|
from .agent_rpc_response import AgentRpcResponse as AgentRpcResponse
|
|
29
29
|
from .agent_task_tracker import AgentTaskTracker as AgentTaskTracker
|
|
30
30
|
from .data_content_param import DataContentParam as DataContentParam
|
|
31
|
+
from .deployment_history import DeploymentHistory as DeploymentHistory
|
|
31
32
|
from .span_create_params import SpanCreateParams as SpanCreateParams
|
|
32
33
|
from .span_list_response import SpanListResponse as SpanListResponse
|
|
33
34
|
from .span_update_params import SpanUpdateParams as SpanUpdateParams
|
|
@@ -62,4 +63,6 @@ from .task_message_content_param import TaskMessageContentParam as TaskMessageCo
|
|
|
62
63
|
from .tool_request_content_param import ToolRequestContentParam as ToolRequestContentParam
|
|
63
64
|
from .tool_response_content_param import ToolResponseContentParam as ToolResponseContentParam
|
|
64
65
|
from .task_retrieve_by_name_params import TaskRetrieveByNameParams as TaskRetrieveByNameParams
|
|
66
|
+
from .deployment_history_list_params import DeploymentHistoryListParams as DeploymentHistoryListParams
|
|
65
67
|
from .task_retrieve_by_name_response import TaskRetrieveByNameResponse as TaskRetrieveByNameResponse
|
|
68
|
+
from .deployment_history_list_response import DeploymentHistoryListResponse as DeploymentHistoryListResponse
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
|
|
5
|
+
from .._models import BaseModel
|
|
6
|
+
|
|
7
|
+
__all__ = ["DeploymentHistory"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class DeploymentHistory(BaseModel):
|
|
11
|
+
id: str
|
|
12
|
+
"""The unique identifier of the deployment record"""
|
|
13
|
+
|
|
14
|
+
agent_id: str
|
|
15
|
+
"""The ID of the agent this deployment belongs to"""
|
|
16
|
+
|
|
17
|
+
author_email: str
|
|
18
|
+
"""Email of the commit author"""
|
|
19
|
+
|
|
20
|
+
author_name: str
|
|
21
|
+
"""Name of the commit author"""
|
|
22
|
+
|
|
23
|
+
branch_name: str
|
|
24
|
+
"""Name of the branch"""
|
|
25
|
+
|
|
26
|
+
build_timestamp: datetime
|
|
27
|
+
"""When the build was created"""
|
|
28
|
+
|
|
29
|
+
commit_hash: str
|
|
30
|
+
"""Git commit hash for this deployment"""
|
|
31
|
+
|
|
32
|
+
deployment_timestamp: datetime
|
|
33
|
+
"""When this deployment was first seen in the system"""
|
|
@@ -0,0 +1,18 @@
|
|
|
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__ = ["DeploymentHistoryListParams"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class DeploymentHistoryListParams(TypedDict, total=False):
|
|
12
|
+
agent_id: Optional[str]
|
|
13
|
+
|
|
14
|
+
agent_name: Optional[str]
|
|
15
|
+
|
|
16
|
+
limit: int
|
|
17
|
+
|
|
18
|
+
page_number: int
|
|
@@ -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 .deployment_history import DeploymentHistory
|
|
7
|
+
|
|
8
|
+
__all__ = ["DeploymentHistoryListResponse"]
|
|
9
|
+
|
|
10
|
+
DeploymentHistoryListResponse: TypeAlias = List[DeploymentHistory]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: agentex-sdk
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.3
|
|
4
4
|
Summary: The official Python library for the agentex API
|
|
5
5
|
Project-URL: Homepage, https://github.com/scaleapi/scale-agentex-python
|
|
6
6
|
Project-URL: Repository, https://github.com/scaleapi/scale-agentex-python
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
agentex/__init__.py,sha256=TvS8DtvGAnubcoUjYIsuCpBzpsdpxBaJCS76s-l-PRo,2712
|
|
2
2
|
agentex/_base_client.py,sha256=g9DKGvDYgnfB-j2mI6ZigM-mIIwQIlTrsLl4wMgkpyI,67048
|
|
3
|
-
agentex/_client.py,sha256=
|
|
3
|
+
agentex/_client.py,sha256=7F6gjeSIunCDoqfsJoLYpfIsGzv95Q-Y1ewI0-fp96k,21388
|
|
4
4
|
agentex/_compat.py,sha256=DQBVORjFb33zch24jzkhM14msvnzY7mmSmgDLaVFUM8,6562
|
|
5
5
|
agentex/_constants.py,sha256=oGldMuFz7eZtwD8_6rJUippKhZB5fGSA7ffbCDGourA,466
|
|
6
6
|
agentex/_exceptions.py,sha256=B09aFjWFRSShb9BFJd-MNDblsGDyGk3w-vItYmjg_AI,3222
|
|
@@ -11,7 +11,7 @@ agentex/_resource.py,sha256=S1t7wmR5WUvoDIhZjo_x-E7uoTJBynJ3d8tPJMQYdjw,1106
|
|
|
11
11
|
agentex/_response.py,sha256=Tb9zazsnemO2rTxWtBjAD5WBqlhli5ZaXGbiKgdu5DE,28794
|
|
12
12
|
agentex/_streaming.py,sha256=p-m2didLkbw_VBZsP4QqeIPc2haAdGZmB0BOU3gUM2A,10153
|
|
13
13
|
agentex/_types.py,sha256=F6X63N7bOstytAtVqJ9Yl7T_JbR9Od2MJfZ_iK5DqOY,7237
|
|
14
|
-
agentex/_version.py,sha256=
|
|
14
|
+
agentex/_version.py,sha256=c2fQYF_Uula9lejrW5sHf4Mfcdn6IMrnCDZlp3EDgno,159
|
|
15
15
|
agentex/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
16
16
|
agentex/_utils/__init__.py,sha256=7fch0GT9zpNnErbciSpUNa-SjTxxjY6kxHxKMOM4AGs,2305
|
|
17
17
|
agentex/_utils/_compat.py,sha256=D8gtAvjJQrDWt9upS0XaG9Rr5l1QhiAx_I_1utT_tt0,1195
|
|
@@ -43,7 +43,7 @@ agentex/lib/adk/_modules/tracing.py,sha256=LZvItZg2ALZZMvJasrsGEBgss4wnXGMnL_lw0
|
|
|
43
43
|
agentex/lib/adk/providers/__init__.py,sha256=bOS-D_lXV3QXRtGKrUvsYb2ZAcZG51ZAtHdfiHgYN-M,306
|
|
44
44
|
agentex/lib/adk/providers/_modules/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
45
45
|
agentex/lib/adk/providers/_modules/litellm.py,sha256=6eOdEpd1g9ZljQHXtIokjGymlFpnaw2g8ow11hldovo,9470
|
|
46
|
-
agentex/lib/adk/providers/_modules/openai.py,sha256=
|
|
46
|
+
agentex/lib/adk/providers/_modules/openai.py,sha256=rguTE4uGLodqr8zx5GRRtSkcWC9llNA1kUFKF0yhdK0,23679
|
|
47
47
|
agentex/lib/adk/providers/_modules/sgp.py,sha256=x64axb0oVmVh5W8hwpnMMPqxad2HySf2DYHPxRNwjck,3208
|
|
48
48
|
agentex/lib/adk/providers/_modules/sync_provider.py,sha256=9RQ_gMICiUN97bvnbVnVypiKoalCeiUiqonn3nKAjwU,26324
|
|
49
49
|
agentex/lib/adk/utils/__init__.py,sha256=7f6ayV0_fqyw5cwzVANNcZWGJZ-vrrYtZ0qi7KKBRFs,130
|
|
@@ -53,7 +53,7 @@ agentex/lib/adk/utils/_modules/templating.py,sha256=tSiJGoDrF-XkMEi4MB_wVH6nyKyh
|
|
|
53
53
|
agentex/lib/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
54
54
|
agentex/lib/cli/commands/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
55
55
|
agentex/lib/cli/commands/agents.py,sha256=E6O7p3B3P4yX-oYWRtzfbEyI5Pws-yzFi-htYJ7B_kY,14079
|
|
56
|
-
agentex/lib/cli/commands/init.py,sha256=
|
|
56
|
+
agentex/lib/cli/commands/init.py,sha256=u2FaPXJD-cJ2dYgdkqDCQezXJXV9-mPtp9_ygOGOsNA,14841
|
|
57
57
|
agentex/lib/cli/commands/main.py,sha256=QWychw-Xq3nQ00BMypgOEF4w1WauNrgQ06PDardNP_8,1042
|
|
58
58
|
agentex/lib/cli/commands/secrets.py,sha256=t4zvoyjOHmw-8qp6nsxdZCvqy43QXOl0MWXA3ooBO6Q,5640
|
|
59
59
|
agentex/lib/cli/commands/tasks.py,sha256=fvZJjYI8Dh-6nbTVpRa2-VdF6A8D4w3Dmd4tMslSTPI,3741
|
|
@@ -167,12 +167,12 @@ agentex/lib/core/temporal/plugins/openai_agents/README.md,sha256=FzvW3xM7dCvdxq2
|
|
|
167
167
|
agentex/lib/core/temporal/plugins/openai_agents/__init__.py,sha256=ZLHVA3LAkPDvRQlSLnJlPs0sDzqy6sUtwlapoG02Hyw,3174
|
|
168
168
|
agentex/lib/core/temporal/plugins/openai_agents/hooks/__init__.py,sha256=soOuozGd7H9uWSwwjA60psUGtRR4xQ6e4wfoQbr73Fo,483
|
|
169
169
|
agentex/lib/core/temporal/plugins/openai_agents/hooks/activities.py,sha256=APpAOZQ90kbhaNpJ6pAeZ2mxxcPx37AchCuLJzeGzB0,3088
|
|
170
|
-
agentex/lib/core/temporal/plugins/openai_agents/hooks/hooks.py,sha256=
|
|
170
|
+
agentex/lib/core/temporal/plugins/openai_agents/hooks/hooks.py,sha256=qbB6RLPlveEIIfziXZBRMkaPJQMQBPsovIX_yM4QuWU,8100
|
|
171
171
|
agentex/lib/core/temporal/plugins/openai_agents/interceptors/__init__.py,sha256=hrj6lRPi9nb_HAohRK4oPnaji69QQ6brj-Wu2q0mU0s,521
|
|
172
172
|
agentex/lib/core/temporal/plugins/openai_agents/interceptors/context_interceptor.py,sha256=sBLJonJJ5Ke1BJIlzbqtGeO5p8NIbvftbEYQbjgeZCE,7256
|
|
173
173
|
agentex/lib/core/temporal/plugins/openai_agents/models/__init__.py,sha256=FeTt91JkSfYLlCTdrVFpjcQ0asbQyCd6Rl5efqZkslo,791
|
|
174
|
-
agentex/lib/core/temporal/plugins/openai_agents/models/temporal_streaming_model.py,sha256=
|
|
175
|
-
agentex/lib/core/temporal/plugins/openai_agents/models/temporal_tracing_model.py,sha256=
|
|
174
|
+
agentex/lib/core/temporal/plugins/openai_agents/models/temporal_streaming_model.py,sha256=ZODPIUuvSZO5eYhByMv2n87SOKYjAh9JunkJm8ECRPQ,42310
|
|
175
|
+
agentex/lib/core/temporal/plugins/openai_agents/models/temporal_tracing_model.py,sha256=BiuIhSvyNfocwMYQtxOoqgMpyJsMHLkyXzYPYnw4ChA,17458
|
|
176
176
|
agentex/lib/core/temporal/plugins/openai_agents/tests/__init__.py,sha256=suEVJuonfBoVZ3IqdO0UMn0hkFFzDqRoso0VEOit-KQ,80
|
|
177
177
|
agentex/lib/core/temporal/plugins/openai_agents/tests/conftest.py,sha256=oMI_3dVn6DoiLgCjRVUeQE_Z2Gz3tGTwPxTQ1krjKSE,7692
|
|
178
178
|
agentex/lib/core/temporal/plugins/openai_agents/tests/test_streaming_model.py,sha256=w8rkQbn3j_f9GZSXHl5j8FMDPaBQ3wED-BFzxQaeBIc,32909
|
|
@@ -248,8 +248,9 @@ agentex/lib/utils/registration.py,sha256=eMumlbRgf6Bo8I2Q2D3qX1x8vII3FiliDxYnDj9
|
|
|
248
248
|
agentex/lib/utils/temporal.py,sha256=sXo8OPMMXiyrF7OSBCJBuN_ufyQOD2bLOXgDbVZoyds,292
|
|
249
249
|
agentex/lib/utils/dev_tools/__init__.py,sha256=oaHxw6ymfhNql-kzXHv3NWVHuqD4fHumasNXJG7kHTU,261
|
|
250
250
|
agentex/lib/utils/dev_tools/async_messages.py,sha256=X1L60LyCSCdhtBw5Sn8ELoMadA1xuEPo_VxyemM9tm0,20083
|
|
251
|
-
agentex/resources/__init__.py,sha256=
|
|
251
|
+
agentex/resources/__init__.py,sha256=RJUjEci2NLCmT00h5MbsMx1x_P5v9VQabKaconwza1c,3859
|
|
252
252
|
agentex/resources/agents.py,sha256=ABj4CXuL3K5A-A12qUlkzrRTCKPL-tF-WLwsTYwNC88,47794
|
|
253
|
+
agentex/resources/deployment_history.py,sha256=uRVhjVyu_UWyJgJ2EGOQbC1pdn-RleposC4ZbpvNF6c,10527
|
|
253
254
|
agentex/resources/events.py,sha256=jbaP-a8nouqOHGVWhLvUEtHN5Um8-oaiB4W1VrkSX-0,10412
|
|
254
255
|
agentex/resources/spans.py,sha256=805_ZnBhphdBiO8c2939xVUT4k5gZiZutfH5xBQx8OQ,21246
|
|
255
256
|
agentex/resources/states.py,sha256=kT1M8GNu6UiHXl-o8kPzPdLhqpPfPtKVNMrTpkOvcQM,19714
|
|
@@ -258,7 +259,7 @@ agentex/resources/tracker.py,sha256=gdYdbKpFSwttLpkme5E9PnMU1ITxmQOGepYbXYNNWAM,
|
|
|
258
259
|
agentex/resources/messages/__init__.py,sha256=_J1eusFtr_k6zrAntJSuqx6LWEUBSTrV1OZZh7MaDPE,1015
|
|
259
260
|
agentex/resources/messages/batch.py,sha256=bYDIf0ZF3-sTKnGfFmzFQUn8LMtMYoniY977J3zr8q8,9653
|
|
260
261
|
agentex/resources/messages/messages.py,sha256=JhdPPGyoBE4UzVx8hugkMJItx_wCNdShpzHCg8B6O68,18076
|
|
261
|
-
agentex/types/__init__.py,sha256=
|
|
262
|
+
agentex/types/__init__.py,sha256=JEDsom9CZpig5AWGV5UH_JRQ7ewW7_q1DUP6TQnnioI,4519
|
|
262
263
|
agentex/types/acp_type.py,sha256=lEn_w4z-RIgyUVTQr8mm5l9OdFDQMDclbJU_lKa4Mi8,217
|
|
263
264
|
agentex/types/agent.py,sha256=hwgmtylJYezzmGJbzbBQ7sn3oV2_bCZqgqlNq9WpZ0g,1318
|
|
264
265
|
agentex/types/agent_list_params.py,sha256=7dGaeOTuGNzwliqAoxk1g1Z0LRD8XEWKYPvnBOLbsSY,392
|
|
@@ -271,6 +272,9 @@ agentex/types/agent_task_tracker.py,sha256=JK1kmQ7LIx1eWC-XaU2pJcIvdtQCmEn21dsJT
|
|
|
271
272
|
agentex/types/data_content.py,sha256=EaGplLRZgCgaHnt-3KEAj1yFiAlOFODprpA8I1oiF3s,776
|
|
272
273
|
agentex/types/data_content_param.py,sha256=5NtD2mcP1VfQJHcUCxgarzd4bwa07Ym2UIYqFWfAcbo,824
|
|
273
274
|
agentex/types/data_delta.py,sha256=q3doAofriE7bQT3R-LbC8VYepytCoUOgHwJ6kWcJjr4,322
|
|
275
|
+
agentex/types/deployment_history.py,sha256=SZiIB9tfUdqIuEgPN6WVlQ8oK64RtbC6TeUHewpQB50,767
|
|
276
|
+
agentex/types/deployment_history_list_params.py,sha256=95H7arVPTPH720CUmmMqmkV0jzvS-8ab3ocnnnef47Q,392
|
|
277
|
+
agentex/types/deployment_history_list_response.py,sha256=Hjw8WGYd4Qgv8tz7Fo6sA-gvNP3aBn0Axtj3h0U_ln8,315
|
|
274
278
|
agentex/types/event.py,sha256=ilYXj7HlPDrgtQnh4YsgQrTXN-BxE7sOgi2ZorKYHdc,700
|
|
275
279
|
agentex/types/event_list_params.py,sha256=Rrz0yo2w3gMTNYe3HQS9YCX1VktE_aaktuHezxoyMbA,594
|
|
276
280
|
agentex/types/event_list_response.py,sha256=rjUCkwS0pXnfqHEVPEKZdLIGJ14uXOrjatuOfR36s5s,254
|
|
@@ -326,8 +330,8 @@ agentex/types/messages/batch_update_params.py,sha256=Ug5CThbD49a8j4qucg04OdmVrp_
|
|
|
326
330
|
agentex/types/messages/batch_update_response.py,sha256=TbSBe6SuPzjXXWSj-nRjT1JHGBooTshHQQDa1AixQA8,278
|
|
327
331
|
agentex/types/shared/__init__.py,sha256=IKs-Qn5Yja0kFh1G1kDqYZo43qrOu1hSoxlPdN-85dI,149
|
|
328
332
|
agentex/types/shared/delete_response.py,sha256=8qH3zvQXaOHYQSHyXi7UQxdR4miTzR7V9K4zXVsiUyk,215
|
|
329
|
-
agentex_sdk-0.6.
|
|
330
|
-
agentex_sdk-0.6.
|
|
331
|
-
agentex_sdk-0.6.
|
|
332
|
-
agentex_sdk-0.6.
|
|
333
|
-
agentex_sdk-0.6.
|
|
333
|
+
agentex_sdk-0.6.3.dist-info/METADATA,sha256=FPfO3b3DUDmtZvVDGhsammLJgD_PlhwLG-zQqo7DzKI,15375
|
|
334
|
+
agentex_sdk-0.6.3.dist-info/WHEEL,sha256=C2FUgwZgiLbznR-k0b_5k3Ai_1aASOXDss3lzCUsUug,87
|
|
335
|
+
agentex_sdk-0.6.3.dist-info/entry_points.txt,sha256=V7vJuMZdF0UlvgX6KiBN7XUvq_cxF5kplcYvc1QlFaQ,62
|
|
336
|
+
agentex_sdk-0.6.3.dist-info/licenses/LICENSE,sha256=Q1AOx2FtRcMlyMgQJ9eVN2WKPq2mQ33lnB4tvWxabLA,11337
|
|
337
|
+
agentex_sdk-0.6.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|