Skip to content

Commit c81b12e

Browse files
Sparteestainless-app[bot]nbarbettini
authored
Rename some class in tests (#81)
* chore(internal): bump pydantic dependency (#56) * docs(readme): fix http client proxies example (#58) * chore(internal): bump pyright (#59) * chore(internal): add support for TypeAliasType (#60) * chore(internal): codegen related update (#61) * chore(internal): codegen related update (#62) * chore(internal): updated imports (#63) * chore(internal): codegen related update (#64) * chore(internal): fix some typos (#65) * chore(internal): codegen related update (#66) * chore: add missing isclass check (#67) * chore(internal): bump httpx dependency (#68) * fix(client): only call .close() when needed (#69) * docs: fix typos (#70) * chore(internal): codegen related update (#71) * fix: correctly handle deserialising `cls` fields (#72) * feat(api): api update (#73) * feat(api): api update (#75) * feat(api): api update (#76) * codegen metadata * feat: feat!: Update helper methods for client breaking changes (#78) * feat!: Update helper methods for client breaking changes * Cleanup * feat: rc2 (#80) * AuthResponse * format --------- Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com> Co-authored-by: Nate Barbettini <[email protected]>
1 parent e32057a commit c81b12e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+1331
-570
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
configured_endpoints: 10
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-4a9af27c5fe900e731350e1d8b72743021977c7863dd41764803a996298dc5b5.yml
1+
configured_endpoints: 12
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-16b37006524034a6b22469da3273ff0f3ce92b3f112192502449de753245d732.yml

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2024 Arcade
1+
Copyright 2025 Arcade
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
44

README.md

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ client = Arcade(
3131
api_key=os.environ.get("ARCADE_API_KEY"), # This is the default and can be omitted
3232
)
3333

34-
response = client.tools.execute(
34+
execute_tool_response = client.tools.execute(
3535
tool_name="Google.ListEmails",
36-
inputs={"n_emails": 10},
36+
input={"n_emails": 10},
3737
user_id="[email protected]",
3838
)
39-
print(response.invocation_id)
39+
print(execute_tool_response.id)
4040
```
4141

4242
While you can provide an `api_key` keyword argument,
@@ -59,12 +59,12 @@ client = AsyncArcade(
5959

6060

6161
async def main() -> None:
62-
response = await client.tools.execute(
62+
execute_tool_response = await client.tools.execute(
6363
tool_name="Google.ListEmails",
64-
inputs={"n_emails": 10},
64+
input={"n_emails": 10},
6565
user_id="[email protected]",
6666
)
67-
print(response.invocation_id)
67+
print(execute_tool_response.id)
6868

6969

7070
asyncio.run(main())
@@ -116,7 +116,7 @@ except arcadepy.APIStatusError as e:
116116
print(e.response)
117117
```
118118

119-
Error codes are as followed:
119+
Error codes are as follows:
120120

121121
| Status Code | Error Type |
122122
| ----------- | -------------------------- |
@@ -273,8 +273,7 @@ If you need to access undocumented endpoints, params, or response properties, th
273273
#### Undocumented endpoints
274274

275275
To make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other
276-
http verbs. Options on the client will be respected (such as retries) will be respected when making this
277-
request.
276+
http verbs. Options on the client will be respected (such as retries) when making this request.
278277

279278
```py
280279
import httpx
@@ -303,18 +302,19 @@ can also get all the extra fields on the Pydantic model as a dict with
303302

304303
You can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:
305304

306-
- Support for proxies
307-
- Custom transports
305+
- Support for [proxies](https://www.python-httpx.org/advanced/proxies/)
306+
- Custom [transports](https://www.python-httpx.org/advanced/transports/)
308307
- Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality
309308

310309
```python
310+
import httpx
311311
from arcadepy import Arcade, DefaultHttpxClient
312312

313313
client = Arcade(
314314
# Or use the `ARCADE_BASE_URL` env var
315315
base_url="http://my.test.server.example.com:8083",
316316
http_client=DefaultHttpxClient(
317-
proxies="http://my.test.proxy.example.com",
317+
proxy="http://my.test.proxy.example.com",
318318
transport=httpx.HTTPTransport(local_address="0.0.0.0"),
319319
),
320320
)
@@ -330,12 +330,22 @@ client.with_options(http_client=DefaultHttpxClient(...))
330330

331331
By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.
332332

333+
```py
334+
from arcadepy import Arcade
335+
336+
with Arcade() as client:
337+
# make requests here
338+
...
339+
340+
# HTTP client is now closed
341+
```
342+
333343
## Versioning
334344

335345
This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:
336346

337347
1. Changes that only affect static types, without breaking runtime behavior.
338-
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_.
348+
2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals.)_
339349
3. Changes that we do not expect to impact the vast majority of users in practice.
340350

341351
We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

api.md

Lines changed: 27 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Shared Types
22

33
```python
4-
from arcadepy.types import AuthorizationResponse, Error, ToolDefinition
4+
from arcadepy.types import AuthAuthorizationContext, AuthAuthorizationResponse, Error
55
```
66

77
# Auth
@@ -14,8 +14,8 @@ from arcadepy.types import AuthRequest
1414

1515
Methods:
1616

17-
- <code title="post /v1/auth/authorize">client.auth.<a href="./src/arcadepy/resources/auth.py">authorize</a>(\*\*<a href="src/arcadepy/types/auth_authorize_params.py">params</a>) -> <a href="./src/arcadepy/types/shared/authorization_response.py">AuthorizationResponse</a></code>
18-
- <code title="get /v1/auth/status">client.auth.<a href="./src/arcadepy/resources/auth.py">status</a>(\*\*<a href="src/arcadepy/types/auth_status_params.py">params</a>) -> <a href="./src/arcadepy/types/shared/authorization_response.py">AuthorizationResponse</a></code>
17+
- <code title="post /v1/auth/authorize">client.auth.<a href="./src/arcadepy/resources/auth.py">authorize</a>(\*\*<a href="src/arcadepy/types/auth_authorize_params.py">params</a>) -> <a href="./src/arcadepy/types/shared/auth_authorization_response.py">AuthAuthorizationResponse</a></code>
18+
- <code title="get /v1/auth/status">client.auth.<a href="./src/arcadepy/resources/auth.py">status</a>(\*\*<a href="src/arcadepy/types/auth_status_params.py">params</a>) -> <a href="./src/arcadepy/types/shared/auth_authorization_response.py">AuthAuthorizationResponse</a></code>
1919

2020
# Health
2121

@@ -51,23 +51,34 @@ Types:
5151
from arcadepy.types import (
5252
AuthorizeToolRequest,
5353
ExecuteToolRequest,
54-
Inputs,
55-
Output,
56-
Parameter,
57-
Requirements,
58-
Response,
59-
ResponseOutput,
60-
ToolkitDefinition,
54+
ExecuteToolResponse,
55+
ToolExecution,
56+
ToolExecutionAttempt,
6157
ValueSchema,
58+
ToolListResponse,
59+
ToolGetResponse,
6260
)
6361
```
6462

6563
Methods:
6664

67-
- <code title="get /v1/tools/list">client.tools.<a href="./src/arcadepy/resources/tools/tools.py">list</a>(\*\*<a href="src/arcadepy/types/tool_list_params.py">params</a>) -> <a href="./src/arcadepy/types/shared/tool_definition.py">SyncOffsetPage[ToolDefinition]</a></code>
68-
- <code title="post /v1/tools/authorize">client.tools.<a href="./src/arcadepy/resources/tools/tools.py">authorize</a>(\*\*<a href="src/arcadepy/types/tool_authorize_params.py">params</a>) -> <a href="./src/arcadepy/types/shared/authorization_response.py">AuthorizationResponse</a></code>
69-
- <code title="post /v1/tools/execute">client.tools.<a href="./src/arcadepy/resources/tools/tools.py">execute</a>(\*\*<a href="src/arcadepy/types/tool_execute_params.py">params</a>) -> <a href="./src/arcadepy/types/response.py">Response</a></code>
70-
- <code title="get /v1/tools/definition">client.tools.<a href="./src/arcadepy/resources/tools/tools.py">get</a>(\*\*<a href="src/arcadepy/types/tool_get_params.py">params</a>) -> <a href="./src/arcadepy/types/shared/tool_definition.py">ToolDefinition</a></code>
65+
- <code title="get /v1/tools">client.tools.<a href="./src/arcadepy/resources/tools/tools.py">list</a>(\*\*<a href="src/arcadepy/types/tool_list_params.py">params</a>) -> <a href="./src/arcadepy/types/tool_list_response.py">SyncOffsetPage[ToolListResponse]</a></code>
66+
- <code title="post /v1/tools/authorize">client.tools.<a href="./src/arcadepy/resources/tools/tools.py">authorize</a>(\*\*<a href="src/arcadepy/types/tool_authorize_params.py">params</a>) -> <a href="./src/arcadepy/types/shared/auth_authorization_response.py">AuthAuthorizationResponse</a></code>
67+
- <code title="post /v1/tools/execute">client.tools.<a href="./src/arcadepy/resources/tools/tools.py">execute</a>(\*\*<a href="src/arcadepy/types/tool_execute_params.py">params</a>) -> <a href="./src/arcadepy/types/execute_tool_response.py">ExecuteToolResponse</a></code>
68+
- <code title="get /v1/tools/{name}">client.tools.<a href="./src/arcadepy/resources/tools/tools.py">get</a>(name) -> <a href="./src/arcadepy/types/tool_get_response.py">ToolGetResponse</a></code>
69+
70+
## Scheduled
71+
72+
Types:
73+
74+
```python
75+
from arcadepy.types.tools import ScheduledGetResponse
76+
```
77+
78+
Methods:
79+
80+
- <code title="get /v1/scheduled_tools">client.tools.scheduled.<a href="./src/arcadepy/resources/tools/scheduled.py">list</a>(\*\*<a href="src/arcadepy/types/tools/scheduled_list_params.py">params</a>) -> <a href="./src/arcadepy/types/tool_execution.py">SyncOffsetPage[ToolExecution]</a></code>
81+
- <code title="get /v1/scheduled_tools/{id}">client.tools.scheduled.<a href="./src/arcadepy/resources/tools/scheduled.py">get</a>(id) -> <a href="./src/arcadepy/types/tools/scheduled_get_response.py">ScheduledGetResponse</a></code>
7182

7283
## Formatted
7384

@@ -79,5 +90,5 @@ from arcadepy.types.tools import FormattedListResponse, FormattedGetResponse
7990

8091
Methods:
8192

82-
- <code title="get /v1/tools/formatted/list">client.tools.formatted.<a href="./src/arcadepy/resources/tools/formatted.py">list</a>(\*\*<a href="src/arcadepy/types/tools/formatted_list_params.py">params</a>) -> <a href="./src/arcadepy/types/tools/formatted_list_response.py">SyncOffsetPage[object]</a></code>
83-
- <code title="get /v1/tools/formatted/definition">client.tools.formatted.<a href="./src/arcadepy/resources/tools/formatted.py">get</a>(\*\*<a href="src/arcadepy/types/tools/formatted_get_params.py">params</a>) -> <a href="./src/arcadepy/types/tools/formatted_get_response.py">object</a></code>
93+
- <code title="get /v1/formatted_tools">client.tools.formatted.<a href="./src/arcadepy/resources/tools/formatted.py">list</a>(\*\*<a href="src/arcadepy/types/tools/formatted_list_params.py">params</a>) -> <a href="./src/arcadepy/types/tools/formatted_list_response.py">SyncOffsetPage[object]</a></code>
94+
- <code title="get /v1/formatted_tools/{name}">client.tools.formatted.<a href="./src/arcadepy/resources/tools/formatted.py">get</a>(name, \*\*<a href="src/arcadepy/types/tools/formatted_get_params.py">params</a>) -> <a href="./src/arcadepy/types/tools/formatted_get_response.py">object</a></code>

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ authors = [
1010
dependencies = [
1111
"httpx>=0.23.0, <1",
1212
"pydantic>=1.9.0, <3",
13-
"typing-extensions>=4.7, <5",
13+
"typing-extensions>=4.10, <5",
1414
"anyio>=3.5.0, <5",
1515
"distro>=1.7.0, <2",
1616
"sniffio",
@@ -54,7 +54,7 @@ dev-dependencies = [
5454
"dirty-equals>=0.6.0",
5555
"importlib-metadata>=6.7.0",
5656
"rich>=13.7.1",
57-
"nest_asyncio==1.6.0"
57+
"nest_asyncio==1.6.0",
5858
]
5959

6060
[tool.rye.scripts]

requirements-dev.lock

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ h11==0.14.0
3535
# via httpcore
3636
httpcore==1.0.2
3737
# via httpx
38-
httpx==0.25.2
38+
httpx==0.28.1
3939
# via arcadepy
4040
# via respx
4141
idna==3.4
@@ -62,21 +62,21 @@ platformdirs==3.11.0
6262
# via virtualenv
6363
pluggy==1.5.0
6464
# via pytest
65-
pydantic==2.9.2
65+
pydantic==2.10.3
6666
# via arcadepy
67-
pydantic-core==2.23.4
67+
pydantic-core==2.27.1
6868
# via pydantic
6969
pygments==2.18.0
7070
# via rich
71-
pyright==1.1.389
71+
pyright==1.1.390
7272
pytest==8.3.3
7373
# via pytest-asyncio
7474
pytest-asyncio==0.24.0
7575
python-dateutil==2.8.2
7676
# via time-machine
7777
pytz==2023.3.post1
7878
# via dirty-equals
79-
respx==0.20.2
79+
respx==0.22.0
8080
rich==13.7.1
8181
ruff==0.6.9
8282
setuptools==68.2.2
@@ -86,7 +86,6 @@ six==1.16.0
8686
sniffio==1.3.0
8787
# via anyio
8888
# via arcadepy
89-
# via httpx
9089
time-machine==2.9.0
9190
tomli==2.0.2
9291
# via mypy

requirements.lock

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,19 +25,18 @@ h11==0.14.0
2525
# via httpcore
2626
httpcore==1.0.2
2727
# via httpx
28-
httpx==0.25.2
28+
httpx==0.28.1
2929
# via arcadepy
3030
idna==3.4
3131
# via anyio
3232
# via httpx
33-
pydantic==2.9.2
33+
pydantic==2.10.3
3434
# via arcadepy
35-
pydantic-core==2.23.4
35+
pydantic-core==2.27.1
3636
# via pydantic
3737
sniffio==1.3.0
3838
# via anyio
3939
# via arcadepy
40-
# via httpx
4140
typing-extensions==4.12.2
4241
# via anyio
4342
# via arcadepy

src/arcadepy/_base_client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,9 @@ def __init__(self, **kwargs: Any) -> None:
767767

768768
class SyncHttpxClientWrapper(DefaultHttpxClient):
769769
def __del__(self) -> None:
770+
if self.is_closed:
771+
return
772+
770773
try:
771774
self.close()
772775
except Exception:
@@ -1334,6 +1337,9 @@ def __init__(self, **kwargs: Any) -> None:
13341337

13351338
class AsyncHttpxClientWrapper(DefaultAsyncHttpxClient):
13361339
def __del__(self) -> None:
1340+
if self.is_closed:
1341+
return
1342+
13371343
try:
13381344
# TODO(someday): support non asyncio runtimes here
13391345
asyncio.get_running_loop().create_task(self.aclose())

0 commit comments

Comments
 (0)