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

wrangler: Add AI binding #3992

Merged
merged 2 commits into from
Sep 21, 2023
Merged

wrangler: Add AI binding #3992

merged 2 commits into from
Sep 21, 2023

Conversation

edevil
Copy link
Contributor

@edevil edevil commented Sep 20, 2023

Added binding for the AI project.

Author has included the following, where applicable:

Reviewer is to perform the following, as applicable:

  • Checked for inclusion of relevant tests
  • Checked for inclusion of a relevant changeset
  • Checked for creation of associated docs updates
  • Manually pulled down the changes and spot-tested

@edevil edevil requested review from a team as code owners September 20, 2023 11:48
@changeset-bot
Copy link

changeset-bot bot commented Sep 20, 2023

🦋 Changeset detected

Latest commit: dbefb3d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
wrangler Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Sep 20, 2023

A wrangler prerelease is available for testing. You can install this latest build in your project with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6259570855/npm-package-wrangler-3992

You can reference the automatically updated head of this PR with:

npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/6259570855/npm-package-wrangler-3992

Or you can use npx with this latest build directly:

npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6259570855/npm-package-wrangler-3992 dev path/to/script.js
Additional artifacts:
npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/6259570855/npm-package-cloudflare-pages-shared-3992

Note that these links will no longer work once the GitHub Actions artifact expires.


wrangler@3.9.0 includes the following runtime dependencies:

Package Constraint Resolved
miniflare 3.20230918.0 3.20230918.0
workerd 1.20230904.0 1.20230904.0
workerd --version 1.20230904.0 2023-09-04

|

Please ensure constraints are pinned, and miniflare/workerd minor versions match.

@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

Merging #3992 (dbefb3d) into main (fe22790) will increase coverage by 0.04%.
Report is 4 commits behind head on main.
The diff coverage is 75.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3992      +/-   ##
==========================================
+ Coverage   74.85%   74.89%   +0.04%     
==========================================
  Files         196      196              
  Lines       11604    11624      +20     
  Branches     3044     3051       +7     
==========================================
+ Hits         8686     8706      +20     
  Misses       2918     2918              
Files Changed Coverage Δ
...ler/src/api/pages/create-worker-bundle-contents.ts 100.00% <ø> (ø)
packages/wrangler/src/deploy/deploy.ts 87.33% <ø> (ø)
packages/wrangler/src/dev.tsx 83.19% <ø> (ø)
packages/wrangler/src/init.ts 92.00% <0.00%> (-0.70%) ⬇️
packages/wrangler/src/secret/index.ts 87.32% <ø> (ø)
packages/wrangler/src/config/validation.ts 90.24% <81.81%> (+0.25%) ⬆️
packages/wrangler/src/config/index.ts 91.19% <100.00%> (+0.74%) ⬆️
packages/wrangler/src/config/validation-helpers.ts 99.02% <100.00%> (+<0.01%) ⬆️
...src/deployment-bundle/create-worker-upload-form.ts 89.25% <100.00%> (+1.02%) ⬆️

Copy link
Contributor

@penalosa penalosa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking good! It would be great to see some more tests in packages/wrangler/e2e/deploy.test.ts (similar to the queues tests in that file) to verify that the binding is being passed through and uploaded properly

Added binding for the AI project.
@edevil
Copy link
Contributor Author

edevil commented Sep 20, 2023

Added missing test @penalosa .

Copy link
Contributor

@JacobMGEvans JacobMGEvans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking great! The additional tests are super helpful as well, thank you 😄

@penalosa
Copy link
Contributor

LGTM! It would be nice to see an example Wrangler TOML file and some more explanation of how to use this in the changeset file, but non-blocking given the timeline

@edevil
Copy link
Contributor Author

edevil commented Sep 21, 2023

Added examples to changeset.

@edevil
Copy link
Contributor Author

edevil commented Sep 21, 2023

Can this be merged? I don't have write permissions to this repo. Thanks.

@RamIdeas RamIdeas merged commit 3556474 into cloudflare:main Sep 21, 2023
@edevil edevil deleted the ai_binding branch September 21, 2023 16:03
elithrar pushed a commit that referenced this pull request Sep 21, 2023
* wrangler: Add AI binding

Added binding for the AI project.

* Workers AI: added example
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants