Skip to content

Commit aee4ad1

Browse files
feat(api): api update
1 parent dd73dba commit aee4ad1

File tree

9 files changed

+24
-64
lines changed

9 files changed

+24
-64
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: 34
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp%2Fagentex-sdk-ed22476258be08ff765c68dcb29c08baf3e4783c98edac50d1e8003e9487db37.yml
3-
openapi_spec_hash: d4010bb4bf479073328ca00be01a7b96
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp%2Fagentex-sdk-315b05c82c3c0fdc9f058422debc4edc09c04cef2f7ff8605953de11d16c489f.yml
3+
openapi_spec_hash: 1bc36f6ebe0d9d926c4312de7ec9222e
44
config_hash: 7c1f6794a184ee175dd94f2f7c2b496b

api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ Methods:
3535
Types:
3636

3737
```python
38-
from agentex.types import Task, TaskListResponse, TaskDeleteResponse, TaskDeleteByNameResponse
38+
from agentex.types import Task, TaskListResponse, TaskDeleteByNameResponse
3939
```
4040

4141
Methods:
4242

4343
- <code title="get /tasks/{task_id}">client.tasks.<a href="./src/agentex/resources/tasks.py">retrieve</a>(task_id) -> <a href="./src/agentex/types/task.py">Task</a></code>
4444
- <code title="get /tasks">client.tasks.<a href="./src/agentex/resources/tasks.py">list</a>() -> <a href="./src/agentex/types/task_list_response.py">TaskListResponse</a></code>
45-
- <code title="delete /tasks/{task_id}">client.tasks.<a href="./src/agentex/resources/tasks.py">delete</a>(task_id) -> <a href="./src/agentex/types/task_delete_response.py">TaskDeleteResponse</a></code>
45+
- <code title="delete /tasks/{task_id}">client.tasks.<a href="./src/agentex/resources/tasks.py">delete</a>(task_id) -> <a href="./src/agentex/types/task.py">Task</a></code>
4646
- <code title="delete /tasks/name/{task_name}">client.tasks.<a href="./src/agentex/resources/tasks.py">delete_by_name</a>(task_name) -> <a href="./src/agentex/types/task_delete_by_name_response.py">TaskDeleteByNameResponse</a></code>
4747
- <code title="get /tasks/name/{task_name}">client.tasks.<a href="./src/agentex/resources/tasks.py">retrieve_by_name</a>(task_name) -> <a href="./src/agentex/types/task.py">Task</a></code>
4848
- <code title="get /tasks/{task_id}/stream">client.tasks.<a href="./src/agentex/resources/tasks.py">stream_events</a>(task_id) -> object</code>

