Skip to content

Commit

Permalink
docs: update changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux committed Aug 15, 2024
1 parent 287d678 commit bc895d6
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions docs/content/4.changelog/hub-ai.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,11 @@ This feature is available on both [free and pro plans](/pricing) and in [`@nuxth

We are excited to introduce [`hubAI()`](/docs/features/ai). This new method allows you to run machine learning models, such as LLMs, directly within your Nuxt application with minimal setup.

At NuxtHub, we care about DX and we want to make it easy for you to leverage AI in your application using Cloudflare AI without having to manage API keys, account ID or using the `wrangler` CLI.

::note
**If you already have a NuxtHub account**, make sure to add the `Worker AI` permission on your Cloudflare API token.

- Open [Cloudflare User API Tokens](https://dash.cloudflare.com/profile/api-tokens)
- Find the NuxtHub token(s)
- Add the `Account > Worker AI > Read` permission
- Save the changes

Another solution is to link again your Cloudflare account from your NuxtHub team settings by clicking on `Link a new account` > `Create a token with required permissions`.
::
At NuxtHub, we care about DX and we want to make it easy for you to leverage AI in your application using Cloudflare AI **without having to manage API keys, account ID or using the `wrangler` CLI**.

## How to use hubAI()

1. Update `@nuxthub/core` to the latest version
1. Update `@nuxthub/core` to the latest version (`v0.7.2` or later)

2. Enable `hub.ai` in your `nuxt.config.ts`

Expand All @@ -52,11 +41,7 @@ export default defineNuxtConfig({

3. Run `npx nuxthub link` to link a NuxtHub project or create a new one

4. That's it! You can now use [`hubAI()`](/docs/features/ai) in your Nuxt application.

## Example

This example creates a `/api/ai-test` route that generates a response from a model.
4. You can now use [`hubAI()`](/docs/features/ai) in your server routes

```ts [server/api/ai-test.ts]
export default defineEventHandler(async (event) => {
Expand All @@ -68,7 +53,18 @@ export default defineEventHandler(async (event) => {

Read the [full documentation](/docs/features/ai) to learn more about `hubAI()`.

::callout
::important
**If you already have a NuxtHub account**, make sure to add the `Worker AI` permission on your Cloudflare API token.

- Open [Cloudflare User API Tokens](https://dash.cloudflare.com/profile/api-tokens)
- Find the NuxtHub token(s)
- Add the `Account > Worker AI > Read` permission
- Save the changes

Another solution is to link again your Cloudflare account from your NuxtHub team settings by clicking on `Link a new account` > `Create a token with required permissions`.
::

::note
This feature has been implemented in [nuxt-hub/core#173](https://github.com/nuxt-hub/core/pull/173).
::

0 comments on commit bc895d6

Please sign in to comment.