cloudflare / cloudflare/ai-utils

Support `workers types` Ai type

Open
#11 1 comment 3 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
196
Forks
29
PR merge metrics
No merged PRs in 30d

Description

Putting `env.AI` as a parameter no longer works with Cloudflare Workers V4 Typescript. Now that we're generating types, this no longer is accepting the proper types for `AI`

```ts
await runWithTools(env.AI, '@cf/meta/llama-3.3-70b-instruct-fp8-fast', ...
```

`Argument of type 'Ai' is not assignable to parameter of type 'import(".../node_modules/.pnpm/@cloudflare+workers-types@4.20250327.0/node_modules/@cloudflare/workers-types/index").Ai`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.