Skip to content
This repository was archived by the owner on Mar 18, 2025. It is now read-only.

Commit aa3e2d4

Browse files
authored
chore: update to wrangler.jsonc (#25)
1 parent b15ad06 commit aa3e2d4

File tree

5 files changed

+37
-30
lines changed

5 files changed

+37
-30
lines changed

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,15 @@ npm install workers-ai-provider
1010

1111
## Usage
1212

13-
First, setup an AI binding in `wrangler.toml` in your Workers project:
13+
First, setup an AI binding in the Wrangler config in your Workers project:
1414

15-
```toml
16-
# ...
17-
[ai]
18-
binding = "AI"
19-
# ...
15+
```jsonc
16+
{
17+
// ...
18+
"ai": {
19+
"binding": "AI"
20+
}
21+
}
2022
```
2123

2224
Then in your Worker, import the factory function and create a new AI provider:
@@ -36,7 +38,7 @@ export default {
3638
// Use the AI provider to interact with the Vercel AI SDK
3739
// Here, we generate a chat stream based on a prompt
3840
const text = await streamText({
39-
model: workersai("@cf/meta/llama-2-7b-chat-int8"),
41+
model: workersai("@cf/meta/llama-3.3-70b-instruct-fp8-fast"),
4042
messages: [
4143
{
4244
role: "user",

examples/ai-chat/wrangler.jsonc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "workers-ai-chat",
3+
"main": "src/server/index.ts",
4+
"compatibility_date": "2024-07-31",
5+
"assets": {
6+
"directory": "public"
7+
},
8+
"build": {
9+
"command": "esbuild src/client/index.tsx --outdir=public/dist --bundle --sourcemap --format=esm --splitting"
10+
},
11+
"ai": {
12+
"binding": "AI"
13+
}
14+
}

examples/ai-chat/wrangler.toml

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "workers-ai-tool-calling",
3+
"main": "src/server/index.ts",
4+
"compatibility_date": "2024-07-31",
5+
"assets": {
6+
"directory": "public"
7+
},
8+
"build": {
9+
"command": "esbuild src/client/index.tsx --outdir=public/dist --bundle --sourcemap --format=esm --splitting"
10+
},
11+
"ai": {
12+
"binding": "AI"
13+
}
14+
}

examples/tool-calling/wrangler.toml

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)