From e004b304c22286151330c2200bcb85046a7ac111 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 30 Jul 2025 17:03:56 +0000 Subject: [PATCH 1/7] feat(client): support file upload requests --- src/agentex/_base_client.py | 5 ++++- src/agentex/_files.py | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/agentex/_base_client.py b/src/agentex/_base_client.py index 0cc1fbb7..67eb675d 100644 --- a/src/agentex/_base_client.py +++ b/src/agentex/_base_client.py @@ -532,7 +532,10 @@ def _build_request( is_body_allowed = options.method.lower() != "get" if is_body_allowed: - kwargs["json"] = json_data if is_given(json_data) else None + if isinstance(json_data, bytes): + kwargs["content"] = json_data + else: + kwargs["json"] = json_data if is_given(json_data) else None kwargs["files"] = files else: headers.pop("Content-Type", None) diff --git a/src/agentex/_files.py b/src/agentex/_files.py index 715cc207..cc14c14f 100644 --- a/src/agentex/_files.py +++ b/src/agentex/_files.py @@ -69,12 +69,12 @@ def _transform_file(file: FileTypes) -> HttpxFileTypes: return file if is_tuple_t(file): - return (file[0], _read_file_content(file[1]), *file[2:]) + return (file[0], read_file_content(file[1]), *file[2:]) raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple") -def _read_file_content(file: FileContent) -> HttpxFileContent: +def read_file_content(file: FileContent) -> HttpxFileContent: if isinstance(file, os.PathLike): return pathlib.Path(file).read_bytes() return file @@ -111,12 +111,12 @@ async def _async_transform_file(file: FileTypes) -> HttpxFileTypes: return file if is_tuple_t(file): - return (file[0], await _async_read_file_content(file[1]), *file[2:]) + return (file[0], await async_read_file_content(file[1]), *file[2:]) raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple") -async def _async_read_file_content(file: FileContent) -> HttpxFileContent: +async def async_read_file_content(file: FileContent) -> HttpxFileContent: if isinstance(file, os.PathLike): return await anyio.Path(file).read_bytes() From 097ca0b1dea79dfc28e5a8aeb409fb2c8e3db428 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 02:24:46 +0000 Subject: [PATCH 2/7] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b5dd2d61..6b2efc6a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 34 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp%2Fagentex-sdk-e1efa8c7e58d81f5c0242d4ea49ac7637b5d455d10a40f217b1183c229b65dd2.yml -openapi_spec_hash: 8fdf7cace40fb14a765c4e09c2d5bb95 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp%2Fagentex-sdk-733bcb26b2f53abaac835267d630274ca18eba7726350b65fa2a74cc490908c1.yml +openapi_spec_hash: f9a141a82a0b19bde31d6ea48ae4d6d6 config_hash: f6ec6016df1ff072b5b60cdf7b438361 From 81f0d7ca44eef25fc7bc0b9d33050ac0e9d9935b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 03:24:46 +0000 Subject: [PATCH 3/7] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6b2efc6a..b5dd2d61 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 34 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp%2Fagentex-sdk-733bcb26b2f53abaac835267d630274ca18eba7726350b65fa2a74cc490908c1.yml -openapi_spec_hash: f9a141a82a0b19bde31d6ea48ae4d6d6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp%2Fagentex-sdk-e1efa8c7e58d81f5c0242d4ea49ac7637b5d455d10a40f217b1183c229b65dd2.yml +openapi_spec_hash: 8fdf7cace40fb14a765c4e09c2d5bb95 config_hash: f6ec6016df1ff072b5b60cdf7b438361 From 8e4dccb5ab0419902a58cc9759ee566dc0a9f00f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 31 Jul 2025 22:24:48 +0000 Subject: [PATCH 4/7] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index b5dd2d61..6b2efc6a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 34 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp%2Fagentex-sdk-e1efa8c7e58d81f5c0242d4ea49ac7637b5d455d10a40f217b1183c229b65dd2.yml -openapi_spec_hash: 8fdf7cace40fb14a765c4e09c2d5bb95 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp%2Fagentex-sdk-733bcb26b2f53abaac835267d630274ca18eba7726350b65fa2a74cc490908c1.yml +openapi_spec_hash: f9a141a82a0b19bde31d6ea48ae4d6d6 config_hash: f6ec6016df1ff072b5b60cdf7b438361 From d4902d52caf82e2f57d1bbf19527cdc1448ed397 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 1 Aug 2025 00:18:07 +0000 Subject: [PATCH 5/7] feat(api): add query params to tasks.list allows listing tasks with filters on agent ID and name --- .stats.yml | 4 +- api.md | 2 +- src/agentex/resources/tasks.py | 58 +++++++++++++++++++++++++-- src/agentex/types/__init__.py | 1 + src/agentex/types/task_list_params.py | 14 +++++++ tests/api_resources/test_tasks.py | 18 +++++++++ 6 files changed, 90 insertions(+), 7 deletions(-) create mode 100644 src/agentex/types/task_list_params.py diff --git a/.stats.yml b/.stats.yml index 6b2efc6a..61c7aed6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 34 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp%2Fagentex-sdk-733bcb26b2f53abaac835267d630274ca18eba7726350b65fa2a74cc490908c1.yml -openapi_spec_hash: f9a141a82a0b19bde31d6ea48ae4d6d6 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp%2Fagentex-sdk-02d466207a009c07fd85804f8917889d1d5503dc600ff6d7fd78ef29cf9e93a1.yml +openapi_spec_hash: e40b923e3cd395998d53a4d5830ab7e4 config_hash: f6ec6016df1ff072b5b60cdf7b438361 diff --git a/api.md b/api.md index 0f9d0c99..9c135dfa 100644 --- a/api.md +++ b/api.md @@ -47,7 +47,7 @@ from agentex.types import Task, TaskListResponse Methods: - client.tasks.retrieve(task_id) -> Task -- client.tasks.list() -> TaskListResponse +- client.tasks.list(\*\*params) -> TaskListResponse - client.tasks.delete(task_id) -> DeleteResponse - client.tasks.delete_by_name(task_name) -> DeleteResponse - client.tasks.retrieve_by_name(task_name) -> Task diff --git a/src/agentex/resources/tasks.py b/src/agentex/resources/tasks.py index a7021c62..5a28465b 100644 --- a/src/agentex/resources/tasks.py +++ b/src/agentex/resources/tasks.py @@ -2,9 +2,13 @@ from __future__ import annotations +from typing import Optional + import httpx +from ..types import task_list_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven +from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( @@ -78,6 +82,8 @@ def retrieve( def list( self, *, + agent_id: Optional[str] | NotGiven = NOT_GIVEN, + agent_name: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -85,11 +91,32 @@ def list( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TaskListResponse: - """List all tasks.""" + """ + List all tasks. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ return self._get( "/tasks", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "agent_id": agent_id, + "agent_name": agent_name, + }, + task_list_params.TaskListParams, + ), ), cast_to=TaskListResponse, ) @@ -320,6 +347,8 @@ async def retrieve( async def list( self, *, + agent_id: Optional[str] | NotGiven = NOT_GIVEN, + agent_name: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -327,11 +356,32 @@ async def list( extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, ) -> TaskListResponse: - """List all tasks.""" + """ + List all tasks. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ return await self._get( "/tasks", options=make_request_options( - extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "agent_id": agent_id, + "agent_name": agent_name, + }, + task_list_params.TaskListParams, + ), ), cast_to=TaskListResponse, ) diff --git a/src/agentex/types/__init__.py b/src/agentex/types/__init__.py index 7e45d120..b502cb00 100644 --- a/src/agentex/types/__init__.py +++ b/src/agentex/types/__init__.py @@ -19,6 +19,7 @@ from .agent_rpc_params import AgentRpcParams as AgentRpcParams from .agent_rpc_result import AgentRpcResult as AgentRpcResult from .span_list_params import SpanListParams as SpanListParams +from .task_list_params import TaskListParams as TaskListParams from .agent_list_params import AgentListParams as AgentListParams from .event_list_params import EventListParams as EventListParams from .state_list_params import StateListParams as StateListParams diff --git a/src/agentex/types/task_list_params.py b/src/agentex/types/task_list_params.py new file mode 100644 index 00000000..f8bc3364 --- /dev/null +++ b/src/agentex/types/task_list_params.py @@ -0,0 +1,14 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing import Optional +from typing_extensions import TypedDict + +__all__ = ["TaskListParams"] + + +class TaskListParams(TypedDict, total=False): + agent_id: Optional[str] + + agent_name: Optional[str] diff --git a/tests/api_resources/test_tasks.py b/tests/api_resources/test_tasks.py index a46e5edc..6a707050 100644 --- a/tests/api_resources/test_tasks.py +++ b/tests/api_resources/test_tasks.py @@ -66,6 +66,15 @@ def test_method_list(self, client: Agentex) -> None: task = client.tasks.list() assert_matches_type(TaskListResponse, task, path=["response"]) + @pytest.mark.skip() + @parametrize + def test_method_list_with_all_params(self, client: Agentex) -> None: + task = client.tasks.list( + agent_id="agent_id", + agent_name="agent_name", + ) + assert_matches_type(TaskListResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize def test_raw_response_list(self, client: Agentex) -> None: @@ -350,6 +359,15 @@ async def test_method_list(self, async_client: AsyncAgentex) -> None: task = await async_client.tasks.list() assert_matches_type(TaskListResponse, task, path=["response"]) + @pytest.mark.skip() + @parametrize + async def test_method_list_with_all_params(self, async_client: AsyncAgentex) -> None: + task = await async_client.tasks.list( + agent_id="agent_id", + agent_name="agent_name", + ) + assert_matches_type(TaskListResponse, task, path=["response"]) + @pytest.mark.skip() @parametrize async def test_raw_response_list(self, async_client: AsyncAgentex) -> None: From b5fd49f0368c3517ae1f915555db0d0baacce08d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 1 Aug 2025 00:24:50 +0000 Subject: [PATCH 6/7] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 61c7aed6..49a26dc2 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 34 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp%2Fagentex-sdk-02d466207a009c07fd85804f8917889d1d5503dc600ff6d7fd78ef29cf9e93a1.yml -openapi_spec_hash: e40b923e3cd395998d53a4d5830ab7e4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp%2Fagentex-sdk-4e1c137bb7977db9f224437bef638a51725f001c0453a1adf273cf3b920a7120.yml +openapi_spec_hash: f52a4797cadb597b32615460abec2b18 config_hash: f6ec6016df1ff072b5b60cdf7b438361 From a1d5b903cc333920e18b7a97484bb38c75a5a2b5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 1 Aug 2025 15:00:36 +0000 Subject: [PATCH 7/7] release: 0.2.6 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 9 +++++++++ pyproject.toml | 2 +- src/agentex/_version.py | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 7f58a508..c4f43cf1 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.2.5" + ".": "0.2.6" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index e01a9cd9..212f923d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 0.2.6 (2025-08-01) + +Full Changelog: [v0.2.5...v0.2.6](https://github.com/scaleapi/agentex-python/compare/v0.2.5...v0.2.6) + +### Features + +* **api:** add query params to tasks.list ([d4902d5](https://github.com/scaleapi/agentex-python/commit/d4902d52caf82e2f57d1bbf19527cdc1448ed397)) +* **client:** support file upload requests ([e004b30](https://github.com/scaleapi/agentex-python/commit/e004b304c22286151330c2200bcb85046a7ac111)) + ## 0.2.5 (2025-07-30) Full Changelog: [v0.2.4...v0.2.5](https://github.com/scaleapi/agentex-python/compare/v0.2.4...v0.2.5) diff --git a/pyproject.toml b/pyproject.toml index 535f569b..6726f2e6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "agentex-sdk" -version = "0.2.5" +version = "0.2.6" description = "The official Python library for the agentex API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/agentex/_version.py b/src/agentex/_version.py index d59e7af8..4cde5e3d 100644 --- a/src/agentex/_version.py +++ b/src/agentex/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "agentex" -__version__ = "0.2.5" # x-release-please-version +__version__ = "0.2.6" # x-release-please-version