diff --git a/docs/app/app.vue b/docs/app/app.vue
index 0c9f7d660e..b47859180b 100644
--- a/docs/app/app.vue
+++ b/docs/app/app.vue
@@ -12,7 +12,6 @@ const { data: files } = useLazyAsyncData('search', () => queryCollectionSearchSe
})
const links = useLinks()
-const searchLinks = useSearchLinks()
const color = computed(() => colorMode.value === 'dark' ? (colors as any)[appConfig.ui.colors.neutral][900] : 'white')
const radius = computed(() => `:root { --ui-radius: ${appConfig.theme.radius}rem; }`)
const blackAsPrimary = computed(() => appConfig.theme.blackAsPrimary ? `:root { --ui-primary: black; } .dark { --ui-primary: white; }` : ':root {}')
@@ -42,7 +41,6 @@ useServerSeoMeta({
useFaviconFromTheme()
-const { frameworks, modules } = useSharedData()
const { mappedNavigation, filteredNavigation } = useContentNavigation(navigation)
provide('navigation', mappedNavigation)
@@ -65,23 +63,7 @@ provide('navigation', mappedNavigation)
-
-
-
+
diff --git a/docs/app/components/Search.client.vue b/docs/app/components/Search.client.vue
new file mode 100644
index 0000000000..8a2b9e3251
--- /dev/null
+++ b/docs/app/components/Search.client.vue
@@ -0,0 +1,199 @@
+
+
+
+
+
+
+
+
+
+
+
+ Searching documentation...
+
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/app/components/prose/PreStream.vue b/docs/app/components/prose/PreStream.vue
new file mode 100644
index 0000000000..63b224e06e
--- /dev/null
+++ b/docs/app/components/prose/PreStream.vue
@@ -0,0 +1,44 @@
+
+
+
+
+
+
+
diff --git a/docs/app/composables/useHighlighter.ts b/docs/app/composables/useHighlighter.ts
new file mode 100644
index 0000000000..dd66e5f324
--- /dev/null
+++ b/docs/app/composables/useHighlighter.ts
@@ -0,0 +1,21 @@
+import { createHighlighter, type HighlighterGeneric } from 'shiki'
+import { createJavaScriptRegexEngine } from 'shiki/engine-javascript.mjs'
+
+let highlighter: HighlighterGeneric | null = null
+
+let promise: Promise> | null = null
+
+export const useHighlighter = async () => {
+ if (!promise) {
+ promise = createHighlighter({
+ langs: ['vue', 'js', 'ts', 'css', 'html', 'json', 'yaml', 'markdown', 'bash'],
+ themes: ['material-theme-palenight', 'material-theme-lighter'],
+ engine: createJavaScriptRegexEngine()
+ })
+ }
+ if (!highlighter) {
+ highlighter = await promise
+ }
+
+ return highlighter
+}
diff --git a/docs/app/composables/useSearchLinks.ts b/docs/app/composables/useSearchLinks.ts
deleted file mode 100644
index 995046dad2..0000000000
--- a/docs/app/composables/useSearchLinks.ts
+++ /dev/null
@@ -1,66 +0,0 @@
-export function useSearchLinks() {
- return [{
- label: 'Docs',
- icon: 'i-lucide-square-play',
- to: '/getting-started'
- }, {
- label: 'Components',
- icon: 'i-lucide-square-code',
- to: '/components'
- }, {
- icon: 'i-lucide-sparkles',
- label: 'Pro > Features',
- description: 'A collection of premium Vue components.',
- to: '/pro'
- }, {
- icon: 'i-lucide-credit-card',
- label: 'Pro > Pricing',
- description: 'Free in development, buy when ready to launch.',
- to: '/pro/pricing'
- }, {
- icon: 'i-lucide-panels-top-left',
- label: 'Pro > Templates',
- description: 'Official templates made with Nuxt UI Pro.',
- to: '/pro/templates'
- }, {
- icon: 'i-lucide-circle-check',
- label: 'Pro > Activate',
- description: 'Enable Nuxt UI Pro in your production projects.',
- to: '/pro/activate'
- }, {
- label: 'Figma',
- icon: 'i-simple-icons-figma',
- to: '/figma'
- }, {
- icon: 'i-lucide-presentation',
- label: 'Community > Showcase',
- description: 'Check out some of the amazing projects built with Nuxt UI.',
- to: '/showcase'
- }, {
- label: 'Community > Contribution',
- description: 'A comprehensive guide on contributing to Nuxt UI, including project structure, development workflow, and best practices.',
- icon: 'i-lucide-git-pull-request-arrow',
- to: '/getting-started/contribution'
- }, {
- label: 'Community > Roadmap',
- description: 'Track our development progress in real-time.',
- icon: 'i-lucide-map',
- to: '/roadmap'
- }, {
- label: 'Community > Devtools',
- description: 'Integrate Nuxt UI with Nuxt Devtools with Compodium.',
- icon: 'i-lucide-code',
- to: 'https://github.com/romhml/compodium',
- target: '_blank'
- }, {
- label: 'Community > Team',
- description: 'Meet the team behind Nuxt UI.',
- icon: 'i-lucide-users',
- to: '/team'
- }, {
- label: 'Releases',
- icon: 'i-lucide-rocket',
- to: 'https://github.com/nuxt/ui/releases',
- target: '_blank'
- }]
-}
diff --git a/docs/app/error.vue b/docs/app/error.vue
index e57f4a6a0c..1f49514e2a 100644
--- a/docs/app/error.vue
+++ b/docs/app/error.vue
@@ -15,7 +15,6 @@ const { data: files } = useLazyAsyncData('search', () => queryCollectionSearchSe
})
const links = useLinks()
-const searchLinks = useSearchLinks()
const color = computed(() => colorMode.value === 'dark' ? (colors as any)[appConfig.ui.colors.neutral][900] : 'white')
const radius = computed(() => `:root { --ui-radius: ${appConfig.theme.radius}rem; }`)
const blackAsPrimary = computed(() => appConfig.theme.blackAsPrimary ? `:root { --ui-primary: black; } .dark { --ui-primary: white; }` : ':root {}')
@@ -49,7 +48,6 @@ useServerSeoMeta({
useFaviconFromTheme()
-const { frameworks, modules } = useSharedData()
const { mappedNavigation, filteredNavigation } = useContentNavigation(navigation)
provide('navigation', mappedNavigation)
@@ -67,22 +65,6 @@ provide('navigation', mappedNavigation)
-
-
-
+
diff --git a/docs/package.json b/docs/package.json
index db5869d440..ec60c57cc2 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -27,6 +27,7 @@
"nuxt-llms": "^0.1.2",
"nuxt-og-image": "^5.1.3",
"prettier": "^3.5.3",
+ "shiki-stream": "^0.1.2",
"shiki-transformer-color-highlight": "^1.0.0",
"sortablejs": "^1.15.6",
"superstruct": "^2.0.2",
diff --git a/docs/server/api/chat.ts b/docs/server/api/chat.ts
index 0f3ddedfb3..d7ef67b3a5 100644
--- a/docs/server/api/chat.ts
+++ b/docs/server/api/chat.ts
@@ -1,5 +1,6 @@
-import { streamText } from 'ai'
+import { streamText, tool } from 'ai'
import { createWorkersAI } from 'workers-ai-provider'
+import { z } from 'zod'
export default defineEventHandler(async (event) => {
const { messages } = await readBody(event)
@@ -12,11 +13,30 @@ export default defineEventHandler(async (event) => {
}
: undefined
const workersAI = createWorkersAI({ binding: hubAI(), gateway })
+ const autorag = hubAutoRAG('ui3')
return streamText({
- model: workersAI('@cf/meta/llama-3.2-3b-instruct'),
- maxTokens: 10000,
- system: 'You are a helpful assistant that can answer questions and help.',
- messages
+ model: workersAI('@cf/meta/llama-3.3-70b-instruct-fp8-fast'),
+ messages,
+ system: `You are a helpful assistant for Nuxt UI. Check your knowledge base before answering any questions.
+ Only respond to questions using information from tool calls.
+ if no relevant information is found in the tool calls, respond, "Sorry, I don't know."
+ Format your markdown response using the following rules:
+ - Use the vue lang for code blocks syntax highlighting.
+ - Don't use markdown headings.
+ `,
+ tools: {
+ searchDocumentation: tool({
+ description: `search the documentation for information to answer questions.`,
+ parameters: z.object({
+ question: z.string().describe('the users question')
+ }),
+ execute: async ({ question }) => {
+ return (await autorag.aiSearch({
+ query: question
+ })).response
+ }
+ })
+ }
}).toDataStreamResponse()
})
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index ab1b4357f3..f4b24b7cef 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -296,6 +296,9 @@ importers:
prettier:
specifier: ^3.5.3
version: 3.5.3
+ shiki-stream:
+ specifier: ^0.1.2
+ version: 0.1.2(react@19.1.0)(vue@3.5.14(typescript@5.8.3))
shiki-transformer-color-highlight:
specifier: ^1.0.0
version: 1.0.0
@@ -6464,6 +6467,17 @@ packages:
resolution: {integrity: sha512-AzqKpGKjrj7EM6rKVQEPpB288oCfnrEIuyoT9cyF4nmGa7V8Zk6f7RRqYisX8X9m+Q7bd632aZW4ky7EhbQztA==}
engines: {node: '>= 0.4'}
+ shiki-stream@0.1.2:
+ resolution: {integrity: sha512-VtzJT2Sn2vwFoJEhKv71/M6Cl7e/m6p0vIVDgJsYKUpV7E+0zayJsuVuU2ltiSEeWUrqncHSPx8i/xKrRqK6Mw==}
+ peerDependencies:
+ react: ^19.0.0
+ vue: ^3.2.0
+ peerDependenciesMeta:
+ react:
+ optional: true
+ vue:
+ optional: true
+
shiki-transformer-color-highlight@1.0.0:
resolution: {integrity: sha512-WwoXcbSQF4Hcfu/F4V7jvZxqmix4f8KNYNlYiNwz0w9RcABqhdNQOLeRRw3VNV2LBYdNcNR0qd9HVnlV+D+uzg==}
@@ -15118,6 +15132,13 @@ snapshots:
shell-quote@1.8.2: {}
+ shiki-stream@0.1.2(react@19.1.0)(vue@3.5.14(typescript@5.8.3)):
+ dependencies:
+ '@shikijs/core': 3.4.0
+ optionalDependencies:
+ react: 19.1.0
+ vue: 3.5.14(typescript@5.8.3)
+
shiki-transformer-color-highlight@1.0.0:
dependencies:
'@shikijs/core': 3.4.0