Skip to content

Commit

Permalink
feat(api): api update (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] committed Jan 9, 2025
1 parent c8ea4ee commit dd6e86b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 14
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/riza%2Friza-api-7b19b1d717fd64001c4c4e27294c423357318869415232142073c716811df72c.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/riza%2Friza-api-fbf471c508c87d8f33abb016566e4a23c1a188f8097af9bab707cd0f13c0663b.yml
8 changes: 4 additions & 4 deletions src/rizaio/resources/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ def create(
self,
*,
code: str,
language: Literal["python", "javascript", "typescript"],
name: str,
description: str | NotGiven = NOT_GIVEN,
input_schema: object | NotGiven = NOT_GIVEN,
language: Literal["python", "javascript", "typescript"] | 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,
Expand All @@ -81,10 +81,10 @@ def create(
body=maybe_transform(
{
"code": code,
"language": language,
"name": name,
"description": description,
"input_schema": input_schema,
"language": language,
},
tool_create_params.ToolCreateParams,
),
Expand Down Expand Up @@ -267,10 +267,10 @@ async def create(
self,
*,
code: str,
language: Literal["python", "javascript", "typescript"],
name: str,
description: str | NotGiven = NOT_GIVEN,
input_schema: object | NotGiven = NOT_GIVEN,
language: Literal["python", "javascript", "typescript"] | 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,
Expand All @@ -295,10 +295,10 @@ async def create(
body=await async_maybe_transform(
{
"code": code,
"language": language,
"name": name,
"description": description,
"input_schema": input_schema,
"language": language,
},
tool_create_params.ToolCreateParams,
),
Expand Down
4 changes: 2 additions & 2 deletions src/rizaio/types/tool_create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
class ToolCreateParams(TypedDict, total=False):
code: Required[str]

language: Required[Literal["python", "javascript", "typescript"]]

name: Required[str]

description: str

input_schema: object

language: Literal["python", "javascript", "typescript"]
10 changes: 8 additions & 2 deletions tests/api_resources/test_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class TestTools:
def test_method_create(self, client: Riza) -> None:
tool = client.tools.create(
code="code",
language="python",
name="name",
)
assert_matches_type(Tool, tool, path=["response"])
Expand All @@ -33,17 +34,18 @@ def test_method_create(self, client: Riza) -> None:
def test_method_create_with_all_params(self, client: Riza) -> None:
tool = client.tools.create(
code="code",
language="python",
name="name",
description="description",
input_schema={},
language="python",
)
assert_matches_type(Tool, tool, path=["response"])

@parametrize
def test_raw_response_create(self, client: Riza) -> None:
response = client.tools.with_raw_response.create(
code="code",
language="python",
name="name",
)

Expand All @@ -56,6 +58,7 @@ def test_raw_response_create(self, client: Riza) -> None:
def test_streaming_response_create(self, client: Riza) -> None:
with client.tools.with_streaming_response.create(
code="code",
language="python",
name="name",
) as response:
assert not response.is_closed
Expand Down Expand Up @@ -264,6 +267,7 @@ class TestAsyncTools:
async def test_method_create(self, async_client: AsyncRiza) -> None:
tool = await async_client.tools.create(
code="code",
language="python",
name="name",
)
assert_matches_type(Tool, tool, path=["response"])
Expand All @@ -272,17 +276,18 @@ async def test_method_create(self, async_client: AsyncRiza) -> None:
async def test_method_create_with_all_params(self, async_client: AsyncRiza) -> None:
tool = await async_client.tools.create(
code="code",
language="python",
name="name",
description="description",
input_schema={},
language="python",
)
assert_matches_type(Tool, tool, path=["response"])

@parametrize
async def test_raw_response_create(self, async_client: AsyncRiza) -> None:
response = await async_client.tools.with_raw_response.create(
code="code",
language="python",
name="name",
)

Expand All @@ -295,6 +300,7 @@ async def test_raw_response_create(self, async_client: AsyncRiza) -> None:
async def test_streaming_response_create(self, async_client: AsyncRiza) -> None:
async with async_client.tools.with_streaming_response.create(
code="code",
language="python",
name="name",
) as response:
assert not response.is_closed
Expand Down

0 comments on commit dd6e86b

Please sign in to comment.