Skip to content

Commit e84ceb0

Browse files
committed
docs(ai): new section
1 parent 3a35679 commit e84ceb0

File tree

3 files changed

+164
-0
lines changed

3 files changed

+164
-0
lines changed

docs/content/7.ai.md

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
---
2+
title: AI-Powered Content Assistance in Nuxt Studio
3+
description: Learn how to enable and use AI-powered features in Nuxt Studio for intelligent content completion, transformation, and style guidance.
4+
navigation:
5+
title: AI Features
6+
icon: i-lucide-sparkles
7+
seo:
8+
title: AI Content Assistance - Nuxt Studio
9+
description: Enable Claude-powered AI features in Nuxt Studio for smart content completion, grammar fixes, improvements, and translation using Vercel AI Gateway.
10+
links: []
11+
---
12+
13+
Nuxt Studio integrates AI-powered content assistance using models via Vercel AI Gateway. These features help you write, improve, and transform content faster with intelligent suggestions and transformations.
14+
15+
::prose-note{type="info"}
16+
AI features are optional and require a Vercel AI Gateway API key.
17+
18+
Vercel provides $5 in free credits, which is typically sufficient for most editing scenarios over several months.
19+
::
20+
21+
## Configuration
22+
23+
### Vercel AI Gateway Setup
24+
25+
Vercel AI Gateway provides a unified API for accessing AI models with built-in caching, rate limiting, and analytics.
26+
27+
::prose-steps{level="4"}
28+
#### Create a Vercel Account
29+
30+
Sign up at [vercel.com](https://vercel.com) if you don't have an account.
31+
32+
#### Access AI Gateway
33+
34+
Navigate to your [Vercel AI Gateway Dashboard](https://vercel.com/ai-gateway) in your account settings.
35+
36+
#### Create an API Key
37+
38+
Generate a new API key from the AI Gateway dashboard.
39+
40+
:::note
41+
Vercel provides $5 in free credits, which is typically sufficient for most editing scenarios over several months.
42+
:::
43+
::
44+
45+
### Set Environment Variable
46+
47+
To enable AI-powered editing in Studio, simply set the `AI_GATEWAY_API_KEY` environment variable.
48+
49+
```bash [.env]
50+
AI_GATEWAY_API_KEY=your_vercel_ai_gateway_api_key
51+
```
52+
53+
### Contextualization
54+
55+
You can then configure AI behavior in your `nuxt.config.ts` file to provide contextual guidance and ensure the AI output aligns with your preferred writing style.
56+
57+
```ts [nuxt.config.ts]
58+
export default defineNuxtConfig({
59+
studio: {
60+
ai: {
61+
context: {
62+
title: 'My Awesome Blog',
63+
description: 'A technical blog about web development',
64+
style: 'Technical and detailed, with practical examples',
65+
tone: 'Professional yet approachable'
66+
}
67+
}
68+
}
69+
})
70+
```
71+
72+
## Features
73+
74+
### AI Completion
75+
76+
AI Completion provides intelligent text suggestions as you type in the TipTap visual editor, similar to GitHub Copilot for code.
77+
78+
#### How It Works
79+
80+
- **Auto-triggers** after 500ms when you stop typing
81+
- **Manual trigger**: Press `Cmd/Ctrl+J` to request a suggestion anytime
82+
- **Accept**: Press `Tab` to insert the suggestion
83+
- **Dismiss**: Press `Escape` or continue typing to ignore
84+
- Powered by **Claude Haiku 4.5** for fast responses (\~300-500ms)
85+
- **Toggle On/Off:** Click the sparkles ✨ button in the footer toolbar to enable/disable AI completion
86+
87+
### AI Transform
88+
89+
Transform selected text with AI-powered improvements, fixes, translations, and simplifications.
90+
91+
#### Available Modes
92+
93+
- **Fix**: Correct grammar and spelling errors
94+
- **Improve**: Enhance clarity, engagement, and readability
95+
- **Simplify**: Use simpler words and shorter sentences
96+
- **Translate**: Translate to another language (language input selection)
97+
98+
#### How it works
99+
100+
- **Trigger** the AI Transform tool from the content editor toolbar
101+
- **Select** a mode from the dropdown menu
102+
- **Review** the proposed changes in the preview pane before applying them.
103+
- **Accept or decline** the AI proposition 
104+
- Powered by **Claude Sonnet 4.5** for high-quality results
105+
106+
### Contextualization
107+
108+
For both completion and transform features, the AI system is contextualized and enriched to deliver more accurate and relevant suggestions:
109+
110+
- **Context-aware :** The system considers surrounding content and cursor position to provide intelligent recommendations.
111+
- **MDC Component**: The AI provides context-aware assistance tailored to specific component types, including component names, slot configurations, and structural patterns.
112+
113+
## Experimental Collection Context
114+
115+
::note
116+
This feature is under development and may change in future releases.
117+
::
118+
119+
Once enable , you can access the AI Tab by clicking the AI icon in the top navigation bar of Nuxt Studio. The AI Tab allows you to generate and manage AI writing style guides per collection, giving AI deeper context about your content structure.
120+
121+
### What It Does
122+
123+
- **Analyzes Collections**: Examines your content collections to understand structure and style
124+
- **Generates Style Guides**: Creates comprehensive writing guidelines for each collection
125+
- **Contextualizes AI**: Uses collection-specific context for better AI suggestions
126+
127+
### How to Enable
128+
129+
To enable AI-powered style guide generation, you need to configure your Nuxt project with the experimental feature flag and then activate the AI features in Studio.
130+
131+
```js [nuxt.config.ts]
132+
export default defineNuxtConfig({
133+
studio: {
134+
ai: {
135+
experimental: {
136+
collectionContext: true // Enable AI Tab
137+
}
138+
}
139+
}
140+
})
141+
```
142+
143+
### How It Works
144+
145+
1. **Access**: Click the AI tab button in the Studio interface
146+
2. **Select Collection**: Choose a collection to analyze
147+
3. **Generate Context**: Click "Analyze Collection" to create a style guide
148+
4. **Edit Context**: Review and customize the generated guidelines
149+
5. **AI Uses Context**: Future AI operations will reference these guidelines
150+
151+
### Context Files
152+
153+
Context files are stored in the `.studio` folder as `${collectionName}.md` files. These files are automatically loaded during AI operations to provide collection-specific guidance.
154+
155+
## Cost Estimation
156+
157+
With Vercel AI Gateway's **$5 free credits**, you can expect:
158+
159+
- **\~11,000 AI completions**: Auto-suggestions as you type
160+
- **\~120 AI transforms**: Grammar fixes, improvements, translations
161+
- **\~2 million words**: Total AI-generated content
162+
- **Several weeks**: Typical usage (varies from occasional to regular content creation)
163+
164+
After free credits, pricing follows Vercel AI Gateway's standard rates based on model usage.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)