Skip to content

Commit fe8c5b3

Browse files
feat(api)!: catch up openapi, rename tasks -> runs
1 parent 71adb45 commit fe8c5b3

File tree

18 files changed

+328
-297
lines changed

18 files changed

+328
-297
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 3
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-678afb4efd7b655ded420e66621722701b018bcfce2423ec9beb4e575108c05c.yml
3-
openapi_spec_hash: 4f8537526fc20ec33facbc86e1abd571
4-
config_hash: 9c6b93a5f4b658b946f0ab7fcfedbaa3
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/warp-bnavetta%2Fwarp-api-24029c9a3bb61d8ed8807686035c52060f97505d57ad827ae4debdec426ea0a0.yml
3+
openapi_spec_hash: ffe58e3dd2d1c5c1552af6c0330e6fb1
4+
config_hash: 386210f0e52fc8dd00b78e25011b9980

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ client = WarpAPI(
3535
response = client.agent.run(
3636
prompt="Fix the bug in auth.go",
3737
)
38-
print(response.task_id)
38+
print(response.run_id)
3939
```
4040

4141
### Using environments and configuration
@@ -119,7 +119,7 @@ async def main() -> None:
119119
response = await client.agent.run(
120120
prompt="Fix the bug in auth.go",
121121
)
122-
print(response.task_id)
122+
print(response.run_id)
123123

124124

125125
asyncio.run(main())
@@ -155,7 +155,7 @@ async def main() -> None:
155155
response = await client.agent.run(
156156
prompt="Fix the bug in auth.go",
157157
)
158-
print(response.task_id)
158+
print(response.run_id)
159159

160160

161161
asyncio.run(main())
@@ -321,7 +321,7 @@ response = client.agent.with_raw_response.run(
321321
print(response.headers.get('X-My-Header'))
322322

323323
agent = response.parse() # get the object that `agent.run()` would have returned
324-
print(agent.task_id)
324+
print(agent.run_id)
325325
```
326326

327327
These methods return an [`APIResponse`](https://github.com/warpdotdev/warp-sdk-python/tree/main/src/warp_agent_sdk/_response.py) object.

api.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ Methods:
1010

1111
- <code title="post /agent/run">client.agent.<a href="./src/warp_agent_sdk/resources/agent/agent.py">run</a>(\*\*<a href="src/warp_agent_sdk/types/agent_run_params.py">params</a>) -> <a href="./src/warp_agent_sdk/types/agent_run_response.py">AgentRunResponse</a></code>
1212

13-
## Tasks
13+
## Runs
1414

1515
Types:
1616

1717
```python
18-
from warp_agent_sdk.types.agent import TaskItem, TaskSourceType, TaskState, TaskListResponse
18+
from warp_agent_sdk.types.agent import RunItem, RunSourceType, RunState, RunListResponse
1919
```
2020

2121
Methods:
2222

23-
- <code title="get /agent/tasks/{taskId}">client.agent.tasks.<a href="./src/warp_agent_sdk/resources/agent/tasks.py">retrieve</a>(task_id) -> <a href="./src/warp_agent_sdk/types/agent/task_item.py">TaskItem</a></code>
24-
- <code title="get /agent/tasks">client.agent.tasks.<a href="./src/warp_agent_sdk/resources/agent/tasks.py">list</a>(\*\*<a href="src/warp_agent_sdk/types/agent/task_list_params.py">params</a>) -> <a href="./src/warp_agent_sdk/types/agent/task_list_response.py">TaskListResponse</a></code>
23+
- <code title="get /agent/runs/{runId}">client.agent.runs.<a href="./src/warp_agent_sdk/resources/agent/runs.py">retrieve</a>(run_id) -> <a href="./src/warp_agent_sdk/types/agent/run_item.py">RunItem</a></code>
24+
- <code title="get /agent/runs">client.agent.runs.<a href="./src/warp_agent_sdk/resources/agent/runs.py">list</a>(\*\*<a href="src/warp_agent_sdk/types/agent/run_list_params.py">params</a>) -> <a href="./src/warp_agent_sdk/types/agent/run_list_response.py">RunListResponse</a></code>

src/warp_agent_sdk/resources/agent/__init__.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3+
from .runs import (
4+
RunsResource,
5+
AsyncRunsResource,
6+
RunsResourceWithRawResponse,
7+
AsyncRunsResourceWithRawResponse,
8+
RunsResourceWithStreamingResponse,
9+
AsyncRunsResourceWithStreamingResponse,
10+
)
311
from .agent import (
412
AgentResource,
513
AsyncAgentResource,
@@ -8,22 +16,14 @@
816
AgentResourceWithStreamingResponse,
917
AsyncAgentResourceWithStreamingResponse,
1018
)
11-
from .tasks import (
12-
TasksResource,
13-
AsyncTasksResource,
14-
TasksResourceWithRawResponse,
15-
AsyncTasksResourceWithRawResponse,
16-
TasksResourceWithStreamingResponse,
17-
AsyncTasksResourceWithStreamingResponse,
18-
)
1919

2020
__all__ = [
21-
"TasksResource",
22-
"AsyncTasksResource",
23-
"TasksResourceWithRawResponse",
24-
"AsyncTasksResourceWithRawResponse",
25-
"TasksResourceWithStreamingResponse",
26-
"AsyncTasksResourceWithStreamingResponse",
21+
"RunsResource",
22+
"AsyncRunsResource",
23+
"RunsResourceWithRawResponse",
24+
"AsyncRunsResourceWithRawResponse",
25+
"RunsResourceWithStreamingResponse",
26+
"AsyncRunsResourceWithStreamingResponse",
2727
"AgentResource",
2828
"AsyncAgentResource",
2929
"AgentResourceWithRawResponse",

src/warp_agent_sdk/resources/agent/agent.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
import httpx
66

7-
from .tasks import (
8-
TasksResource,
9-
AsyncTasksResource,
10-
TasksResourceWithRawResponse,
11-
AsyncTasksResourceWithRawResponse,
12-
TasksResourceWithStreamingResponse,
13-
AsyncTasksResourceWithStreamingResponse,
7+
from .runs import (
8+
RunsResource,
9+
AsyncRunsResource,
10+
RunsResourceWithRawResponse,
11+
AsyncRunsResourceWithRawResponse,
12+
RunsResourceWithStreamingResponse,
13+
AsyncRunsResourceWithStreamingResponse,
1414
)
1515
from ...types import agent_run_params
1616
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given
@@ -32,8 +32,8 @@
3232

3333
class AgentResource(SyncAPIResource):
3434
@cached_property
35-
def tasks(self) -> TasksResource:
36-
return TasksResource(self._client)
35+
def runs(self) -> RunsResource:
36+
return RunsResource(self._client)
3737

3838
@cached_property
3939
def with_raw_response(self) -> AgentResourceWithRawResponse:
@@ -71,16 +71,16 @@ def run(
7171
"""Spawn an ambient agent with a prompt and optional configuration.
7272
7373
The agent will
74-
be queued for execution and assigned a unique task ID.
74+
be queued for execution and assigned a unique run ID.
7575
7676
Args:
7777
prompt: The prompt/instruction for the agent to execute
7878
79-
config: Configuration for an ambient agent task
79+
config: Configuration for an ambient agent run
8080
81-
team: Make the task visible to all team members, not only the calling user
81+
team: Make the run visible to all team members, not only the calling user
8282
83-
title: Custom title for the task (auto-generated if not provided)
83+
title: Custom title for the run (auto-generated if not provided)
8484
8585
extra_headers: Send extra headers
8686
@@ -110,8 +110,8 @@ def run(
110110

111111
class AsyncAgentResource(AsyncAPIResource):
112112
@cached_property
113-
def tasks(self) -> AsyncTasksResource:
114-
return AsyncTasksResource(self._client)
113+
def runs(self) -> AsyncRunsResource:
114+
return AsyncRunsResource(self._client)
115115

116116
@cached_property
117117
def with_raw_response(self) -> AsyncAgentResourceWithRawResponse:
@@ -149,16 +149,16 @@ async def run(
149149
"""Spawn an ambient agent with a prompt and optional configuration.
150150
151151
The agent will
152-
be queued for execution and assigned a unique task ID.
152+
be queued for execution and assigned a unique run ID.
153153
154154
Args:
155155
prompt: The prompt/instruction for the agent to execute
156156
157-
config: Configuration for an ambient agent task
157+
config: Configuration for an ambient agent run
158158
159-
team: Make the task visible to all team members, not only the calling user
159+
team: Make the run visible to all team members, not only the calling user
160160
161-
title: Custom title for the task (auto-generated if not provided)
161+
title: Custom title for the run (auto-generated if not provided)
162162
163163
extra_headers: Send extra headers
164164
@@ -195,8 +195,8 @@ def __init__(self, agent: AgentResource) -> None:
195195
)
196196

197197
@cached_property
198-
def tasks(self) -> TasksResourceWithRawResponse:
199-
return TasksResourceWithRawResponse(self._agent.tasks)
198+
def runs(self) -> RunsResourceWithRawResponse:
199+
return RunsResourceWithRawResponse(self._agent.runs)
200200

201201

202202
class AsyncAgentResourceWithRawResponse:
@@ -208,8 +208,8 @@ def __init__(self, agent: AsyncAgentResource) -> None:
208208
)
209209

210210
@cached_property
211-
def tasks(self) -> AsyncTasksResourceWithRawResponse:
212-
return AsyncTasksResourceWithRawResponse(self._agent.tasks)
211+
def runs(self) -> AsyncRunsResourceWithRawResponse:
212+
return AsyncRunsResourceWithRawResponse(self._agent.runs)
213213

214214

215215
class AgentResourceWithStreamingResponse:
@@ -221,8 +221,8 @@ def __init__(self, agent: AgentResource) -> None:
221221
)
222222

223223
@cached_property
224-
def tasks(self) -> TasksResourceWithStreamingResponse:
225-
return TasksResourceWithStreamingResponse(self._agent.tasks)
224+
def runs(self) -> RunsResourceWithStreamingResponse:
225+
return RunsResourceWithStreamingResponse(self._agent.runs)
226226

227227

228228
class AsyncAgentResourceWithStreamingResponse:
@@ -234,5 +234,5 @@ def __init__(self, agent: AsyncAgentResource) -> None:
234234
)
235235

236236
@cached_property
237-
def tasks(self) -> AsyncTasksResourceWithStreamingResponse:
238-
return AsyncTasksResourceWithStreamingResponse(self._agent.tasks)
237+
def runs(self) -> AsyncRunsResourceWithStreamingResponse:
238+
return AsyncRunsResourceWithStreamingResponse(self._agent.runs)

0 commit comments

Comments
 (0)