Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#1166)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Jul 3, 2024
1 parent 8d11aed commit dd753a1
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM mcr.microsoft.com/vscode/devcontainers/python:0-${VARIANT}

USER vscode

RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.24.0" RYE_INSTALL_OPTION="--yes" bash
RUN curl -sSf https://rye.astral.sh/get | RYE_VERSION="0.35.0" RYE_INSTALL_OPTION="--yes" bash
ENV PATH=/home/vscode/.rye/shims:$PATH

RUN echo "[[ -d .venv ]] && source .venv/bin/activate" >> /home/vscode/.bashrc
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: 0.24.0
RYE_VERSION: '0.35.0'
RYE_INSTALL_OPTION: '--yes'

- name: Install dependencies
Expand All @@ -41,7 +41,7 @@ jobs:
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: 0.24.0
RYE_VERSION: '0.35.0'
RYE_INSTALL_OPTION: '--yes'

- name: Bootstrap
Expand All @@ -61,8 +61,8 @@ jobs:
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: 0.24.0
RYE_INSTALL_OPTION: "--yes"
RYE_VERSION: '0.35.0'
RYE_INSTALL_OPTION: '--yes'
- name: Install dependencies
run: |
rye sync --all-features
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ jobs:
curl -sSf https://rye.astral.sh/get | bash
echo "$HOME/.rye/shims" >> $GITHUB_PATH
env:
RYE_VERSION: 0.24.0
RYE_INSTALL_OPTION: "--yes"
RYE_VERSION: '0.35.0'
RYE_INSTALL_OPTION: '--yes'

- name: Publish to PyPI
run: |
Expand Down
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1254
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9ec83085fa15e1f1cc613401a707a27556909eab3b6b756359938f8fd4a1aef4.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-ad7a39118e76762e485d8d1f264939212ed6a602f6e717a254cf924316e058f0.yml
1 change: 1 addition & 0 deletions requirements-dev.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# features: []
# all-features: true
# with-sources: false
# generate-hashes: false

-e file:.
annotated-types==0.6.0
Expand Down
1 change: 1 addition & 0 deletions requirements.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# features: []
# all-features: true
# with-sources: false
# generate-hashes: false

-e file:.
annotated-types==0.6.0
Expand Down
8 changes: 8 additions & 0 deletions src/cloudflare/resources/workers/ai/ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ def run(
prompt: str,
guidance: float | NotGiven = NOT_GIVEN,
image: Iterable[float] | NotGiven = NOT_GIVEN,
lora_weights: Iterable[float] | NotGiven = NOT_GIVEN,
loras: List[str] | NotGiven = NOT_GIVEN,
mask: Iterable[float] | NotGiven = NOT_GIVEN,
num_steps: int | NotGiven = NOT_GIVEN,
strength: float | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -486,6 +488,8 @@ def run(
prompt: str | NotGiven = NOT_GIVEN,
guidance: float | NotGiven = NOT_GIVEN,
image: Iterable[float] | NotGiven = NOT_GIVEN,
lora_weights: Iterable[float] | NotGiven = NOT_GIVEN,
loras: List[str] | NotGiven = NOT_GIVEN,
mask: Iterable[float] | NotGiven = NOT_GIVEN,
num_steps: int | NotGiven = NOT_GIVEN,
strength: float | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -624,6 +628,8 @@ async def run(
prompt: str,
guidance: float | NotGiven = NOT_GIVEN,
image: Iterable[float] | NotGiven = NOT_GIVEN,
lora_weights: Iterable[float] | NotGiven = NOT_GIVEN,
loras: List[str] | NotGiven = NOT_GIVEN,
mask: Iterable[float] | NotGiven = NOT_GIVEN,
num_steps: int | NotGiven = NOT_GIVEN,
strength: float | NotGiven = NOT_GIVEN,
Expand Down Expand Up @@ -977,6 +983,8 @@ async def run(
prompt: str | NotGiven = NOT_GIVEN,
guidance: float | NotGiven = NOT_GIVEN,
image: Iterable[float] | NotGiven = NOT_GIVEN,
lora_weights: Iterable[float] | NotGiven = NOT_GIVEN,
loras: List[str] | NotGiven = NOT_GIVEN,
mask: Iterable[float] | NotGiven = NOT_GIVEN,
num_steps: int | NotGiven = NOT_GIVEN,
strength: float | NotGiven = NOT_GIVEN,
Expand Down
4 changes: 4 additions & 0 deletions src/cloudflare/types/workers/ai_run_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ class TextToImage(TypedDict, total=False):

image: Iterable[float]

lora_weights: Iterable[float]

loras: List[str]

mask: Iterable[float]

num_steps: int
Expand Down
4 changes: 4 additions & 0 deletions tests/api_resources/workers/test_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@ def test_method_run_with_all_params_overload_3(self, client: Cloudflare) -> None
prompt="x",
guidance=0,
image=[0, 0, 0],
lora_weights=[0, 0, 0],
loras=["string", "string", "string"],
mask=[0, 0, 0],
num_steps=0,
strength=0,
Expand Down Expand Up @@ -820,6 +822,8 @@ async def test_method_run_with_all_params_overload_3(self, async_client: AsyncCl
prompt="x",
guidance=0,
image=[0, 0, 0],
lora_weights=[0, 0, 0],
loras=["string", "string", "string"],
mask=[0, 0, 0],
num_steps=0,
strength=0,
Expand Down

0 comments on commit dd753a1

Please sign in to comment.