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): OpenAPI spec update via Stainless API #1179

Merged
merged 1 commit into from
Jul 11, 2024
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: 1252
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-57358570b9af58f781ddd4b9333cd38dc712fb26845901cbe8bce2b7bba4ff26.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9f6e9da01b27f4f387991ca14ecafe0c42a356cc3c47b269e5f8b4f6cd0ed700.yml
20 changes: 20 additions & 0 deletions src/cloudflare/resources/workers/ai/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,17 @@ def run(
account_id: str,
prompt: str,
guidance: float | NotGiven = NOT_GIVEN,
height: int | NotGiven = NOT_GIVEN,
image: Iterable[float] | NotGiven = NOT_GIVEN,
image_b64: str | NotGiven = NOT_GIVEN,
lora_weights: Iterable[float] | NotGiven = NOT_GIVEN,
loras: List[str] | NotGiven = NOT_GIVEN,
mask: Iterable[float] | NotGiven = NOT_GIVEN,
negative_prompt: str | NotGiven = NOT_GIVEN,
num_steps: int | NotGiven = NOT_GIVEN,
seed: int | NotGiven = NOT_GIVEN,
strength: float | NotGiven = NOT_GIVEN,
width: int | 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 Down Expand Up @@ -485,12 +490,17 @@ def run(
text: str | Union[str, List[str]] | NotGiven = NOT_GIVEN,
prompt: str | NotGiven = NOT_GIVEN,
guidance: float | NotGiven = NOT_GIVEN,
height: int | NotGiven = NOT_GIVEN,
image: Iterable[float] | NotGiven = NOT_GIVEN,
image_b64: str | NotGiven = NOT_GIVEN,
lora_weights: Iterable[float] | NotGiven = NOT_GIVEN,
loras: List[str] | NotGiven = NOT_GIVEN,
mask: Iterable[float] | NotGiven = NOT_GIVEN,
negative_prompt: str | NotGiven = NOT_GIVEN,
num_steps: int | NotGiven = NOT_GIVEN,
seed: int | NotGiven = NOT_GIVEN,
strength: float | NotGiven = NOT_GIVEN,
width: int | NotGiven = NOT_GIVEN,
audio: Iterable[float] | NotGiven = NOT_GIVEN,
lora: str | NotGiven = NOT_GIVEN,
max_tokens: int | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -625,12 +635,17 @@ async def run(
account_id: str,
prompt: str,
guidance: float | NotGiven = NOT_GIVEN,
height: int | NotGiven = NOT_GIVEN,
image: Iterable[float] | NotGiven = NOT_GIVEN,
image_b64: str | NotGiven = NOT_GIVEN,
lora_weights: Iterable[float] | NotGiven = NOT_GIVEN,
loras: List[str] | NotGiven = NOT_GIVEN,
mask: Iterable[float] | NotGiven = NOT_GIVEN,
negative_prompt: str | NotGiven = NOT_GIVEN,
num_steps: int | NotGiven = NOT_GIVEN,
seed: int | NotGiven = NOT_GIVEN,
strength: float | NotGiven = NOT_GIVEN,
width: int | 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 Down Expand Up @@ -980,12 +995,17 @@ async def run(
text: str | Union[str, List[str]] | NotGiven = NOT_GIVEN,
prompt: str | NotGiven = NOT_GIVEN,
guidance: float | NotGiven = NOT_GIVEN,
height: int | NotGiven = NOT_GIVEN,
image: Iterable[float] | NotGiven = NOT_GIVEN,
image_b64: str | NotGiven = NOT_GIVEN,
lora_weights: Iterable[float] | NotGiven = NOT_GIVEN,
loras: List[str] | NotGiven = NOT_GIVEN,
mask: Iterable[float] | NotGiven = NOT_GIVEN,
negative_prompt: str | NotGiven = NOT_GIVEN,
num_steps: int | NotGiven = NOT_GIVEN,
seed: int | NotGiven = NOT_GIVEN,
strength: float | NotGiven = NOT_GIVEN,
width: int | NotGiven = NOT_GIVEN,
audio: Iterable[float] | NotGiven = NOT_GIVEN,
lora: str | NotGiven = NOT_GIVEN,
max_tokens: int | NotGiven = NOT_GIVEN,
Expand Down
10 changes: 10 additions & 0 deletions src/cloudflare/types/workers/ai_run_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,28 @@ class TextToImage(TypedDict, total=False):

guidance: float

height: int

image: Iterable[float]

image_b64: str

lora_weights: Iterable[float]

loras: List[str]

mask: Iterable[float]

negative_prompt: str

num_steps: int

seed: int

strength: float

width: int


class TextEmbeddings(TypedDict, total=False):
account_id: Required[str]
Expand Down
10 changes: 10 additions & 0 deletions tests/api_resources/workers/test_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,17 @@ def test_method_run_with_all_params_overload_3(self, client: Cloudflare) -> None
account_id="023e105f4ecef8ad9ca31a8372d0c353",
prompt="x",
guidance=0,
height=0,
image=[0, 0, 0],
image_b64="image_b64",
lora_weights=[0, 0, 0],
loras=["string", "string", "string"],
mask=[0, 0, 0],
negative_prompt="negative_prompt",
num_steps=0,
seed=0,
strength=0,
width=0,
)
assert_matches_type(Optional[AIRunResponse], ai, path=["response"])

Expand Down Expand Up @@ -821,12 +826,17 @@ async def test_method_run_with_all_params_overload_3(self, async_client: AsyncCl
account_id="023e105f4ecef8ad9ca31a8372d0c353",
prompt="x",
guidance=0,
height=0,
image=[0, 0, 0],
image_b64="image_b64",
lora_weights=[0, 0, 0],
loras=["string", "string", "string"],
mask=[0, 0, 0],
negative_prompt="negative_prompt",
num_steps=0,
seed=0,
strength=0,
width=0,
)
assert_matches_type(Optional[AIRunResponse], ai, path=["response"])

Expand Down