-
Notifications
You must be signed in to change notification settings - Fork 10.4k
[Workers AI]Streaming docs on getting started #19018
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1 files reviewed, 1 total issue(s) found.
Deploying cloudflare-docs with
|
| Latest commit: |
163c83c
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://a4d7c67b.cloudflare-docs-7ou.pages.dev |
| Branch Preview URL: | https://workers-ai-streaming.cloudflare-docs-7ou.pages.dev |
|
Files with changes (up to 15)
|
Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com>
craigsdennis
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as this has been tested, it LGTM!
| }; | ||
| ``` | ||
|
|
||
| The above code can be easily integrated into simple HTML pages or complex SPAs using frameworks like React, Angular, or Vue. For example, in React, you can manage the `EventSource` connection in a `useEffect` hook and update the state incrementally as data is streamed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strike easily here.
| You can also use streaming directly within a Cloudflare Worker: | ||
|
|
||
| ```javascript | ||
| import { Ai } from "@cloudflare/ai"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not anymore
|
|
||
| ```bash | ||
| curl -X POST \ | ||
| "https://api.cloudflare.com/client/v4/accounts/<account>/ai/run/@cf/meta/llama-2-7b-chat-int8" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update models?
|
Streaming has been moved to particular models. |
Summary
Streaming docs on getting started
Screenshots (optional)
Documentation checklist