Skip to content

Commit 641b9eb

Browse files
feat(api): api update (#76)
1 parent 9c9dc2d commit 641b9eb

File tree

12 files changed

+523
-8
lines changed

12 files changed

+523
-8
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-a5519a054c37ff2977f15c6970a74a1c3096bc0c6c2e1798514924ddf5169da2.yml
1+
configured_endpoints: 12
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/arcade-ai%2Farcade-engine-de575832ec31be11be16d65af5af6ff0ac12590cee8c27e7e434f985f71390c0.yml

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ client = Arcade(
3333

3434
execute_tool_response = client.tools.execute(
3535
tool_name="Google.ListEmails",
36+
input={"n_emails": 10},
3637
user_id="user@example.com",
3738
)
3839
print(execute_tool_response.id)
@@ -60,6 +61,7 @@ client = AsyncArcade(
6061
async def main() -> None:
6162
execute_tool_response = await client.tools.execute(
6263
tool_name="Google.ListEmails",
64+
input={"n_emails": 10},
6365
user_id="user@example.com",
6466
)
6567
print(execute_tool_response.id)

api.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,14 @@ from arcadepy.types import (
5555
ToolExecution,
5656
ToolExecutionAttempt,
5757
ValueSchema,
58+
ToolListResponse,
5859
ToolGetResponse,
5960
)
6061
```
6162

6263
Methods:
6364

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>
6466
- <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>
6567
- <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>
6668
- <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>
@@ -83,9 +85,10 @@ Methods:
8385
Types:
8486

8587
```python
86-
from arcadepy.types.tools import FormattedGetResponse
88+
from arcadepy.types.tools import FormattedListResponse, FormattedGetResponse
8789
```
8890

8991
Methods:
9092

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>
9194
- <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>

src/arcadepy/resources/tools/formatted.py

Lines changed: 127 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
async_to_raw_response_wrapper,
1818
async_to_streamed_response_wrapper,
1919
)
20-
from ...types.tools import formatted_get_params
21-
from ..._base_client import make_request_options
20+
from ...pagination import SyncOffsetPage, AsyncOffsetPage
21+
from ...types.tools import formatted_get_params, formatted_list_params
22+
from ..._base_client import AsyncPaginator, make_request_options
2223

2324
__all__ = ["FormattedResource", "AsyncFormattedResource"]
2425

@@ -43,6 +44,62 @@ def with_streaming_response(self) -> FormattedResourceWithStreamingResponse:
4344
"""
4445
return FormattedResourceWithStreamingResponse(self)
4546

47+
def list(
48+
self,
49+
*,
50+
format: str | NotGiven = NOT_GIVEN,
51+
limit: int | NotGiven = NOT_GIVEN,
52+
offset: int | NotGiven = NOT_GIVEN,
53+
toolkit: str | NotGiven = NOT_GIVEN,
54+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
55+
# The extra values given here take precedence over values defined on the client or passed to this method.
56+
extra_headers: Headers | None = None,
57+
extra_query: Query | None = None,
58+
extra_body: Body | None = None,
59+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
60+
) -> SyncOffsetPage[object]:
61+
"""
62+
Returns a page of tools from the engine configuration, optionally filtered by
63+
toolkit, formatted for a specific provider
64+
65+
Args:
66+
format: Provider format
67+
68+
limit: Number of items to return (default: 25, max: 100)
69+
70+
offset: Offset from the start of the list (default: 0)
71+
72+
toolkit: Toolkit name
73+
74+
extra_headers: Send extra headers
75+
76+
extra_query: Add additional query parameters to the request
77+
78+
extra_body: Add additional JSON properties to the request
79+
80+
timeout: Override the client-level default timeout for this request, in seconds
81+
"""
82+
return self._get_api_list(
83+
"/v1/formatted_tools",
84+
page=SyncOffsetPage[object],
85+
options=make_request_options(
86+
extra_headers=extra_headers,
87+
extra_query=extra_query,
88+
extra_body=extra_body,
89+
timeout=timeout,
90+
query=maybe_transform(
91+
{
92+
"format": format,
93+
"limit": limit,
94+
"offset": offset,
95+
"toolkit": toolkit,
96+
},
97+
formatted_list_params.FormattedListParams,
98+
),
99+
),
100+
model=object,
101+
)
102+
46103
def get(
47104
self,
48105
name: str,
@@ -104,6 +161,62 @@ def with_streaming_response(self) -> AsyncFormattedResourceWithStreamingResponse
104161
"""
105162
return AsyncFormattedResourceWithStreamingResponse(self)
106163

164+
def list(
165+
self,
166+
*,
167+
format: str | NotGiven = NOT_GIVEN,
168+
limit: int | NotGiven = NOT_GIVEN,
169+
offset: int | NotGiven = NOT_GIVEN,
170+
toolkit: str | NotGiven = NOT_GIVEN,
171+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
172+
# The extra values given here take precedence over values defined on the client or passed to this method.
173+
extra_headers: Headers | None = None,
174+
extra_query: Query | None = None,
175+
extra_body: Body | None = None,
176+
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
177+
) -> AsyncPaginator[object, AsyncOffsetPage[object]]:
178+
"""
179+
Returns a page of tools from the engine configuration, optionally filtered by
180+
toolkit, formatted for a specific provider
181+
182+
Args:
183+
format: Provider format
184+
185+
limit: Number of items to return (default: 25, max: 100)
186+
187+
offset: Offset from the start of the list (default: 0)
188+
189+
toolkit: Toolkit name
190+
191+
extra_headers: Send extra headers
192+
193+
extra_query: Add additional query parameters to the request
194+
195+
extra_body: Add additional JSON properties to the request
196+
197+
timeout: Override the client-level default timeout for this request, in seconds
198+
"""
199+
return self._get_api_list(
200+
"/v1/formatted_tools",
201+
page=AsyncOffsetPage[object],
202+
options=make_request_options(
203+
extra_headers=extra_headers,
204+
extra_query=extra_query,
205+
extra_body=extra_body,
206+
timeout=timeout,
207+
query=maybe_transform(
208+
{
209+
"format": format,
210+
"limit": limit,
211+
"offset": offset,
212+
"toolkit": toolkit,
213+
},
214+
formatted_list_params.FormattedListParams,
215+
),
216+
),
217+
model=object,
218+
)
219+
107220
async def get(
108221
self,
109222
name: str,
@@ -149,6 +262,9 @@ class FormattedResourceWithRawResponse:
149262
def __init__(self, formatted: FormattedResource) -> None:
150263
self._formatted = formatted
151264

265+
self.list = to_raw_response_wrapper(
266+
formatted.list,
267+
)
152268
self.get = to_raw_response_wrapper(
153269
formatted.get,
154270
)
@@ -158,6 +274,9 @@ class AsyncFormattedResourceWithRawResponse:
158274
def __init__(self, formatted: AsyncFormattedResource) -> None:
159275
self._formatted = formatted
160276

277+
self.list = async_to_raw_response_wrapper(
278+
formatted.list,
279+
)
161280
self.get = async_to_raw_response_wrapper(
162281
formatted.get,
163282
)
@@ -167,6 +286,9 @@ class FormattedResourceWithStreamingResponse:
167286
def __init__(self, formatted: FormattedResource) -> None:
168287
self._formatted = formatted
169288

289+
self.list = to_streamed_response_wrapper(
290+
formatted.list,
291+
)
170292
self.get = to_streamed_response_wrapper(
171293
formatted.get,
172294
)
@@ -176,6 +298,9 @@ class AsyncFormattedResourceWithStreamingResponse:
176298
def __init__(self, formatted: AsyncFormattedResource) -> None:
177299
self._formatted = formatted
178300

301+
self.list = async_to_streamed_response_wrapper(
302+
formatted.list,
303+
)
179304
self.get = async_to_streamed_response_wrapper(
180305
formatted.get,
181306
)

0 commit comments

Comments
 (0)