Skip to content

Commit db2d311

Browse files
feat(api): modify openapi trigger
1 parent 68b845f commit db2d311

19 files changed

+339
-91
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 12
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-5793d9138ec4b7af85e46c9b3f02baa0caeddcdfdf8b2c2192b26f62348392b9.yml
3-
openapi_spec_hash: 0452abd7cb14486ce786a47a9a62e49b
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-c99d72d8d845f1eeabf7a716949a12408df952a2a0ca2b97df570da3a7c8bb49.yml
3+
openapi_spec_hash: 8a503cbccc8a5741554282327a557114
44
config_hash: 07820b17df23cbea39cb77fa05292538

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ from warp_agent_sdk import WarpAPI
180180
client = WarpAPI()
181181

182182
response = client.agent.run(
183-
prompt="Fix the bug in auth.go",
184183
config={},
185184
)
186185
print(response.config)

src/warp_agent_sdk/resources/agent/agent.py

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

33
from __future__ import annotations
44

5+
from typing import Iterable
6+
from typing_extensions import Literal
7+
58
import httpx
69

710
from .runs import (
@@ -70,7 +73,9 @@ def with_streaming_response(self) -> AgentResourceWithStreamingResponse:
7073
def list(
7174
self,
7275
*,
76+
refresh: bool | Omit = omit,
7377
repo: str | Omit = omit,
78+
sort_by: Literal["name", "last_run"] | Omit = omit,
7479
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
7580
# The extra values given here take precedence over values defined on the client or passed to this method.
7681
extra_headers: Headers | None = None,
@@ -83,9 +88,17 @@ def list(
8388
Agents are discovered from environments or a specific repository.
8489
8590
Args:
91+
refresh: When true, clears the agent list cache before fetching. Use this to force a
92+
refresh of the available agents.
93+
8694
repo: Optional repository specification to list agents from (format: "owner/repo"). If
8795
not provided, lists agents from all accessible environments.
8896
97+
sort_by: Sort order for the returned agents.
98+
99+
- "name": Sort alphabetically by name (default)
100+
- "last_run": Sort by most recently used
101+
89102
extra_headers: Send extra headers
90103
91104
extra_query: Add additional query parameters to the request
@@ -101,16 +114,26 @@ def list(
101114
extra_query=extra_query,
102115
extra_body=extra_body,
103116
timeout=timeout,
104-
query=maybe_transform({"repo": repo}, agent_list_params.AgentListParams),
117+
query=maybe_transform(
118+
{
119+
"refresh": refresh,
120+
"repo": repo,
121+
"sort_by": sort_by,
122+
},
123+
agent_list_params.AgentListParams,
124+
),
105125
),
106126
cast_to=AgentListResponse,
107127
)
108128

109129
def run(
110130
self,
111131
*,
112-
prompt: str,
113132
config: AmbientAgentConfigParam | Omit = omit,
133+
conversation_id: str | Omit = omit,
134+
images: Iterable[agent_run_params.Image] | Omit = omit,
135+
prompt: str | Omit = omit,
136+
skill: str | Omit = omit,
114137
team: bool | Omit = omit,
115138
title: str | Omit = omit,
116139
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -120,17 +143,33 @@ def run(
120143
extra_body: Body | None = None,
121144
timeout: float | httpx.Timeout | None | NotGiven = not_given,
122145
) -> AgentRunResponse:
123-
"""Spawn an ambient agent with a prompt and optional configuration.
146+
"""Spawn an cloud agent with a prompt and optional configuration.
124147
125-
The agent will
126-
be queued for execution and assigned a unique run ID.
148+
The agent will be
149+
queued for execution and assigned a unique run ID.
127150
128151
Args:
129-
prompt: The prompt/instruction for the agent to execute
152+
config: Configuration for an cloud agent run
153+
154+
conversation_id: Optional conversation ID to continue an existing conversation. If provided, the
155+
agent will continue from where the previous run left off.
130156
131-
config: Configuration for an ambient agent run
157+
images: Optional images to include with the prompt (max 5). Images are uploaded to cloud
158+
storage and made available to the agent.
132159
133-
team: Make the run visible to all team members, not only the calling user
160+
prompt: The prompt/instruction for the agent to execute. Required unless a skill is
161+
specified via the skill field or config.skill_spec.
162+
163+
skill:
164+
Skill specification to use as the base prompt for the agent. Supported formats:
165+
166+
- "repo:skill_name" - Simple name in specific repo
167+
- "repo:skill_path" - Full path in specific repo
168+
- "org/repo:skill_name" - Simple name with org and repo
169+
- "org/repo:skill_path" - Full path with org and repo When provided, this takes
170+
precedence over config.skill_spec.
171+
172+
team: Whether to create a team-owned run. Defaults to true for users on a single team.
134173
135174
title: Custom title for the run (auto-generated if not provided)
136175
@@ -146,8 +185,11 @@ def run(
146185
"/agent/run",
147186
body=maybe_transform(
148187
{
149-
"prompt": prompt,
150188
"config": config,
189+
"conversation_id": conversation_id,
190+
"images": images,
191+
"prompt": prompt,
192+
"skill": skill,
151193
"team": team,
152194
"title": title,
153195
},
@@ -191,7 +233,9 @@ def with_streaming_response(self) -> AsyncAgentResourceWithStreamingResponse:
191233
async def list(
192234
self,
193235
*,
236+
refresh: bool | Omit = omit,
194237
repo: str | Omit = omit,
238+
sort_by: Literal["name", "last_run"] | Omit = omit,
195239
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
196240
# The extra values given here take precedence over values defined on the client or passed to this method.
197241
extra_headers: Headers | None = None,
@@ -204,9 +248,17 @@ async def list(
204248
Agents are discovered from environments or a specific repository.
205249
206250
Args:
251+
refresh: When true, clears the agent list cache before fetching. Use this to force a
252+
refresh of the available agents.
253+
207254
repo: Optional repository specification to list agents from (format: "owner/repo"). If
208255
not provided, lists agents from all accessible environments.
209256
257+
sort_by: Sort order for the returned agents.
258+
259+
- "name": Sort alphabetically by name (default)
260+
- "last_run": Sort by most recently used
261+
210262
extra_headers: Send extra headers
211263
212264
extra_query: Add additional query parameters to the request
@@ -222,16 +274,26 @@ async def list(
222274
extra_query=extra_query,
223275
extra_body=extra_body,
224276
timeout=timeout,
225-
query=await async_maybe_transform({"repo": repo}, agent_list_params.AgentListParams),
277+
query=await async_maybe_transform(
278+
{
279+
"refresh": refresh,
280+
"repo": repo,
281+
"sort_by": sort_by,
282+
},
283+
agent_list_params.AgentListParams,
284+
),
226285
),
227286
cast_to=AgentListResponse,
228287
)
229288

230289
async def run(
231290
self,
232291
*,
233-
prompt: str,
234292
config: AmbientAgentConfigParam | Omit = omit,
293+
conversation_id: str | Omit = omit,
294+
images: Iterable[agent_run_params.Image] | Omit = omit,
295+
prompt: str | Omit = omit,
296+
skill: str | Omit = omit,
235297
team: bool | Omit = omit,
236298
title: str | Omit = omit,
237299
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -241,17 +303,33 @@ async def run(
241303
extra_body: Body | None = None,
242304
timeout: float | httpx.Timeout | None | NotGiven = not_given,
243305
) -> AgentRunResponse:
244-
"""Spawn an ambient agent with a prompt and optional configuration.
306+
"""Spawn an cloud agent with a prompt and optional configuration.
245307
246-
The agent will
247-
be queued for execution and assigned a unique run ID.
308+
The agent will be
309+
queued for execution and assigned a unique run ID.
248310
249311
Args:
250-
prompt: The prompt/instruction for the agent to execute
312+
config: Configuration for an cloud agent run
313+
314+
conversation_id: Optional conversation ID to continue an existing conversation. If provided, the
315+
agent will continue from where the previous run left off.
316+
317+
images: Optional images to include with the prompt (max 5). Images are uploaded to cloud
318+
storage and made available to the agent.
251319
252-
config: Configuration for an ambient agent run
320+
prompt: The prompt/instruction for the agent to execute. Required unless a skill is
321+
specified via the skill field or config.skill_spec.
253322
254-
team: Make the run visible to all team members, not only the calling user
323+
skill:
324+
Skill specification to use as the base prompt for the agent. Supported formats:
325+
326+
- "repo:skill_name" - Simple name in specific repo
327+
- "repo:skill_path" - Full path in specific repo
328+
- "org/repo:skill_name" - Simple name with org and repo
329+
- "org/repo:skill_path" - Full path with org and repo When provided, this takes
330+
precedence over config.skill_spec.
331+
332+
team: Whether to create a team-owned run. Defaults to true for users on a single team.
255333
256334
title: Custom title for the run (auto-generated if not provided)
257335
@@ -267,8 +345,11 @@ async def run(
267345
"/agent/run",
268346
body=await async_maybe_transform(
269347
{
270-
"prompt": prompt,
271348
"config": config,
349+
"conversation_id": conversation_id,
350+
"images": images,
351+
"prompt": prompt,
352+
"skill": skill,
272353
"team": team,
273354
"title": title,
274355
},

src/warp_agent_sdk/resources/agent/runs.py

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
from typing import List, Union
66
from datetime import datetime
7+
from typing_extensions import Literal
78

89
import httpx
910

@@ -84,15 +85,18 @@ def retrieve(
8485
def list(
8586
self,
8687
*,
87-
config_name: str | Omit = omit,
88+
artifact_type: Literal["PLAN", "PULL_REQUEST"] | Omit = omit,
8889
created_after: Union[str, datetime] | Omit = omit,
8990
created_before: Union[str, datetime] | Omit = omit,
9091
creator: str | Omit = omit,
9192
cursor: str | Omit = omit,
9293
environment_id: str | Omit = omit,
9394
limit: int | Omit = omit,
9495
model_id: str | Omit = omit,
96+
name: str | Omit = omit,
97+
q: str | Omit = omit,
9598
schedule_id: str | Omit = omit,
99+
skill: str | Omit = omit,
96100
skill_spec: str | Omit = omit,
97101
source: RunSourceType | Omit = omit,
98102
state: List[RunState] | Omit = omit,
@@ -110,7 +114,7 @@ def list(
110114
ordered by creation time (newest first).
111115
112116
Args:
113-
config_name: Filter by agent config name
117+
artifact_type: Filter runs by artifact type (PLAN or PULL_REQUEST)
114118
115119
created_after: Filter runs created after this timestamp (RFC3339 format)
116120
@@ -126,8 +130,15 @@ def list(
126130
127131
model_id: Filter by model ID
128132
133+
name: Filter by agent config name
134+
135+
q: Fuzzy search query across run title, prompt, and skill_spec
136+
129137
schedule_id: Filter runs by the scheduled agent ID that created them
130138
139+
skill: Filter runs by skill spec (e.g., "owner/repo:path/to/SKILL.md"). Alias for
140+
skill_spec.
141+
131142
skill_spec: Filter runs by skill spec (e.g., "owner/repo:path/to/SKILL.md")
132143
133144
source: Filter by run source type
@@ -154,15 +165,18 @@ def list(
154165
timeout=timeout,
155166
query=maybe_transform(
156167
{
157-
"config_name": config_name,
168+
"artifact_type": artifact_type,
158169
"created_after": created_after,
159170
"created_before": created_before,
160171
"creator": creator,
161172
"cursor": cursor,
162173
"environment_id": environment_id,
163174
"limit": limit,
164175
"model_id": model_id,
176+
"name": name,
177+
"q": q,
165178
"schedule_id": schedule_id,
179+
"skill": skill,
166180
"skill_spec": skill_spec,
167181
"source": source,
168182
"state": state,
@@ -267,15 +281,18 @@ async def retrieve(
267281
async def list(
268282
self,
269283
*,
270-
config_name: str | Omit = omit,
284+
artifact_type: Literal["PLAN", "PULL_REQUEST"] | Omit = omit,
271285
created_after: Union[str, datetime] | Omit = omit,
272286
created_before: Union[str, datetime] | Omit = omit,
273287
creator: str | Omit = omit,
274288
cursor: str | Omit = omit,
275289
environment_id: str | Omit = omit,
276290
limit: int | Omit = omit,
277291
model_id: str | Omit = omit,
292+
name: str | Omit = omit,
293+
q: str | Omit = omit,
278294
schedule_id: str | Omit = omit,
295+
skill: str | Omit = omit,
279296
skill_spec: str | Omit = omit,
280297
source: RunSourceType | Omit = omit,
281298
state: List[RunState] | Omit = omit,
@@ -293,7 +310,7 @@ async def list(
293310
ordered by creation time (newest first).
294311
295312
Args:
296-
config_name: Filter by agent config name
313+
artifact_type: Filter runs by artifact type (PLAN or PULL_REQUEST)
297314
298315
created_after: Filter runs created after this timestamp (RFC3339 format)
299316
@@ -309,8 +326,15 @@ async def list(
309326
310327
model_id: Filter by model ID
311328
329+
name: Filter by agent config name
330+
331+
q: Fuzzy search query across run title, prompt, and skill_spec
332+
312333
schedule_id: Filter runs by the scheduled agent ID that created them
313334
335+
skill: Filter runs by skill spec (e.g., "owner/repo:path/to/SKILL.md"). Alias for
336+
skill_spec.
337+
314338
skill_spec: Filter runs by skill spec (e.g., "owner/repo:path/to/SKILL.md")
315339
316340
source: Filter by run source type
@@ -337,15 +361,18 @@ async def list(
337361
timeout=timeout,
338362
query=await async_maybe_transform(
339363
{
340-
"config_name": config_name,
364+
"artifact_type": artifact_type,
341365
"created_after": created_after,
342366
"created_before": created_before,
343367
"creator": creator,
344368
"cursor": cursor,
345369
"environment_id": environment_id,
346370
"limit": limit,
347371
"model_id": model_id,
372+
"name": name,
373+
"q": q,
348374
"schedule_id": schedule_id,
375+
"skill": skill,
349376
"skill_spec": skill_spec,
350377
"source": source,
351378
"state": state,

0 commit comments

Comments
 (0)