Skip to content

Commit 13a857b

Browse files
release: 1.2.0 (#106)
* feat(api): api update (#105) * fix: asyncify on non-asyncio runtimes (#107) * codegen metadata * feat(api): api update (#108) * feat(client): allow passing `NotGiven` for body (#109) fix(client): mark some request bodies as optional * release: 1.2.0 --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 7da3c7d commit 13a857b

File tree

11 files changed

+71
-20
lines changed

11 files changed

+71
-20
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.1.1"
2+
".": "1.2.0"
33
}

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 12
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-e8018130b37ed5edd723ea7d399d3db7d0b6e0d65962414da07ed981e960bcb3.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-32b8e3b9f33faf15b95ab7ece843b8d2b42af9f11b7afcccb244ef4600f72b2b.yml

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## 1.2.0 (2025-02-21)
4+
5+
Full Changelog: [v1.1.1...v1.2.0](https://github.com/ArcadeAI/arcade-py/compare/v1.1.1...v1.2.0)
6+
7+
### Features
8+
9+
* **api:** api update ([#105](https://github.com/ArcadeAI/arcade-py/issues/105)) ([7ed533f](https://github.com/ArcadeAI/arcade-py/commit/7ed533fca689340285fe5b194efd5b0f233e3bd4))
10+
* **api:** api update ([#108](https://github.com/ArcadeAI/arcade-py/issues/108)) ([ba6ddc9](https://github.com/ArcadeAI/arcade-py/commit/ba6ddc9d5d7d94fbf7764aff94b5fd8a6c28e7fa))
11+
* **client:** allow passing `NotGiven` for body ([#109](https://github.com/ArcadeAI/arcade-py/issues/109)) ([920d114](https://github.com/ArcadeAI/arcade-py/commit/920d114c56a7d31ef0914b6bff37d4928240622a))
12+
13+
14+
### Bug Fixes
15+
16+
* asyncify on non-asyncio runtimes ([#107](https://github.com/ArcadeAI/arcade-py/issues/107)) ([3252ac3](https://github.com/ArcadeAI/arcade-py/commit/3252ac3b2af698fd007f045e45097e858842b575))
17+
* **client:** mark some request bodies as optional ([920d114](https://github.com/ArcadeAI/arcade-py/commit/920d114c56a7d31ef0914b6bff37d4928240622a))
18+
319
## 1.1.1 (2025-02-13)
420

521
Full Changelog: [v1.1.0...v1.1.1](https://github.com/ArcadeAI/arcade-py/compare/v1.1.0...v1.1.1)

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ try:
101101
messages=[
102102
{
103103
"role": "user",
104-
"content": "Hello, how can I use Arcade AI?",
104+
"content": "Hello, how can I use Arcade?",
105105
}
106106
],
107107
)
@@ -151,7 +151,7 @@ client.with_options(max_retries=5).chat.completions.create(
151151
messages=[
152152
{
153153
"role": "user",
154-
"content": "Hello, how can I use Arcade AI?",
154+
"content": "Hello, how can I use Arcade?",
155155
}
156156
],
157157
)
@@ -181,7 +181,7 @@ client.with_options(timeout=5.0).chat.completions.create(
181181
messages=[
182182
{
183183
"role": "user",
184-
"content": "Hello, how can I use Arcade AI?",
184+
"content": "Hello, how can I use Arcade?",
185185
}
186186
],
187187
)
@@ -228,7 +228,7 @@ client = Arcade()
228228
response = client.chat.completions.with_raw_response.create(
229229
messages=[{
230230
"role": "user",
231-
"content": "Hello, how can I use Arcade AI?",
231+
"content": "Hello, how can I use Arcade?",
232232
}],
233233
)
234234
print(response.headers.get('X-My-Header'))
@@ -252,7 +252,7 @@ with client.chat.completions.with_streaming_response.create(
252252
messages=[
253253
{
254254
"role": "user",
255-
"content": "Hello, how can I use Arcade AI?",
255+
"content": "Hello, how can I use Arcade?",
256256
}
257257
],
258258
) as response:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "arcadepy"
3-
version = "1.1.1"
3+
version = "1.2.0"
44
description = "The official Python library for the Arcade API"
55
dynamic = ["readme"]
66
license = "MIT"

src/arcadepy/_base_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ def _build_request(
518518
# so that passing a `TypedDict` doesn't cause an error.
519519
# https://github.com/microsoft/pyright/issues/3526#event-6715453066
520520
params=self.qs.stringify(cast(Mapping[str, Any], params)) if params else None,
521-
json=json_data,
521+
json=json_data if is_given(json_data) else None,
522522
files=files,
523523
**kwargs,
524524
)

src/arcadepy/_utils/_sync.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,20 @@
77
from typing import Any, TypeVar, Callable, Awaitable
88
from typing_extensions import ParamSpec
99

10+
import anyio
11+
import sniffio
12+
import anyio.to_thread
13+
1014
T_Retval = TypeVar("T_Retval")
1115
T_ParamSpec = ParamSpec("T_ParamSpec")
1216

1317

1418
if sys.version_info >= (3, 9):
15-
to_thread = asyncio.to_thread
19+
_asyncio_to_thread = asyncio.to_thread
1620
else:
1721
# backport of https://docs.python.org/3/library/asyncio-task.html#asyncio.to_thread
1822
# for Python 3.8 support
19-
async def to_thread(
23+
async def _asyncio_to_thread(
2024
func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs
2125
) -> Any:
2226
"""Asynchronously run function *func* in a separate thread.
@@ -34,6 +38,17 @@ async def to_thread(
3438
return await loop.run_in_executor(None, func_call)
3539

3640

41+
async def to_thread(
42+
func: Callable[T_ParamSpec, T_Retval], /, *args: T_ParamSpec.args, **kwargs: T_ParamSpec.kwargs
43+
) -> T_Retval:
44+
if sniffio.current_async_library() == "asyncio":
45+
return await _asyncio_to_thread(func, *args, **kwargs)
46+
47+
return await anyio.to_thread.run_sync(
48+
functools.partial(func, *args, **kwargs),
49+
)
50+
51+
3752
# inspired by `asyncer`, https://github.com/tiangolo/asyncer
3853
def asyncify(function: Callable[T_ParamSpec, T_Retval]) -> Callable[T_ParamSpec, Awaitable[T_Retval]]:
3954
"""

src/arcadepy/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
__title__ = "arcadepy"
4-
__version__ = "1.1.1" # x-release-please-version
4+
__version__ = "1.2.0" # x-release-please-version

src/arcadepy/types/execute_tool_response.py

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

3-
from typing import Optional
3+
from typing import List, Optional
44

55
from .._models import BaseModel
66
from .shared.authorization_response import AuthorizationResponse
77

8-
__all__ = ["ExecuteToolResponse", "Output", "OutputError"]
8+
__all__ = ["ExecuteToolResponse", "Output", "OutputError", "OutputLog"]
99

1010

1111
class OutputError(BaseModel):
@@ -20,11 +20,21 @@ class OutputError(BaseModel):
2020
retry_after_ms: Optional[int] = None
2121

2222

23+
class OutputLog(BaseModel):
24+
level: str
25+
26+
message: str
27+
28+
subtype: Optional[str] = None
29+
30+
2331
class Output(BaseModel):
2432
authorization: Optional[AuthorizationResponse] = None
2533

2634
error: Optional[OutputError] = None
2735

36+
logs: Optional[List[OutputLog]] = None
37+
2838
value: Optional[object] = None
2939

3040

src/arcadepy/types/tool_execution_attempt.py

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

3-
from typing import Optional
3+
from typing import List, Optional
44

55
from .._models import BaseModel
66
from .shared.authorization_response import AuthorizationResponse
77

8-
__all__ = ["ToolExecutionAttempt", "Output", "OutputError"]
8+
__all__ = ["ToolExecutionAttempt", "Output", "OutputError", "OutputLog"]
99

1010

1111
class OutputError(BaseModel):
@@ -20,11 +20,21 @@ class OutputError(BaseModel):
2020
retry_after_ms: Optional[int] = None
2121

2222

23+
class OutputLog(BaseModel):
24+
level: str
25+
26+
message: str
27+
28+
subtype: Optional[str] = None
29+
30+
2331
class Output(BaseModel):
2432
authorization: Optional[AuthorizationResponse] = None
2533

2634
error: Optional[OutputError] = None
2735

36+
logs: Optional[List[OutputLog]] = None
37+
2838
value: Optional[object] = None
2939

3040

0 commit comments

Comments
 (0)