Skip to content

Commit 1ffc53b

Browse files
feat(api): api update
1 parent cf28804 commit 1ffc53b

16 files changed

+417
-54
lines changed

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 14
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-8f9c749573846b07a55a3131b66456f0a592838c6bfc986ab30948df66cd6f11.yml
3-
openapi_spec_hash: 59f1ac98ad6cf13b12c59196bcecffd7
4-
config_hash: 60052b2c1c0862014416821aba875574
1+
configured_endpoints: 15
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-abde9a81e648a7bbddbb7c7af07eb9202e584f78dea9cc79ff075da2ad66efd5.yml
3+
openapi_spec_hash: db45809e85b0f85020a6b046c6eed90e
4+
config_hash: 253e4b5ca01236d448980a78491c17c5

api.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ from oz_agent_sdk.types import (
77
AgentSkill,
88
AmbientAgentConfig,
99
AwsProviderConfig,
10+
CloudEnvironment,
1011
CloudEnvironmentConfig,
1112
Error,
1213
ErrorCode,
@@ -16,6 +17,7 @@ from oz_agent_sdk.types import (
1617
UserProfile,
1718
AgentListResponse,
1819
AgentGetArtifactResponse,
20+
AgentListEnvironmentsResponse,
1921
AgentRunResponse,
2022
)
2123
```
@@ -24,6 +26,7 @@ Methods:
2426

2527
- <code title="get /agent">client.agent.<a href="./src/oz_agent_sdk/resources/agent/agent.py">list</a>(\*\*<a href="src/oz_agent_sdk/types/agent_list_params.py">params</a>) -> <a href="./src/oz_agent_sdk/types/agent_list_response.py">AgentListResponse</a></code>
2628
- <code title="get /agent/artifacts/{artifactUid}">client.agent.<a href="./src/oz_agent_sdk/resources/agent/agent.py">get_artifact</a>(artifact_uid) -> <a href="./src/oz_agent_sdk/types/agent_get_artifact_response.py">AgentGetArtifactResponse</a></code>
29+
- <code title="get /agent/environments">client.agent.<a href="./src/oz_agent_sdk/resources/agent/agent.py">list_environments</a>(\*\*<a href="src/oz_agent_sdk/types/agent_list_environments_params.py">params</a>) -> <a href="./src/oz_agent_sdk/types/agent_list_environments_response.py">AgentListEnvironmentsResponse</a></code>
2730
- <code title="post /agent/runs">client.agent.<a href="./src/oz_agent_sdk/resources/agent/agent.py">run</a>(\*\*<a href="src/oz_agent_sdk/types/agent_run_params.py">params</a>) -> <a href="./src/oz_agent_sdk/types/agent_run_response.py">AgentRunResponse</a></code>
2831

2932
## Runs

src/oz_agent_sdk/resources/agent/agent.py

Lines changed: 108 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
RunsResourceWithStreamingResponse,
1616
AsyncRunsResourceWithStreamingResponse,
1717
)
18-
from ...types import agent_run_params, agent_list_params
18+
from ...types import agent_run_params, agent_list_params, agent_list_environments_params
1919
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
2020
from ..._utils import path_template, maybe_transform, async_maybe_transform
2121
from .sessions import (
@@ -47,6 +47,7 @@
4747
from ...types.agent_list_response import AgentListResponse
4848
from ...types.ambient_agent_config_param import AmbientAgentConfigParam
4949
from ...types.agent_get_artifact_response import AgentGetArtifactResponse
50+
from ...types.agent_list_environments_response import AgentListEnvironmentsResponse
5051

5152
__all__ = ["AgentResource", "AsyncAgentResource"]
5253

@@ -163,8 +164,9 @@ def get_artifact(
163164
) -> AgentGetArtifactResponse:
164165
"""Retrieve an artifact by its UUID.
165166
166-
For supported downloadable artifacts, returns
167-
a time-limited signed download URL.
167+
For downloadable file-like artifacts, returns
168+
a time-limited signed download URL. For plan artifacts, returns the current plan
169+
content inline.
168170
169171
Args:
170172
extra_headers: Send extra headers
@@ -190,6 +192,49 @@ def get_artifact(
190192
),
191193
)
192194

195+
def list_environments(
196+
self,
197+
*,
198+
sort_by: Literal["name", "last_updated"] | Omit = omit,
199+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
200+
# The extra values given here take precedence over values defined on the client or passed to this method.
201+
extra_headers: Headers | None = None,
202+
extra_query: Query | None = None,
203+
extra_body: Body | None = None,
204+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
205+
) -> AgentListEnvironmentsResponse:
206+
"""Retrieve cloud environments accessible to the authenticated principal.
207+
208+
Returns
209+
environments the caller owns, has been granted guest access to, or has accessed
210+
via link sharing.
211+
212+
Args:
213+
sort_by: Sort order for the returned environments.
214+
215+
- `name`: alphabetical by environment name
216+
- `last_updated`: most recently updated first (default)
217+
218+
extra_headers: Send extra headers
219+
220+
extra_query: Add additional query parameters to the request
221+
222+
extra_body: Add additional JSON properties to the request
223+
224+
timeout: Override the client-level default timeout for this request, in seconds
225+
"""
226+
return self._get(
227+
"/agent/environments",
228+
options=make_request_options(
229+
extra_headers=extra_headers,
230+
extra_query=extra_query,
231+
extra_body=extra_body,
232+
timeout=timeout,
233+
query=maybe_transform({"sort_by": sort_by}, agent_list_environments_params.AgentListEnvironmentsParams),
234+
),
235+
cast_to=AgentListEnvironmentsResponse,
236+
)
237+
193238
def run(
194239
self,
195240
*,
@@ -392,8 +437,9 @@ async def get_artifact(
392437
) -> AgentGetArtifactResponse:
393438
"""Retrieve an artifact by its UUID.
394439
395-
For supported downloadable artifacts, returns
396-
a time-limited signed download URL.
440+
For downloadable file-like artifacts, returns
441+
a time-limited signed download URL. For plan artifacts, returns the current plan
442+
content inline.
397443
398444
Args:
399445
extra_headers: Send extra headers
@@ -419,6 +465,51 @@ async def get_artifact(
419465
),
420466
)
421467

468+
async def list_environments(
469+
self,
470+
*,
471+
sort_by: Literal["name", "last_updated"] | Omit = omit,
472+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
473+
# The extra values given here take precedence over values defined on the client or passed to this method.
474+
extra_headers: Headers | None = None,
475+
extra_query: Query | None = None,
476+
extra_body: Body | None = None,
477+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
478+
) -> AgentListEnvironmentsResponse:
479+
"""Retrieve cloud environments accessible to the authenticated principal.
480+
481+
Returns
482+
environments the caller owns, has been granted guest access to, or has accessed
483+
via link sharing.
484+
485+
Args:
486+
sort_by: Sort order for the returned environments.
487+
488+
- `name`: alphabetical by environment name
489+
- `last_updated`: most recently updated first (default)
490+
491+
extra_headers: Send extra headers
492+
493+
extra_query: Add additional query parameters to the request
494+
495+
extra_body: Add additional JSON properties to the request
496+
497+
timeout: Override the client-level default timeout for this request, in seconds
498+
"""
499+
return await self._get(
500+
"/agent/environments",
501+
options=make_request_options(
502+
extra_headers=extra_headers,
503+
extra_query=extra_query,
504+
extra_body=extra_body,
505+
timeout=timeout,
506+
query=await async_maybe_transform(
507+
{"sort_by": sort_by}, agent_list_environments_params.AgentListEnvironmentsParams
508+
),
509+
),
510+
cast_to=AgentListEnvironmentsResponse,
511+
)
512+
422513
async def run(
423514
self,
424515
*,
@@ -519,6 +610,9 @@ def __init__(self, agent: AgentResource) -> None:
519610
self.get_artifact = to_raw_response_wrapper(
520611
agent.get_artifact,
521612
)
613+
self.list_environments = to_raw_response_wrapper(
614+
agent.list_environments,
615+
)
522616
self.run = to_raw_response_wrapper(
523617
agent.run,
524618
)
@@ -549,6 +643,9 @@ def __init__(self, agent: AsyncAgentResource) -> None:
549643
self.get_artifact = async_to_raw_response_wrapper(
550644
agent.get_artifact,
551645
)
646+
self.list_environments = async_to_raw_response_wrapper(
647+
agent.list_environments,
648+
)
552649
self.run = async_to_raw_response_wrapper(
553650
agent.run,
554651
)
@@ -579,6 +676,9 @@ def __init__(self, agent: AgentResource) -> None:
579676
self.get_artifact = to_streamed_response_wrapper(
580677
agent.get_artifact,
581678
)
679+
self.list_environments = to_streamed_response_wrapper(
680+
agent.list_environments,
681+
)
582682
self.run = to_streamed_response_wrapper(
583683
agent.run,
584684
)
@@ -609,6 +709,9 @@ def __init__(self, agent: AsyncAgentResource) -> None:
609709
self.get_artifact = async_to_streamed_response_wrapper(
610710
agent.get_artifact,
611711
)
712+
self.list_environments = async_to_streamed_response_wrapper(
713+
agent.list_environments,
714+
)
612715
self.run = async_to_streamed_response_wrapper(
613716
agent.run,
614717
)

src/oz_agent_sdk/resources/agent/runs.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def retrieve(
8787
def list(
8888
self,
8989
*,
90+
ancestor_run_id: str | Omit = omit,
9091
artifact_type: Literal["PLAN", "PULL_REQUEST", "SCREENSHOT", "FILE"] | Omit = omit,
9192
created_after: Union[str, datetime] | Omit = omit,
9293
created_before: Union[str, datetime] | Omit = omit,
@@ -119,6 +120,9 @@ def list(
119120
to `sort_by=updated_at` and `sort_order=desc`.
120121
121122
Args:
123+
ancestor_run_id: Filter runs by ancestor run ID. The referenced run must exist and be accessible
124+
to the caller.
125+
122126
artifact_type: Filter runs by artifact type
123127
124128
created_after: Filter runs created after this timestamp (RFC3339 format)
@@ -182,6 +186,7 @@ def list(
182186
timeout=timeout,
183187
query=maybe_transform(
184188
{
189+
"ancestor_run_id": ancestor_run_id,
185190
"artifact_type": artifact_type,
186191
"created_after": created_after,
187192
"created_before": created_before,
@@ -307,6 +312,7 @@ async def retrieve(
307312
def list(
308313
self,
309314
*,
315+
ancestor_run_id: str | Omit = omit,
310316
artifact_type: Literal["PLAN", "PULL_REQUEST", "SCREENSHOT", "FILE"] | Omit = omit,
311317
created_after: Union[str, datetime] | Omit = omit,
312318
created_before: Union[str, datetime] | Omit = omit,
@@ -339,6 +345,9 @@ def list(
339345
to `sort_by=updated_at` and `sort_order=desc`.
340346
341347
Args:
348+
ancestor_run_id: Filter runs by ancestor run ID. The referenced run must exist and be accessible
349+
to the caller.
350+
342351
artifact_type: Filter runs by artifact type
343352
344353
created_after: Filter runs created after this timestamp (RFC3339 format)
@@ -402,6 +411,7 @@ def list(
402411
timeout=timeout,
403412
query=maybe_transform(
404413
{
414+
"ancestor_run_id": ancestor_run_id,
405415
"artifact_type": artifact_type,
406416
"created_after": created_after,
407417
"created_before": created_before,

src/oz_agent_sdk/types/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from .user_profile import UserProfile as UserProfile
99
from .agent_run_params import AgentRunParams as AgentRunParams
1010
from .agent_list_params import AgentListParams as AgentListParams
11+
from .cloud_environment import CloudEnvironment as CloudEnvironment
1112
from .mcp_server_config import McpServerConfig as McpServerConfig
1213
from .agent_run_response import AgentRunResponse as AgentRunResponse
1314
from .agent_list_response import AgentListResponse as AgentListResponse
@@ -18,3 +19,5 @@
1819
from .cloud_environment_config import CloudEnvironmentConfig as CloudEnvironmentConfig
1920
from .ambient_agent_config_param import AmbientAgentConfigParam as AmbientAgentConfigParam
2021
from .agent_get_artifact_response import AgentGetArtifactResponse as AgentGetArtifactResponse
22+
from .agent_list_environments_params import AgentListEnvironmentsParams as AgentListEnvironmentsParams
23+
from .agent_list_environments_response import AgentListEnvironmentsResponse as AgentListEnvironmentsResponse

src/oz_agent_sdk/types/agent/artifact_item.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,21 @@ class PlanArtifactData(BaseModel):
2424
document_uid: str
2525
"""Unique identifier for the plan document"""
2626

27+
artifact_uid: Optional[str] = None
28+
"""
29+
Unique identifier for the plan artifact, usable with the artifact retrieval
30+
endpoint
31+
"""
32+
2733
notebook_uid: Optional[str] = None
2834
"""Unique identifier for the associated notebook"""
2935

3036
title: Optional[str] = None
3137
"""Title of the plan"""
3238

39+
url: Optional[str] = None
40+
"""URL to open the plan in Warp Drive"""
41+
3342

3443
class PlanArtifact(BaseModel):
3544
artifact_type: Literal["PLAN"]

src/oz_agent_sdk/types/agent/run_list_params.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414

1515

1616
class RunListParams(TypedDict, total=False):
17+
ancestor_run_id: str
18+
"""Filter runs by ancestor run ID.
19+
20+
The referenced run must exist and be accessible to the caller.
21+
"""
22+
1723
artifact_type: Literal["PLAN", "PULL_REQUEST", "SCREENSHOT", "FILE"]
1824
"""Filter runs by artifact type"""
1925

src/oz_agent_sdk/types/agent_get_artifact_response.py

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,53 @@
99

1010
__all__ = [
1111
"AgentGetArtifactResponse",
12+
"PlanArtifactResponse",
13+
"PlanArtifactResponseData",
1214
"ScreenshotArtifactResponse",
1315
"ScreenshotArtifactResponseData",
1416
"FileArtifactResponse",
1517
"FileArtifactResponseData",
1618
]
1719

1820

21+
class PlanArtifactResponseData(BaseModel):
22+
"""Response data for a plan artifact, including current markdown content."""
23+
24+
content: str
25+
"""Current markdown content of the plan"""
26+
27+
content_type: str
28+
"""MIME type of the returned plan content"""
29+
30+
document_uid: str
31+
"""Unique identifier for the plan document"""
32+
33+
notebook_uid: str
34+
"""Unique identifier for the associated notebook"""
35+
36+
title: Optional[str] = None
37+
"""Current title of the plan"""
38+
39+
url: Optional[str] = None
40+
"""URL to open the plan in Warp Drive"""
41+
42+
43+
class PlanArtifactResponse(BaseModel):
44+
"""Response for retrieving a plan artifact."""
45+
46+
artifact_type: Literal["PLAN"]
47+
"""Type of the artifact"""
48+
49+
artifact_uid: str
50+
"""Unique identifier (UUID) for the artifact"""
51+
52+
created_at: datetime
53+
"""Timestamp when the artifact was created (RFC3339)"""
54+
55+
data: PlanArtifactResponseData
56+
"""Response data for a plan artifact, including current markdown content."""
57+
58+
1959
class ScreenshotArtifactResponseData(BaseModel):
2060
"""Response data for a screenshot artifact, including a signed download URL."""
2161

@@ -90,5 +130,6 @@ class FileArtifactResponse(BaseModel):
90130

91131

92132
AgentGetArtifactResponse: TypeAlias = Annotated[
93-
Union[ScreenshotArtifactResponse, FileArtifactResponse], PropertyInfo(discriminator="artifact_type")
133+
Union[PlanArtifactResponse, ScreenshotArtifactResponse, FileArtifactResponse],
134+
PropertyInfo(discriminator="artifact_type"),
94135
]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
from __future__ import annotations
4+
5+
from typing_extensions import Literal, TypedDict
6+
7+
__all__ = ["AgentListEnvironmentsParams"]
8+
9+
10+
class AgentListEnvironmentsParams(TypedDict, total=False):
11+
sort_by: Literal["name", "last_updated"]
12+
"""Sort order for the returned environments.
13+
14+
- `name`: alphabetical by environment name
15+
- `last_updated`: most recently updated first (default)
16+
"""

0 commit comments

Comments
 (0)