Skip to content

Commit 28b54e9

Browse files
committed
update deps
of note: - vite plugin's updated, so that process.env works as expected now - the partyserver update now allows for prefixes that/have/sub/paths - bindings THAT_LOOK_LIKE_THIS are correctly converted to kebabcase now
1 parent 52c8c18 commit 28b54e9

File tree

5 files changed

+224
-345
lines changed

5 files changed

+224
-345
lines changed

README.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -156,19 +156,15 @@ Replace the `@ai-sdk/openai` import and usage with the `workers-ai-provider`:
156156
```diff
157157
// server.ts
158158
// Change the imports
159-
- import { createOpenAI } from "@ai-sdk/openai";
159+
- import { openai } from "@ai-sdk/openai";
160160
+ import { createWorkersAI } from 'workers-ai-provider';
161161

162162
// Create a Workers AI instance
163-
- const openai = createOpenAI({
164-
- apiKey: this.env.OPENAI_API_KEY,
165-
- });
166163
+ const workersai = createWorkersAI({ binding: env.AI });
167164

168165
// Use it when calling the streamText method (or other methods)
169166
// from the ai-sdk
170-
- const result = streamText({
171-
- model: openai("gpt-4o-2024-11-20"),
167+
- const model = openai("gpt-4o-2024-11-20");
172168
+ const model = workersai("@cf/deepseek-ai/deepseek-r1-distill-qwen-32b")
173169
```
174170

0 commit comments

Comments
 (0)