From bc895d68ee96c39ab55287057b0834e427fdeb15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Chopin?= Date: Thu, 15 Aug 2024 18:55:17 +0200 Subject: [PATCH] docs: update changelog --- docs/content/4.changelog/hub-ai.md | 34 +++++++++++++----------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/docs/content/4.changelog/hub-ai.md b/docs/content/4.changelog/hub-ai.md index 7d056908..b171c063 100644 --- a/docs/content/4.changelog/hub-ai.md +++ b/docs/content/4.changelog/hub-ai.md @@ -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` @@ -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) => { @@ -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). ::