src/agentex/resources/messages/messages.py

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ def update(
179179
def list(
180180
self,
181181
*,
182-
task_id: str,
183182
limit: Optional[int] | NotGiven = NOT_GIVEN,
184183
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
185184
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -207,13 +206,7 @@ def list(
207206
extra_query=extra_query,
208207
extra_body=extra_body,
209208
timeout=timeout,
210-
query=maybe_transform(
211-
{
212-
"task_id": task_id,
213-
"limit": limit,
214-
},
215-
message_list_params.MessageListParams,
216-
),
209+
query=maybe_transform({"limit": limit}, message_list_params.MessageListParams),
217210
),
218211
cast_to=MessageListResponse,
219212
)
@@ -364,7 +357,6 @@ async def update(
364357
async def list(
365358
self,
366359
*,
367-
task_id: str,
368360
limit: Optional[int] | NotGiven = NOT_GIVEN,
369361
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
370362
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -392,13 +384,7 @@ async def list(
392384
extra_query=extra_query,
393385
extra_body=extra_body,
394386
timeout=timeout,
395-
query=await async_maybe_transform(
396-
{
397-
"task_id": task_id,
398-
"limit": limit,
399-
},
400-
message_list_params.MessageListParams,
401-
),
387+
query=await async_maybe_transform({"limit": limit}, message_list_params.MessageListParams),
402388
),
403389
cast_to=MessageListResponse,
404390
)

src/agentex/resources/tasks.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
from ..types.task import Task
1818
from .._base_client import make_request_options
1919
from ..types.task_list_response import TaskListResponse
20-
from ..types.task_delete_response import TaskDeleteResponse
2120
from ..types.task_delete_by_name_response import TaskDeleteByNameResponse
2221

2322
__all__ = ["TasksResource", "AsyncTasksResource"]
@@ -105,7 +104,7 @@ def delete(
105104
extra_query: Query | None = None,
106105
extra_body: Body | None = None,
107106
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
108-
) -> TaskDeleteResponse:
107+
) -> Task:
109108
"""
110109
Delete a task by its unique ID.
111110
@@ -125,7 +124,7 @@ def delete(
125124
options=make_request_options(
126125
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
127126
),
128-
cast_to=TaskDeleteResponse,
127+
cast_to=Task,
129128
)
130129

131130
def delete_by_name(
@@ -347,7 +346,7 @@ async def delete(
347346
extra_query: Query | None = None,
348347
extra_body: Body | None = None,
349348
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
350-
) -> TaskDeleteResponse:
349+
) -> Task:
351350
"""
352351
Delete a task by its unique ID.
353352
@@ -367,7 +366,7 @@ async def delete(
367366
options=make_request_options(
368367
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
369368
),
370-
cast_to=TaskDeleteResponse,
369+
cast_to=Task,
371370
)
372371

373372
async def delete_by_name(

src/agentex/types/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
from .task_message_update import TaskMessageUpdate as TaskMessageUpdate
4141
from .tool_response_delta import ToolResponseDelta as ToolResponseDelta
4242
from .tracker_list_params import TrackerListParams as TrackerListParams
43-
from .task_delete_response import TaskDeleteResponse as TaskDeleteResponse
4443
from .task_message_content import TaskMessageContent as TaskMessageContent
4544
from .tool_request_content import ToolRequestContent as ToolRequestContent
4645
from .message_create_params import MessageCreateParams as MessageCreateParams

src/agentex/types/message_list_params.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
from __future__ import annotations
44

55
from typing import Optional
6-
from typing_extensions import Required, TypedDict
6+
from typing_extensions import TypedDict
77

88
__all__ = ["MessageListParams"]
99

1010

1111
class MessageListParams(TypedDict, total=False):
12-
task_id: Required[str]
13-
1412
limit: Optional[int]

src/agentex/types/task_delete_response.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

tests/api_resources/test_messages.py

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -229,26 +229,21 @@ def test_path_params_update(self, client: Agentex) -> None:
229229
@pytest.mark.skip()
230230
@parametrize
231231
def test_method_list(self, client: Agentex) -> None:
232-
message = client.messages.list(
233-
task_id="task_id",
234-
)
232+
message = client.messages.list()
235233
assert_matches_type(MessageListResponse, message, path=["response"])
236234

237235
@pytest.mark.skip()
238236
@parametrize
239237
def test_method_list_with_all_params(self, client: Agentex) -> None:
240238
message = client.messages.list(
241-
task_id="task_id",
242239
limit=0,
243240
)
244241
assert_matches_type(MessageListResponse, message, path=["response"])
245242

246243
@pytest.mark.skip()
247244
@parametrize
248245
def test_raw_response_list(self, client: Agentex) -> None:
249-
response = client.messages.with_raw_response.list(
250-
task_id="task_id",
251-
)
246+
response = client.messages.with_raw_response.list()
252247

253248
assert response.is_closed is True
254249
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -258,9 +253,7 @@ def test_raw_response_list(self, client: Agentex) -> None:
258253
@pytest.mark.skip()
259254
@parametrize
260255
def test_streaming_response_list(self, client: Agentex) -> None:
261-
with client.messages.with_streaming_response.list(
262-
task_id="task_id",
263-
) as response:
256+
with client.messages.with_streaming_response.list() as response:
264257
assert not response.is_closed
265258
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
266259

@@ -484,26 +477,21 @@ async def test_path_params_update(self, async_client: AsyncAgentex) -> None:
484477
@pytest.mark.skip()
485478
@parametrize
486479
async def test_method_list(self, async_client: AsyncAgentex) -> None:
487-
message = await async_client.messages.list(
488-
task_id="task_id",
489-
)
480+
message = await async_client.messages.list()
490481
assert_matches_type(MessageListResponse, message, path=["response"])
491482

492483
@pytest.mark.skip()
493484
@parametrize
494485
async def test_method_list_with_all_params(self, async_client: AsyncAgentex) -> None:
495486
message = await async_client.messages.list(
496-
task_id="task_id",
497487
limit=0,
498488
)
499489
assert_matches_type(MessageListResponse, message, path=["response"])
500490

501491
@pytest.mark.skip()
502492
@parametrize
503493
async def test_raw_response_list(self, async_client: AsyncAgentex) -> None:
504-
response = await async_client.messages.with_raw_response.list(
505-
task_id="task_id",
506-
)
494+
response = await async_client.messages.with_raw_response.list()
507495

508496
assert response.is_closed is True
509497
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
@@ -513,9 +501,7 @@ async def test_raw_response_list(self, async_client: AsyncAgentex) -> None:
513501
@pytest.mark.skip()
514502
@parametrize
515503
async def test_streaming_response_list(self, async_client: AsyncAgentex) -> None:
516-
async with async_client.messages.with_streaming_response.list(
517-
task_id="task_id",
518-
) as response:
504+
async with async_client.messages.with_streaming_response.list() as response:
519505
assert not response.is_closed
520506
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
521507

tests/api_resources/test_tasks.py

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

1010
from agentex import Agentex, AsyncAgentex
1111
from tests.utils import assert_matches_type
12-
from agentex.types import Task, TaskListResponse, TaskDeleteResponse, TaskDeleteByNameResponse
12+
from agentex.types import Task, TaskListResponse, TaskDeleteByNameResponse
1313

1414
base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
1515

@@ -93,7 +93,7 @@ def test_method_delete(self, client: Agentex) -> None:
9393
task = client.tasks.delete(
9494
"task_id",
9595
)
96-
assert_matches_type(TaskDeleteResponse, task, path=["response"])
96+
assert_matches_type(Task, task, path=["response"])
9797

9898
@pytest.mark.skip()
9999
@parametrize
@@ -105,7 +105,7 @@ def test_raw_response_delete(self, client: Agentex) -> None:
105105
assert response.is_closed is True
106106
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
107107
task = response.parse()
108-
assert_matches_type(TaskDeleteResponse, task, path=["response"])
108+
assert_matches_type(Task, task, path=["response"])
109109

110110
@pytest.mark.skip()
111111
@parametrize
@@ -117,7 +117,7 @@ def test_streaming_response_delete(self, client: Agentex) -> None:
117117
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
118118

119119
task = response.parse()
120-
assert_matches_type(TaskDeleteResponse, task, path=["response"])
120+
assert_matches_type(Task, task, path=["response"])
121121

122122
assert cast(Any, response.is_closed) is True
123123

@@ -377,7 +377,7 @@ async def test_method_delete(self, async_client: AsyncAgentex) -> None:
377377
task = await async_client.tasks.delete(
378378
"task_id",
379379
)
380-
assert_matches_type(TaskDeleteResponse, task, path=["response"])
380+
assert_matches_type(Task, task, path=["response"])
381381

382382
@pytest.mark.skip()
383383
@parametrize
@@ -389,7 +389,7 @@ async def test_raw_response_delete(self, async_client: AsyncAgentex) -> None:
389389
assert response.is_closed is True
390390
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
391391
task = await response.parse()
392-
assert_matches_type(TaskDeleteResponse, task, path=["response"])
392+
assert_matches_type(Task, task, path=["response"])
393393

394394
@pytest.mark.skip()
395395
@parametrize
@@ -401,7 +401,7 @@ async def test_streaming_response_delete(self, async_client: AsyncAgentex) -> No
401401
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
402402

403403
task = await response.parse()
404-
assert_matches_type(TaskDeleteResponse, task, path=["response"])
404+
assert_matches_type(Task, task, path=["response"])
405405

406406
assert cast(Any, response.is_closed) is True
407407

0 commit comments

Comments
 (0)