From 7ed533fca689340285fe5b194efd5b0f233e3bd4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Feb 2025 18:22:16 +0000 Subject: [PATCH 1/6] feat(api): api update (#105) --- .stats.yml | 2 +- README.md | 10 +++++----- tests/test_client.py | 8 ++++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index cc5ed9f2..4ea65bab 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 12 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-e8018130b37ed5edd723ea7d399d3db7d0b6e0d65962414da07ed981e960bcb3.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-220dec6c4df78f04b72232189f5c310a16158fe7a205fc7e60f1f54f906719af.yml diff --git a/README.md b/README.md index 19418286..f0336202 100644 --- a/README.md +++ b/README.md @@ -101,7 +101,7 @@ try: messages=[ { "role": "user", - "content": "Hello, how can I use Arcade AI?", + "content": "Hello, how can I use Arcade?", } ], ) @@ -151,7 +151,7 @@ client.with_options(max_retries=5).chat.completions.create( messages=[ { "role": "user", - "content": "Hello, how can I use Arcade AI?", + "content": "Hello, how can I use Arcade?", } ], ) @@ -181,7 +181,7 @@ client.with_options(timeout=5.0).chat.completions.create( messages=[ { "role": "user", - "content": "Hello, how can I use Arcade AI?", + "content": "Hello, how can I use Arcade?", } ], ) @@ -228,7 +228,7 @@ client = Arcade() response = client.chat.completions.with_raw_response.create( messages=[{ "role": "user", - "content": "Hello, how can I use Arcade AI?", + "content": "Hello, how can I use Arcade?", }], ) print(response.headers.get('X-My-Header')) @@ -252,7 +252,7 @@ with client.chat.completions.with_streaming_response.create( messages=[ { "role": "user", - "content": "Hello, how can I use Arcade AI?", + "content": "Hello, how can I use Arcade?", } ], ) as response: diff --git a/tests/test_client.py b/tests/test_client.py index c6453ebb..7a0b0109 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -724,7 +724,7 @@ def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) -> No messages=[ { "role": "user", - "content": "Hello, how can I use Arcade AI?", + "content": "Hello, how can I use Arcade?", } ] ), @@ -752,7 +752,7 @@ def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) -> Non messages=[ { "role": "user", - "content": "Hello, how can I use Arcade AI?", + "content": "Hello, how can I use Arcade?", } ] ), @@ -1526,7 +1526,7 @@ async def test_retrying_timeout_errors_doesnt_leak(self, respx_mock: MockRouter) messages=[ { "role": "user", - "content": "Hello, how can I use Arcade AI?", + "content": "Hello, how can I use Arcade?", } ] ), @@ -1554,7 +1554,7 @@ async def test_retrying_status_errors_doesnt_leak(self, respx_mock: MockRouter) messages=[ { "role": "user", - "content": "Hello, how can I use Arcade AI?", + "content": "Hello, how can I use Arcade?", } ] ), From 3252ac3b2af698fd007f045e45097e858842b575 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 03:02:00 +0000 Subject: [PATCH 2/6] fix: asyncify on non-asyncio runtimes (#107) --- src/arcadepy/_utils/_sync.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/arcadepy/_utils/_sync.py b/src/arcadepy/_utils/_sync.py index 8b3aaf2b..ad7ec71b 100644 --- a/src/arcadepy/_utils/_sync.py +++ b/src/arcadepy/_utils/_sync.py @@ -7,16 +7,20 @@ from typing import Any, TypeVar, Callable, Awaitable from typing_extensions import ParamSpec +import anyio +import sniffio +import anyio.to_thread + T_Retval = TypeVar("T_Retval") T_ParamSpec = ParamSpec("T_ParamSpec") if sys.version_info >= (3, 9): - to_thread = asyncio.to_thread + _asyncio_to_thread = asyncio.to_thread else: # backport of https://docs.python.org/3/library/asyncio-task.html#asyncio.to_thread # for Python 3.8 support - async def to_thread( + async def _asyncio_to_thread( func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs ) -> Any: """Asynchronously run function *func* in a separate thread. @@ -34,6 +38,17 @@ async def to_thread( return await loop.run_in_executor(None, func_call) +async def to_thread( + func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs +) -> T_Retval: + if sniffio.current_async_library() == "asyncio": + return await _asyncio_to_thread(func, *args, **kwargs) + + return await anyio.to_thread.run_sync( + functools.partial(func, *args, **kwargs), + ) + + # inspired by `asyncer`, https://github.com/tiangolo/asyncer def asyncify(function: Callable[T_ParamSpec, T_Retval]) -> Callable[T_ParamSpec, Awaitable[T_Retval]]: """ From 17592a6bab7cbc78e45b3fc96437e170d26f4f36 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 17:35:24 +0000 Subject: [PATCH 3/6] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 4ea65bab..4f07287d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 12 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-220dec6c4df78f04b72232189f5c310a16158fe7a205fc7e60f1f54f906719af.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-eaac1b5b072ceed69a940b71a93fc4d7fe13256b956f3653d62535f56f8fea7b.yml From ba6ddc9d5d7d94fbf7764aff94b5fd8a6c28e7fa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 18 Feb 2025 21:28:10 +0000 Subject: [PATCH 4/6] feat(api): api update (#108) --- .stats.yml | 2 +- src/arcadepy/types/execute_tool_response.py | 14 ++++++++++++-- src/arcadepy/types/tool_execution_attempt.py | 14 ++++++++++++-- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index 4f07287d..b18f1d3c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,2 +1,2 @@ configured_endpoints: 12 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-eaac1b5b072ceed69a940b71a93fc4d7fe13256b956f3653d62535f56f8fea7b.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-32b8e3b9f33faf15b95ab7ece843b8d2b42af9f11b7afcccb244ef4600f72b2b.yml diff --git a/src/arcadepy/types/execute_tool_response.py b/src/arcadepy/types/execute_tool_response.py index 463afb71..ddbe0334 100644 --- a/src/arcadepy/types/execute_tool_response.py +++ b/src/arcadepy/types/execute_tool_response.py @@ -1,11 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from .._models import BaseModel from .shared.authorization_response import AuthorizationResponse -__all__ = ["ExecuteToolResponse", "Output", "OutputError"] +__all__ = ["ExecuteToolResponse", "Output", "OutputError", "OutputLog"] class OutputError(BaseModel): @@ -20,11 +20,21 @@ class OutputError(BaseModel): retry_after_ms: Optional[int] = None +class OutputLog(BaseModel): + level: str + + message: str + + subtype: Optional[str] = None + + class Output(BaseModel): authorization: Optional[AuthorizationResponse] = None error: Optional[OutputError] = None + logs: Optional[List[OutputLog]] = None + value: Optional[object] = None diff --git a/src/arcadepy/types/tool_execution_attempt.py b/src/arcadepy/types/tool_execution_attempt.py index 6ec1bc2c..c22091db 100644 --- a/src/arcadepy/types/tool_execution_attempt.py +++ b/src/arcadepy/types/tool_execution_attempt.py @@ -1,11 +1,11 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional +from typing import List, Optional from .._models import BaseModel from .shared.authorization_response import AuthorizationResponse -__all__ = ["ToolExecutionAttempt", "Output", "OutputError"] +__all__ = ["ToolExecutionAttempt", "Output", "OutputError", "OutputLog"] class OutputError(BaseModel): @@ -20,11 +20,21 @@ class OutputError(BaseModel): retry_after_ms: Optional[int] = None +class OutputLog(BaseModel): + level: str + + message: str + + subtype: Optional[str] = None + + class Output(BaseModel): authorization: Optional[AuthorizationResponse] = None error: Optional[OutputError] = None + logs: Optional[List[OutputLog]] = None + value: Optional[object] = None From 920d114c56a7d31ef0914b6bff37d4928240622a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 03:29:59 +0000 Subject: [PATCH 5/6] feat(client): allow passing `NotGiven` for body (#109) fix(client): mark some request bodies as optional --- src/arcadepy/_base_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/arcadepy/_base_client.py b/src/arcadepy/_base_client.py index 7185c51e..d80dee6f 100644 --- a/src/arcadepy/_base_client.py +++ b/src/arcadepy/_base_client.py @@ -518,7 +518,7 @@ def _build_request( # so that passing a `TypedDict` doesn't cause an error. # https://github.com/microsoft/pyright/issues/3526#event-6715453066 params=self.qs.stringify(cast(Mapping[str, Any], params)) if params else None, - json=json_data, + json=json_data if is_given(json_data) else None, files=files, **kwargs, ) From 18dc8e8dff14a4b958a79174ee864a5cc63588e3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 21 Feb 2025 03:30:26 +0000 Subject: [PATCH 6/6] release: 1.2.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 16 ++++++++++++++++ pyproject.toml | 2 +- src/arcadepy/_version.py | 2 +- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index b55c11f0..d0ab6645 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.1.1" + ".": "1.2.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 3818c6fc..f72d3bc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,21 @@ # Changelog +## 1.2.0 (2025-02-21) + +Full Changelog: [v1.1.1...v1.2.0](https://github.com/ArcadeAI/arcade-py/compare/v1.1.1...v1.2.0) + +### Features + +* **api:** api update ([#105](https://github.com/ArcadeAI/arcade-py/issues/105)) ([7ed533f](https://github.com/ArcadeAI/arcade-py/commit/7ed533fca689340285fe5b194efd5b0f233e3bd4)) +* **api:** api update ([#108](https://github.com/ArcadeAI/arcade-py/issues/108)) ([ba6ddc9](https://github.com/ArcadeAI/arcade-py/commit/ba6ddc9d5d7d94fbf7764aff94b5fd8a6c28e7fa)) +* **client:** allow passing `NotGiven` for body ([#109](https://github.com/ArcadeAI/arcade-py/issues/109)) ([920d114](https://github.com/ArcadeAI/arcade-py/commit/920d114c56a7d31ef0914b6bff37d4928240622a)) + + +### Bug Fixes + +* asyncify on non-asyncio runtimes ([#107](https://github.com/ArcadeAI/arcade-py/issues/107)) ([3252ac3](https://github.com/ArcadeAI/arcade-py/commit/3252ac3b2af698fd007f045e45097e858842b575)) +* **client:** mark some request bodies as optional ([920d114](https://github.com/ArcadeAI/arcade-py/commit/920d114c56a7d31ef0914b6bff37d4928240622a)) + ## 1.1.1 (2025-02-13) Full Changelog: [v1.1.0...v1.1.1](https://github.com/ArcadeAI/arcade-py/compare/v1.1.0...v1.1.1) diff --git a/pyproject.toml b/pyproject.toml index ca6767dd..69409a1d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "arcadepy" -version = "1.1.1" +version = "1.2.0" description = "The official Python library for the Arcade API" dynamic = ["readme"] license = "MIT" diff --git a/src/arcadepy/_version.py b/src/arcadepy/_version.py index 7cba56af..021dd3f2 100644 --- a/src/arcadepy/_version.py +++ b/src/arcadepy/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "arcadepy" -__version__ = "1.1.1" # x-release-please-version +__version__ = "1.2.0" # x-release-please-version