workers-ai-provider
Advanced tools
Comparing version 0.0.9 to 0.0.10
@@ -5,3 +5,3 @@ { | ||
"type": "module", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"main": "dist/index.js", | ||
@@ -8,0 +8,0 @@ "types": "dist/index.d.ts", |
@@ -1,8 +0,5 @@ | ||
# workers-ai-provider ⬡ ⤫ ▴ | ||
# ⛅️ ✨ workers-ai-provider ✨ ⛅️ | ||
A custom provider that enables [Workers AI](https://ai.cloudflare.com/)'s models for the [Vercel AI SDK](https://sdk.vercel.ai/). | ||
> [!CAUTION] | ||
> This project is in its experimental early stages and is not recommended for production use. | ||
## Install | ||
@@ -16,3 +13,3 @@ | ||
First, setup an AI binding in `wrangler.toml`: | ||
First, setup an AI binding in `wrangler.toml` in your Workers project: | ||
@@ -52,3 +49,11 @@ ```toml | ||
return text.toTextStreamResponse(); | ||
return text.toTextStreamResponse({ | ||
headers: { | ||
// add these headers to ensure that the | ||
// response is chunked and streamed | ||
"Content-Type": "text/x-unknown", | ||
"content-encoding": "identity", | ||
"transfer-encoding": "chunked", | ||
}, | ||
}); | ||
}, | ||
@@ -55,0 +60,0 @@ }; |
90699
66