Skip to content

Commit 9cf2d03

Browse files
feat(api): api update
1 parent caf9c45 commit 9cf2d03

6 files changed

Lines changed: 14 additions & 210 deletions

File tree

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 22
22
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-348bf98eecccd80255fdcee166b5eb385d8d9743811d080f94a1ec33337abc48.yml
3-
openapi_spec_hash: 276da0f1c45cb44f9c882a505cb2f8b6
3+
openapi_spec_hash: 1952fae99172f1adaf35d800b0d63936
44
config_hash: 44a1e8f98607a5cf03815a63bae63453

src/oz_agent_sdk/resources/agent/agent_.py

Lines changed: 9 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22

33
from __future__ import annotations
44

5-
from typing import Iterable, Optional
6-
75
import httpx
86

9-
from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, SequenceNotStr, omit, not_given
7+
from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given
108
from ..._utils import path_template, maybe_transform, async_maybe_transform
119
from ..._compat import cached_property
1210
from ..._resource import SyncAPIResource, AsyncAPIResource
@@ -50,9 +48,6 @@ def create(
5048
self,
5149
*,
5250
name: str,
53-
description: Optional[str] | Omit = omit,
54-
secrets: Iterable[agent_create_params.Secret] | Omit = omit,
55-
skills: SequenceNotStr[str] | Omit = omit,
5651
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
5752
# The extra values given here take precedence over values defined on the client or passed to this method.
5853
extra_headers: Headers | None = None,
@@ -68,18 +63,6 @@ def create(
6863
Args:
6964
name: A name for the agent
7065
71-
description: Optional description of the agent
72-
73-
secrets: Optional list of secrets associated with the agent. Duplicate names within a
74-
single request are rejected.
75-
76-
skills:
77-
Optional list of skill specs to associate with the agent. Format:
78-
"{owner}/{repo}:{skill_path}" (e.g.,
79-
"warpdotdev/warp-server:.claude/skills/deploy/SKILL.md"). Each spec is validated
80-
and normalized at attach time using the team's GitHub credentials; inaccessible
81-
or malformed specs are rejected.
82-
8366
extra_headers: Send extra headers
8467
8568
extra_query: Add additional query parameters to the request
@@ -90,15 +73,7 @@ def create(
9073
"""
9174
return self._post(
9275
"/agent/identities",
93-
body=maybe_transform(
94-
{
95-
"name": name,
96-
"description": description,
97-
"secrets": secrets,
98-
"skills": skills,
99-
},
100-
agent_create_params.AgentCreateParams,
101-
),
76+
body=maybe_transform({"name": name}, agent_create_params.AgentCreateParams),
10277
options=make_request_options(
10378
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
10479
),
@@ -109,33 +84,20 @@ def update(
10984
self,
11085
uid: str,
11186
*,
112-
description: Optional[str] | Omit = omit,
11387
name: str | Omit = omit,
114-
secrets: Optional[Iterable[agent_update_params.Secret]] | Omit = omit,
115-
skills: Optional[SequenceNotStr[str]] | Omit = omit,
11688
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
11789
# The extra values given here take precedence over values defined on the client or passed to this method.
11890
extra_headers: Headers | None = None,
11991
extra_query: Query | None = None,
12092
extra_body: Body | None = None,
12193
timeout: float | httpx.Timeout | None | NotGiven = not_given,
12294
) -> AgentResponse:
123-
"""Update an existing agent.
95+
"""
96+
Update an existing agent.
12497
12598
Args:
126-
description: Replacement description.
127-
128-
Omit or pass `null` to leave unchanged, or use an empty
129-
value to clear.
130-
13199
name: The new name for the agent
132100
133-
secrets: Replacement list of secrets. Omit to leave unchanged, pass an empty array to
134-
clear, or pass a non-empty array to replace. Duplicate names are rejected.
135-
136-
skills: Replacement list of skill specs. Omit to leave unchanged, pass an empty array to
137-
clear, or pass a non-empty array to replace.
138-
139101
extra_headers: Send extra headers
140102
141103
extra_query: Add additional query parameters to the request
@@ -148,15 +110,7 @@ def update(
148110
raise ValueError(f"Expected a non-empty value for `uid` but received {uid!r}")
149111
return self._put(
150112
path_template("/agent/identities/{uid}", uid=uid),
151-
body=maybe_transform(
152-
{
153-
"description": description,
154-
"name": name,
155-
"secrets": secrets,
156-
"skills": skills,
157-
},
158-
agent_update_params.AgentUpdateParams,
159-
),
113+
body=maybe_transform({"name": name}, agent_update_params.AgentUpdateParams),
160114
options=make_request_options(
161115
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
162116
),
@@ -248,9 +202,6 @@ async def create(
248202
self,
249203
*,
250204
name: str,
251-
description: Optional[str] | Omit = omit,
252-
secrets: Iterable[agent_create_params.Secret] | Omit = omit,
253-
skills: SequenceNotStr[str] | Omit = omit,
254205
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
255206
# The extra values given here take precedence over values defined on the client or passed to this method.
256207
extra_headers: Headers | None = None,
@@ -266,18 +217,6 @@ async def create(
266217
Args:
267218
name: A name for the agent
268219
269-
description: Optional description of the agent
270-
271-
secrets: Optional list of secrets associated with the agent. Duplicate names within a
272-
single request are rejected.
273-
274-
skills:
275-
Optional list of skill specs to associate with the agent. Format:
276-
"{owner}/{repo}:{skill_path}" (e.g.,
277-
"warpdotdev/warp-server:.claude/skills/deploy/SKILL.md"). Each spec is validated
278-
and normalized at attach time using the team's GitHub credentials; inaccessible
279-
or malformed specs are rejected.
280-
281220
extra_headers: Send extra headers
282221
283222
extra_query: Add additional query parameters to the request
@@ -288,15 +227,7 @@ async def create(
288227
"""
289228
return await self._post(
290229
"/agent/identities",
291-
body=await async_maybe_transform(
292-
{
293-
"name": name,
294-
"description": description,
295-
"secrets": secrets,
296-
"skills": skills,
297-
},
298-
agent_create_params.AgentCreateParams,
299-
),
230+
body=await async_maybe_transform({"name": name}, agent_create_params.AgentCreateParams),
300231
options=make_request_options(
301232
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
302233
),
@@ -307,33 +238,20 @@ async def update(
307238
self,
308239
uid: str,
309240
*,
310-
description: Optional[str] | Omit = omit,
311241
name: str | Omit = omit,
312-
secrets: Optional[Iterable[agent_update_params.Secret]] | Omit = omit,
313-
skills: Optional[SequenceNotStr[str]] | Omit = omit,
314242
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
315243
# The extra values given here take precedence over values defined on the client or passed to this method.
316244
extra_headers: Headers | None = None,
317245
extra_query: Query | None = None,
318246
extra_body: Body | None = None,
319247
timeout: float | httpx.Timeout | None | NotGiven = not_given,
320248
) -> AgentResponse:
321-
"""Update an existing agent.
249+
"""
250+
Update an existing agent.
322251
323252
Args:
324-
description: Replacement description.
325-
326-
Omit or pass `null` to leave unchanged, or use an empty
327-
value to clear.
328-
329253
name: The new name for the agent
330254
331-
secrets: Replacement list of secrets. Omit to leave unchanged, pass an empty array to
332-
clear, or pass a non-empty array to replace. Duplicate names are rejected.
333-
334-
skills: Replacement list of skill specs. Omit to leave unchanged, pass an empty array to
335-
clear, or pass a non-empty array to replace.
336-
337255
extra_headers: Send extra headers
338256
339257
extra_query: Add additional query parameters to the request
@@ -346,15 +264,7 @@ async def update(
346264
raise ValueError(f"Expected a non-empty value for `uid` but received {uid!r}")
347265
return await self._put(
348266
path_template("/agent/identities/{uid}", uid=uid),
349-
body=await async_maybe_transform(
350-
{
351-
"description": description,
352-
"name": name,
353-
"secrets": secrets,
354-
"skills": skills,
355-
},
356-
agent_update_params.AgentUpdateParams,
357-
),
267+
body=await async_maybe_transform({"name": name}, agent_update_params.AgentUpdateParams),
358268
options=make_request_options(
359269
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
360270
),

src/oz_agent_sdk/types/agent/agent_create_params.py

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,11 @@
22

33
from __future__ import annotations
44

5-
from typing import Iterable, Optional
65
from typing_extensions import Required, TypedDict
76

8-
from ..._types import SequenceNotStr
9-
10-
__all__ = ["AgentCreateParams", "Secret"]
7+
__all__ = ["AgentCreateParams"]
118

129

1310
class AgentCreateParams(TypedDict, total=False):
1411
name: Required[str]
1512
"""A name for the agent"""
16-
17-
description: Optional[str]
18-
"""Optional description of the agent"""
19-
20-
secrets: Iterable[Secret]
21-
"""
22-
Optional list of secrets associated with the agent. Duplicate names within a
23-
single request are rejected.
24-
"""
25-
26-
skills: SequenceNotStr[str]
27-
"""
28-
Optional list of skill specs to associate with the agent. Format:
29-
"{owner}/{repo}:{skill_path}" (e.g.,
30-
"warpdotdev/warp-server:.claude/skills/deploy/SKILL.md"). Each spec is validated
31-
and normalized at attach time using the team's GitHub credentials; inaccessible
32-
or malformed specs are rejected.
33-
"""
34-
35-
36-
class Secret(TypedDict, total=False):
37-
"""Reference to a managed secret by name."""
38-
39-
name: Required[str]
40-
"""Name of the managed secret."""
Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import List, Optional
43
from datetime import datetime
54

65
from ..._models import BaseModel
76

8-
__all__ = ["AgentResponse", "Secret"]
9-
10-
11-
class Secret(BaseModel):
12-
"""Reference to a managed secret by name."""
13-
14-
name: str
15-
"""Name of the managed secret."""
7+
__all__ = ["AgentResponse"]
168

179

1810
class AgentResponse(BaseModel):
@@ -25,17 +17,5 @@ class AgentResponse(BaseModel):
2517
name: str
2618
"""Name of the agent"""
2719

28-
secrets: List[Secret]
29-
"""Secrets that this agent may access by default."""
30-
31-
skills: List[str]
32-
"""
33-
Ordered list of normalized skill specs associated with this agent. Always
34-
present; empty when no skills are attached.
35-
"""
36-
3720
uid: str
3821
"""Unique identifier for the agent"""
39-
40-
description: Optional[str] = None
41-
"""Optional description of the agent"""

src/oz_agent_sdk/types/agent/agent_update_params.py

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,11 @@
22

33
from __future__ import annotations
44

5-
from typing import Iterable, Optional
6-
from typing_extensions import Required, TypedDict
5+
from typing_extensions import TypedDict
76

8-
from ..._types import SequenceNotStr
9-
10-
__all__ = ["AgentUpdateParams", "Secret"]
7+
__all__ = ["AgentUpdateParams"]
118

129

1310
class AgentUpdateParams(TypedDict, total=False):
14-
description: Optional[str]
15-
"""Replacement description.
16-
17-
Omit or pass `null` to leave unchanged, or use an empty value to clear.
18-
"""
19-
2011
name: str
2112
"""The new name for the agent"""
22-
23-
secrets: Optional[Iterable[Secret]]
24-
"""Replacement list of secrets.
25-
26-
Omit to leave unchanged, pass an empty array to clear, or pass a non-empty array
27-
to replace. Duplicate names are rejected.
28-
"""
29-
30-
skills: Optional[SequenceNotStr[str]]
31-
"""Replacement list of skill specs.
32-
33-
Omit to leave unchanged, pass an empty array to clear, or pass a non-empty array
34-
to replace.
35-
"""
36-
37-
38-
class Secret(TypedDict, total=False):
39-
"""Reference to a managed secret by name."""
40-
41-
name: Required[str]
42-
"""Name of the managed secret."""

tests/api_resources/agent/test_agent_.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,6 @@ def test_method_create(self, client: OzAPI) -> None:
2828
)
2929
assert_matches_type(AgentResponse, agent, path=["response"])
3030

31-
@pytest.mark.skip(reason="Mock server tests are disabled")
32-
@parametrize
33-
def test_method_create_with_all_params(self, client: OzAPI) -> None:
34-
agent = client.agent.agent.create(
35-
name="name",
36-
description="description",
37-
secrets=[{"name": "name"}],
38-
skills=["string"],
39-
)
40-
assert_matches_type(AgentResponse, agent, path=["response"])
41-
4231
@pytest.mark.skip(reason="Mock server tests are disabled")
4332
@parametrize
4433
def test_raw_response_create(self, client: OzAPI) -> None:
@@ -78,10 +67,7 @@ def test_method_update(self, client: OzAPI) -> None:
7867
def test_method_update_with_all_params(self, client: OzAPI) -> None:
7968
agent = client.agent.agent.update(
8069
uid="uid",
81-
description="description",
8270
name="name",
83-
secrets=[{"name": "name"}],
84-
skills=["string"],
8571
)
8672
assert_matches_type(AgentResponse, agent, path=["response"])
8773

@@ -203,17 +189,6 @@ async def test_method_create(self, async_client: AsyncOzAPI) -> None:
203189
)
204190
assert_matches_type(AgentResponse, agent, path=["response"])
205191

206-
@pytest.mark.skip(reason="Mock server tests are disabled")
207-
@parametrize
208-
async def test_method_create_with_all_params(self, async_client: AsyncOzAPI) -> None:
209-
agent = await async_client.agent.agent.create(
210-
name="name",
211-
description="description",
212-
secrets=[{"name": "name"}],
213-
skills=["string"],
214-
)
215-
assert_matches_type(AgentResponse, agent, path=["response"])
216-
217192
@pytest.mark.skip(reason="Mock server tests are disabled")
218193
@parametrize
219194
async def test_raw_response_create(self, async_client: AsyncOzAPI) -> None:
@@ -253,10 +228,7 @@ async def test_method_update(self, async_client: AsyncOzAPI) -> None:
253228
async def test_method_update_with_all_params(self, async_client: AsyncOzAPI) -> None:
254229
agent = await async_client.agent.agent.update(
255230
uid="uid",
256-
description="description",
257231
name="name",
258-
secrets=[{"name": "name"}],
259-
skills=["string"],
260232
)
261233
assert_matches_type(AgentResponse, agent, path=["response"])
262234

0 commit comments

Comments
 (0)