Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
threepointone committed Aug 9, 2024
1 parent 5b119e0 commit d16ae4c
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .changeset/seven-sloths-end.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"workers-ai-provider": patch
---

update readme
17 changes: 11 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# 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

```bash
Expand All @@ -13,7 +10,7 @@ npm install workers-ai-provider

## Usage

First, setup an AI binding in `wrangler.toml`:
First, setup an AI binding in `wrangler.toml` in your WOrkers project:

```toml
# ...
Expand Down Expand Up @@ -48,7 +45,15 @@ export default {
],
});

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",
},
});
},
};
```
Expand Down
2 changes: 1 addition & 1 deletion examples/ai-chat/src/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default {
});
return result.toDataStreamResponse({
headers: {
// we add these headers to ensure that the
// add these headers to ensure that the
// response is chunked and streamed
"Content-Type": "text/x-unknown",
"content-encoding": "identity",
Expand Down
17 changes: 11 additions & 6 deletions packages/ai-provider/README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# 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

```bash
Expand All @@ -13,7 +10,7 @@ npm install workers-ai-provider

## Usage

First, setup an AI binding in `wrangler.toml`:
First, setup an AI binding in `wrangler.toml` in your WOrkers project:

```toml
# ...
Expand Down Expand Up @@ -48,7 +45,15 @@ export default {
],
});

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",
},
});
},
};
```
Expand Down

0 comments on commit d16ae4c

Please sign in to comment.