Skip to content

Conversation

@daisyfaithauma
Copy link
Contributor

Summary

Initial websocket documentation

Screenshots (optional)

Documentation checklist

  • The documentation style guide has been adhered to.
  • If a larger change - such as adding a new page- an issue has been opened in relation to any incorrect or out of date information that this PR fixes.
  • Files which have changed name or location have been allocated redirects.

Copy link
Contributor

@hyperlint-ai hyperlint-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, 5 total issue(s) found.

daisyfaithauma and others added 6 commits November 18, 2024 16:51
Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com>
Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com>
Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com>
Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com>
Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Nov 18, 2024

Deploying cloudflare-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2368b00
Status: ✅  Deploy successful!
Preview URL: https://e40745c1.cloudflare-docs-7ou.pages.dev
Branch Preview URL: https://aig-websockets.cloudflare-docs-7ou.pages.dev

View logs

@github-actions github-actions bot added product:ai-gateway AI Gateway: https://developers.cloudflare.com/ai-gateway/ size/m labels Nov 18, 2024

## Setting up

1. Generate an AI Gateway token with appropriate AI Gateway Run and opt in to using an authenticated gateway.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the correct way to show RUN permission?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got it right off the documentation.

```
wss://gateway.ai.cloudflare.com/v1/{account_id}/{gateway_id}
```
3. Open a WebSocket connection authenticated with a Cloudflare token with the AI Gateway Run permission.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the correct way to show RUN permission?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got it right off the documentation.


The above will send a request to Workers AI Inference API, if it fails it will proceed to OpenAI. You can add as many fallbacks as you need, just by adding another JSON in the array.

## Websockets API (beta)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should beta be in words or be the beta label

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed

@daisyfaithauma daisyfaithauma merged commit fd0e5ea into production Nov 19, 2024
12 checks passed
@daisyfaithauma daisyfaithauma deleted the aig-websockets branch November 19, 2024 13:06
harshil1712 pushed a commit that referenced this pull request Dec 3, 2024
* Initial websocket documentation

* Update src/content/docs/ai-gateway/get-started.mdx

Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com>

* Update src/content/docs/ai-gateway/providers/universal.mdx

Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com>

* Update src/content/docs/ai-gateway/configuration/websockets-api.mdx

Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com>

* Update src/content/docs/ai-gateway/configuration/websockets-api.mdx

Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com>

* Update src/content/docs/ai-gateway/configuration/websockets-api.mdx

Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com>

* grammar

* Update websockets-api.mdx

* added a badge

* Update src/content/docs/ai-gateway/configuration/websockets-api.mdx

Co-authored-by: Maddy <[email protected]>

---------

Co-authored-by: hyperlint-ai[bot] <154288675+hyperlint-ai[bot]@users.noreply.github.com>
Co-authored-by: Kathy <[email protected]>
Co-authored-by: Maddy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

product:ai-gateway AI Gateway: https://developers.cloudflare.com/ai-gateway/ size/m

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants