Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): api update #117

Merged
merged 1 commit into from
Jan 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 15
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/riza%2Friza-api-fb88a69cdf1c683229e1b4955389acf571be1cb9c2724bd2e03375c314e5d564.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/riza%2Friza-api-cf7aadf0b0db354f95e6a80756043f9588fa1c90ec9556e2255ad00c45be2528.yml
8 changes: 4 additions & 4 deletions src/rizaio/resources/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ def exec_func(
`execute`. The function will be passed `input` as an object.

Args:
code: The function to execute. Your code must define a function named 'execute' and
return a JSON-serializable value.
code: The function to execute. Your code must define a function named "execute" that
takes in a single argument and returns a JSON-serializable value.

language: The interpreter to use when executing code.

Expand Down Expand Up @@ -317,8 +317,8 @@ async def exec_func(
`execute`. The function will be passed `input` as an object.

Args:
code: The function to execute. Your code must define a function named 'execute' and
return a JSON-serializable value.
code: The function to execute. Your code must define a function named "execute" that
takes in a single argument and returns a JSON-serializable value.

language: The interpreter to use when executing code.

Expand Down
4 changes: 2 additions & 2 deletions src/rizaio/types/command_exec_func_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class CommandExecFuncParams(TypedDict, total=False):
code: Required[str]
"""The function to execute.

Your code must define a function named 'execute' and return a JSON-serializable
value.
Your code must define a function named "execute" that takes in a single argument
and returns a JSON-serializable value.
"""

language: Required[Literal["python", "javascript", "typescript", "ruby", "php"]]
Expand Down
16 changes: 8 additions & 8 deletions tests/api_resources/test_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@ def test_streaming_response_exec(self, client: Riza) -> None:
@parametrize
def test_method_exec_func(self, client: Riza) -> None:
command = client.command.exec_func(
code='def execute(input): return { "name": "John", "executed": True }',
code='def execute(input): return { "name": input["name"], "executed": True }',
language="python",
)
assert_matches_type(CommandExecFuncResponse, command, path=["response"])

@parametrize
def test_method_exec_func_with_all_params(self, client: Riza) -> None:
command = client.command.exec_func(
code='def execute(input): return { "name": "John", "executed": True }',
code='def execute(input): return { "name": input["name"], "executed": True }',
language="python",
env={"foo": "string"},
files=[
Expand Down Expand Up @@ -150,7 +150,7 @@ def test_method_exec_func_with_all_params(self, client: Riza) -> None:
@parametrize
def test_raw_response_exec_func(self, client: Riza) -> None:
response = client.command.with_raw_response.exec_func(
code='def execute(input): return { "name": "John", "executed": True }',
code='def execute(input): return { "name": input["name"], "executed": True }',
language="python",
)

Expand All @@ -162,7 +162,7 @@ def test_raw_response_exec_func(self, client: Riza) -> None:
@parametrize
def test_streaming_response_exec_func(self, client: Riza) -> None:
with client.command.with_streaming_response.exec_func(
code='def execute(input): return { "name": "John", "executed": True }',
code='def execute(input): return { "name": input["name"], "executed": True }',
language="python",
) as response:
assert not response.is_closed
Expand Down Expand Up @@ -259,15 +259,15 @@ async def test_streaming_response_exec(self, async_client: AsyncRiza) -> None:
@parametrize
async def test_method_exec_func(self, async_client: AsyncRiza) -> None:
command = await async_client.command.exec_func(
code='def execute(input): return { "name": "John", "executed": True }',
code='def execute(input): return { "name": input["name"], "executed": True }',
language="python",
)
assert_matches_type(CommandExecFuncResponse, command, path=["response"])

@parametrize
async def test_method_exec_func_with_all_params(self, async_client: AsyncRiza) -> None:
command = await async_client.command.exec_func(
code='def execute(input): return { "name": "John", "executed": True }',
code='def execute(input): return { "name": input["name"], "executed": True }',
language="python",
env={"foo": "string"},
files=[
Expand Down Expand Up @@ -310,7 +310,7 @@ async def test_method_exec_func_with_all_params(self, async_client: AsyncRiza) -
@parametrize
async def test_raw_response_exec_func(self, async_client: AsyncRiza) -> None:
response = await async_client.command.with_raw_response.exec_func(
code='def execute(input): return { "name": "John", "executed": True }',
code='def execute(input): return { "name": input["name"], "executed": True }',
language="python",
)

Expand All @@ -322,7 +322,7 @@ async def test_raw_response_exec_func(self, async_client: AsyncRiza) -> None:
@parametrize
async def test_streaming_response_exec_func(self, async_client: AsyncRiza) -> None:
async with async_client.command.with_streaming_response.exec_func(
code='def execute(input): return { "name": "John", "executed": True }',
code='def execute(input): return { "name": input["name"], "executed": True }',
language="python",
) as response:
assert not response.is_closed
Expand Down