[{"data":1,"prerenderedAt":11409},["ShallowReactive",2],{"navigation":3,"blog":929,"blog-posts":941,"blog-hero-title":11382,"blog-hero-description":11401},[4],{"title":5,"path":6,"stem":7,"children":8,"page":36},"Docs","/docs","docs",[9,163,792,828],{"title":10,"path":11,"stem":12,"children":13,"framework":16,"category":16,"description":16,"icon":30},"Get Started","/docs/getting-started","docs/1.getting-started/1.index",[14,19,37,47,53,76,140],{"title":15,"path":11,"stem":12,"framework":16,"category":16,"description":17,"icon":18},"Introduction",null,"Nuxt UI is a comprehensive Vue UI component library (Nuxt optional), offering 125+ accessible, Tailwind CSS components for building modern web applications.","i-lucide-house",{"title":20,"framework":16,"category":16,"description":16,"shadow":21,"path":22,"stem":23,"children":24,"page":36},"Installation",true,"/docs/getting-started/installation","docs/1.getting-started/2.installation",[25,31],{"title":20,"path":26,"stem":27,"framework":28,"category":16,"description":29,"icon":30},"/docs/getting-started/installation/nuxt","docs/1.getting-started/2.installation/1.nuxt","nuxt","Learn how to install and configure Nuxt UI in your Nuxt application.","i-lucide-square-play",{"title":20,"path":32,"stem":33,"framework":34,"category":16,"description":35,"icon":30},"/docs/getting-started/installation/vue","docs/1.getting-started/2.installation/2.vue","vue","Learn how to install and configure Nuxt UI in your Vue application, compatible with both plain Vite and Inertia.",false,{"title":38,"framework":16,"category":16,"description":16,"icon":39,"shadow":21,"path":40,"stem":41,"children":42,"page":36},"Migration","i-lucide-arrow-right-left","/docs/getting-started/migration","docs/1.getting-started/3.migration",[43],{"title":38,"path":44,"stem":45,"framework":16,"category":16,"description":46,"icon":39},"/docs/getting-started/migration/v4","docs/1.getting-started/3.migration/1.v4","A comprehensive guide to migrate your application from Nuxt UI v3 to Nuxt UI v4.",{"title":48,"path":49,"stem":50,"framework":16,"category":16,"description":51,"icon":52},"Contribution","/docs/getting-started/contribution","docs/1.getting-started/4.contribution","A comprehensive guide on contributing to Nuxt UI, including project structure, development workflow, and best practices.","i-lucide-handshake",{"title":54,"path":55,"stem":56,"children":57,"page":36},"Theme","/docs/getting-started/theme","docs/1.getting-started/5.theme",[58,64,70],{"title":59,"path":60,"stem":61,"framework":16,"category":16,"description":62,"icon":63},"Design System","/docs/getting-started/theme/design-system","docs/1.getting-started/5.theme/1.design-system","Nuxt UI's design system uses Tailwind CSS for simple theming and easy customization.","i-lucide-palette",{"title":65,"path":66,"stem":67,"framework":16,"category":16,"description":68,"icon":69},"CSS Variables","/docs/getting-started/theme/css-variables","docs/1.getting-started/5.theme/2.css-variables","Nuxt UI uses CSS variables as design tokens for flexible, consistent theming with built-in light and dark mode support.","i-lucide-swatch-book",{"title":71,"path":72,"stem":73,"framework":16,"category":16,"description":74,"icon":75},"Components","/docs/getting-started/theme/components","docs/1.getting-started/5.theme/3.components","Learn how to customize Nuxt UI components with the Tailwind Variants API for advanced, flexible, and maintainable styling.","i-lucide-layout-grid",{"title":77,"framework":16,"category":16,"description":16,"path":78,"stem":79,"children":80,"page":36},"Integrations","/docs/getting-started/integrations","docs/1.getting-started/6.integrations",[81,95,101,115,129,135],{"title":82,"framework":16,"category":16,"description":16,"shadow":21,"path":83,"stem":84,"children":85,"page":36},"Icons","/docs/getting-started/integrations/icons","docs/1.getting-started/6.integrations/1.icons",[86,91],{"title":82,"path":87,"stem":88,"framework":28,"category":16,"description":89,"icon":90},"/docs/getting-started/integrations/icons/nuxt","docs/1.getting-started/6.integrations/1.icons/1.nuxt","Nuxt UI integrates with Nuxt Icon to access over 200,000+ icons from Iconify.","i-lucide-smile",{"title":82,"path":92,"stem":93,"framework":34,"category":16,"description":94,"icon":90},"/docs/getting-started/integrations/icons/vue","docs/1.getting-started/6.integrations/1.icons/2.vue","Nuxt UI integrates with Iconify to access over 200,000+ icons.",{"title":96,"path":97,"stem":98,"framework":28,"category":16,"description":99,"icon":100},"Fonts","/docs/getting-started/integrations/fonts","docs/1.getting-started/6.integrations/2.fonts","Nuxt UI integrates with Nuxt Fonts to provide plug-and-play font optimization.","i-lucide-a-large-small",{"title":102,"framework":16,"category":16,"description":16,"shadow":21,"path":103,"stem":104,"children":105,"page":36},"Color Mode","/docs/getting-started/integrations/color-mode","docs/1.getting-started/6.integrations/3.color-mode",[106,111],{"title":102,"path":107,"stem":108,"framework":28,"category":16,"description":109,"icon":110},"/docs/getting-started/integrations/color-mode/nuxt","docs/1.getting-started/6.integrations/3.color-mode/1.nuxt","Nuxt UI integrates with Nuxt Color Mode to allow for easy switching between light and dark themes.","i-lucide-sun-moon",{"title":102,"path":112,"stem":113,"framework":34,"category":16,"description":114,"icon":110},"/docs/getting-started/integrations/color-mode/vue","docs/1.getting-started/6.integrations/3.color-mode/2.vue","Nuxt UI integrates with VueUse to allow for easy switching between light and dark themes.",{"title":116,"framework":16,"category":16,"description":16,"shadow":21,"path":117,"stem":118,"children":119,"page":36},"I18n","/docs/getting-started/integrations/i18n","docs/1.getting-started/6.integrations/4.i18n",[120,126],{"title":121,"path":122,"stem":123,"framework":28,"category":16,"description":124,"icon":125},"Internationalization (i18n)","/docs/getting-started/integrations/i18n/nuxt","docs/1.getting-started/6.integrations/4.i18n/1.nuxt","Nuxt UI supports 50+ locales and multi-directional (LTR/RTL) internationalization.","i-lucide-languages",{"title":121,"path":127,"stem":128,"framework":34,"category":16,"description":124,"icon":125},"/docs/getting-started/integrations/i18n/vue","docs/1.getting-started/6.integrations/4.i18n/2.vue",{"title":130,"path":131,"stem":132,"framework":28,"category":16,"description":133,"icon":134},"Content","/docs/getting-started/integrations/content","docs/1.getting-started/6.integrations/5.content","Nuxt UI integrates with Nuxt Content to deliver beautiful typography and consistent component styling.","i-simple-icons-markdown",{"title":136,"path":137,"stem":138,"framework":34,"category":16,"description":139,"icon":134},"SSR","/docs/getting-started/integrations/ssr","docs/1.getting-started/6.integrations/6.ssr","Nuxt UI has first-party support for Vue SSR. This guide will help you have it fully enabled.",{"title":141,"framework":16,"category":16,"description":16,"path":142,"stem":143,"children":144,"page":36},"Agents","/docs/getting-started/ai","docs/1.getting-started/7.ai",[145,151,157],{"title":146,"path":147,"stem":148,"framework":16,"category":16,"description":149,"icon":150},"MCP Server","/docs/getting-started/ai/mcp","docs/1.getting-started/7.ai/1.mcp","Use Nuxt UI components in your AI assistants with Model Context Protocol support.","i-lucide-server",{"title":152,"path":153,"stem":154,"framework":16,"category":16,"description":155,"icon":156},"LLMs.txt","/docs/getting-started/ai/llms-txt","docs/1.getting-started/7.ai/2.llms-txt","How to get AI tools like Cursor, Windsurf, GitHub Copilot, ChatGPT, and Claude to understand Nuxt UI components, theming, and best practices.","i-lucide-bot",{"title":158,"path":159,"stem":160,"framework":16,"category":16,"description":161,"icon":162},"Skills","/docs/getting-started/ai/skills","docs/1.getting-started/7.ai/3.skills","Install Nuxt UI skills to give AI coding agents deep knowledge of components, theming, and best practices.","i-lucide-sparkles",{"title":71,"framework":16,"category":16,"description":16,"icon":164,"path":165,"stem":166,"children":167,"page":36},"i-lucide-square-code","/docs/components","docs/2.components",[168,174,180,186,192,197,202,207,212,217,222,228,233,238,243,248,253,258,264,269,274,279,284,290,295,300,305,311,316,321,326,331,336,341,346,352,357,362,367,372,378,384,389,394,399,404,409,414,419,424,429,434,439,446,451,456,461,466,471,476,481,486,491,496,501,506,511,516,521,526,531,536,541,546,551,556,561,567,572,577,582,587,592,597,602,607,612,617,622,627,632,637,642,647,652,657,662,667,672,677,682,687,692,697,702,707,712,717,722,727,732,737,742,747,752,757,762,767,772,777,782,787],{"title":169,"path":170,"stem":171,"framework":16,"category":172,"description":173},"Accordion","/docs/components/accordion","docs/2.components/accordion","data","A stacked set of collapsible panels.",{"title":175,"path":176,"stem":177,"framework":16,"category":178,"description":179},"Alert","/docs/components/alert","docs/2.components/alert","element","A callout to draw user's attention.",{"title":181,"path":182,"stem":183,"framework":16,"category":184,"description":185},"App","/docs/components/app","docs/2.components/app","layout","Wraps your app to provide global configurations and more.",{"title":187,"path":188,"stem":189,"framework":16,"category":190,"description":191},"AuthForm","/docs/components/auth-form","docs/2.components/auth-form","page","A customizable Form to create login, register or password reset forms.",{"title":193,"path":194,"stem":195,"framework":16,"category":178,"description":196},"Avatar","/docs/components/avatar","docs/2.components/avatar","An img element with fallback and Nuxt Image support.",{"title":198,"path":199,"stem":200,"framework":16,"category":178,"description":201},"AvatarGroup","/docs/components/avatar-group","docs/2.components/avatar-group","Stack multiple avatars in a group.",{"title":203,"path":204,"stem":205,"framework":16,"category":178,"description":206},"Badge","/docs/components/badge","docs/2.components/badge","A short text to represent a status or a category.",{"title":208,"path":209,"stem":210,"framework":16,"category":178,"description":211},"Banner","/docs/components/banner","docs/2.components/banner","Display a banner at the top of your website to inform users about important information.",{"title":213,"path":214,"stem":215,"framework":16,"category":190,"description":216},"BlogPost","/docs/components/blog-post","docs/2.components/blog-post","A customizable article to display in a blog page.",{"title":218,"path":219,"stem":220,"framework":16,"category":190,"description":221},"BlogPosts","/docs/components/blog-posts","docs/2.components/blog-posts","Display a list of blog posts in a responsive grid layout.",{"title":223,"path":224,"stem":225,"framework":16,"category":226,"description":227},"Breadcrumb","/docs/components/breadcrumb","docs/2.components/breadcrumb","navigation","A hierarchy of links to navigate through a website.",{"title":229,"path":230,"stem":231,"framework":16,"category":178,"description":232},"Button","/docs/components/button","docs/2.components/button","A button element that can act as a link or trigger an action.",{"title":234,"path":235,"stem":236,"framework":16,"category":178,"description":237},"Calendar","/docs/components/calendar","docs/2.components/calendar","A calendar component for selecting single dates, multiple dates or date ranges.",{"title":239,"path":240,"stem":241,"framework":16,"category":178,"description":242},"Card","/docs/components/card","docs/2.components/card","Display content in a card with a header, body and footer.",{"title":244,"path":245,"stem":246,"framework":16,"category":172,"description":247},"Carousel","/docs/components/carousel","docs/2.components/carousel","A carousel with motion and swipe built using Embla.",{"title":249,"path":250,"stem":251,"framework":16,"category":190,"description":252},"ChangelogVersion","/docs/components/changelog-version","docs/2.components/changelog-version","A customizable article to display in a changelog.",{"title":254,"path":255,"stem":256,"framework":16,"category":190,"description":257},"ChangelogVersions","/docs/components/changelog-versions","docs/2.components/changelog-versions","Display a list of changelog versions in a timeline.",{"title":259,"path":260,"stem":261,"framework":16,"category":262,"description":263},"ChatMessage","/docs/components/chat-message","docs/2.components/chat-message","chat","Display a chat message with icon, avatar, and actions.",{"title":265,"path":266,"stem":267,"framework":16,"category":262,"description":268},"ChatMessages","/docs/components/chat-messages","docs/2.components/chat-messages","Display a list of chat messages, designed to work seamlessly with Vercel AI SDK.",{"title":270,"path":271,"stem":272,"framework":16,"category":262,"description":273},"ChatPalette","/docs/components/chat-palette","docs/2.components/chat-palette","A chat palette to create a chatbot interface inside an overlay.",{"title":275,"path":276,"stem":277,"framework":16,"category":262,"description":278},"ChatPrompt","/docs/components/chat-prompt","docs/2.components/chat-prompt","An enhanced Textarea for submitting prompts in AI chat interfaces.",{"title":280,"path":281,"stem":282,"framework":16,"category":262,"description":283},"ChatPromptSubmit","/docs/components/chat-prompt-submit","docs/2.components/chat-prompt-submit","A Button for submitting chat prompts with automatic status handling.",{"title":285,"path":286,"stem":287,"framework":16,"category":288,"description":289},"Checkbox","/docs/components/checkbox","docs/2.components/checkbox","form","An input element to toggle between checked and unchecked states.",{"title":291,"path":292,"stem":293,"framework":16,"category":288,"description":294},"CheckboxGroup","/docs/components/checkbox-group","docs/2.components/checkbox-group","A set of checklist buttons to select multiple option from a list.",{"title":296,"path":297,"stem":298,"framework":16,"category":178,"description":299},"Chip","/docs/components/chip","docs/2.components/chip","An indicator of a numeric value or a state.",{"title":301,"path":302,"stem":303,"framework":16,"category":178,"description":304},"Collapsible","/docs/components/collapsible","docs/2.components/collapsible","A collapsible element to toggle visibility of its content.",{"title":306,"path":307,"stem":308,"framework":16,"category":309,"description":310},"ColorModeAvatar","/docs/components/color-mode-avatar","docs/2.components/color-mode-avatar","color-mode","An Avatar with a different source for light and dark mode.",{"title":312,"path":313,"stem":314,"framework":16,"category":309,"description":315},"ColorModeButton","/docs/components/color-mode-button","docs/2.components/color-mode-button","A Button to switch between light and dark mode.",{"title":317,"path":318,"stem":319,"framework":16,"category":309,"description":320},"ColorModeImage","/docs/components/color-mode-image","docs/2.components/color-mode-image","An image element with a different source for light and dark mode.",{"title":322,"path":323,"stem":324,"framework":16,"category":309,"description":325},"ColorModeSelect","/docs/components/color-mode-select","docs/2.components/color-mode-select","A Select to switch between system, dark & light mode.",{"title":327,"path":328,"stem":329,"framework":16,"category":309,"description":330},"ColorModeSwitch","/docs/components/color-mode-switch","docs/2.components/color-mode-switch","A switch to toggle between light and dark mode.",{"title":332,"path":333,"stem":334,"framework":16,"category":288,"description":335},"ColorPicker","/docs/components/color-picker","docs/2.components/color-picker","A component to select a color.",{"title":337,"path":338,"stem":339,"framework":16,"category":226,"description":340},"CommandPalette","/docs/components/command-palette","docs/2.components/command-palette","A command palette with full-text search powered by Fuse.js for efficient fuzzy matching.",{"title":342,"path":343,"stem":344,"framework":16,"category":184,"description":345},"Container","/docs/components/container","docs/2.components/container","A container lets you center and constrain the width of your content.",{"title":347,"path":348,"stem":349,"framework":28,"category":350,"description":351},"ContentNavigation","/docs/components/content-navigation","docs/2.components/content-navigation","content","An accordion-style navigation component for organizing page links.",{"title":353,"path":354,"stem":355,"framework":28,"category":350,"description":356},"ContentSearch","/docs/components/content-search","docs/2.components/content-search","A ready to use CommandPalette to add to your documentation.",{"title":358,"path":359,"stem":360,"framework":28,"category":350,"description":361},"ContentSearchButton","/docs/components/content-search-button","docs/2.components/content-search-button","A pre-styled Button to open the ContentSearch modal.",{"title":363,"path":364,"stem":365,"framework":28,"category":350,"description":366},"ContentSurround","/docs/components/content-surround","docs/2.components/content-surround","A pair of prev and next links to navigate between pages.",{"title":368,"path":369,"stem":370,"framework":28,"category":350,"description":371},"ContentToc","/docs/components/content-toc","docs/2.components/content-toc","A sticky Table of Contents with automatic active anchor link highlighting.",{"title":373,"path":374,"stem":375,"framework":16,"category":376,"description":377},"ContextMenu","/docs/components/context-menu","docs/2.components/context-menu","overlay","A menu to display actions when right-clicking on an element.",{"title":379,"path":380,"stem":381,"framework":16,"category":382,"description":383},"DashboardGroup","/docs/components/dashboard-group","docs/2.components/dashboard-group","dashboard","A fixed layout component that provides context for dashboard components with sidebar state management and persistence.",{"title":385,"path":386,"stem":387,"framework":16,"category":382,"description":388},"DashboardNavbar","/docs/components/dashboard-navbar","docs/2.components/dashboard-navbar","A responsive navbar to display in a dashboard.",{"title":390,"path":391,"stem":392,"framework":16,"category":382,"description":393},"DashboardPanel","/docs/components/dashboard-panel","docs/2.components/dashboard-panel","A resizable panel to display in a dashboard.",{"title":395,"path":396,"stem":397,"framework":16,"category":382,"description":398},"DashboardResizeHandle","/docs/components/dashboard-resize-handle","docs/2.components/dashboard-resize-handle","A handle to resize a sidebar or panel.",{"title":400,"path":401,"stem":402,"framework":16,"category":382,"description":403},"DashboardSearch","/docs/components/dashboard-search","docs/2.components/dashboard-search","A ready to use CommandPalette to add to your dashboard.",{"title":405,"path":406,"stem":407,"framework":16,"category":382,"description":408},"DashboardSearchButton","/docs/components/dashboard-search-button","docs/2.components/dashboard-search-button","A pre-styled Button to open the DashboardSearch modal.",{"title":410,"path":411,"stem":412,"framework":16,"category":382,"description":413},"DashboardSidebar","/docs/components/dashboard-sidebar","docs/2.components/dashboard-sidebar","A resizable and collapsible sidebar to display in a dashboard.",{"title":415,"path":416,"stem":417,"framework":16,"category":382,"description":418},"DashboardSidebarCollapse","/docs/components/dashboard-sidebar-collapse","docs/2.components/dashboard-sidebar-collapse","A Button to collapse the sidebar on desktop.",{"title":420,"path":421,"stem":422,"framework":16,"category":382,"description":423},"DashboardSidebarToggle","/docs/components/dashboard-sidebar-toggle","docs/2.components/dashboard-sidebar-toggle","A Button to toggle the sidebar on mobile.",{"title":425,"path":426,"stem":427,"framework":16,"category":382,"description":428},"DashboardToolbar","/docs/components/dashboard-toolbar","docs/2.components/dashboard-toolbar","A toolbar to display under the navbar in a dashboard.",{"title":430,"path":431,"stem":432,"framework":16,"category":376,"description":433},"Drawer","/docs/components/drawer","docs/2.components/drawer","A drawer that smoothly slides in & out of the screen.",{"title":435,"path":436,"stem":437,"framework":16,"category":376,"description":438},"DropdownMenu","/docs/components/dropdown-menu","docs/2.components/dropdown-menu","A menu to display actions when clicking on an element.",{"title":440,"path":441,"stem":442,"framework":16,"category":443,"description":444,"badge":445},"Editor","/docs/components/editor","docs/2.components/editor","editor","A rich text editor component based on TipTap with support for markdown, HTML, and JSON content types.","New",{"title":447,"path":448,"stem":449,"framework":16,"category":443,"description":450,"badge":445},"EditorDragHandle","/docs/components/editor-drag-handle","docs/2.components/editor-drag-handle","A draggable handle for reordering and selecting blocks in the editor.",{"title":452,"path":453,"stem":454,"framework":16,"category":443,"description":455,"badge":445},"EditorEmojiMenu","/docs/components/editor-emoji-menu","docs/2.components/editor-emoji-menu","An emoji picker menu that displays emoji suggestions when typing the : character in the editor.",{"title":457,"path":458,"stem":459,"framework":16,"category":443,"description":460,"badge":445},"EditorMentionMenu","/docs/components/editor-mention-menu","docs/2.components/editor-mention-menu","A mention menu that displays user suggestions when typing a trigger character in the editor.",{"title":462,"path":463,"stem":464,"framework":16,"category":443,"description":465,"badge":445},"EditorSuggestionMenu","/docs/components/editor-suggestion-menu","docs/2.components/editor-suggestion-menu","A command menu that displays formatting and action suggestions when typing the / character in the editor.",{"title":467,"path":468,"stem":469,"framework":16,"category":443,"description":470,"badge":445},"EditorToolbar","/docs/components/editor-toolbar","docs/2.components/editor-toolbar","A customizable toolbar for editor actions that can be displayed as fixed, bubble, or floating menu.",{"title":472,"path":473,"stem":474,"framework":16,"category":172,"description":475},"Empty","/docs/components/empty","docs/2.components/empty","A component to display an empty state.",{"title":477,"path":478,"stem":479,"framework":16,"category":184,"description":480},"Error","/docs/components/error","docs/2.components/error","A pre-built error component with NuxtError support.",{"title":482,"path":483,"stem":484,"framework":16,"category":178,"description":485},"FieldGroup","/docs/components/field-group","docs/2.components/field-group","Group multiple button-like elements together.",{"title":487,"path":488,"stem":489,"framework":16,"category":288,"description":490},"FileUpload","/docs/components/file-upload","docs/2.components/file-upload","An input element to upload files.",{"title":492,"path":493,"stem":494,"framework":16,"category":184,"description":495},"Footer","/docs/components/footer","docs/2.components/footer","A responsive footer component.",{"title":497,"path":498,"stem":499,"framework":16,"category":226,"description":500},"FooterColumns","/docs/components/footer-columns","docs/2.components/footer-columns","A list of links as columns to display in your Footer.",{"title":502,"path":503,"stem":504,"framework":16,"category":288,"description":505},"Form","/docs/components/form","docs/2.components/form","A form component with built-in validation and submission handling.",{"title":507,"path":508,"stem":509,"framework":16,"category":288,"description":510},"FormField","/docs/components/form-field","docs/2.components/form-field","A wrapper for form elements that provides validation and error handling.",{"title":512,"path":513,"stem":514,"framework":16,"category":184,"description":515},"Header","/docs/components/header","docs/2.components/header","A responsive header component.",{"title":517,"path":518,"stem":519,"framework":16,"category":178,"description":520},"Icon","/docs/components/icon","docs/2.components/icon","A component to display any icon from Iconify or another component.",{"title":522,"path":523,"stem":524,"framework":16,"category":288,"description":525},"Input","/docs/components/input","docs/2.components/input","An input element to enter text.",{"title":527,"path":528,"stem":529,"framework":16,"category":288,"description":530},"InputDate","/docs/components/input-date","docs/2.components/input-date","An input component for date selection.",{"title":532,"path":533,"stem":534,"framework":16,"category":288,"description":535},"InputMenu","/docs/components/input-menu","docs/2.components/input-menu","An autocomplete input with real-time suggestions.",{"title":537,"path":538,"stem":539,"framework":16,"category":288,"description":540},"InputNumber","/docs/components/input-number","docs/2.components/input-number","An input for numerical values with a customizable range.",{"title":542,"path":543,"stem":544,"framework":16,"category":288,"description":545},"InputTags","/docs/components/input-tags","docs/2.components/input-tags","An input element that displays interactive tags.",{"title":547,"path":548,"stem":549,"framework":16,"category":288,"description":550},"InputTime","/docs/components/input-time","docs/2.components/input-time","An input for selecting a time.",{"title":552,"path":553,"stem":554,"framework":16,"category":178,"description":555},"Kbd","/docs/components/kbd","docs/2.components/kbd","A kbd element to display a keyboard key.",{"title":557,"path":558,"stem":559,"framework":16,"category":226,"description":560},"Link","/docs/components/link","docs/2.components/link","A wrapper around \u003CNuxtLink> with extra props.",{"title":562,"path":563,"stem":564,"framework":16,"category":565,"description":566},"LocaleSelect","/docs/components/locale-select","docs/2.components/locale-select","i18n","A Select to switch between locales.",{"title":568,"path":569,"stem":570,"framework":16,"category":184,"description":571},"Main","/docs/components/main","docs/2.components/main","A main element that fills the available viewport height.",{"title":573,"path":574,"stem":575,"framework":16,"category":172,"description":576},"Marquee","/docs/components/marquee","docs/2.components/marquee","A component to create infinite scrolling content.",{"title":578,"path":579,"stem":580,"framework":16,"category":376,"description":581},"Modal","/docs/components/modal","docs/2.components/modal","A dialog window that can be used to display a message or request user input.",{"title":583,"path":584,"stem":585,"framework":16,"category":226,"description":586},"NavigationMenu","/docs/components/navigation-menu","docs/2.components/navigation-menu","A list of links that can be displayed horizontally or vertically.",{"title":588,"path":589,"stem":590,"framework":16,"category":190,"description":591},"Page","/docs/components/page","docs/2.components/page","A grid layout for your pages with left and right columns.",{"title":593,"path":594,"stem":595,"framework":16,"category":190,"description":596},"PageAnchors","/docs/components/page-anchors","docs/2.components/page-anchors","A list of anchors to be displayed in the page.",{"title":598,"path":599,"stem":600,"framework":16,"category":190,"description":601},"PageAside","/docs/components/page-aside","docs/2.components/page-aside","A sticky aside to display your page navigation.",{"title":603,"path":604,"stem":605,"framework":16,"category":190,"description":606},"PageBody","/docs/components/page-body","docs/2.components/page-body","The main content of your page.",{"title":608,"path":609,"stem":610,"framework":16,"category":190,"description":611},"PageCard","/docs/components/page-card","docs/2.components/page-card","A pre-styled card component that displays a title, description and optional link.",{"title":613,"path":614,"stem":615,"framework":16,"category":190,"description":616},"PageColumns","/docs/components/page-columns","docs/2.components/page-columns","A responsive multi-column layout system for organizing content side-by-side.",{"title":618,"path":619,"stem":620,"framework":16,"category":190,"description":621},"PageCTA","/docs/components/page-cta","docs/2.components/page-cta","A call to action section to display in your pages.",{"title":623,"path":624,"stem":625,"framework":16,"category":190,"description":626},"PageFeature","/docs/components/page-feature","docs/2.components/page-feature","A component to showcase key features of your application.",{"title":628,"path":629,"stem":630,"framework":16,"category":190,"description":631},"PageGrid","/docs/components/page-grid","docs/2.components/page-grid","A responsive grid system for displaying content in a flexible layout.",{"title":633,"path":634,"stem":635,"framework":16,"category":190,"description":636},"PageHeader","/docs/components/page-header","docs/2.components/page-header","A responsive header for your pages.",{"title":638,"path":639,"stem":640,"framework":16,"category":190,"description":641},"PageHero","/docs/components/page-hero","docs/2.components/page-hero","A responsive hero for your pages.",{"title":643,"path":644,"stem":645,"framework":16,"category":190,"description":646},"PageLinks","/docs/components/page-links","docs/2.components/page-links","A list of links to be displayed in the page.",{"title":648,"path":649,"stem":650,"framework":16,"category":190,"description":651},"PageList","/docs/components/page-list","docs/2.components/page-list","A vertical list layout for displaying content in a stacked format.",{"title":653,"path":654,"stem":655,"framework":16,"category":190,"description":656},"PageLogos","/docs/components/page-logos","docs/2.components/page-logos","A list of logos or images to display on your pages.",{"title":658,"path":659,"stem":660,"framework":16,"category":190,"description":661},"PageSection","/docs/components/page-section","docs/2.components/page-section","A responsive section for your pages.",{"title":663,"path":664,"stem":665,"framework":16,"category":226,"description":666},"Pagination","/docs/components/pagination","docs/2.components/pagination","A list of buttons or links to navigate through pages.",{"title":668,"path":669,"stem":670,"framework":16,"category":288,"description":671},"PinInput","/docs/components/pin-input","docs/2.components/pin-input","An input element to enter a pin.",{"title":673,"path":674,"stem":675,"framework":16,"category":376,"description":676},"Popover","/docs/components/popover","docs/2.components/popover","A non-modal dialog that floats around a trigger element.",{"title":678,"path":679,"stem":680,"framework":16,"category":190,"description":681},"PricingPlan","/docs/components/pricing-plan","docs/2.components/pricing-plan","A customizable pricing plan to display in a pricing page.",{"title":683,"path":684,"stem":685,"framework":16,"category":190,"description":686},"PricingPlans","/docs/components/pricing-plans","docs/2.components/pricing-plans","Display a list of pricing plans in a responsive grid layout.",{"title":688,"path":689,"stem":690,"framework":16,"category":190,"description":691},"PricingTable","/docs/components/pricing-table","docs/2.components/pricing-table","A responsive pricing table component that displays tiered pricing plans with feature comparisons.",{"title":693,"path":694,"stem":695,"framework":16,"category":178,"description":696},"Progress","/docs/components/progress","docs/2.components/progress","An indicator showing the progress of a task.",{"title":698,"path":699,"stem":700,"framework":16,"category":288,"description":701},"RadioGroup","/docs/components/radio-group","docs/2.components/radio-group","A set of radio buttons to select a single option from a list.",{"title":703,"path":704,"stem":705,"framework":16,"category":172,"description":706,"badge":445},"ScrollArea","/docs/components/scroll-area","docs/2.components/scroll-area","A flexible scroll container with virtualization support.",{"title":708,"path":709,"stem":710,"framework":16,"category":288,"description":711},"Select","/docs/components/select","docs/2.components/select","A select element to choose from a list of options.",{"title":713,"path":714,"stem":715,"framework":16,"category":288,"description":716},"SelectMenu","/docs/components/select-menu","docs/2.components/select-menu","An advanced searchable select element.",{"title":718,"path":719,"stem":720,"framework":16,"category":178,"description":721},"Separator","/docs/components/separator","docs/2.components/separator","Separates content horizontally or vertically.",{"title":723,"path":724,"stem":725,"framework":16,"category":178,"description":726},"Skeleton","/docs/components/skeleton","docs/2.components/skeleton","A placeholder to show while content is loading.",{"title":728,"path":729,"stem":730,"framework":16,"category":376,"description":731},"Slideover","/docs/components/slideover","docs/2.components/slideover","A dialog that slides in from any side of the screen.",{"title":733,"path":734,"stem":735,"framework":16,"category":288,"description":736},"Slider","/docs/components/slider","docs/2.components/slider","An input to select a numeric value within a range.",{"title":738,"path":739,"stem":740,"framework":16,"category":226,"description":741},"Stepper","/docs/components/stepper","docs/2.components/stepper","A set of steps that are used to indicate progress through a multi-step process.",{"title":743,"path":744,"stem":745,"framework":16,"category":288,"description":746},"Switch","/docs/components/switch","docs/2.components/switch","A control that toggles between two states.",{"title":748,"path":749,"stem":750,"framework":16,"category":172,"description":751},"Table","/docs/components/table","docs/2.components/table","A responsive table element to display data in rows and columns.",{"title":753,"path":754,"stem":755,"framework":16,"category":226,"description":756},"Tabs","/docs/components/tabs","docs/2.components/tabs","A set of tab panels that are displayed one at a time.",{"title":758,"path":759,"stem":760,"framework":16,"category":288,"description":761},"Textarea","/docs/components/textarea","docs/2.components/textarea","A textarea element to input multi-line text.",{"title":54,"path":763,"stem":764,"framework":16,"category":184,"description":765,"badge":766},"/docs/components/theme","docs/2.components/theme","A headless component to theme child components.","Soon",{"title":768,"path":769,"stem":770,"framework":16,"category":172,"description":771},"Timeline","/docs/components/timeline","docs/2.components/timeline","A component that displays a sequence of events with dates, titles, icons or avatars.",{"title":773,"path":774,"stem":775,"framework":16,"category":376,"description":776},"Toast","/docs/components/toast","docs/2.components/toast","A succinct message to provide information or feedback to the user.",{"title":778,"path":779,"stem":780,"framework":16,"category":376,"description":781},"Tooltip","/docs/components/tooltip","docs/2.components/tooltip","A popup that reveals information when hovering over an element.",{"title":783,"path":784,"stem":785,"framework":16,"category":172,"description":786},"Tree","/docs/components/tree","docs/2.components/tree","A tree view component to display and interact with hierarchical data structures.",{"title":788,"path":789,"stem":790,"framework":16,"category":172,"description":791},"User","/docs/components/user","docs/2.components/user","Display user information with name, description and avatar.",{"title":793,"framework":16,"category":16,"description":16,"icon":794,"path":795,"stem":796,"children":797,"page":36},"Composables","i-lucide-square-function","/docs/composables","docs/3.composables",[798,803,808,813,818,823],{"title":799,"path":800,"stem":801,"framework":16,"category":16,"description":802},"defineLocale","/docs/composables/define-locale","docs/3.composables/define-locale","A utility to create a custom locale for your app.",{"title":804,"path":805,"stem":806,"framework":16,"category":16,"description":807},"defineShortcuts","/docs/composables/define-shortcuts","docs/3.composables/define-shortcuts","A composable to define keyboard shortcuts in your app.",{"title":809,"path":810,"stem":811,"framework":16,"category":16,"description":812},"extendLocale","/docs/composables/extend-locale","docs/3.composables/extend-locale","A utility to extend an existing locale with custom translations.",{"title":814,"path":815,"stem":816,"framework":16,"category":16,"description":817},"extractShortcuts","/docs/composables/extract-shortcuts","docs/3.composables/extract-shortcuts","A utility to extract keyboard shortcuts from menu items.",{"title":819,"path":820,"stem":821,"framework":16,"category":16,"description":822},"useOverlay","/docs/composables/use-overlay","docs/3.composables/use-overlay","A composable to programmatically control overlays.",{"title":824,"path":825,"stem":826,"framework":16,"category":16,"description":827},"useToast","/docs/composables/use-toast","docs/3.composables/use-toast","A composable to display toast notifications in your app.",{"title":829,"path":830,"stem":831,"children":832,"framework":28,"category":16,"description":16,"icon":928},"Typography","/docs/typography","docs/4.typography/1.index",[833,835,840,845,850,855,860,864,869,873,878,883,888,893,898,902,907,911,915,919,924],{"title":15,"path":830,"stem":831,"framework":28,"category":16,"description":834},"Beautiful typography components and utilities to style your content with Nuxt UI.",{"title":836,"path":837,"stem":838,"framework":28,"category":16,"description":839},"Headers and text","/docs/typography/headers-and-text","docs/4.typography/2.headers-and-text","Beautifully styled headings, paragraphs, text formatting, and links for optimal readability.",{"title":841,"path":842,"stem":843,"framework":28,"category":16,"description":844},"Lists and tables","/docs/typography/lists-and-tables","docs/4.typography/3.lists-and-tables","Organize information with styled lists and responsive tables for clear, consistent readability.",{"title":846,"path":847,"stem":848,"framework":28,"category":16,"description":849},"Images and embeds","/docs/typography/images-and-embeds","docs/4.typography/4.images-and-embeds","Responsive images, videos, and rich media embeds to enhance and illustrate your documentation.",{"title":851,"path":852,"stem":853,"framework":28,"category":16,"description":854},"Code","/docs/typography/code","docs/4.typography/5.code","Display inline code and syntax-highlighted code blocks with copy-to-clipboard support.",{"title":169,"path":856,"stem":857,"framework":28,"category":858,"description":859},"/docs/typography/accordion","docs/4.typography/accordion","components","Create expandable content sections for better information organization.",{"title":203,"path":861,"stem":862,"framework":28,"category":858,"description":863},"/docs/typography/badge","docs/4.typography/badge","Display version numbers, status labels, and tags within your content.",{"title":865,"path":866,"stem":867,"framework":28,"category":858,"description":868},"Callout","/docs/typography/callout","docs/4.typography/callout","Highlight important information with eye-catching colored boxes and icons.",{"title":239,"path":870,"stem":871,"framework":28,"category":858,"description":872},"/docs/typography/card","docs/4.typography/card","Create highlighted content blocks with optional links and navigation.",{"title":874,"path":875,"stem":876,"framework":28,"category":858,"description":877},"CardGroup","/docs/typography/card-group","docs/4.typography/card-group","Organize multiple cards in responsive grid layouts for better content presentation.",{"title":879,"path":880,"stem":881,"framework":28,"category":858,"description":882},"CodeCollapse","/docs/typography/code-collapse","docs/4.typography/code-collapse","Make long code blocks collapsible to save space and improve readability.",{"title":884,"path":885,"stem":886,"framework":28,"category":858,"description":887},"CodeGroup","/docs/typography/code-group","docs/4.typography/code-group","Group multiple code examples in tabbed interfaces for easy comparison.",{"title":889,"path":890,"stem":891,"framework":28,"category":858,"description":892},"CodePreview","/docs/typography/code-preview","docs/4.typography/code-preview","Display code examples with a preview and their source for clearer documentation.",{"title":894,"path":895,"stem":896,"framework":28,"category":858,"description":897},"CodeTree","/docs/typography/code-tree","docs/4.typography/code-tree","Visualize file and folder structures with syntax-highlighted code.",{"title":301,"path":899,"stem":900,"framework":28,"category":858,"description":901},"/docs/typography/collapsible","docs/4.typography/collapsible","Toggle content visibility with smooth expand and collapse animations.",{"title":903,"path":904,"stem":905,"framework":28,"category":858,"description":906},"Field","/docs/typography/field","docs/4.typography/field","Document API parameters, props, and configuration options clearly.",{"title":482,"path":908,"stem":909,"framework":28,"category":858,"description":910},"/docs/typography/field-group","docs/4.typography/field-group","Group related fields together for comprehensive API documentation.",{"title":517,"path":912,"stem":913,"framework":28,"category":858,"description":914},"/docs/typography/icon","docs/4.typography/icon","Display icons from popular icon libraries to enhance your content.",{"title":552,"path":916,"stem":917,"framework":28,"category":858,"description":918},"/docs/typography/kbd","docs/4.typography/kbd","Display keyboard shortcuts and key combinations with proper styling.",{"title":920,"path":921,"stem":922,"framework":28,"category":858,"description":923},"Steps","/docs/typography/steps","docs/4.typography/steps","Transform headings into numbered step-by-step guides and tutorials.",{"title":753,"path":925,"stem":926,"framework":28,"category":858,"description":927},"/docs/typography/tabs","docs/4.typography/tabs","Organize related content in interactive tabbed interfaces.","i-lucide-square-pilcrow",{"id":930,"title":931,"body":16,"description":932,"extension":933,"hero":934,"meta":936,"navigation":36,"path":937,"seo":938,"stem":939,"__hash__":940},"blog/blog.yml","Blog","Tutorials, guides, and insights to help you build beautiful applications with Nuxt UI.","yml",{"title":935,"description":932},"Nuxt [UI]{.text-primary} Blog",{},"/blog",{"title":931,"description":932},"blog","ESl67YJxs4hhxlk_OHymZ1sSoeclVge2lYINtoN5zxg",[942],{"id":943,"title":944,"authors":945,"body":956,"date":11372,"description":11373,"extension":11374,"image":11375,"meta":11376,"navigation":36,"path":11378,"seo":11379,"stem":11380,"__hash__":11381},"posts/blog/how-to-build-an-ai-chat.md","Build an AI Chatbot with Nuxt, Nuxt UI, and AI SDK",[946,951],{"name":947,"avatar":948,"to":950},"Hugo Richard",{"src":949},"https://github.com/hugorcd.png","https://x.com/hugorcd",{"name":952,"avatar":953,"to":955},"Benjamin Canac",{"src":954},"https://github.com/benjamincanac.png","https://x.com/benjamincanac",{"type":957,"value":958,"toc":11339},"minimark",[959,963,968,971,1006,1019,1023,1026,1042,1046,1049,1087,1092,1095,1239,1243,1250,1466,1469,1508,1512,1519,1614,1621,1638,1648,1652,1666,2397,2400,2418,2428,2432,2440,2444,2455,2823,2827,2854,4208,4211,4216,4223,4228,4239,4244,4253,4271,4276,4292,4305,4309,4312,4687,4691,4706,4710,4718,5294,5301,5326,5330,5349,6609,6612,6617,6628,6666,6681,6686,6693,6707,6712,6733,6738,6743,6750,6761,6765,6768,6772,6775,6928,6932,6957,7426,7430,7969,7973,9137,9146,9150,9157,9161,9171,9428,9432,9440,9689,9693,9696,10939,10943,10946,10951,10960,10965,10974,11177,11189,11193,11196,11211,11214,11229,11244,11252,11256,11259,11289,11292,11297,11332,11335],[960,961,962],"p",{},"Building AI-powered applications has never been more accessible. This guide walks through creating a full-featured AI chatbot using Nuxt, Nuxt UI, and the Vercel AI SDK. Each step is explained in detail so you understand how every piece works together.",[964,965,967],"h2",{"id":966},"what-were-building","What we're building",[960,969,970],{},"By the end of this tutorial, you'll have a fully functional AI chatbot with:",[972,973,974,982,988,994,1000],"ul",{},[975,976,977,981],"li",{},[978,979,980],"strong",{},"Streaming responses"," that appear in real-time as the AI generates them",[975,983,984,987],{},[978,985,986],{},"A beautiful chat interface"," built with Nuxt UI's purpose-built chat components",[975,989,990,993],{},[978,991,992],{},"Markdown rendering"," for rich AI responses with code highlighting",[975,995,996,999],{},[978,997,998],{},"Multi-model support"," allowing users to switch between OpenAI, Anthropic, and Google models",[975,1001,1002,1005],{},[978,1003,1004],{},"Server-side AI integration"," using Nitro API routes and the AI SDK",[1007,1008,1012],"callout",{"icon":1009,"target":1010,"to":1011},"i-simple-icons-github","_blank","https://github.com/nuxt-ui-templates/chat",[960,1013,1014,1015,1018],{},"Check out the complete ",[978,1016,1017],{},"AI Chat template"," on GitHub for a production-ready implementation with authentication, database persistence, and more.",[964,1020,1022],{"id":1021},"prerequisites","Prerequisites",[960,1024,1025],{},"Before we start, make sure you have:",[972,1027,1028,1031],{},[975,1029,1030],{},"Node.js 20+ installed",[975,1032,1033,1034,1041],{},"A ",[1035,1036,1040],"a",{"href":1037,"rel":1038},"https://vercel.com/docs/ai-gateway",[1039],"nofollow","Vercel AI Gateway"," API key (provides access to multiple AI providers through a single endpoint)",[964,1043,1045],{"id":1044},"project-setup","Project setup",[960,1047,1048],{},"Start by creating a new Nuxt project:",[1050,1051,1056],"pre",{"className":1052,"code":1053,"language":1054,"meta":1055,"style":1055},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","npx nuxi@latest init nuxt-ai-chat\ncd nuxt-ai-chat\n","bash","",[1057,1058,1059,1078],"code",{"__ignoreMap":1055},[1060,1061,1064,1068,1072,1075],"span",{"class":1062,"line":1063},"line",1,[1060,1065,1067],{"class":1066},"sBMFI","npx",[1060,1069,1071],{"class":1070},"sfazB"," nuxi@latest",[1060,1073,1074],{"class":1070}," init",[1060,1076,1077],{"class":1070}," nuxt-ai-chat\n",[1060,1079,1081,1085],{"class":1062,"line":1080},2,[1060,1082,1084],{"class":1083},"s2Zo4","cd",[1060,1086,1077],{"class":1070},[1088,1089,1091],"h3",{"id":1090},"installing-dependencies","Installing dependencies",[960,1093,1094],{},"Install Nuxt UI and the AI-specific dependencies:",[1096,1097,1099,1142,1174,1207],"code-group",{"sync":1098},"pm",[1050,1100,1103],{"className":1052,"code":1101,"filename":1102,"language":1054,"meta":1055,"style":1055},"pnpm add @nuxt/ui tailwindcss @nuxtjs/mdc @nuxthub/core drizzle-orm drizzle-kit @libsql/client ai @ai-sdk/vue zod\n","pnpm",[1057,1104,1105],{"__ignoreMap":1055},[1060,1106,1107,1109,1112,1115,1118,1121,1124,1127,1130,1133,1136,1139],{"class":1062,"line":1063},[1060,1108,1102],{"class":1066},[1060,1110,1111],{"class":1070}," add",[1060,1113,1114],{"class":1070}," @nuxt/ui",[1060,1116,1117],{"class":1070}," tailwindcss",[1060,1119,1120],{"class":1070}," @nuxtjs/mdc",[1060,1122,1123],{"class":1070}," @nuxthub/core",[1060,1125,1126],{"class":1070}," drizzle-orm",[1060,1128,1129],{"class":1070}," drizzle-kit",[1060,1131,1132],{"class":1070}," @libsql/client",[1060,1134,1135],{"class":1070}," ai",[1060,1137,1138],{"class":1070}," @ai-sdk/vue",[1060,1140,1141],{"class":1070}," zod\n",[1050,1143,1146],{"className":1052,"code":1144,"filename":1145,"language":1054,"meta":1055,"style":1055},"yarn add @nuxt/ui tailwindcss @nuxtjs/mdc @nuxthub/core drizzle-orm drizzle-kit @libsql/client ai @ai-sdk/vue zod\n","yarn",[1057,1147,1148],{"__ignoreMap":1055},[1060,1149,1150,1152,1154,1156,1158,1160,1162,1164,1166,1168,1170,1172],{"class":1062,"line":1063},[1060,1151,1145],{"class":1066},[1060,1153,1111],{"class":1070},[1060,1155,1114],{"class":1070},[1060,1157,1117],{"class":1070},[1060,1159,1120],{"class":1070},[1060,1161,1123],{"class":1070},[1060,1163,1126],{"class":1070},[1060,1165,1129],{"class":1070},[1060,1167,1132],{"class":1070},[1060,1169,1135],{"class":1070},[1060,1171,1138],{"class":1070},[1060,1173,1141],{"class":1070},[1050,1175,1178],{"className":1052,"code":1176,"filename":1177,"language":1054,"meta":1055,"style":1055},"npm install @nuxt/ui tailwindcss @nuxtjs/mdc @nuxthub/core drizzle-orm drizzle-kit @libsql/client ai @ai-sdk/vue zod\n","npm",[1057,1179,1180],{"__ignoreMap":1055},[1060,1181,1182,1184,1187,1189,1191,1193,1195,1197,1199,1201,1203,1205],{"class":1062,"line":1063},[1060,1183,1177],{"class":1066},[1060,1185,1186],{"class":1070}," install",[1060,1188,1114],{"class":1070},[1060,1190,1117],{"class":1070},[1060,1192,1120],{"class":1070},[1060,1194,1123],{"class":1070},[1060,1196,1126],{"class":1070},[1060,1198,1129],{"class":1070},[1060,1200,1132],{"class":1070},[1060,1202,1135],{"class":1070},[1060,1204,1138],{"class":1070},[1060,1206,1141],{"class":1070},[1050,1208,1211],{"className":1052,"code":1209,"filename":1210,"language":1054,"meta":1055,"style":1055},"bun add @nuxt/ui tailwindcss @nuxtjs/mdc @nuxthub/core drizzle-orm drizzle-kit @libsql/client ai @ai-sdk/vue zod\n","bun",[1057,1212,1213],{"__ignoreMap":1055},[1060,1214,1215,1217,1219,1221,1223,1225,1227,1229,1231,1233,1235,1237],{"class":1062,"line":1063},[1060,1216,1210],{"class":1066},[1060,1218,1111],{"class":1070},[1060,1220,1114],{"class":1070},[1060,1222,1117],{"class":1070},[1060,1224,1120],{"class":1070},[1060,1226,1123],{"class":1070},[1060,1228,1126],{"class":1070},[1060,1230,1129],{"class":1070},[1060,1232,1132],{"class":1070},[1060,1234,1135],{"class":1070},[1060,1236,1138],{"class":1070},[1060,1238,1141],{"class":1070},[1088,1240,1242],{"id":1241},"configuration","Configuration",[960,1244,1245,1246,1249],{},"Update your ",[1057,1247,1248],{},"nuxt.config.ts"," to register the modules:",[1251,1252,1253],"code-tree-intersection",{},[1050,1254,1258],{"className":1255,"code":1256,"filename":1248,"language":1257,"meta":1055,"style":1055},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","export default defineNuxtConfig({\n  modules: [\n    '@nuxt/ui',\n    '@nuxtjs/mdc',\n    '@nuxthub/core'\n  ],\n\n  hub: {\n    db: 'sqlite'\n  },\n\n  css: ['~/assets/css/main.css'],\n\n  mdc: {\n    headings: {\n      anchorLinks: false // Disable anchor links in AI responses\n    }\n  },\n})\n","ts",[1057,1259,1260,1280,1292,1307,1319,1330,1338,1344,1355,1371,1377,1382,1405,1410,1420,1430,1446,1452,1457],{"__ignoreMap":1055},[1060,1261,1262,1266,1269,1272,1276],{"class":1062,"line":1063},[1060,1263,1265],{"class":1264},"s7zQu","export",[1060,1267,1268],{"class":1264}," default",[1060,1270,1271],{"class":1083}," defineNuxtConfig",[1060,1273,1275],{"class":1274},"sTEyZ","(",[1060,1277,1279],{"class":1278},"sMK4o","{\n",[1060,1281,1282,1286,1289],{"class":1062,"line":1080},[1060,1283,1285],{"class":1284},"swJcz","  modules",[1060,1287,1288],{"class":1278},":",[1060,1290,1291],{"class":1274}," [\n",[1060,1293,1295,1298,1301,1304],{"class":1062,"line":1294},3,[1060,1296,1297],{"class":1278},"    '",[1060,1299,1300],{"class":1070},"@nuxt/ui",[1060,1302,1303],{"class":1278},"'",[1060,1305,1306],{"class":1278},",\n",[1060,1308,1310,1312,1315,1317],{"class":1062,"line":1309},4,[1060,1311,1297],{"class":1278},[1060,1313,1314],{"class":1070},"@nuxtjs/mdc",[1060,1316,1303],{"class":1278},[1060,1318,1306],{"class":1278},[1060,1320,1322,1324,1327],{"class":1062,"line":1321},5,[1060,1323,1297],{"class":1278},[1060,1325,1326],{"class":1070},"@nuxthub/core",[1060,1328,1329],{"class":1278},"'\n",[1060,1331,1333,1336],{"class":1062,"line":1332},6,[1060,1334,1335],{"class":1274},"  ]",[1060,1337,1306],{"class":1278},[1060,1339,1341],{"class":1062,"line":1340},7,[1060,1342,1343],{"emptyLinePlaceholder":21},"\n",[1060,1345,1347,1350,1352],{"class":1062,"line":1346},8,[1060,1348,1349],{"class":1284},"  hub",[1060,1351,1288],{"class":1278},[1060,1353,1354],{"class":1278}," {\n",[1060,1356,1358,1361,1363,1366,1369],{"class":1062,"line":1357},9,[1060,1359,1360],{"class":1284},"    db",[1060,1362,1288],{"class":1278},[1060,1364,1365],{"class":1278}," '",[1060,1367,1368],{"class":1070},"sqlite",[1060,1370,1329],{"class":1278},[1060,1372,1374],{"class":1062,"line":1373},10,[1060,1375,1376],{"class":1278},"  },\n",[1060,1378,1380],{"class":1062,"line":1379},11,[1060,1381,1343],{"emptyLinePlaceholder":21},[1060,1383,1385,1388,1390,1393,1395,1398,1400,1403],{"class":1062,"line":1384},12,[1060,1386,1387],{"class":1284},"  css",[1060,1389,1288],{"class":1278},[1060,1391,1392],{"class":1274}," [",[1060,1394,1303],{"class":1278},[1060,1396,1397],{"class":1070},"~/assets/css/main.css",[1060,1399,1303],{"class":1278},[1060,1401,1402],{"class":1274},"]",[1060,1404,1306],{"class":1278},[1060,1406,1408],{"class":1062,"line":1407},13,[1060,1409,1343],{"emptyLinePlaceholder":21},[1060,1411,1413,1416,1418],{"class":1062,"line":1412},14,[1060,1414,1415],{"class":1284},"  mdc",[1060,1417,1288],{"class":1278},[1060,1419,1354],{"class":1278},[1060,1421,1423,1426,1428],{"class":1062,"line":1422},15,[1060,1424,1425],{"class":1284},"    headings",[1060,1427,1288],{"class":1278},[1060,1429,1354],{"class":1278},[1060,1431,1433,1436,1438,1442],{"class":1062,"line":1432},16,[1060,1434,1435],{"class":1284},"      anchorLinks",[1060,1437,1288],{"class":1278},[1060,1439,1441],{"class":1440},"sfNiH"," false",[1060,1443,1445],{"class":1444},"sHwdD"," // Disable anchor links in AI responses\n",[1060,1447,1449],{"class":1062,"line":1448},17,[1060,1450,1451],{"class":1278},"    }\n",[1060,1453,1455],{"class":1062,"line":1454},18,[1060,1456,1376],{"class":1278},[1060,1458,1460,1463],{"class":1062,"line":1459},19,[1060,1461,1462],{"class":1278},"}",[1060,1464,1465],{"class":1274},")\n",[960,1467,1468],{},"Create the main CSS file to import Tailwind CSS and Nuxt UI:",[1251,1470,1471],{},[1050,1472,1477],{"className":1473,"code":1474,"filename":1475,"language":1476,"meta":1055,"style":1055},"language-css shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","@import \"tailwindcss\";\n@import \"@nuxt/ui\";\n","app/assets/css/main.css","css",[1057,1478,1479,1496],{"__ignoreMap":1055},[1060,1480,1481,1484,1487,1490,1493],{"class":1062,"line":1063},[1060,1482,1483],{"class":1264},"@import",[1060,1485,1486],{"class":1278}," \"",[1060,1488,1489],{"class":1070},"tailwindcss",[1060,1491,1492],{"class":1278},"\"",[1060,1494,1495],{"class":1278},";\n",[1060,1497,1498,1500,1502,1504,1506],{"class":1062,"line":1080},[1060,1499,1483],{"class":1264},[1060,1501,1486],{"class":1278},[1060,1503,1300],{"class":1070},[1060,1505,1492],{"class":1278},[1060,1507,1495],{"class":1278},[1088,1509,1511],{"id":1510},"setting-up-the-app","Setting up the app",[960,1513,1514,1515,1518],{},"Nuxt UI requires wrapping your app with ",[1057,1516,1517],{},"UApp"," for modals, toasts, and overlays to work properly:",[1251,1520,1521],{},[1050,1522,1527],{"className":1523,"code":1524,"filename":1525,"highlights":1526,"language":34,"meta":1055,"style":1055},"language-vue shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","\u003Ctemplate>\n  \u003CUApp>\n    \u003CUDashboardGroup unit=\"rem\">\n      \u003CNuxtPage />\n    \u003C/UDashboardGroup>\n  \u003C/UApp>\n\u003C/template>\n","app/app.vue",[1080,1332],[1057,1528,1529,1540,1551,1575,1586,1595,1605],{"__ignoreMap":1055},[1060,1530,1531,1534,1537],{"class":1062,"line":1063},[1060,1532,1533],{"class":1278},"\u003C",[1060,1535,1536],{"class":1284},"template",[1060,1538,1539],{"class":1278},">\n",[1060,1541,1544,1547,1549],{"class":1542,"line":1080},[1062,1543],"highlight",[1060,1545,1546],{"class":1278},"  \u003C",[1060,1548,1517],{"class":1284},[1060,1550,1539],{"class":1278},[1060,1552,1553,1556,1559,1563,1566,1568,1571,1573],{"class":1062,"line":1294},[1060,1554,1555],{"class":1278},"    \u003C",[1060,1557,1558],{"class":1284},"UDashboardGroup",[1060,1560,1562],{"class":1561},"spNyl"," unit",[1060,1564,1565],{"class":1278},"=",[1060,1567,1492],{"class":1278},[1060,1569,1570],{"class":1070},"rem",[1060,1572,1492],{"class":1278},[1060,1574,1539],{"class":1278},[1060,1576,1577,1580,1583],{"class":1062,"line":1309},[1060,1578,1579],{"class":1278},"      \u003C",[1060,1581,1582],{"class":1284},"NuxtPage",[1060,1584,1585],{"class":1278}," />\n",[1060,1587,1588,1591,1593],{"class":1062,"line":1321},[1060,1589,1590],{"class":1278},"    \u003C/",[1060,1592,1558],{"class":1284},[1060,1594,1539],{"class":1278},[1060,1596,1598,1601,1603],{"class":1597,"line":1332},[1062,1543],[1060,1599,1600],{"class":1278},"  \u003C/",[1060,1602,1517],{"class":1284},[1060,1604,1539],{"class":1278},[1060,1606,1607,1610,1612],{"class":1062,"line":1340},[1060,1608,1609],{"class":1278},"\u003C/",[1060,1611,1536],{"class":1284},[1060,1613,1539],{"class":1278},[960,1615,1616,1617,1620],{},"Create a ",[1057,1618,1619],{},".env"," file with your AI Gateway API key:",[1251,1622,1623],{},[1050,1624,1626],{"className":1052,"code":1625,"filename":1619,"language":1054,"meta":1055,"style":1055},"AI_GATEWAY_API_KEY=your-api-key-here\n",[1057,1627,1628],{"__ignoreMap":1055},[1060,1629,1630,1633,1635],{"class":1062,"line":1063},[1060,1631,1632],{"class":1274},"AI_GATEWAY_API_KEY",[1060,1634,1565],{"class":1278},[1060,1636,1637],{"class":1070},"your-api-key-here\n",[1639,1640,1641],"note",{},[960,1642,1643,1644,1647],{},"With ",[1035,1645,1040],{"href":1037,"rel":1646},[1039],", you don't need individual API keys for OpenAI, Anthropic, or Google. The AI Gateway provides a unified API to access hundreds of models through a single endpoint.",[1088,1649,1651],{"id":1650},"setting-up-the-database","Setting up the database",[960,1653,1654,1659,1660,1665],{},[1035,1655,1658],{"href":1656,"rel":1657},"https://hub.nuxt.com",[1039],"NuxtHub"," provides a zero-config database powered by ",[1035,1661,1664],{"href":1662,"rel":1663},"https://orm.drizzle.team",[1039],"Drizzle ORM",". Here is the schema for the chat application:",[1251,1667,1668],{},[1669,1670,1671],"code-collapse",{},[1050,1672,1675],{"className":1255,"code":1673,"filename":1674,"language":1257,"meta":1055,"style":1055},"import { sqliteTable, text, integer, index } from 'drizzle-orm/sqlite-core'\nimport { relations } from 'drizzle-orm'\n\nexport const chats = sqliteTable('chats', {\n  id: text().primaryKey().$defaultFn(() => crypto.randomUUID()),\n  title: text(),\n  createdAt: integer({ mode: 'timestamp' }).notNull().$defaultFn(() => new Date())\n})\n\nexport const chatsRelations = relations(chats, ({ many }) => ({\n  messages: many(messages)\n}))\n\nexport const messages = sqliteTable('messages', {\n  id: text('id').primaryKey().$defaultFn(() => crypto.randomUUID()),\n  chatId: text('chat_id').notNull().references(() => chats.id, { onDelete: 'cascade' }),\n  role: text('role', { enum: ['user', 'assistant', 'system'] }).notNull(),\n  parts: text('parts', { mode: 'json' }),\n  createdAt: integer({ mode: 'timestamp' }).notNull().$defaultFn(() => new Date()),\n}, table => [\n  index('messages_chat_id_idx').on(table.chatId)\n])\n\nexport const messagesRelations = relations(messages, ({ one }) => ({\n  chat: one(chats, {\n    fields: [messages.chatId],\n    references: [chats.id]\n  })\n}))\n","server/db/schema.ts",[1057,1676,1677,1717,1737,1741,1768,1813,1826,1883,1889,1893,1928,1940,1947,1951,1977,2022,2088,2157,2196,2246,2259,2289,2295,2300,2332,2348,2366,2382,2390],{"__ignoreMap":1055},[1060,1678,1679,1682,1685,1688,1691,1694,1696,1699,1701,1704,1707,1710,1712,1715],{"class":1062,"line":1063},[1060,1680,1681],{"class":1264},"import",[1060,1683,1684],{"class":1278}," {",[1060,1686,1687],{"class":1274}," sqliteTable",[1060,1689,1690],{"class":1278},",",[1060,1692,1693],{"class":1274}," text",[1060,1695,1690],{"class":1278},[1060,1697,1698],{"class":1274}," integer",[1060,1700,1690],{"class":1278},[1060,1702,1703],{"class":1274}," index",[1060,1705,1706],{"class":1278}," }",[1060,1708,1709],{"class":1264}," from",[1060,1711,1365],{"class":1278},[1060,1713,1714],{"class":1070},"drizzle-orm/sqlite-core",[1060,1716,1329],{"class":1278},[1060,1718,1719,1721,1723,1726,1728,1730,1732,1735],{"class":1062,"line":1080},[1060,1720,1681],{"class":1264},[1060,1722,1684],{"class":1278},[1060,1724,1725],{"class":1274}," relations",[1060,1727,1706],{"class":1278},[1060,1729,1709],{"class":1264},[1060,1731,1365],{"class":1278},[1060,1733,1734],{"class":1070},"drizzle-orm",[1060,1736,1329],{"class":1278},[1060,1738,1739],{"class":1062,"line":1294},[1060,1740,1343],{"emptyLinePlaceholder":21},[1060,1742,1743,1745,1748,1751,1753,1755,1757,1759,1762,1764,1766],{"class":1062,"line":1309},[1060,1744,1265],{"class":1264},[1060,1746,1747],{"class":1561}," const",[1060,1749,1750],{"class":1274}," chats ",[1060,1752,1565],{"class":1278},[1060,1754,1687],{"class":1083},[1060,1756,1275],{"class":1274},[1060,1758,1303],{"class":1278},[1060,1760,1761],{"class":1070},"chats",[1060,1763,1303],{"class":1278},[1060,1765,1690],{"class":1278},[1060,1767,1354],{"class":1278},[1060,1769,1770,1773,1775,1777,1780,1783,1786,1788,1790,1793,1795,1797,1800,1803,1805,1808,1811],{"class":1062,"line":1321},[1060,1771,1772],{"class":1284},"  id",[1060,1774,1288],{"class":1278},[1060,1776,1693],{"class":1083},[1060,1778,1779],{"class":1274},"()",[1060,1781,1782],{"class":1278},".",[1060,1784,1785],{"class":1083},"primaryKey",[1060,1787,1779],{"class":1274},[1060,1789,1782],{"class":1278},[1060,1791,1792],{"class":1083},"$defaultFn",[1060,1794,1275],{"class":1274},[1060,1796,1779],{"class":1278},[1060,1798,1799],{"class":1561}," =>",[1060,1801,1802],{"class":1274}," crypto",[1060,1804,1782],{"class":1278},[1060,1806,1807],{"class":1083},"randomUUID",[1060,1809,1810],{"class":1274},"())",[1060,1812,1306],{"class":1278},[1060,1814,1815,1818,1820,1822,1824],{"class":1062,"line":1332},[1060,1816,1817],{"class":1284},"  title",[1060,1819,1288],{"class":1278},[1060,1821,1693],{"class":1083},[1060,1823,1779],{"class":1274},[1060,1825,1306],{"class":1278},[1060,1827,1828,1831,1833,1835,1837,1840,1843,1845,1847,1850,1852,1854,1857,1859,1862,1864,1866,1868,1870,1872,1874,1877,1880],{"class":1062,"line":1340},[1060,1829,1830],{"class":1284},"  createdAt",[1060,1832,1288],{"class":1278},[1060,1834,1698],{"class":1083},[1060,1836,1275],{"class":1274},[1060,1838,1839],{"class":1278},"{",[1060,1841,1842],{"class":1284}," mode",[1060,1844,1288],{"class":1278},[1060,1846,1365],{"class":1278},[1060,1848,1849],{"class":1070},"timestamp",[1060,1851,1303],{"class":1278},[1060,1853,1706],{"class":1278},[1060,1855,1856],{"class":1274},")",[1060,1858,1782],{"class":1278},[1060,1860,1861],{"class":1083},"notNull",[1060,1863,1779],{"class":1274},[1060,1865,1782],{"class":1278},[1060,1867,1792],{"class":1083},[1060,1869,1275],{"class":1274},[1060,1871,1779],{"class":1278},[1060,1873,1799],{"class":1561},[1060,1875,1876],{"class":1278}," new",[1060,1878,1879],{"class":1083}," Date",[1060,1881,1882],{"class":1274},"())\n",[1060,1884,1885,1887],{"class":1062,"line":1346},[1060,1886,1462],{"class":1278},[1060,1888,1465],{"class":1274},[1060,1890,1891],{"class":1062,"line":1357},[1060,1892,1343],{"emptyLinePlaceholder":21},[1060,1894,1895,1897,1899,1902,1904,1906,1909,1911,1914,1918,1921,1923,1926],{"class":1062,"line":1373},[1060,1896,1265],{"class":1264},[1060,1898,1747],{"class":1561},[1060,1900,1901],{"class":1274}," chatsRelations ",[1060,1903,1565],{"class":1278},[1060,1905,1725],{"class":1083},[1060,1907,1908],{"class":1274},"(chats",[1060,1910,1690],{"class":1278},[1060,1912,1913],{"class":1278}," ({",[1060,1915,1917],{"class":1916},"sHdIc"," many",[1060,1919,1920],{"class":1278}," })",[1060,1922,1799],{"class":1561},[1060,1924,1925],{"class":1274}," (",[1060,1927,1279],{"class":1278},[1060,1929,1930,1933,1935,1937],{"class":1062,"line":1379},[1060,1931,1932],{"class":1284},"  messages",[1060,1934,1288],{"class":1278},[1060,1936,1917],{"class":1083},[1060,1938,1939],{"class":1274},"(messages)\n",[1060,1941,1942,1944],{"class":1062,"line":1384},[1060,1943,1462],{"class":1278},[1060,1945,1946],{"class":1274},"))\n",[1060,1948,1949],{"class":1062,"line":1407},[1060,1950,1343],{"emptyLinePlaceholder":21},[1060,1952,1953,1955,1957,1960,1962,1964,1966,1968,1971,1973,1975],{"class":1062,"line":1412},[1060,1954,1265],{"class":1264},[1060,1956,1747],{"class":1561},[1060,1958,1959],{"class":1274}," messages ",[1060,1961,1565],{"class":1278},[1060,1963,1687],{"class":1083},[1060,1965,1275],{"class":1274},[1060,1967,1303],{"class":1278},[1060,1969,1970],{"class":1070},"messages",[1060,1972,1303],{"class":1278},[1060,1974,1690],{"class":1278},[1060,1976,1354],{"class":1278},[1060,1978,1979,1981,1983,1985,1987,1989,1992,1994,1996,1998,2000,2002,2004,2006,2008,2010,2012,2014,2016,2018,2020],{"class":1062,"line":1422},[1060,1980,1772],{"class":1284},[1060,1982,1288],{"class":1278},[1060,1984,1693],{"class":1083},[1060,1986,1275],{"class":1274},[1060,1988,1303],{"class":1278},[1060,1990,1991],{"class":1070},"id",[1060,1993,1303],{"class":1278},[1060,1995,1856],{"class":1274},[1060,1997,1782],{"class":1278},[1060,1999,1785],{"class":1083},[1060,2001,1779],{"class":1274},[1060,2003,1782],{"class":1278},[1060,2005,1792],{"class":1083},[1060,2007,1275],{"class":1274},[1060,2009,1779],{"class":1278},[1060,2011,1799],{"class":1561},[1060,2013,1802],{"class":1274},[1060,2015,1782],{"class":1278},[1060,2017,1807],{"class":1083},[1060,2019,1810],{"class":1274},[1060,2021,1306],{"class":1278},[1060,2023,2024,2027,2029,2031,2033,2035,2038,2040,2042,2044,2046,2048,2050,2053,2055,2057,2059,2062,2064,2066,2068,2070,2073,2075,2077,2080,2082,2084,2086],{"class":1062,"line":1432},[1060,2025,2026],{"class":1284},"  chatId",[1060,2028,1288],{"class":1278},[1060,2030,1693],{"class":1083},[1060,2032,1275],{"class":1274},[1060,2034,1303],{"class":1278},[1060,2036,2037],{"class":1070},"chat_id",[1060,2039,1303],{"class":1278},[1060,2041,1856],{"class":1274},[1060,2043,1782],{"class":1278},[1060,2045,1861],{"class":1083},[1060,2047,1779],{"class":1274},[1060,2049,1782],{"class":1278},[1060,2051,2052],{"class":1083},"references",[1060,2054,1275],{"class":1274},[1060,2056,1779],{"class":1278},[1060,2058,1799],{"class":1561},[1060,2060,2061],{"class":1274}," chats",[1060,2063,1782],{"class":1278},[1060,2065,1991],{"class":1274},[1060,2067,1690],{"class":1278},[1060,2069,1684],{"class":1278},[1060,2071,2072],{"class":1284}," onDelete",[1060,2074,1288],{"class":1278},[1060,2076,1365],{"class":1278},[1060,2078,2079],{"class":1070},"cascade",[1060,2081,1303],{"class":1278},[1060,2083,1706],{"class":1278},[1060,2085,1856],{"class":1274},[1060,2087,1306],{"class":1278},[1060,2089,2090,2093,2095,2097,2099,2101,2104,2106,2108,2110,2113,2115,2117,2119,2122,2124,2126,2128,2131,2133,2135,2137,2140,2142,2145,2147,2149,2151,2153,2155],{"class":1062,"line":1448},[1060,2091,2092],{"class":1284},"  role",[1060,2094,1288],{"class":1278},[1060,2096,1693],{"class":1083},[1060,2098,1275],{"class":1274},[1060,2100,1303],{"class":1278},[1060,2102,2103],{"class":1070},"role",[1060,2105,1303],{"class":1278},[1060,2107,1690],{"class":1278},[1060,2109,1684],{"class":1278},[1060,2111,2112],{"class":1284}," enum",[1060,2114,1288],{"class":1278},[1060,2116,1392],{"class":1274},[1060,2118,1303],{"class":1278},[1060,2120,2121],{"class":1070},"user",[1060,2123,1303],{"class":1278},[1060,2125,1690],{"class":1278},[1060,2127,1365],{"class":1278},[1060,2129,2130],{"class":1070},"assistant",[1060,2132,1303],{"class":1278},[1060,2134,1690],{"class":1278},[1060,2136,1365],{"class":1278},[1060,2138,2139],{"class":1070},"system",[1060,2141,1303],{"class":1278},[1060,2143,2144],{"class":1274},"] ",[1060,2146,1462],{"class":1278},[1060,2148,1856],{"class":1274},[1060,2150,1782],{"class":1278},[1060,2152,1861],{"class":1083},[1060,2154,1779],{"class":1274},[1060,2156,1306],{"class":1278},[1060,2158,2159,2162,2164,2166,2168,2170,2173,2175,2177,2179,2181,2183,2185,2188,2190,2192,2194],{"class":1062,"line":1454},[1060,2160,2161],{"class":1284},"  parts",[1060,2163,1288],{"class":1278},[1060,2165,1693],{"class":1083},[1060,2167,1275],{"class":1274},[1060,2169,1303],{"class":1278},[1060,2171,2172],{"class":1070},"parts",[1060,2174,1303],{"class":1278},[1060,2176,1690],{"class":1278},[1060,2178,1684],{"class":1278},[1060,2180,1842],{"class":1284},[1060,2182,1288],{"class":1278},[1060,2184,1365],{"class":1278},[1060,2186,2187],{"class":1070},"json",[1060,2189,1303],{"class":1278},[1060,2191,1706],{"class":1278},[1060,2193,1856],{"class":1274},[1060,2195,1306],{"class":1278},[1060,2197,2198,2200,2202,2204,2206,2208,2210,2212,2214,2216,2218,2220,2222,2224,2226,2228,2230,2232,2234,2236,2238,2240,2242,2244],{"class":1062,"line":1459},[1060,2199,1830],{"class":1284},[1060,2201,1288],{"class":1278},[1060,2203,1698],{"class":1083},[1060,2205,1275],{"class":1274},[1060,2207,1839],{"class":1278},[1060,2209,1842],{"class":1284},[1060,2211,1288],{"class":1278},[1060,2213,1365],{"class":1278},[1060,2215,1849],{"class":1070},[1060,2217,1303],{"class":1278},[1060,2219,1706],{"class":1278},[1060,2221,1856],{"class":1274},[1060,2223,1782],{"class":1278},[1060,2225,1861],{"class":1083},[1060,2227,1779],{"class":1274},[1060,2229,1782],{"class":1278},[1060,2231,1792],{"class":1083},[1060,2233,1275],{"class":1274},[1060,2235,1779],{"class":1278},[1060,2237,1799],{"class":1561},[1060,2239,1876],{"class":1278},[1060,2241,1879],{"class":1083},[1060,2243,1810],{"class":1274},[1060,2245,1306],{"class":1278},[1060,2247,2249,2252,2255,2257],{"class":1062,"line":2248},20,[1060,2250,2251],{"class":1278},"},",[1060,2253,2254],{"class":1916}," table",[1060,2256,1799],{"class":1561},[1060,2258,1291],{"class":1274},[1060,2260,2262,2265,2267,2269,2272,2274,2276,2278,2281,2284,2286],{"class":1062,"line":2261},21,[1060,2263,2264],{"class":1083},"  index",[1060,2266,1275],{"class":1274},[1060,2268,1303],{"class":1278},[1060,2270,2271],{"class":1070},"messages_chat_id_idx",[1060,2273,1303],{"class":1278},[1060,2275,1856],{"class":1274},[1060,2277,1782],{"class":1278},[1060,2279,2280],{"class":1083},"on",[1060,2282,2283],{"class":1274},"(table",[1060,2285,1782],{"class":1278},[1060,2287,2288],{"class":1274},"chatId)\n",[1060,2290,2292],{"class":1062,"line":2291},22,[1060,2293,2294],{"class":1274},"])\n",[1060,2296,2298],{"class":1062,"line":2297},23,[1060,2299,1343],{"emptyLinePlaceholder":21},[1060,2301,2303,2305,2307,2310,2312,2314,2317,2319,2321,2324,2326,2328,2330],{"class":1062,"line":2302},24,[1060,2304,1265],{"class":1264},[1060,2306,1747],{"class":1561},[1060,2308,2309],{"class":1274}," messagesRelations ",[1060,2311,1565],{"class":1278},[1060,2313,1725],{"class":1083},[1060,2315,2316],{"class":1274},"(messages",[1060,2318,1690],{"class":1278},[1060,2320,1913],{"class":1278},[1060,2322,2323],{"class":1916}," one",[1060,2325,1920],{"class":1278},[1060,2327,1799],{"class":1561},[1060,2329,1925],{"class":1274},[1060,2331,1279],{"class":1278},[1060,2333,2335,2338,2340,2342,2344,2346],{"class":1062,"line":2334},25,[1060,2336,2337],{"class":1284},"  chat",[1060,2339,1288],{"class":1278},[1060,2341,2323],{"class":1083},[1060,2343,1908],{"class":1274},[1060,2345,1690],{"class":1278},[1060,2347,1354],{"class":1278},[1060,2349,2351,2354,2356,2359,2361,2364],{"class":1062,"line":2350},26,[1060,2352,2353],{"class":1284},"    fields",[1060,2355,1288],{"class":1278},[1060,2357,2358],{"class":1274}," [messages",[1060,2360,1782],{"class":1278},[1060,2362,2363],{"class":1274},"chatId]",[1060,2365,1306],{"class":1278},[1060,2367,2369,2372,2374,2377,2379],{"class":1062,"line":2368},27,[1060,2370,2371],{"class":1284},"    references",[1060,2373,1288],{"class":1278},[1060,2375,2376],{"class":1274}," [chats",[1060,2378,1782],{"class":1278},[1060,2380,2381],{"class":1274},"id]\n",[1060,2383,2385,2388],{"class":1062,"line":2384},28,[1060,2386,2387],{"class":1278},"  }",[1060,2389,1465],{"class":1274},[1060,2391,2393,2395],{"class":1062,"line":2392},29,[1060,2394,1462],{"class":1278},[1060,2396,1946],{"class":1274},[960,2398,2399],{},"Generate the database migrations from your schema:",[1050,2401,2403],{"className":1052,"code":2402,"language":1054,"meta":1055,"style":1055},"npx nuxt db generate\n",[1057,2404,2405],{"__ignoreMap":1055},[1060,2406,2407,2409,2412,2415],{"class":1062,"line":1063},[1060,2408,1067],{"class":1066},[1060,2410,2411],{"class":1070}," nuxt",[1060,2413,2414],{"class":1070}," db",[1060,2416,2417],{"class":1070}," generate\n",[2419,2420,2421],"tip",{},[960,2422,2423,2424,2427],{},"Migrations are automatically applied when you start the development server with ",[1057,2425,2426],{},"npx nuxt dev",". NuxtHub uses SQLite locally, so no external database is required during development.",[964,2429,2431],{"id":2430},"building-the-backend","Building the backend",[960,2433,2434,2435,1782],{},"This section covers integrating AI on the server. The following API endpoints handle chat creation, AI streaming, and data persistence using ",[1035,2436,2439],{"href":2437,"rel":2438},"https://nitro.build",[1039],"Nitro",[1088,2441,2443],{"id":2442},"creating-a-chat","Creating a chat",[960,2445,2446,2447,2454],{},"First, create the endpoint that initializes a new chat and saves the first message to the database. This uses the ",[1035,2448,2451],{"href":2449,"rel":2450},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/ui-message",[1039],[1057,2452,2453],{},"UIMessage"," type from the AI SDK:",[1251,2456,2457],{},[1050,2458,2461],{"className":1255,"code":2459,"filename":2460,"language":1257,"meta":1055,"style":1055},"import { defineEventHandler, readValidatedBody } from 'h3'\nimport type { UIMessage } from 'ai'\nimport { db, schema } from 'hub:db'\nimport { z } from 'zod'\n\nexport default defineEventHandler(async (event) => {\n  const { message } = await readValidatedBody(event, z.object({\n    message: z.custom\u003CUIMessage>()\n  }).parse)\n\n  // Create a new chat\n  const [chat] = await db.insert(schema.chats).values({}).returning()\n\n  // Save the first user message\n  await db.insert(schema.messages).values({\n    chatId: chat.id,\n    role: 'user',\n    parts: message.parts\n  })\n\n  return chat\n})\n","server/api/chats.post.ts",[1057,2462,2463,2487,2510,2534,2554,2558,2582,2619,2643,2656,2660,2665,2716,2720,2725,2754,2770,2785,2799,2805,2809,2817],{"__ignoreMap":1055},[1060,2464,2465,2467,2469,2472,2474,2477,2479,2481,2483,2485],{"class":1062,"line":1063},[1060,2466,1681],{"class":1264},[1060,2468,1684],{"class":1278},[1060,2470,2471],{"class":1274}," defineEventHandler",[1060,2473,1690],{"class":1278},[1060,2475,2476],{"class":1274}," readValidatedBody",[1060,2478,1706],{"class":1278},[1060,2480,1709],{"class":1264},[1060,2482,1365],{"class":1278},[1060,2484,1088],{"class":1070},[1060,2486,1329],{"class":1278},[1060,2488,2489,2491,2494,2496,2499,2501,2503,2505,2508],{"class":1062,"line":1080},[1060,2490,1681],{"class":1264},[1060,2492,2493],{"class":1264}," type",[1060,2495,1684],{"class":1278},[1060,2497,2498],{"class":1274}," UIMessage",[1060,2500,1706],{"class":1278},[1060,2502,1709],{"class":1264},[1060,2504,1365],{"class":1278},[1060,2506,2507],{"class":1070},"ai",[1060,2509,1329],{"class":1278},[1060,2511,2512,2514,2516,2518,2520,2523,2525,2527,2529,2532],{"class":1062,"line":1294},[1060,2513,1681],{"class":1264},[1060,2515,1684],{"class":1278},[1060,2517,2414],{"class":1274},[1060,2519,1690],{"class":1278},[1060,2521,2522],{"class":1274}," schema",[1060,2524,1706],{"class":1278},[1060,2526,1709],{"class":1264},[1060,2528,1365],{"class":1278},[1060,2530,2531],{"class":1070},"hub:db",[1060,2533,1329],{"class":1278},[1060,2535,2536,2538,2540,2543,2545,2547,2549,2552],{"class":1062,"line":1309},[1060,2537,1681],{"class":1264},[1060,2539,1684],{"class":1278},[1060,2541,2542],{"class":1274}," z",[1060,2544,1706],{"class":1278},[1060,2546,1709],{"class":1264},[1060,2548,1365],{"class":1278},[1060,2550,2551],{"class":1070},"zod",[1060,2553,1329],{"class":1278},[1060,2555,2556],{"class":1062,"line":1321},[1060,2557,1343],{"emptyLinePlaceholder":21},[1060,2559,2560,2562,2564,2566,2568,2571,2573,2576,2578,2580],{"class":1062,"line":1332},[1060,2561,1265],{"class":1264},[1060,2563,1268],{"class":1264},[1060,2565,2471],{"class":1083},[1060,2567,1275],{"class":1274},[1060,2569,2570],{"class":1561},"async",[1060,2572,1925],{"class":1278},[1060,2574,2575],{"class":1916},"event",[1060,2577,1856],{"class":1278},[1060,2579,1799],{"class":1561},[1060,2581,1354],{"class":1278},[1060,2583,2584,2587,2589,2592,2594,2597,2600,2602,2604,2606,2608,2610,2612,2615,2617],{"class":1062,"line":1340},[1060,2585,2586],{"class":1561},"  const",[1060,2588,1684],{"class":1278},[1060,2590,2591],{"class":1274}," message",[1060,2593,1706],{"class":1278},[1060,2595,2596],{"class":1278}," =",[1060,2598,2599],{"class":1264}," await",[1060,2601,2476],{"class":1083},[1060,2603,1275],{"class":1284},[1060,2605,2575],{"class":1274},[1060,2607,1690],{"class":1278},[1060,2609,2542],{"class":1274},[1060,2611,1782],{"class":1278},[1060,2613,2614],{"class":1083},"object",[1060,2616,1275],{"class":1284},[1060,2618,1279],{"class":1278},[1060,2620,2621,2624,2626,2628,2630,2633,2635,2637,2640],{"class":1062,"line":1346},[1060,2622,2623],{"class":1284},"    message",[1060,2625,1288],{"class":1278},[1060,2627,2542],{"class":1274},[1060,2629,1782],{"class":1278},[1060,2631,2632],{"class":1083},"custom",[1060,2634,1533],{"class":1278},[1060,2636,2453],{"class":1066},[1060,2638,2639],{"class":1278},">",[1060,2641,2642],{"class":1284},"()\n",[1060,2644,2645,2647,2649,2651,2654],{"class":1062,"line":1357},[1060,2646,2387],{"class":1278},[1060,2648,1856],{"class":1284},[1060,2650,1782],{"class":1278},[1060,2652,2653],{"class":1274},"parse",[1060,2655,1465],{"class":1284},[1060,2657,2658],{"class":1062,"line":1373},[1060,2659,1343],{"emptyLinePlaceholder":21},[1060,2661,2662],{"class":1062,"line":1379},[1060,2663,2664],{"class":1444},"  // Create a new chat\n",[1060,2666,2667,2669,2671,2673,2675,2677,2679,2681,2683,2686,2688,2691,2693,2695,2697,2699,2702,2704,2707,2709,2711,2714],{"class":1062,"line":1384},[1060,2668,2586],{"class":1561},[1060,2670,1392],{"class":1278},[1060,2672,262],{"class":1274},[1060,2674,1402],{"class":1278},[1060,2676,2596],{"class":1278},[1060,2678,2599],{"class":1264},[1060,2680,2414],{"class":1274},[1060,2682,1782],{"class":1278},[1060,2684,2685],{"class":1083},"insert",[1060,2687,1275],{"class":1284},[1060,2689,2690],{"class":1274},"schema",[1060,2692,1782],{"class":1278},[1060,2694,1761],{"class":1274},[1060,2696,1856],{"class":1284},[1060,2698,1782],{"class":1278},[1060,2700,2701],{"class":1083},"values",[1060,2703,1275],{"class":1284},[1060,2705,2706],{"class":1278},"{}",[1060,2708,1856],{"class":1284},[1060,2710,1782],{"class":1278},[1060,2712,2713],{"class":1083},"returning",[1060,2715,2642],{"class":1284},[1060,2717,2718],{"class":1062,"line":1407},[1060,2719,1343],{"emptyLinePlaceholder":21},[1060,2721,2722],{"class":1062,"line":1412},[1060,2723,2724],{"class":1444},"  // Save the first user message\n",[1060,2726,2727,2730,2732,2734,2736,2738,2740,2742,2744,2746,2748,2750,2752],{"class":1062,"line":1422},[1060,2728,2729],{"class":1264},"  await",[1060,2731,2414],{"class":1274},[1060,2733,1782],{"class":1278},[1060,2735,2685],{"class":1083},[1060,2737,1275],{"class":1284},[1060,2739,2690],{"class":1274},[1060,2741,1782],{"class":1278},[1060,2743,1970],{"class":1274},[1060,2745,1856],{"class":1284},[1060,2747,1782],{"class":1278},[1060,2749,2701],{"class":1083},[1060,2751,1275],{"class":1284},[1060,2753,1279],{"class":1278},[1060,2755,2756,2759,2761,2764,2766,2768],{"class":1062,"line":1432},[1060,2757,2758],{"class":1284},"    chatId",[1060,2760,1288],{"class":1278},[1060,2762,2763],{"class":1274}," chat",[1060,2765,1782],{"class":1278},[1060,2767,1991],{"class":1274},[1060,2769,1306],{"class":1278},[1060,2771,2772,2775,2777,2779,2781,2783],{"class":1062,"line":1448},[1060,2773,2774],{"class":1284},"    role",[1060,2776,1288],{"class":1278},[1060,2778,1365],{"class":1278},[1060,2780,2121],{"class":1070},[1060,2782,1303],{"class":1278},[1060,2784,1306],{"class":1278},[1060,2786,2787,2790,2792,2794,2796],{"class":1062,"line":1454},[1060,2788,2789],{"class":1284},"    parts",[1060,2791,1288],{"class":1278},[1060,2793,2591],{"class":1274},[1060,2795,1782],{"class":1278},[1060,2797,2798],{"class":1274},"parts\n",[1060,2800,2801,2803],{"class":1062,"line":1459},[1060,2802,2387],{"class":1278},[1060,2804,1465],{"class":1284},[1060,2806,2807],{"class":1062,"line":2248},[1060,2808,1343],{"emptyLinePlaceholder":21},[1060,2810,2811,2814],{"class":1062,"line":2261},[1060,2812,2813],{"class":1264},"  return",[1060,2815,2816],{"class":1274}," chat\n",[1060,2818,2819,2821],{"class":1062,"line":2291},[1060,2820,1462],{"class":1278},[1060,2822,1465],{"class":1274},[1088,2824,2826],{"id":2825},"streaming-ai-responses","Streaming AI responses",[960,2828,2829,2830,2837,2838,2845,2846,2853],{},"Next, create the endpoint that handles the AI conversation. This endpoint uses ",[1035,2831,2834],{"href":2832,"rel":2833},"https://ai-sdk.dev/docs/reference/ai-sdk-core/stream-text",[1039],[1057,2835,2836],{},"streamText",", ",[1035,2839,2842],{"href":2840,"rel":2841},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/create-ui-message-stream",[1039],[1057,2843,2844],{},"createUIMessageStream",", and ",[1035,2847,2850],{"href":2848,"rel":2849},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/create-ui-message-stream-response",[1039],[1057,2851,2852],{},"createUIMessageStreamResponse"," from the AI SDK:",[1251,2855,2856],{},[1669,2857,2858],{},[1050,2859,2862],{"className":1255,"code":2860,"filename":2861,"language":1257,"meta":1055,"style":1055},"import { createError, defineEventHandler, getValidatedRouterParams, readValidatedBody } from 'h3'\nimport { eq } from 'drizzle-orm'\nimport { db, schema } from 'hub:db'\nimport { z } from 'zod'\nimport {\n  convertToModelMessages,\n  createUIMessageStream,\n  createUIMessageStreamResponse,\n  generateText,\n  streamText\n} from 'ai'\nimport type { UIMessage } from 'ai'\n\nexport default defineEventHandler(async (event) => {\n  const { id } = await getValidatedRouterParams(event, z.object({\n    id: z.string()\n  }).parse)\n\n  const { model, messages } = await readValidatedBody(event, z.object({\n    model: z.string().default('openai/gpt-4o-mini'),\n    messages: z.array(z.custom\u003CUIMessage>())\n  }).parse)\n\n  // Fetch the chat from the database\n  const chat = await db.query.chats.findFirst({\n    where: (chat, { eq }) => eq(chat.id, id as string)\n  })\n\n  if (!chat) {\n    throw createError({ statusCode: 404, statusMessage: 'Chat not found' })\n  }\n\n  // Generate a title for the chat if it doesn't have one\n  if (!chat.title) {\n    const { text: title } = await generateText({\n      model: 'openai/gpt-4o-mini',\n      system: `Generate a short title (max 30 characters) based on the user's message. No quotes or punctuation.`,\n      prompt: JSON.stringify(messages[0])\n    })\n\n    await db.update(schema.chats).set({ title }).where(eq(schema.chats.id, id))\n  }\n\n  // Save the user message if it's a follow-up\n  const lastMessage = messages[messages.length - 1]\n  if (lastMessage?.role === 'user' && messages.length > 1) {\n    await db.insert(schema.messages).values({\n      chatId: id,\n      role: 'user',\n      parts: lastMessage.parts\n    })\n  }\n\n  // Create the streaming response\n  const stream = createUIMessageStream({\n    execute: async ({ writer }) => {\n      const result = streamText({\n        model,\n        system: `You are a helpful AI assistant. Be concise and friendly.`,\n        messages: await convertToModelMessages(messages)\n      })\n\n      // Notify the client that a title was generated\n      if (!chat.title) {\n        writer.write({\n          type: 'data-chat-title',\n          data: { message: 'Title generated' },\n          transient: true\n        })\n      }\n\n      writer.merge(result.toUIMessageStream())\n    },\n    onFinish: async ({ messages }) => {\n      // Save the assistant's response to the database\n      await db.insert(schema.messages).values(messages.map(message => ({\n        chatId: chat.id,\n        role: message.role as 'user' | 'assistant',\n        parts: message.parts\n      })))\n    }\n  })\n\n  return createUIMessageStreamResponse({ stream })\n})\n","server/api/chats/[id].post.ts",[1057,2863,2864,2896,2915,2937,2955,2961,2968,2975,2982,2989,2994,3006,3026,3030,3052,3085,3101,3113,3117,3155,3188,3219,3231,3235,3240,3270,3313,3319,3323,3340,3379,3385,3390,3396,3416,3444,3460,3479,3507,3515,3520,3586,3591,3596,3602,3632,3674,3703,3715,3731,3745,3752,3757,3762,3768,3785,3807,3825,3833,3850,3869,3877,3882,3888,3908,3923,3940,3964,3975,3983,3989,3994,4017,4023,4043,4049,4095,4111,4144,4158,4166,4171,4178,4183,4201],{"__ignoreMap":1055},[1060,2865,2866,2868,2870,2873,2875,2877,2879,2882,2884,2886,2888,2890,2892,2894],{"class":1062,"line":1063},[1060,2867,1681],{"class":1264},[1060,2869,1684],{"class":1278},[1060,2871,2872],{"class":1274}," createError",[1060,2874,1690],{"class":1278},[1060,2876,2471],{"class":1274},[1060,2878,1690],{"class":1278},[1060,2880,2881],{"class":1274}," getValidatedRouterParams",[1060,2883,1690],{"class":1278},[1060,2885,2476],{"class":1274},[1060,2887,1706],{"class":1278},[1060,2889,1709],{"class":1264},[1060,2891,1365],{"class":1278},[1060,2893,1088],{"class":1070},[1060,2895,1329],{"class":1278},[1060,2897,2898,2900,2902,2905,2907,2909,2911,2913],{"class":1062,"line":1080},[1060,2899,1681],{"class":1264},[1060,2901,1684],{"class":1278},[1060,2903,2904],{"class":1274}," eq",[1060,2906,1706],{"class":1278},[1060,2908,1709],{"class":1264},[1060,2910,1365],{"class":1278},[1060,2912,1734],{"class":1070},[1060,2914,1329],{"class":1278},[1060,2916,2917,2919,2921,2923,2925,2927,2929,2931,2933,2935],{"class":1062,"line":1294},[1060,2918,1681],{"class":1264},[1060,2920,1684],{"class":1278},[1060,2922,2414],{"class":1274},[1060,2924,1690],{"class":1278},[1060,2926,2522],{"class":1274},[1060,2928,1706],{"class":1278},[1060,2930,1709],{"class":1264},[1060,2932,1365],{"class":1278},[1060,2934,2531],{"class":1070},[1060,2936,1329],{"class":1278},[1060,2938,2939,2941,2943,2945,2947,2949,2951,2953],{"class":1062,"line":1309},[1060,2940,1681],{"class":1264},[1060,2942,1684],{"class":1278},[1060,2944,2542],{"class":1274},[1060,2946,1706],{"class":1278},[1060,2948,1709],{"class":1264},[1060,2950,1365],{"class":1278},[1060,2952,2551],{"class":1070},[1060,2954,1329],{"class":1278},[1060,2956,2957,2959],{"class":1062,"line":1321},[1060,2958,1681],{"class":1264},[1060,2960,1354],{"class":1278},[1060,2962,2963,2966],{"class":1062,"line":1332},[1060,2964,2965],{"class":1274},"  convertToModelMessages",[1060,2967,1306],{"class":1278},[1060,2969,2970,2973],{"class":1062,"line":1340},[1060,2971,2972],{"class":1274},"  createUIMessageStream",[1060,2974,1306],{"class":1278},[1060,2976,2977,2980],{"class":1062,"line":1346},[1060,2978,2979],{"class":1274},"  createUIMessageStreamResponse",[1060,2981,1306],{"class":1278},[1060,2983,2984,2987],{"class":1062,"line":1357},[1060,2985,2986],{"class":1274},"  generateText",[1060,2988,1306],{"class":1278},[1060,2990,2991],{"class":1062,"line":1373},[1060,2992,2993],{"class":1274},"  streamText\n",[1060,2995,2996,2998,3000,3002,3004],{"class":1062,"line":1379},[1060,2997,1462],{"class":1278},[1060,2999,1709],{"class":1264},[1060,3001,1365],{"class":1278},[1060,3003,2507],{"class":1070},[1060,3005,1329],{"class":1278},[1060,3007,3008,3010,3012,3014,3016,3018,3020,3022,3024],{"class":1062,"line":1384},[1060,3009,1681],{"class":1264},[1060,3011,2493],{"class":1264},[1060,3013,1684],{"class":1278},[1060,3015,2498],{"class":1274},[1060,3017,1706],{"class":1278},[1060,3019,1709],{"class":1264},[1060,3021,1365],{"class":1278},[1060,3023,2507],{"class":1070},[1060,3025,1329],{"class":1278},[1060,3027,3028],{"class":1062,"line":1407},[1060,3029,1343],{"emptyLinePlaceholder":21},[1060,3031,3032,3034,3036,3038,3040,3042,3044,3046,3048,3050],{"class":1062,"line":1412},[1060,3033,1265],{"class":1264},[1060,3035,1268],{"class":1264},[1060,3037,2471],{"class":1083},[1060,3039,1275],{"class":1274},[1060,3041,2570],{"class":1561},[1060,3043,1925],{"class":1278},[1060,3045,2575],{"class":1916},[1060,3047,1856],{"class":1278},[1060,3049,1799],{"class":1561},[1060,3051,1354],{"class":1278},[1060,3053,3054,3056,3058,3061,3063,3065,3067,3069,3071,3073,3075,3077,3079,3081,3083],{"class":1062,"line":1422},[1060,3055,2586],{"class":1561},[1060,3057,1684],{"class":1278},[1060,3059,3060],{"class":1274}," id",[1060,3062,1706],{"class":1278},[1060,3064,2596],{"class":1278},[1060,3066,2599],{"class":1264},[1060,3068,2881],{"class":1083},[1060,3070,1275],{"class":1284},[1060,3072,2575],{"class":1274},[1060,3074,1690],{"class":1278},[1060,3076,2542],{"class":1274},[1060,3078,1782],{"class":1278},[1060,3080,2614],{"class":1083},[1060,3082,1275],{"class":1284},[1060,3084,1279],{"class":1278},[1060,3086,3087,3090,3092,3094,3096,3099],{"class":1062,"line":1432},[1060,3088,3089],{"class":1284},"    id",[1060,3091,1288],{"class":1278},[1060,3093,2542],{"class":1274},[1060,3095,1782],{"class":1278},[1060,3097,3098],{"class":1083},"string",[1060,3100,2642],{"class":1284},[1060,3102,3103,3105,3107,3109,3111],{"class":1062,"line":1448},[1060,3104,2387],{"class":1278},[1060,3106,1856],{"class":1284},[1060,3108,1782],{"class":1278},[1060,3110,2653],{"class":1274},[1060,3112,1465],{"class":1284},[1060,3114,3115],{"class":1062,"line":1454},[1060,3116,1343],{"emptyLinePlaceholder":21},[1060,3118,3119,3121,3123,3126,3128,3131,3133,3135,3137,3139,3141,3143,3145,3147,3149,3151,3153],{"class":1062,"line":1459},[1060,3120,2586],{"class":1561},[1060,3122,1684],{"class":1278},[1060,3124,3125],{"class":1274}," model",[1060,3127,1690],{"class":1278},[1060,3129,3130],{"class":1274}," messages",[1060,3132,1706],{"class":1278},[1060,3134,2596],{"class":1278},[1060,3136,2599],{"class":1264},[1060,3138,2476],{"class":1083},[1060,3140,1275],{"class":1284},[1060,3142,2575],{"class":1274},[1060,3144,1690],{"class":1278},[1060,3146,2542],{"class":1274},[1060,3148,1782],{"class":1278},[1060,3150,2614],{"class":1083},[1060,3152,1275],{"class":1284},[1060,3154,1279],{"class":1278},[1060,3156,3157,3160,3162,3164,3166,3168,3170,3172,3175,3177,3179,3182,3184,3186],{"class":1062,"line":2248},[1060,3158,3159],{"class":1284},"    model",[1060,3161,1288],{"class":1278},[1060,3163,2542],{"class":1274},[1060,3165,1782],{"class":1278},[1060,3167,3098],{"class":1083},[1060,3169,1779],{"class":1284},[1060,3171,1782],{"class":1278},[1060,3173,3174],{"class":1083},"default",[1060,3176,1275],{"class":1284},[1060,3178,1303],{"class":1278},[1060,3180,3181],{"class":1070},"openai/gpt-4o-mini",[1060,3183,1303],{"class":1278},[1060,3185,1856],{"class":1284},[1060,3187,1306],{"class":1278},[1060,3189,3190,3193,3195,3197,3199,3202,3204,3207,3209,3211,3213,3215,3217],{"class":1062,"line":2261},[1060,3191,3192],{"class":1284},"    messages",[1060,3194,1288],{"class":1278},[1060,3196,2542],{"class":1274},[1060,3198,1782],{"class":1278},[1060,3200,3201],{"class":1083},"array",[1060,3203,1275],{"class":1284},[1060,3205,3206],{"class":1274},"z",[1060,3208,1782],{"class":1278},[1060,3210,2632],{"class":1083},[1060,3212,1533],{"class":1278},[1060,3214,2453],{"class":1066},[1060,3216,2639],{"class":1278},[1060,3218,1882],{"class":1284},[1060,3220,3221,3223,3225,3227,3229],{"class":1062,"line":2291},[1060,3222,2387],{"class":1278},[1060,3224,1856],{"class":1284},[1060,3226,1782],{"class":1278},[1060,3228,2653],{"class":1274},[1060,3230,1465],{"class":1284},[1060,3232,3233],{"class":1062,"line":2297},[1060,3234,1343],{"emptyLinePlaceholder":21},[1060,3236,3237],{"class":1062,"line":2302},[1060,3238,3239],{"class":1444},"  // Fetch the chat from the database\n",[1060,3241,3242,3244,3246,3248,3250,3252,3254,3257,3259,3261,3263,3266,3268],{"class":1062,"line":2334},[1060,3243,2586],{"class":1561},[1060,3245,2763],{"class":1274},[1060,3247,2596],{"class":1278},[1060,3249,2599],{"class":1264},[1060,3251,2414],{"class":1274},[1060,3253,1782],{"class":1278},[1060,3255,3256],{"class":1274},"query",[1060,3258,1782],{"class":1278},[1060,3260,1761],{"class":1274},[1060,3262,1782],{"class":1278},[1060,3264,3265],{"class":1083},"findFirst",[1060,3267,1275],{"class":1284},[1060,3269,1279],{"class":1278},[1060,3271,3272,3275,3277,3279,3281,3283,3285,3287,3289,3291,3293,3295,3297,3299,3301,3303,3305,3308,3311],{"class":1062,"line":2350},[1060,3273,3274],{"class":1083},"    where",[1060,3276,1288],{"class":1278},[1060,3278,1925],{"class":1278},[1060,3280,262],{"class":1916},[1060,3282,1690],{"class":1278},[1060,3284,1684],{"class":1278},[1060,3286,2904],{"class":1916},[1060,3288,1920],{"class":1278},[1060,3290,1799],{"class":1561},[1060,3292,2904],{"class":1083},[1060,3294,1275],{"class":1284},[1060,3296,262],{"class":1274},[1060,3298,1782],{"class":1278},[1060,3300,1991],{"class":1274},[1060,3302,1690],{"class":1278},[1060,3304,3060],{"class":1274},[1060,3306,3307],{"class":1264}," as",[1060,3309,3310],{"class":1066}," string",[1060,3312,1465],{"class":1284},[1060,3314,3315,3317],{"class":1062,"line":2368},[1060,3316,2387],{"class":1278},[1060,3318,1465],{"class":1284},[1060,3320,3321],{"class":1062,"line":2384},[1060,3322,1343],{"emptyLinePlaceholder":21},[1060,3324,3325,3328,3330,3333,3335,3338],{"class":1062,"line":2392},[1060,3326,3327],{"class":1264},"  if",[1060,3329,1925],{"class":1284},[1060,3331,3332],{"class":1278},"!",[1060,3334,262],{"class":1274},[1060,3336,3337],{"class":1284},") ",[1060,3339,1279],{"class":1278},[1060,3341,3343,3346,3348,3350,3352,3355,3357,3361,3363,3366,3368,3370,3373,3375,3377],{"class":1062,"line":3342},30,[1060,3344,3345],{"class":1264},"    throw",[1060,3347,2872],{"class":1083},[1060,3349,1275],{"class":1284},[1060,3351,1839],{"class":1278},[1060,3353,3354],{"class":1284}," statusCode",[1060,3356,1288],{"class":1278},[1060,3358,3360],{"class":3359},"sbssI"," 404",[1060,3362,1690],{"class":1278},[1060,3364,3365],{"class":1284}," statusMessage",[1060,3367,1288],{"class":1278},[1060,3369,1365],{"class":1278},[1060,3371,3372],{"class":1070},"Chat not found",[1060,3374,1303],{"class":1278},[1060,3376,1706],{"class":1278},[1060,3378,1465],{"class":1284},[1060,3380,3382],{"class":1062,"line":3381},31,[1060,3383,3384],{"class":1278},"  }\n",[1060,3386,3388],{"class":1062,"line":3387},32,[1060,3389,1343],{"emptyLinePlaceholder":21},[1060,3391,3393],{"class":1062,"line":3392},33,[1060,3394,3395],{"class":1444},"  // Generate a title for the chat if it doesn't have one\n",[1060,3397,3399,3401,3403,3405,3407,3409,3412,3414],{"class":1062,"line":3398},34,[1060,3400,3327],{"class":1264},[1060,3402,1925],{"class":1284},[1060,3404,3332],{"class":1278},[1060,3406,262],{"class":1274},[1060,3408,1782],{"class":1278},[1060,3410,3411],{"class":1274},"title",[1060,3413,3337],{"class":1284},[1060,3415,1279],{"class":1278},[1060,3417,3419,3422,3424,3426,3428,3431,3433,3435,3437,3440,3442],{"class":1062,"line":3418},35,[1060,3420,3421],{"class":1561},"    const",[1060,3423,1684],{"class":1278},[1060,3425,1693],{"class":1284},[1060,3427,1288],{"class":1278},[1060,3429,3430],{"class":1274}," title",[1060,3432,1706],{"class":1278},[1060,3434,2596],{"class":1278},[1060,3436,2599],{"class":1264},[1060,3438,3439],{"class":1083}," generateText",[1060,3441,1275],{"class":1284},[1060,3443,1279],{"class":1278},[1060,3445,3447,3450,3452,3454,3456,3458],{"class":1062,"line":3446},36,[1060,3448,3449],{"class":1284},"      model",[1060,3451,1288],{"class":1278},[1060,3453,1365],{"class":1278},[1060,3455,3181],{"class":1070},[1060,3457,1303],{"class":1278},[1060,3459,1306],{"class":1278},[1060,3461,3463,3466,3468,3471,3474,3477],{"class":1062,"line":3462},37,[1060,3464,3465],{"class":1284},"      system",[1060,3467,1288],{"class":1278},[1060,3469,3470],{"class":1278}," `",[1060,3472,3473],{"class":1070},"Generate a short title (max 30 characters) based on the user's message. No quotes or punctuation.",[1060,3475,3476],{"class":1278},"`",[1060,3478,1306],{"class":1278},[1060,3480,3482,3485,3487,3490,3492,3495,3497,3499,3502,3505],{"class":1062,"line":3481},38,[1060,3483,3484],{"class":1284},"      prompt",[1060,3486,1288],{"class":1278},[1060,3488,3489],{"class":1274}," JSON",[1060,3491,1782],{"class":1278},[1060,3493,3494],{"class":1083},"stringify",[1060,3496,1275],{"class":1284},[1060,3498,1970],{"class":1274},[1060,3500,3501],{"class":1284},"[",[1060,3503,3504],{"class":3359},"0",[1060,3506,2294],{"class":1284},[1060,3508,3510,3513],{"class":1062,"line":3509},39,[1060,3511,3512],{"class":1278},"    }",[1060,3514,1465],{"class":1284},[1060,3516,3518],{"class":1062,"line":3517},40,[1060,3519,1343],{"emptyLinePlaceholder":21},[1060,3521,3523,3526,3528,3530,3533,3535,3537,3539,3541,3543,3545,3548,3550,3552,3554,3556,3558,3560,3563,3565,3568,3570,3572,3574,3576,3578,3580,3582,3584],{"class":1062,"line":3522},41,[1060,3524,3525],{"class":1264},"    await",[1060,3527,2414],{"class":1274},[1060,3529,1782],{"class":1278},[1060,3531,3532],{"class":1083},"update",[1060,3534,1275],{"class":1284},[1060,3536,2690],{"class":1274},[1060,3538,1782],{"class":1278},[1060,3540,1761],{"class":1274},[1060,3542,1856],{"class":1284},[1060,3544,1782],{"class":1278},[1060,3546,3547],{"class":1083},"set",[1060,3549,1275],{"class":1284},[1060,3551,1839],{"class":1278},[1060,3553,3430],{"class":1274},[1060,3555,1706],{"class":1278},[1060,3557,1856],{"class":1284},[1060,3559,1782],{"class":1278},[1060,3561,3562],{"class":1083},"where",[1060,3564,1275],{"class":1284},[1060,3566,3567],{"class":1083},"eq",[1060,3569,1275],{"class":1284},[1060,3571,2690],{"class":1274},[1060,3573,1782],{"class":1278},[1060,3575,1761],{"class":1274},[1060,3577,1782],{"class":1278},[1060,3579,1991],{"class":1274},[1060,3581,1690],{"class":1278},[1060,3583,3060],{"class":1274},[1060,3585,1946],{"class":1284},[1060,3587,3589],{"class":1062,"line":3588},42,[1060,3590,3384],{"class":1278},[1060,3592,3594],{"class":1062,"line":3593},43,[1060,3595,1343],{"emptyLinePlaceholder":21},[1060,3597,3599],{"class":1062,"line":3598},44,[1060,3600,3601],{"class":1444},"  // Save the user message if it's a follow-up\n",[1060,3603,3605,3607,3610,3612,3614,3616,3618,3620,3623,3626,3629],{"class":1062,"line":3604},45,[1060,3606,2586],{"class":1561},[1060,3608,3609],{"class":1274}," lastMessage",[1060,3611,2596],{"class":1278},[1060,3613,3130],{"class":1274},[1060,3615,3501],{"class":1284},[1060,3617,1970],{"class":1274},[1060,3619,1782],{"class":1278},[1060,3621,3622],{"class":1274},"length",[1060,3624,3625],{"class":1278}," -",[1060,3627,3628],{"class":3359}," 1",[1060,3630,3631],{"class":1284},"]\n",[1060,3633,3635,3637,3639,3642,3645,3647,3650,3652,3654,3656,3659,3661,3663,3665,3668,3670,3672],{"class":1062,"line":3634},46,[1060,3636,3327],{"class":1264},[1060,3638,1925],{"class":1284},[1060,3640,3641],{"class":1274},"lastMessage",[1060,3643,3644],{"class":1278},"?.",[1060,3646,2103],{"class":1274},[1060,3648,3649],{"class":1278}," ===",[1060,3651,1365],{"class":1278},[1060,3653,2121],{"class":1070},[1060,3655,1303],{"class":1278},[1060,3657,3658],{"class":1278}," &&",[1060,3660,3130],{"class":1274},[1060,3662,1782],{"class":1278},[1060,3664,3622],{"class":1274},[1060,3666,3667],{"class":1278}," >",[1060,3669,3628],{"class":3359},[1060,3671,3337],{"class":1284},[1060,3673,1279],{"class":1278},[1060,3675,3677,3679,3681,3683,3685,3687,3689,3691,3693,3695,3697,3699,3701],{"class":1062,"line":3676},47,[1060,3678,3525],{"class":1264},[1060,3680,2414],{"class":1274},[1060,3682,1782],{"class":1278},[1060,3684,2685],{"class":1083},[1060,3686,1275],{"class":1284},[1060,3688,2690],{"class":1274},[1060,3690,1782],{"class":1278},[1060,3692,1970],{"class":1274},[1060,3694,1856],{"class":1284},[1060,3696,1782],{"class":1278},[1060,3698,2701],{"class":1083},[1060,3700,1275],{"class":1284},[1060,3702,1279],{"class":1278},[1060,3704,3706,3709,3711,3713],{"class":1062,"line":3705},48,[1060,3707,3708],{"class":1284},"      chatId",[1060,3710,1288],{"class":1278},[1060,3712,3060],{"class":1274},[1060,3714,1306],{"class":1278},[1060,3716,3718,3721,3723,3725,3727,3729],{"class":1062,"line":3717},49,[1060,3719,3720],{"class":1284},"      role",[1060,3722,1288],{"class":1278},[1060,3724,1365],{"class":1278},[1060,3726,2121],{"class":1070},[1060,3728,1303],{"class":1278},[1060,3730,1306],{"class":1278},[1060,3732,3734,3737,3739,3741,3743],{"class":1062,"line":3733},50,[1060,3735,3736],{"class":1284},"      parts",[1060,3738,1288],{"class":1278},[1060,3740,3609],{"class":1274},[1060,3742,1782],{"class":1278},[1060,3744,2798],{"class":1274},[1060,3746,3748,3750],{"class":1062,"line":3747},51,[1060,3749,3512],{"class":1278},[1060,3751,1465],{"class":1284},[1060,3753,3755],{"class":1062,"line":3754},52,[1060,3756,3384],{"class":1278},[1060,3758,3760],{"class":1062,"line":3759},53,[1060,3761,1343],{"emptyLinePlaceholder":21},[1060,3763,3765],{"class":1062,"line":3764},54,[1060,3766,3767],{"class":1444},"  // Create the streaming response\n",[1060,3769,3771,3773,3776,3778,3781,3783],{"class":1062,"line":3770},55,[1060,3772,2586],{"class":1561},[1060,3774,3775],{"class":1274}," stream",[1060,3777,2596],{"class":1278},[1060,3779,3780],{"class":1083}," createUIMessageStream",[1060,3782,1275],{"class":1284},[1060,3784,1279],{"class":1278},[1060,3786,3788,3791,3793,3796,3798,3801,3803,3805],{"class":1062,"line":3787},56,[1060,3789,3790],{"class":1083},"    execute",[1060,3792,1288],{"class":1278},[1060,3794,3795],{"class":1561}," async",[1060,3797,1913],{"class":1278},[1060,3799,3800],{"class":1916}," writer",[1060,3802,1920],{"class":1278},[1060,3804,1799],{"class":1561},[1060,3806,1354],{"class":1278},[1060,3808,3810,3813,3816,3818,3821,3823],{"class":1062,"line":3809},57,[1060,3811,3812],{"class":1561},"      const",[1060,3814,3815],{"class":1274}," result",[1060,3817,2596],{"class":1278},[1060,3819,3820],{"class":1083}," streamText",[1060,3822,1275],{"class":1284},[1060,3824,1279],{"class":1278},[1060,3826,3828,3831],{"class":1062,"line":3827},58,[1060,3829,3830],{"class":1274},"        model",[1060,3832,1306],{"class":1278},[1060,3834,3836,3839,3841,3843,3846,3848],{"class":1062,"line":3835},59,[1060,3837,3838],{"class":1284},"        system",[1060,3840,1288],{"class":1278},[1060,3842,3470],{"class":1278},[1060,3844,3845],{"class":1070},"You are a helpful AI assistant. Be concise and friendly.",[1060,3847,3476],{"class":1278},[1060,3849,1306],{"class":1278},[1060,3851,3853,3856,3858,3860,3863,3865,3867],{"class":1062,"line":3852},60,[1060,3854,3855],{"class":1284},"        messages",[1060,3857,1288],{"class":1278},[1060,3859,2599],{"class":1264},[1060,3861,3862],{"class":1083}," convertToModelMessages",[1060,3864,1275],{"class":1284},[1060,3866,1970],{"class":1274},[1060,3868,1465],{"class":1284},[1060,3870,3872,3875],{"class":1062,"line":3871},61,[1060,3873,3874],{"class":1278},"      }",[1060,3876,1465],{"class":1284},[1060,3878,3880],{"class":1062,"line":3879},62,[1060,3881,1343],{"emptyLinePlaceholder":21},[1060,3883,3885],{"class":1062,"line":3884},63,[1060,3886,3887],{"class":1444},"      // Notify the client that a title was generated\n",[1060,3889,3891,3894,3896,3898,3900,3902,3904,3906],{"class":1062,"line":3890},64,[1060,3892,3893],{"class":1264},"      if",[1060,3895,1925],{"class":1284},[1060,3897,3332],{"class":1278},[1060,3899,262],{"class":1274},[1060,3901,1782],{"class":1278},[1060,3903,3411],{"class":1274},[1060,3905,3337],{"class":1284},[1060,3907,1279],{"class":1278},[1060,3909,3911,3914,3916,3919,3921],{"class":1062,"line":3910},65,[1060,3912,3913],{"class":1274},"        writer",[1060,3915,1782],{"class":1278},[1060,3917,3918],{"class":1083},"write",[1060,3920,1275],{"class":1284},[1060,3922,1279],{"class":1278},[1060,3924,3926,3929,3931,3933,3936,3938],{"class":1062,"line":3925},66,[1060,3927,3928],{"class":1284},"          type",[1060,3930,1288],{"class":1278},[1060,3932,1365],{"class":1278},[1060,3934,3935],{"class":1070},"data-chat-title",[1060,3937,1303],{"class":1278},[1060,3939,1306],{"class":1278},[1060,3941,3943,3946,3948,3950,3952,3954,3956,3959,3961],{"class":1062,"line":3942},67,[1060,3944,3945],{"class":1284},"          data",[1060,3947,1288],{"class":1278},[1060,3949,1684],{"class":1278},[1060,3951,2591],{"class":1284},[1060,3953,1288],{"class":1278},[1060,3955,1365],{"class":1278},[1060,3957,3958],{"class":1070},"Title generated",[1060,3960,1303],{"class":1278},[1060,3962,3963],{"class":1278}," },\n",[1060,3965,3967,3970,3972],{"class":1062,"line":3966},68,[1060,3968,3969],{"class":1284},"          transient",[1060,3971,1288],{"class":1278},[1060,3973,3974],{"class":1440}," true\n",[1060,3976,3978,3981],{"class":1062,"line":3977},69,[1060,3979,3980],{"class":1278},"        }",[1060,3982,1465],{"class":1284},[1060,3984,3986],{"class":1062,"line":3985},70,[1060,3987,3988],{"class":1278},"      }\n",[1060,3990,3992],{"class":1062,"line":3991},71,[1060,3993,1343],{"emptyLinePlaceholder":21},[1060,3995,3997,4000,4002,4005,4007,4010,4012,4015],{"class":1062,"line":3996},72,[1060,3998,3999],{"class":1274},"      writer",[1060,4001,1782],{"class":1278},[1060,4003,4004],{"class":1083},"merge",[1060,4006,1275],{"class":1284},[1060,4008,4009],{"class":1274},"result",[1060,4011,1782],{"class":1278},[1060,4013,4014],{"class":1083},"toUIMessageStream",[1060,4016,1882],{"class":1284},[1060,4018,4020],{"class":1062,"line":4019},73,[1060,4021,4022],{"class":1278},"    },\n",[1060,4024,4026,4029,4031,4033,4035,4037,4039,4041],{"class":1062,"line":4025},74,[1060,4027,4028],{"class":1083},"    onFinish",[1060,4030,1288],{"class":1278},[1060,4032,3795],{"class":1561},[1060,4034,1913],{"class":1278},[1060,4036,3130],{"class":1916},[1060,4038,1920],{"class":1278},[1060,4040,1799],{"class":1561},[1060,4042,1354],{"class":1278},[1060,4044,4046],{"class":1062,"line":4045},75,[1060,4047,4048],{"class":1444},"      // Save the assistant's response to the database\n",[1060,4050,4052,4055,4057,4059,4061,4063,4065,4067,4069,4071,4073,4075,4077,4079,4081,4084,4086,4089,4091,4093],{"class":1062,"line":4051},76,[1060,4053,4054],{"class":1264},"      await",[1060,4056,2414],{"class":1274},[1060,4058,1782],{"class":1278},[1060,4060,2685],{"class":1083},[1060,4062,1275],{"class":1284},[1060,4064,2690],{"class":1274},[1060,4066,1782],{"class":1278},[1060,4068,1970],{"class":1274},[1060,4070,1856],{"class":1284},[1060,4072,1782],{"class":1278},[1060,4074,2701],{"class":1083},[1060,4076,1275],{"class":1284},[1060,4078,1970],{"class":1274},[1060,4080,1782],{"class":1278},[1060,4082,4083],{"class":1083},"map",[1060,4085,1275],{"class":1284},[1060,4087,4088],{"class":1916},"message",[1060,4090,1799],{"class":1561},[1060,4092,1925],{"class":1284},[1060,4094,1279],{"class":1278},[1060,4096,4098,4101,4103,4105,4107,4109],{"class":1062,"line":4097},77,[1060,4099,4100],{"class":1284},"        chatId",[1060,4102,1288],{"class":1278},[1060,4104,2763],{"class":1274},[1060,4106,1782],{"class":1278},[1060,4108,1991],{"class":1274},[1060,4110,1306],{"class":1278},[1060,4112,4114,4117,4119,4121,4123,4125,4127,4129,4131,4133,4136,4138,4140,4142],{"class":1062,"line":4113},78,[1060,4115,4116],{"class":1284},"        role",[1060,4118,1288],{"class":1278},[1060,4120,2591],{"class":1274},[1060,4122,1782],{"class":1278},[1060,4124,2103],{"class":1274},[1060,4126,3307],{"class":1264},[1060,4128,1365],{"class":1278},[1060,4130,2121],{"class":1070},[1060,4132,1303],{"class":1278},[1060,4134,4135],{"class":1278}," |",[1060,4137,1365],{"class":1278},[1060,4139,2130],{"class":1070},[1060,4141,1303],{"class":1278},[1060,4143,1306],{"class":1278},[1060,4145,4147,4150,4152,4154,4156],{"class":1062,"line":4146},79,[1060,4148,4149],{"class":1284},"        parts",[1060,4151,1288],{"class":1278},[1060,4153,2591],{"class":1274},[1060,4155,1782],{"class":1278},[1060,4157,2798],{"class":1274},[1060,4159,4161,4163],{"class":1062,"line":4160},80,[1060,4162,3874],{"class":1278},[1060,4164,4165],{"class":1284},")))\n",[1060,4167,4169],{"class":1062,"line":4168},81,[1060,4170,1451],{"class":1278},[1060,4172,4174,4176],{"class":1062,"line":4173},82,[1060,4175,2387],{"class":1278},[1060,4177,1465],{"class":1284},[1060,4179,4181],{"class":1062,"line":4180},83,[1060,4182,1343],{"emptyLinePlaceholder":21},[1060,4184,4186,4188,4191,4193,4195,4197,4199],{"class":1062,"line":4185},84,[1060,4187,2813],{"class":1264},[1060,4189,4190],{"class":1083}," createUIMessageStreamResponse",[1060,4192,1275],{"class":1284},[1060,4194,1839],{"class":1278},[1060,4196,3775],{"class":1274},[1060,4198,1706],{"class":1278},[1060,4200,1465],{"class":1284},[1060,4202,4204,4206],{"class":1062,"line":4203},85,[1060,4205,1462],{"class":1278},[1060,4207,1465],{"class":1274},[960,4209,4210],{},"Here's what each part does:",[960,4212,4213],{},[978,4214,4215],{},"AI Gateway",[960,4217,4218,4219,4222],{},"Thanks to ",[1035,4220,1040],{"href":1037,"rel":4221},[1039],", we can use any AI model supported by the gateway just by specifying the model name.",[960,4224,4225],{},[978,4226,4227],{},"Automatic Title Generation",[960,4229,4230,4231,4238],{},"When a chat doesn't have a title yet, we use ",[1035,4232,4235],{"href":4233,"rel":4234},"https://ai-sdk.dev/docs/reference/ai-sdk-core/generate-text#generatetext",[1039],[1057,4236,4237],{},"generateText"," to create one based on the first message. This provides a better UX by showing meaningful titles in the chat history instead of \"Untitled\".",[960,4240,4241],{},[978,4242,4243],{},"Streaming with streamText",[960,4245,4246,4247,4252],{},"The ",[1035,4248,4250],{"href":2832,"rel":4249},[1039],[1057,4251,2836],{}," function generates a streaming response from the AI model. Key options include:",[972,4254,4255,4261,4266],{},[975,4256,4257,4260],{},[1057,4258,4259],{},"model",": The AI model to use",[975,4262,4263,4265],{},[1057,4264,2139],{},": Instructions that guide the AI's behavior",[975,4267,4268,4270],{},[1057,4269,1970],{},": The conversation history",[960,4272,4273],{},[978,4274,4275],{},"UIMessageStream",[960,4277,4246,4278,4284,4285,4291],{},[1035,4279,4282],{"href":4280,"rel":4281},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/create-ui-message-stream#createuimessagestream",[1039],[1057,4283,2844],{}," and ",[1035,4286,4289],{"href":4287,"rel":4288},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/create-ui-message-stream-response#createuimessagestreamresponse",[1039],[1057,4290,2852],{}," functions create a stream that the AI SDK client can consume. The response streams chunks as they're generated, creating the real-time typing effect.",[960,4293,4246,4294,4297,4298,4300,4301,4304],{},[1057,4295,4296],{},"writer.write()"," method allows sending custom data events to the client (like ",[1057,4299,3935],{},"), while ",[1057,4302,4303],{},"onFinish"," is called when streaming completes, perfect for persisting the assistant's response.",[1088,4306,4308],{"id":4307},"fetching-a-chat","Fetching a chat",[960,4310,4311],{},"Add an endpoint to fetch existing chat data from your database:",[1251,4313,4314],{},[1050,4315,4318],{"className":1255,"code":4316,"filename":4317,"language":1257,"meta":1055,"style":1055},"import { createError, defineEventHandler, getValidatedRouterParams } from 'h3'\nimport { asc, eq } from 'drizzle-orm'\nimport { db, schema } from 'hub:db'\nimport { z } from 'zod'\n\nexport default defineEventHandler(async (event) => {\n  const { id } = await getValidatedRouterParams(event, z.object({\n    id: z.string()\n  }).parse)\n\n  const chat = await db.query.chats.findFirst({\n    where: (eq(schema.chats.id, id)),\n    with: {\n      messages: {\n        orderBy: () => asc(schema.messages.createdAt)\n      }\n    }\n  })\n\n  if (!chat) {\n    throw createError({ statusCode: 404, statusMessage: 'Chat not found' })\n  }\n\n  return chat\n})\n","server/api/chats/[id].get.ts",[1057,4319,4320,4346,4369,4391,4409,4413,4435,4467,4481,4493,4497,4525,4556,4565,4574,4603,4607,4611,4617,4621,4635,4667,4671,4675,4681],{"__ignoreMap":1055},[1060,4321,4322,4324,4326,4328,4330,4332,4334,4336,4338,4340,4342,4344],{"class":1062,"line":1063},[1060,4323,1681],{"class":1264},[1060,4325,1684],{"class":1278},[1060,4327,2872],{"class":1274},[1060,4329,1690],{"class":1278},[1060,4331,2471],{"class":1274},[1060,4333,1690],{"class":1278},[1060,4335,2881],{"class":1274},[1060,4337,1706],{"class":1278},[1060,4339,1709],{"class":1264},[1060,4341,1365],{"class":1278},[1060,4343,1088],{"class":1070},[1060,4345,1329],{"class":1278},[1060,4347,4348,4350,4352,4355,4357,4359,4361,4363,4365,4367],{"class":1062,"line":1080},[1060,4349,1681],{"class":1264},[1060,4351,1684],{"class":1278},[1060,4353,4354],{"class":1274}," asc",[1060,4356,1690],{"class":1278},[1060,4358,2904],{"class":1274},[1060,4360,1706],{"class":1278},[1060,4362,1709],{"class":1264},[1060,4364,1365],{"class":1278},[1060,4366,1734],{"class":1070},[1060,4368,1329],{"class":1278},[1060,4370,4371,4373,4375,4377,4379,4381,4383,4385,4387,4389],{"class":1062,"line":1294},[1060,4372,1681],{"class":1264},[1060,4374,1684],{"class":1278},[1060,4376,2414],{"class":1274},[1060,4378,1690],{"class":1278},[1060,4380,2522],{"class":1274},[1060,4382,1706],{"class":1278},[1060,4384,1709],{"class":1264},[1060,4386,1365],{"class":1278},[1060,4388,2531],{"class":1070},[1060,4390,1329],{"class":1278},[1060,4392,4393,4395,4397,4399,4401,4403,4405,4407],{"class":1062,"line":1309},[1060,4394,1681],{"class":1264},[1060,4396,1684],{"class":1278},[1060,4398,2542],{"class":1274},[1060,4400,1706],{"class":1278},[1060,4402,1709],{"class":1264},[1060,4404,1365],{"class":1278},[1060,4406,2551],{"class":1070},[1060,4408,1329],{"class":1278},[1060,4410,4411],{"class":1062,"line":1321},[1060,4412,1343],{"emptyLinePlaceholder":21},[1060,4414,4415,4417,4419,4421,4423,4425,4427,4429,4431,4433],{"class":1062,"line":1332},[1060,4416,1265],{"class":1264},[1060,4418,1268],{"class":1264},[1060,4420,2471],{"class":1083},[1060,4422,1275],{"class":1274},[1060,4424,2570],{"class":1561},[1060,4426,1925],{"class":1278},[1060,4428,2575],{"class":1916},[1060,4430,1856],{"class":1278},[1060,4432,1799],{"class":1561},[1060,4434,1354],{"class":1278},[1060,4436,4437,4439,4441,4443,4445,4447,4449,4451,4453,4455,4457,4459,4461,4463,4465],{"class":1062,"line":1340},[1060,4438,2586],{"class":1561},[1060,4440,1684],{"class":1278},[1060,4442,3060],{"class":1274},[1060,4444,1706],{"class":1278},[1060,4446,2596],{"class":1278},[1060,4448,2599],{"class":1264},[1060,4450,2881],{"class":1083},[1060,4452,1275],{"class":1284},[1060,4454,2575],{"class":1274},[1060,4456,1690],{"class":1278},[1060,4458,2542],{"class":1274},[1060,4460,1782],{"class":1278},[1060,4462,2614],{"class":1083},[1060,4464,1275],{"class":1284},[1060,4466,1279],{"class":1278},[1060,4468,4469,4471,4473,4475,4477,4479],{"class":1062,"line":1346},[1060,4470,3089],{"class":1284},[1060,4472,1288],{"class":1278},[1060,4474,2542],{"class":1274},[1060,4476,1782],{"class":1278},[1060,4478,3098],{"class":1083},[1060,4480,2642],{"class":1284},[1060,4482,4483,4485,4487,4489,4491],{"class":1062,"line":1357},[1060,4484,2387],{"class":1278},[1060,4486,1856],{"class":1284},[1060,4488,1782],{"class":1278},[1060,4490,2653],{"class":1274},[1060,4492,1465],{"class":1284},[1060,4494,4495],{"class":1062,"line":1373},[1060,4496,1343],{"emptyLinePlaceholder":21},[1060,4498,4499,4501,4503,4505,4507,4509,4511,4513,4515,4517,4519,4521,4523],{"class":1062,"line":1379},[1060,4500,2586],{"class":1561},[1060,4502,2763],{"class":1274},[1060,4504,2596],{"class":1278},[1060,4506,2599],{"class":1264},[1060,4508,2414],{"class":1274},[1060,4510,1782],{"class":1278},[1060,4512,3256],{"class":1274},[1060,4514,1782],{"class":1278},[1060,4516,1761],{"class":1274},[1060,4518,1782],{"class":1278},[1060,4520,3265],{"class":1083},[1060,4522,1275],{"class":1284},[1060,4524,1279],{"class":1278},[1060,4526,4527,4529,4531,4533,4535,4537,4539,4541,4543,4545,4547,4549,4551,4554],{"class":1062,"line":1384},[1060,4528,3274],{"class":1284},[1060,4530,1288],{"class":1278},[1060,4532,1925],{"class":1284},[1060,4534,3567],{"class":1083},[1060,4536,1275],{"class":1284},[1060,4538,2690],{"class":1274},[1060,4540,1782],{"class":1278},[1060,4542,1761],{"class":1274},[1060,4544,1782],{"class":1278},[1060,4546,1991],{"class":1274},[1060,4548,1690],{"class":1278},[1060,4550,3060],{"class":1274},[1060,4552,4553],{"class":1284},"))",[1060,4555,1306],{"class":1278},[1060,4557,4558,4561,4563],{"class":1062,"line":1407},[1060,4559,4560],{"class":1284},"    with",[1060,4562,1288],{"class":1278},[1060,4564,1354],{"class":1278},[1060,4566,4567,4570,4572],{"class":1062,"line":1412},[1060,4568,4569],{"class":1284},"      messages",[1060,4571,1288],{"class":1278},[1060,4573,1354],{"class":1278},[1060,4575,4576,4579,4581,4584,4586,4588,4590,4592,4594,4596,4598,4601],{"class":1062,"line":1422},[1060,4577,4578],{"class":1083},"        orderBy",[1060,4580,1288],{"class":1278},[1060,4582,4583],{"class":1278}," ()",[1060,4585,1799],{"class":1561},[1060,4587,4354],{"class":1083},[1060,4589,1275],{"class":1284},[1060,4591,2690],{"class":1274},[1060,4593,1782],{"class":1278},[1060,4595,1970],{"class":1274},[1060,4597,1782],{"class":1278},[1060,4599,4600],{"class":1274},"createdAt",[1060,4602,1465],{"class":1284},[1060,4604,4605],{"class":1062,"line":1432},[1060,4606,3988],{"class":1278},[1060,4608,4609],{"class":1062,"line":1448},[1060,4610,1451],{"class":1278},[1060,4612,4613,4615],{"class":1062,"line":1454},[1060,4614,2387],{"class":1278},[1060,4616,1465],{"class":1284},[1060,4618,4619],{"class":1062,"line":1459},[1060,4620,1343],{"emptyLinePlaceholder":21},[1060,4622,4623,4625,4627,4629,4631,4633],{"class":1062,"line":2248},[1060,4624,3327],{"class":1264},[1060,4626,1925],{"class":1284},[1060,4628,3332],{"class":1278},[1060,4630,262],{"class":1274},[1060,4632,3337],{"class":1284},[1060,4634,1279],{"class":1278},[1060,4636,4637,4639,4641,4643,4645,4647,4649,4651,4653,4655,4657,4659,4661,4663,4665],{"class":1062,"line":2261},[1060,4638,3345],{"class":1264},[1060,4640,2872],{"class":1083},[1060,4642,1275],{"class":1284},[1060,4644,1839],{"class":1278},[1060,4646,3354],{"class":1284},[1060,4648,1288],{"class":1278},[1060,4650,3360],{"class":3359},[1060,4652,1690],{"class":1278},[1060,4654,3365],{"class":1284},[1060,4656,1288],{"class":1278},[1060,4658,1365],{"class":1278},[1060,4660,3372],{"class":1070},[1060,4662,1303],{"class":1278},[1060,4664,1706],{"class":1278},[1060,4666,1465],{"class":1284},[1060,4668,4669],{"class":1062,"line":2291},[1060,4670,3384],{"class":1278},[1060,4672,4673],{"class":1062,"line":2297},[1060,4674,1343],{"emptyLinePlaceholder":21},[1060,4676,4677,4679],{"class":1062,"line":2302},[1060,4678,2813],{"class":1264},[1060,4680,2816],{"class":1274},[1060,4682,4683,4685],{"class":1062,"line":2334},[1060,4684,1462],{"class":1278},[1060,4686,1465],{"class":1274},[964,4688,4690],{"id":4689},"wire-up-the-ui","Wire up the UI",[960,4692,4693,4694,4699,4700,4705],{},"Nuxt UI provides purpose-built components for AI chat interfaces: ",[1035,4695,4696],{"href":276},[1057,4697,4698],{},"UChatPrompt"," for the input area and ",[1035,4701,4702],{"href":266},[1057,4703,4704],{},"UChatMessages"," for displaying the conversation.",[1088,4707,4709],{"id":4708},"creating-the-home-page","Creating the home page",[960,4711,4712,4713,4717],{},"The home page is where users start a new conversation. The ",[1035,4714,4715],{"href":276},[1057,4716,4698],{}," component provides a textarea with auto-resize, keyboard shortcuts, and a submit button:",[1251,4719,4720],{},[1050,4721,4725],{"className":1523,"code":4722,"filename":4723,"highlights":4724,"language":34,"meta":1055,"style":1055},"\u003Cscript setup lang=\"ts\">\nconst input = ref('')\nconst loading = ref(false)\n\nasync function createChat() {\n  if (!input.value.trim()) return\n\n  loading.value = true\n\n  // Create a new chat on the server\n  const chat = await $fetch('/api/chats', {\n    method: 'POST',\n    body: {\n      message: {\n        role: 'user',\n        parts: [{ type: 'text', text: input.value }]\n      }\n    }\n  })\n\n  // Navigate to the chat page\n  navigateTo(`/chat/${chat.id}`)\n}\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CUDashboardPanel :ui=\"{ body: 'p-0 sm:p-0' }\">\n    \u003Ctemplate #body>\n      \u003CUContainer class=\"min-h-dvh flex flex-col justify-center gap-6 py-8\">\n        \u003Ch1 class=\"text-3xl sm:text-4xl text-highlighted font-bold\">\n          How can I help you today?\n        \u003C/h1>\n\n        \u003CUChatPrompt\n          v-model=\"input\"\n          :status=\"loading ? 'streaming' : 'ready'\"\n          variant=\"subtle\"\n          placeholder=\"Ask me anything...\"\n          @submit=\"createChat\"\n        >\n          \u003CUChatPromptSubmit color=\"neutral\" />\n        \u003C/UChatPrompt>\n      \u003C/UContainer>\n    \u003C/template>\n  \u003C/UDashboardPanel>\n\u003C/template>\n","app/pages/index.vue",[3398,3418,3446,3462,3481,3509,3517,3522,3588],[1057,4726,4727,4750,4770,4788,4792,4806,4833,4837,4850,4854,4859,4885,4901,4910,4919,4933,4971,4975,4979,4985,4989,4994,5020,5025,5033,5037,5045,5066,5080,5101,5122,5127,5136,5140,5148,5163,5178,5193,5208,5223,5229,5252,5261,5270,5278,5286],{"__ignoreMap":1055},[1060,4728,4729,4731,4734,4737,4740,4742,4744,4746,4748],{"class":1062,"line":1063},[1060,4730,1533],{"class":1278},[1060,4732,4733],{"class":1284},"script",[1060,4735,4736],{"class":1561}," setup",[1060,4738,4739],{"class":1561}," lang",[1060,4741,1565],{"class":1278},[1060,4743,1492],{"class":1278},[1060,4745,1257],{"class":1070},[1060,4747,1492],{"class":1278},[1060,4749,1539],{"class":1278},[1060,4751,4752,4755,4758,4760,4763,4765,4768],{"class":1062,"line":1080},[1060,4753,4754],{"class":1561},"const",[1060,4756,4757],{"class":1274}," input ",[1060,4759,1565],{"class":1278},[1060,4761,4762],{"class":1083}," ref",[1060,4764,1275],{"class":1274},[1060,4766,4767],{"class":1278},"''",[1060,4769,1465],{"class":1274},[1060,4771,4772,4774,4777,4779,4781,4783,4786],{"class":1062,"line":1294},[1060,4773,4754],{"class":1561},[1060,4775,4776],{"class":1274}," loading ",[1060,4778,1565],{"class":1278},[1060,4780,4762],{"class":1083},[1060,4782,1275],{"class":1274},[1060,4784,4785],{"class":1440},"false",[1060,4787,1465],{"class":1274},[1060,4789,4790],{"class":1062,"line":1309},[1060,4791,1343],{"emptyLinePlaceholder":21},[1060,4793,4794,4796,4799,4802,4804],{"class":1062,"line":1321},[1060,4795,2570],{"class":1561},[1060,4797,4798],{"class":1561}," function",[1060,4800,4801],{"class":1083}," createChat",[1060,4803,1779],{"class":1278},[1060,4805,1354],{"class":1278},[1060,4807,4808,4810,4812,4814,4817,4819,4822,4824,4827,4830],{"class":1062,"line":1332},[1060,4809,3327],{"class":1264},[1060,4811,1925],{"class":1284},[1060,4813,3332],{"class":1278},[1060,4815,4816],{"class":1274},"input",[1060,4818,1782],{"class":1278},[1060,4820,4821],{"class":1274},"value",[1060,4823,1782],{"class":1278},[1060,4825,4826],{"class":1083},"trim",[1060,4828,4829],{"class":1284},"()) ",[1060,4831,4832],{"class":1264},"return\n",[1060,4834,4835],{"class":1062,"line":1340},[1060,4836,1343],{"emptyLinePlaceholder":21},[1060,4838,4839,4842,4844,4846,4848],{"class":1062,"line":1346},[1060,4840,4841],{"class":1274},"  loading",[1060,4843,1782],{"class":1278},[1060,4845,4821],{"class":1274},[1060,4847,2596],{"class":1278},[1060,4849,3974],{"class":1440},[1060,4851,4852],{"class":1062,"line":1357},[1060,4853,1343],{"emptyLinePlaceholder":21},[1060,4855,4856],{"class":1062,"line":1373},[1060,4857,4858],{"class":1444},"  // Create a new chat on the server\n",[1060,4860,4861,4863,4865,4867,4869,4872,4874,4876,4879,4881,4883],{"class":1062,"line":1379},[1060,4862,2586],{"class":1561},[1060,4864,2763],{"class":1274},[1060,4866,2596],{"class":1278},[1060,4868,2599],{"class":1264},[1060,4870,4871],{"class":1083}," $fetch",[1060,4873,1275],{"class":1284},[1060,4875,1303],{"class":1278},[1060,4877,4878],{"class":1070},"/api/chats",[1060,4880,1303],{"class":1278},[1060,4882,1690],{"class":1278},[1060,4884,1354],{"class":1278},[1060,4886,4887,4890,4892,4894,4897,4899],{"class":1062,"line":1384},[1060,4888,4889],{"class":1284},"    method",[1060,4891,1288],{"class":1278},[1060,4893,1365],{"class":1278},[1060,4895,4896],{"class":1070},"POST",[1060,4898,1303],{"class":1278},[1060,4900,1306],{"class":1278},[1060,4902,4903,4906,4908],{"class":1062,"line":1407},[1060,4904,4905],{"class":1284},"    body",[1060,4907,1288],{"class":1278},[1060,4909,1354],{"class":1278},[1060,4911,4912,4915,4917],{"class":1062,"line":1412},[1060,4913,4914],{"class":1284},"      message",[1060,4916,1288],{"class":1278},[1060,4918,1354],{"class":1278},[1060,4920,4921,4923,4925,4927,4929,4931],{"class":1062,"line":1422},[1060,4922,4116],{"class":1284},[1060,4924,1288],{"class":1278},[1060,4926,1365],{"class":1278},[1060,4928,2121],{"class":1070},[1060,4930,1303],{"class":1278},[1060,4932,1306],{"class":1278},[1060,4934,4935,4937,4939,4941,4943,4945,4947,4949,4952,4954,4956,4958,4960,4963,4965,4967,4969],{"class":1062,"line":1432},[1060,4936,4149],{"class":1284},[1060,4938,1288],{"class":1278},[1060,4940,1392],{"class":1284},[1060,4942,1839],{"class":1278},[1060,4944,2493],{"class":1284},[1060,4946,1288],{"class":1278},[1060,4948,1365],{"class":1278},[1060,4950,4951],{"class":1070},"text",[1060,4953,1303],{"class":1278},[1060,4955,1690],{"class":1278},[1060,4957,1693],{"class":1284},[1060,4959,1288],{"class":1278},[1060,4961,4962],{"class":1274}," input",[1060,4964,1782],{"class":1278},[1060,4966,4821],{"class":1274},[1060,4968,1706],{"class":1278},[1060,4970,3631],{"class":1284},[1060,4972,4973],{"class":1062,"line":1448},[1060,4974,3988],{"class":1278},[1060,4976,4977],{"class":1062,"line":1454},[1060,4978,1451],{"class":1278},[1060,4980,4981,4983],{"class":1062,"line":1459},[1060,4982,2387],{"class":1278},[1060,4984,1465],{"class":1284},[1060,4986,4987],{"class":1062,"line":2248},[1060,4988,1343],{"emptyLinePlaceholder":21},[1060,4990,4991],{"class":1062,"line":2261},[1060,4992,4993],{"class":1444},"  // Navigate to the chat page\n",[1060,4995,4996,4999,5001,5003,5006,5009,5011,5013,5015,5018],{"class":1062,"line":2291},[1060,4997,4998],{"class":1083},"  navigateTo",[1060,5000,1275],{"class":1284},[1060,5002,3476],{"class":1278},[1060,5004,5005],{"class":1070},"/chat/",[1060,5007,5008],{"class":1278},"${",[1060,5010,262],{"class":1274},[1060,5012,1782],{"class":1278},[1060,5014,1991],{"class":1274},[1060,5016,5017],{"class":1278},"}`",[1060,5019,1465],{"class":1284},[1060,5021,5022],{"class":1062,"line":2297},[1060,5023,5024],{"class":1278},"}\n",[1060,5026,5027,5029,5031],{"class":1062,"line":2302},[1060,5028,1609],{"class":1278},[1060,5030,4733],{"class":1284},[1060,5032,1539],{"class":1278},[1060,5034,5035],{"class":1062,"line":2334},[1060,5036,1343],{"emptyLinePlaceholder":21},[1060,5038,5039,5041,5043],{"class":1062,"line":2350},[1060,5040,1533],{"class":1278},[1060,5042,1536],{"class":1284},[1060,5044,1539],{"class":1278},[1060,5046,5047,5049,5052,5055,5057,5059,5062,5064],{"class":1062,"line":2368},[1060,5048,1546],{"class":1278},[1060,5050,5051],{"class":1284},"UDashboardPanel",[1060,5053,5054],{"class":1561}," :ui",[1060,5056,1565],{"class":1278},[1060,5058,1492],{"class":1278},[1060,5060,5061],{"class":1070},"{ body: 'p-0 sm:p-0' }",[1060,5063,1492],{"class":1278},[1060,5065,1539],{"class":1278},[1060,5067,5068,5070,5072,5075,5078],{"class":1062,"line":2384},[1060,5069,1555],{"class":1278},[1060,5071,1536],{"class":1284},[1060,5073,5074],{"class":1278}," #",[1060,5076,5077],{"class":1561},"body",[1060,5079,1539],{"class":1278},[1060,5081,5082,5084,5087,5090,5092,5094,5097,5099],{"class":1062,"line":2392},[1060,5083,1579],{"class":1278},[1060,5085,5086],{"class":1284},"UContainer",[1060,5088,5089],{"class":1561}," class",[1060,5091,1565],{"class":1278},[1060,5093,1492],{"class":1278},[1060,5095,5096],{"class":1070},"min-h-dvh flex flex-col justify-center gap-6 py-8",[1060,5098,1492],{"class":1278},[1060,5100,1539],{"class":1278},[1060,5102,5103,5106,5109,5111,5113,5115,5118,5120],{"class":1062,"line":3342},[1060,5104,5105],{"class":1278},"        \u003C",[1060,5107,5108],{"class":1284},"h1",[1060,5110,5089],{"class":1561},[1060,5112,1565],{"class":1278},[1060,5114,1492],{"class":1278},[1060,5116,5117],{"class":1070},"text-3xl sm:text-4xl text-highlighted font-bold",[1060,5119,1492],{"class":1278},[1060,5121,1539],{"class":1278},[1060,5123,5124],{"class":1062,"line":3381},[1060,5125,5126],{"class":1274},"          How can I help you today?\n",[1060,5128,5129,5132,5134],{"class":1062,"line":3387},[1060,5130,5131],{"class":1278},"        \u003C/",[1060,5133,5108],{"class":1284},[1060,5135,1539],{"class":1278},[1060,5137,5138],{"class":1062,"line":3392},[1060,5139,1343],{"emptyLinePlaceholder":21},[1060,5141,5143,5145],{"class":5142,"line":3398},[1062,1543],[1060,5144,5105],{"class":1278},[1060,5146,5147],{"class":1284},"UChatPrompt\n",[1060,5149,5151,5154,5156,5158,5160],{"class":5150,"line":3418},[1062,1543],[1060,5152,5153],{"class":1561},"          v-model",[1060,5155,1565],{"class":1278},[1060,5157,1492],{"class":1278},[1060,5159,4816],{"class":1070},[1060,5161,5162],{"class":1278},"\"\n",[1060,5164,5166,5169,5171,5173,5176],{"class":5165,"line":3446},[1062,1543],[1060,5167,5168],{"class":1561},"          :status",[1060,5170,1565],{"class":1278},[1060,5172,1492],{"class":1278},[1060,5174,5175],{"class":1070},"loading ? 'streaming' : 'ready'",[1060,5177,5162],{"class":1278},[1060,5179,5181,5184,5186,5188,5191],{"class":5180,"line":3462},[1062,1543],[1060,5182,5183],{"class":1561},"          variant",[1060,5185,1565],{"class":1278},[1060,5187,1492],{"class":1278},[1060,5189,5190],{"class":1070},"subtle",[1060,5192,5162],{"class":1278},[1060,5194,5196,5199,5201,5203,5206],{"class":5195,"line":3481},[1062,1543],[1060,5197,5198],{"class":1561},"          placeholder",[1060,5200,1565],{"class":1278},[1060,5202,1492],{"class":1278},[1060,5204,5205],{"class":1070},"Ask me anything...",[1060,5207,5162],{"class":1278},[1060,5209,5211,5214,5216,5218,5221],{"class":5210,"line":3509},[1062,1543],[1060,5212,5213],{"class":1561},"          @submit",[1060,5215,1565],{"class":1278},[1060,5217,1492],{"class":1278},[1060,5219,5220],{"class":1070},"createChat",[1060,5222,5162],{"class":1278},[1060,5224,5226],{"class":5225,"line":3517},[1062,1543],[1060,5227,5228],{"class":1278},"        >\n",[1060,5230,5232,5235,5238,5241,5243,5245,5248,5250],{"class":5231,"line":3522},[1062,1543],[1060,5233,5234],{"class":1278},"          \u003C",[1060,5236,5237],{"class":1284},"UChatPromptSubmit",[1060,5239,5240],{"class":1561}," color",[1060,5242,1565],{"class":1278},[1060,5244,1492],{"class":1278},[1060,5246,5247],{"class":1070},"neutral",[1060,5249,1492],{"class":1278},[1060,5251,1585],{"class":1278},[1060,5253,5255,5257,5259],{"class":5254,"line":3588},[1062,1543],[1060,5256,5131],{"class":1278},[1060,5258,4698],{"class":1284},[1060,5260,1539],{"class":1278},[1060,5262,5263,5266,5268],{"class":1062,"line":3593},[1060,5264,5265],{"class":1278},"      \u003C/",[1060,5267,5086],{"class":1284},[1060,5269,1539],{"class":1278},[1060,5271,5272,5274,5276],{"class":1062,"line":3598},[1060,5273,1590],{"class":1278},[1060,5275,1536],{"class":1284},[1060,5277,1539],{"class":1278},[1060,5279,5280,5282,5284],{"class":1062,"line":3604},[1060,5281,1600],{"class":1278},[1060,5283,5051],{"class":1284},[1060,5285,1539],{"class":1278},[1060,5287,5288,5290,5292],{"class":1062,"line":3634},[1060,5289,1609],{"class":1278},[1060,5291,1536],{"class":1284},[1060,5293,1539],{"class":1278},[960,5295,4246,5296,5300],{},[1035,5297,5298],{"href":276},[1057,5299,4698],{}," component automatically handles:",[972,5302,5303,5310,5313,5323],{},[975,5304,5305,5306],{},"Form submission when pressing ",[5307,5308],"kbd",{"value":5309},"enter",[975,5311,5312],{},"Auto-resizing as you type",[975,5314,5315,5316,5319,5320],{},"A loading state when ",[1057,5317,5318],{},"status"," is set to ",[1057,5321,5322],{},"streaming",[975,5324,5325],{},"Focus management and keyboard shortcuts",[964,5327,5329],{"id":5328},"creating-the-chat-page","Creating the chat page",[960,5331,5332,5333,5340,5341,5348],{},"The chat page is where the actual conversation happens. It integrates the AI SDK's ",[1035,5334,5337],{"href":5335,"rel":5336},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/chat",[1039],[1057,5338,5339],{},"Chat"," class and ",[1035,5342,5345],{"href":5343,"rel":5344},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/default-chat-transport",[1039],[1057,5346,5347],{},"DefaultChatTransport"," for real-time streaming.",[1251,5350,5351],{},[1669,5352,5353],{},[1050,5354,5358],{"className":1523,"code":5355,"filename":5356,"highlights":5357,"language":34,"meta":1055,"style":1055},"\u003Cscript setup lang=\"ts\">\nimport { DefaultChatTransport } from 'ai'\nimport { Chat } from '@ai-sdk/vue'\n\nconst route = useRoute()\nconst toast = useToast()\n\n// Fetch existing chat data\nconst { data: chatData } = await useFetch(`/api/chats/${route.params.id}`)\n\nif (!chatData.value) {\n  throw createError({ statusCode: 404, statusMessage: 'Chat not found', fatal: true })\n}\n\nconst input = ref('')\n\n// Initialize the Chat class from AI SDK\nconst chat = new Chat({\n  id: chatData.value.id,\n  messages: chatData.value.messages,\n  transport: new DefaultChatTransport({\n    api: `/api/chats/${chatData.value.id}`\n  }),\n  onData(dataPart) {\n    // Refresh the chat list when a title is generated\n    if (dataPart.type === 'data-chat-title') {\n      refreshNuxtData('chats')\n    }\n  },\n  onError(error) {\n    toast.add({\n      title: 'Error',\n      description: error.message,\n      color: 'error'\n    })\n  }\n})\n\nfunction handleSubmit(e: Event) {\n  e.preventDefault()\n  if (input.value.trim()) {\n    chat.sendMessage({ text: input.value })\n    input.value = ''\n  }\n}\n\n// Auto-generate response for first message\nonMounted(() => {\n  if (chatData.value?.messages.length === 1) {\n    chat.regenerate()\n  }\n})\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CUDashboardPanel :ui=\"{ body: 'p-0 sm:p-0' }\">\n    \u003Ctemplate #body>\n      \u003CUContainer class=\"min-h-dvh flex flex-col py-4 sm:py-6\">\n        \u003CUChatMessages\n          :messages=\"chat.messages\"\n          :status=\"chat.status\"\n          should-auto-scroll\n          class=\"flex-1\"\n        >\n          \u003Ctemplate #content=\"{ message }\">\n            \u003Ctemplate v-for=\"(part, index) in message.parts\" :key=\"`${message.id}-${part.type}-${index}`\">\n              \u003CMDC v-if=\"part.type === 'text' && message.role === 'assistant'\" :value=\"part.text\" :cache-key=\"`${message.id}-${index}`\" class=\"*:first:mt-0 *:last:mb-0\" />\n              \u003Cp v-else-if=\"part.type === 'text' && message.role === 'user'\" class=\"whitespace-pre-wrap\">{{ part.text }}\u003C/p>\n            \u003C/template>\n          \u003C/template>\n        \u003C/UChatMessages>\n\n        \u003CUChatPrompt\n          v-model=\"input\"\n          :error=\"chat.error\"\n          variant=\"subtle\"\n          class=\"sticky bottom-0\"\n          @submit=\"handleSubmit\"\n        >\n          \u003CUChatPromptSubmit\n            :status=\"chat.status\"\n            color=\"neutral\"\n            @stop=\"chat.stop()\"\n            @reload=\"chat.regenerate()\"\n          />\n        \u003C/UChatPrompt>\n      \u003C/UContainer>\n    \u003C/template>\n  \u003C/UDashboardPanel>\n\u003C/template>\n","app/pages/chat/[id].vue",[1080,1294,1309,1459,2248,2261,2291,2297,2302,2334,2350,2368,2384,2392,3342,3381,3387,3392,3398,3418,3446,3462,3481],[1057,5359,5360,5380,5400,5421,5426,5440,5454,5458,5463,5511,5515,5534,5577,5581,5585,5601,5605,5610,5627,5647,5666,5682,5709,5718,5733,5739,5766,5782,5787,5792,5807,5822,5838,5855,5869,5876,5881,5888,5893,5915,5927,5947,5975,5989,5993,5997,6001,6006,6019,6047,6058,6062,6068,6076,6080,6088,6106,6118,6137,6144,6158,6171,6176,6190,6194,6219,6297,6354,6394,6403,6412,6420,6424,6430,6442,6456,6468,6481,6494,6498,6505,6518,6531,6545,6559,6564,6573,6582,6591,6600],{"__ignoreMap":1055},[1060,5361,5362,5364,5366,5368,5370,5372,5374,5376,5378],{"class":1062,"line":1063},[1060,5363,1533],{"class":1278},[1060,5365,4733],{"class":1284},[1060,5367,4736],{"class":1561},[1060,5369,4739],{"class":1561},[1060,5371,1565],{"class":1278},[1060,5373,1492],{"class":1278},[1060,5375,1257],{"class":1070},[1060,5377,1492],{"class":1278},[1060,5379,1539],{"class":1278},[1060,5381,5383,5385,5387,5390,5392,5394,5396,5398],{"class":5382,"line":1080},[1062,1543],[1060,5384,1681],{"class":1264},[1060,5386,1684],{"class":1278},[1060,5388,5389],{"class":1274}," DefaultChatTransport",[1060,5391,1706],{"class":1278},[1060,5393,1709],{"class":1264},[1060,5395,1365],{"class":1278},[1060,5397,2507],{"class":1070},[1060,5399,1329],{"class":1278},[1060,5401,5403,5405,5407,5410,5412,5414,5416,5419],{"class":5402,"line":1294},[1062,1543],[1060,5404,1681],{"class":1264},[1060,5406,1684],{"class":1278},[1060,5408,5409],{"class":1274}," Chat",[1060,5411,1706],{"class":1278},[1060,5413,1709],{"class":1264},[1060,5415,1365],{"class":1278},[1060,5417,5418],{"class":1070},"@ai-sdk/vue",[1060,5420,1329],{"class":1278},[1060,5422,5424],{"class":5423,"line":1309},[1062,1543],[1060,5425,1343],{"emptyLinePlaceholder":21},[1060,5427,5428,5430,5433,5435,5438],{"class":1062,"line":1321},[1060,5429,4754],{"class":1561},[1060,5431,5432],{"class":1274}," route ",[1060,5434,1565],{"class":1278},[1060,5436,5437],{"class":1083}," useRoute",[1060,5439,2642],{"class":1274},[1060,5441,5442,5444,5447,5449,5452],{"class":1062,"line":1332},[1060,5443,4754],{"class":1561},[1060,5445,5446],{"class":1274}," toast ",[1060,5448,1565],{"class":1278},[1060,5450,5451],{"class":1083}," useToast",[1060,5453,2642],{"class":1274},[1060,5455,5456],{"class":1062,"line":1340},[1060,5457,1343],{"emptyLinePlaceholder":21},[1060,5459,5460],{"class":1062,"line":1346},[1060,5461,5462],{"class":1444},"// Fetch existing chat data\n",[1060,5464,5465,5467,5469,5472,5474,5477,5479,5481,5483,5486,5488,5490,5493,5495,5498,5500,5503,5505,5507,5509],{"class":1062,"line":1357},[1060,5466,4754],{"class":1561},[1060,5468,1684],{"class":1278},[1060,5470,5471],{"class":1284}," data",[1060,5473,1288],{"class":1278},[1060,5475,5476],{"class":1274}," chatData ",[1060,5478,1462],{"class":1278},[1060,5480,2596],{"class":1278},[1060,5482,2599],{"class":1264},[1060,5484,5485],{"class":1083}," useFetch",[1060,5487,1275],{"class":1274},[1060,5489,3476],{"class":1278},[1060,5491,5492],{"class":1070},"/api/chats/",[1060,5494,5008],{"class":1278},[1060,5496,5497],{"class":1274},"route",[1060,5499,1782],{"class":1278},[1060,5501,5502],{"class":1274},"params",[1060,5504,1782],{"class":1278},[1060,5506,1991],{"class":1274},[1060,5508,5017],{"class":1278},[1060,5510,1465],{"class":1274},[1060,5512,5513],{"class":1062,"line":1373},[1060,5514,1343],{"emptyLinePlaceholder":21},[1060,5516,5517,5520,5522,5524,5527,5529,5532],{"class":1062,"line":1379},[1060,5518,5519],{"class":1264},"if",[1060,5521,1925],{"class":1274},[1060,5523,3332],{"class":1278},[1060,5525,5526],{"class":1274},"chatData",[1060,5528,1782],{"class":1278},[1060,5530,5531],{"class":1274},"value) ",[1060,5533,1279],{"class":1278},[1060,5535,5536,5539,5541,5543,5545,5547,5549,5551,5553,5555,5557,5559,5561,5563,5565,5568,5570,5573,5575],{"class":1062,"line":1384},[1060,5537,5538],{"class":1264},"  throw",[1060,5540,2872],{"class":1083},[1060,5542,1275],{"class":1284},[1060,5544,1839],{"class":1278},[1060,5546,3354],{"class":1284},[1060,5548,1288],{"class":1278},[1060,5550,3360],{"class":3359},[1060,5552,1690],{"class":1278},[1060,5554,3365],{"class":1284},[1060,5556,1288],{"class":1278},[1060,5558,1365],{"class":1278},[1060,5560,3372],{"class":1070},[1060,5562,1303],{"class":1278},[1060,5564,1690],{"class":1278},[1060,5566,5567],{"class":1284}," fatal",[1060,5569,1288],{"class":1278},[1060,5571,5572],{"class":1440}," true",[1060,5574,1706],{"class":1278},[1060,5576,1465],{"class":1284},[1060,5578,5579],{"class":1062,"line":1407},[1060,5580,5024],{"class":1278},[1060,5582,5583],{"class":1062,"line":1412},[1060,5584,1343],{"emptyLinePlaceholder":21},[1060,5586,5587,5589,5591,5593,5595,5597,5599],{"class":1062,"line":1422},[1060,5588,4754],{"class":1561},[1060,5590,4757],{"class":1274},[1060,5592,1565],{"class":1278},[1060,5594,4762],{"class":1083},[1060,5596,1275],{"class":1274},[1060,5598,4767],{"class":1278},[1060,5600,1465],{"class":1274},[1060,5602,5603],{"class":1062,"line":1432},[1060,5604,1343],{"emptyLinePlaceholder":21},[1060,5606,5607],{"class":1062,"line":1448},[1060,5608,5609],{"class":1444},"// Initialize the Chat class from AI SDK\n",[1060,5611,5612,5614,5617,5619,5621,5623,5625],{"class":1062,"line":1454},[1060,5613,4754],{"class":1561},[1060,5615,5616],{"class":1274}," chat ",[1060,5618,1565],{"class":1278},[1060,5620,1876],{"class":1278},[1060,5622,5409],{"class":1083},[1060,5624,1275],{"class":1274},[1060,5626,1279],{"class":1278},[1060,5628,5630,5632,5634,5637,5639,5641,5643,5645],{"class":5629,"line":1459},[1062,1543],[1060,5631,1772],{"class":1284},[1060,5633,1288],{"class":1278},[1060,5635,5636],{"class":1274}," chatData",[1060,5638,1782],{"class":1278},[1060,5640,4821],{"class":1274},[1060,5642,1782],{"class":1278},[1060,5644,1991],{"class":1274},[1060,5646,1306],{"class":1278},[1060,5648,5650,5652,5654,5656,5658,5660,5662,5664],{"class":5649,"line":2248},[1062,1543],[1060,5651,1932],{"class":1284},[1060,5653,1288],{"class":1278},[1060,5655,5636],{"class":1274},[1060,5657,1782],{"class":1278},[1060,5659,4821],{"class":1274},[1060,5661,1782],{"class":1278},[1060,5663,1970],{"class":1274},[1060,5665,1306],{"class":1278},[1060,5667,5669,5672,5674,5676,5678,5680],{"class":5668,"line":2261},[1062,1543],[1060,5670,5671],{"class":1284},"  transport",[1060,5673,1288],{"class":1278},[1060,5675,1876],{"class":1278},[1060,5677,5389],{"class":1083},[1060,5679,1275],{"class":1274},[1060,5681,1279],{"class":1278},[1060,5683,5685,5688,5690,5692,5694,5696,5698,5700,5702,5704,5706],{"class":5684,"line":2291},[1062,1543],[1060,5686,5687],{"class":1284},"    api",[1060,5689,1288],{"class":1278},[1060,5691,3470],{"class":1278},[1060,5693,5492],{"class":1070},[1060,5695,5008],{"class":1278},[1060,5697,5526],{"class":1274},[1060,5699,1782],{"class":1278},[1060,5701,4821],{"class":1274},[1060,5703,1782],{"class":1278},[1060,5705,1991],{"class":1274},[1060,5707,5708],{"class":1278},"}`\n",[1060,5710,5712,5714,5716],{"class":5711,"line":2297},[1062,1543],[1060,5713,2387],{"class":1278},[1060,5715,1856],{"class":1274},[1060,5717,1306],{"class":1278},[1060,5719,5721,5724,5726,5729,5731],{"class":5720,"line":2302},[1062,1543],[1060,5722,5723],{"class":1284},"  onData",[1060,5725,1275],{"class":1278},[1060,5727,5728],{"class":1916},"dataPart",[1060,5730,1856],{"class":1278},[1060,5732,1354],{"class":1278},[1060,5734,5736],{"class":5735,"line":2334},[1062,1543],[1060,5737,5738],{"class":1444},"    // Refresh the chat list when a title is generated\n",[1060,5740,5742,5745,5747,5749,5751,5754,5756,5758,5760,5762,5764],{"class":5741,"line":2350},[1062,1543],[1060,5743,5744],{"class":1264},"    if",[1060,5746,1925],{"class":1284},[1060,5748,5728],{"class":1274},[1060,5750,1782],{"class":1278},[1060,5752,5753],{"class":1274},"type",[1060,5755,3649],{"class":1278},[1060,5757,1365],{"class":1278},[1060,5759,3935],{"class":1070},[1060,5761,1303],{"class":1278},[1060,5763,3337],{"class":1284},[1060,5765,1279],{"class":1278},[1060,5767,5769,5772,5774,5776,5778,5780],{"class":5768,"line":2368},[1062,1543],[1060,5770,5771],{"class":1083},"      refreshNuxtData",[1060,5773,1275],{"class":1284},[1060,5775,1303],{"class":1278},[1060,5777,1761],{"class":1070},[1060,5779,1303],{"class":1278},[1060,5781,1465],{"class":1284},[1060,5783,5785],{"class":5784,"line":2384},[1062,1543],[1060,5786,1451],{"class":1278},[1060,5788,5790],{"class":5789,"line":2392},[1062,1543],[1060,5791,1376],{"class":1278},[1060,5793,5795,5798,5800,5803,5805],{"class":5794,"line":3342},[1062,1543],[1060,5796,5797],{"class":1284},"  onError",[1060,5799,1275],{"class":1278},[1060,5801,5802],{"class":1916},"error",[1060,5804,1856],{"class":1278},[1060,5806,1354],{"class":1278},[1060,5808,5810,5813,5815,5818,5820],{"class":5809,"line":3381},[1062,1543],[1060,5811,5812],{"class":1274},"    toast",[1060,5814,1782],{"class":1278},[1060,5816,5817],{"class":1083},"add",[1060,5819,1275],{"class":1284},[1060,5821,1279],{"class":1278},[1060,5823,5825,5828,5830,5832,5834,5836],{"class":5824,"line":3387},[1062,1543],[1060,5826,5827],{"class":1284},"      title",[1060,5829,1288],{"class":1278},[1060,5831,1365],{"class":1278},[1060,5833,477],{"class":1070},[1060,5835,1303],{"class":1278},[1060,5837,1306],{"class":1278},[1060,5839,5841,5844,5846,5849,5851,5853],{"class":5840,"line":3392},[1062,1543],[1060,5842,5843],{"class":1284},"      description",[1060,5845,1288],{"class":1278},[1060,5847,5848],{"class":1274}," error",[1060,5850,1782],{"class":1278},[1060,5852,4088],{"class":1274},[1060,5854,1306],{"class":1278},[1060,5856,5858,5861,5863,5865,5867],{"class":5857,"line":3398},[1062,1543],[1060,5859,5860],{"class":1284},"      color",[1060,5862,1288],{"class":1278},[1060,5864,1365],{"class":1278},[1060,5866,5802],{"class":1070},[1060,5868,1329],{"class":1278},[1060,5870,5872,5874],{"class":5871,"line":3418},[1062,1543],[1060,5873,3512],{"class":1278},[1060,5875,1465],{"class":1284},[1060,5877,5879],{"class":5878,"line":3446},[1062,1543],[1060,5880,3384],{"class":1278},[1060,5882,5884,5886],{"class":5883,"line":3462},[1062,1543],[1060,5885,1462],{"class":1278},[1060,5887,1465],{"class":1274},[1060,5889,5891],{"class":5890,"line":3481},[1062,1543],[1060,5892,1343],{"emptyLinePlaceholder":21},[1060,5894,5895,5898,5901,5903,5906,5908,5911,5913],{"class":1062,"line":3509},[1060,5896,5897],{"class":1561},"function",[1060,5899,5900],{"class":1083}," handleSubmit",[1060,5902,1275],{"class":1278},[1060,5904,5905],{"class":1916},"e",[1060,5907,1288],{"class":1278},[1060,5909,5910],{"class":1066}," Event",[1060,5912,1856],{"class":1278},[1060,5914,1354],{"class":1278},[1060,5916,5917,5920,5922,5925],{"class":1062,"line":3517},[1060,5918,5919],{"class":1274},"  e",[1060,5921,1782],{"class":1278},[1060,5923,5924],{"class":1083},"preventDefault",[1060,5926,2642],{"class":1284},[1060,5928,5929,5931,5933,5935,5937,5939,5941,5943,5945],{"class":1062,"line":3522},[1060,5930,3327],{"class":1264},[1060,5932,1925],{"class":1284},[1060,5934,4816],{"class":1274},[1060,5936,1782],{"class":1278},[1060,5938,4821],{"class":1274},[1060,5940,1782],{"class":1278},[1060,5942,4826],{"class":1083},[1060,5944,4829],{"class":1284},[1060,5946,1279],{"class":1278},[1060,5948,5949,5952,5954,5957,5959,5961,5963,5965,5967,5969,5971,5973],{"class":1062,"line":3588},[1060,5950,5951],{"class":1274},"    chat",[1060,5953,1782],{"class":1278},[1060,5955,5956],{"class":1083},"sendMessage",[1060,5958,1275],{"class":1284},[1060,5960,1839],{"class":1278},[1060,5962,1693],{"class":1284},[1060,5964,1288],{"class":1278},[1060,5966,4962],{"class":1274},[1060,5968,1782],{"class":1278},[1060,5970,4821],{"class":1274},[1060,5972,1706],{"class":1278},[1060,5974,1465],{"class":1284},[1060,5976,5977,5980,5982,5984,5986],{"class":1062,"line":3593},[1060,5978,5979],{"class":1274},"    input",[1060,5981,1782],{"class":1278},[1060,5983,4821],{"class":1274},[1060,5985,2596],{"class":1278},[1060,5987,5988],{"class":1278}," ''\n",[1060,5990,5991],{"class":1062,"line":3598},[1060,5992,3384],{"class":1278},[1060,5994,5995],{"class":1062,"line":3604},[1060,5996,5024],{"class":1278},[1060,5998,5999],{"class":1062,"line":3634},[1060,6000,1343],{"emptyLinePlaceholder":21},[1060,6002,6003],{"class":1062,"line":3676},[1060,6004,6005],{"class":1444},"// Auto-generate response for first message\n",[1060,6007,6008,6011,6013,6015,6017],{"class":1062,"line":3705},[1060,6009,6010],{"class":1083},"onMounted",[1060,6012,1275],{"class":1274},[1060,6014,1779],{"class":1278},[1060,6016,1799],{"class":1561},[1060,6018,1354],{"class":1278},[1060,6020,6021,6023,6025,6027,6029,6031,6033,6035,6037,6039,6041,6043,6045],{"class":1062,"line":3717},[1060,6022,3327],{"class":1264},[1060,6024,1925],{"class":1284},[1060,6026,5526],{"class":1274},[1060,6028,1782],{"class":1278},[1060,6030,4821],{"class":1274},[1060,6032,3644],{"class":1278},[1060,6034,1970],{"class":1274},[1060,6036,1782],{"class":1278},[1060,6038,3622],{"class":1274},[1060,6040,3649],{"class":1278},[1060,6042,3628],{"class":3359},[1060,6044,3337],{"class":1284},[1060,6046,1279],{"class":1278},[1060,6048,6049,6051,6053,6056],{"class":1062,"line":3733},[1060,6050,5951],{"class":1274},[1060,6052,1782],{"class":1278},[1060,6054,6055],{"class":1083},"regenerate",[1060,6057,2642],{"class":1284},[1060,6059,6060],{"class":1062,"line":3747},[1060,6061,3384],{"class":1278},[1060,6063,6064,6066],{"class":1062,"line":3754},[1060,6065,1462],{"class":1278},[1060,6067,1465],{"class":1274},[1060,6069,6070,6072,6074],{"class":1062,"line":3759},[1060,6071,1609],{"class":1278},[1060,6073,4733],{"class":1284},[1060,6075,1539],{"class":1278},[1060,6077,6078],{"class":1062,"line":3764},[1060,6079,1343],{"emptyLinePlaceholder":21},[1060,6081,6082,6084,6086],{"class":1062,"line":3770},[1060,6083,1533],{"class":1278},[1060,6085,1536],{"class":1284},[1060,6087,1539],{"class":1278},[1060,6089,6090,6092,6094,6096,6098,6100,6102,6104],{"class":1062,"line":3787},[1060,6091,1546],{"class":1278},[1060,6093,5051],{"class":1284},[1060,6095,5054],{"class":1561},[1060,6097,1565],{"class":1278},[1060,6099,1492],{"class":1278},[1060,6101,5061],{"class":1070},[1060,6103,1492],{"class":1278},[1060,6105,1539],{"class":1278},[1060,6107,6108,6110,6112,6114,6116],{"class":1062,"line":3809},[1060,6109,1555],{"class":1278},[1060,6111,1536],{"class":1284},[1060,6113,5074],{"class":1278},[1060,6115,5077],{"class":1561},[1060,6117,1539],{"class":1278},[1060,6119,6120,6122,6124,6126,6128,6130,6133,6135],{"class":1062,"line":3827},[1060,6121,1579],{"class":1278},[1060,6123,5086],{"class":1284},[1060,6125,5089],{"class":1561},[1060,6127,1565],{"class":1278},[1060,6129,1492],{"class":1278},[1060,6131,6132],{"class":1070},"min-h-dvh flex flex-col py-4 sm:py-6",[1060,6134,1492],{"class":1278},[1060,6136,1539],{"class":1278},[1060,6138,6139,6141],{"class":1062,"line":3835},[1060,6140,5105],{"class":1278},[1060,6142,6143],{"class":1284},"UChatMessages\n",[1060,6145,6146,6149,6151,6153,6156],{"class":1062,"line":3852},[1060,6147,6148],{"class":1561},"          :messages",[1060,6150,1565],{"class":1278},[1060,6152,1492],{"class":1278},[1060,6154,6155],{"class":1070},"chat.messages",[1060,6157,5162],{"class":1278},[1060,6159,6160,6162,6164,6166,6169],{"class":1062,"line":3871},[1060,6161,5168],{"class":1561},[1060,6163,1565],{"class":1278},[1060,6165,1492],{"class":1278},[1060,6167,6168],{"class":1070},"chat.status",[1060,6170,5162],{"class":1278},[1060,6172,6173],{"class":1062,"line":3879},[1060,6174,6175],{"class":1561},"          should-auto-scroll\n",[1060,6177,6178,6181,6183,6185,6188],{"class":1062,"line":3884},[1060,6179,6180],{"class":1561},"          class",[1060,6182,1565],{"class":1278},[1060,6184,1492],{"class":1278},[1060,6186,6187],{"class":1070},"flex-1",[1060,6189,5162],{"class":1278},[1060,6191,6192],{"class":1062,"line":3890},[1060,6193,5228],{"class":1278},[1060,6195,6196,6198,6200,6202,6204,6206,6208,6210,6213,6215,6217],{"class":1062,"line":3910},[1060,6197,5234],{"class":1278},[1060,6199,1536],{"class":1284},[1060,6201,5074],{"class":1278},[1060,6203,350],{"class":1561},[1060,6205,1565],{"class":1278},[1060,6207,1492],{"class":1278},[1060,6209,1839],{"class":1278},[1060,6211,6212],{"class":1274}," message ",[1060,6214,1462],{"class":1278},[1060,6216,1492],{"class":1278},[1060,6218,1539],{"class":1278},[1060,6220,6221,6224,6226,6229,6231,6233,6236,6238,6241,6244,6246,6248,6250,6252,6255,6258,6260,6263,6265,6267,6269,6271,6274,6276,6279,6281,6283,6285,6287,6289,6292,6295],{"class":1062,"line":3925},[1060,6222,6223],{"class":1278},"            \u003C",[1060,6225,1536],{"class":1284},[1060,6227,6228],{"class":1264}," v-for",[1060,6230,1565],{"class":1278},[1060,6232,1492],{"class":1278},[1060,6234,6235],{"class":1274},"(part",[1060,6237,1690],{"class":1278},[1060,6239,6240],{"class":1274}," index) ",[1060,6242,6243],{"class":1278},"in",[1060,6245,2591],{"class":1274},[1060,6247,1782],{"class":1278},[1060,6249,2172],{"class":1274},[1060,6251,1492],{"class":1278},[1060,6253,6254],{"class":1278}," :",[1060,6256,6257],{"class":1561},"key",[1060,6259,1565],{"class":1278},[1060,6261,6262],{"class":1278},"\"`${",[1060,6264,4088],{"class":1274},[1060,6266,1782],{"class":1278},[1060,6268,1991],{"class":1274},[1060,6270,1462],{"class":1278},[1060,6272,6273],{"class":1070},"-",[1060,6275,5008],{"class":1278},[1060,6277,6278],{"class":1274},"part",[1060,6280,1782],{"class":1278},[1060,6282,5753],{"class":1274},[1060,6284,1462],{"class":1278},[1060,6286,6273],{"class":1070},[1060,6288,5008],{"class":1278},[1060,6290,6291],{"class":1274},"index",[1060,6293,6294],{"class":1278},"}`\"",[1060,6296,1539],{"class":1278},[1060,6298,6299,6302,6305,6308,6310,6312,6315,6317,6320,6322,6324,6327,6329,6332,6334,6336,6339,6341,6343,6345,6347,6350,6352],{"class":1062,"line":3942},[1060,6300,6301],{"class":1278},"              \u003C",[1060,6303,6304],{"class":1284},"MDC",[1060,6306,6307],{"class":1561}," v-if",[1060,6309,1565],{"class":1278},[1060,6311,1492],{"class":1278},[1060,6313,6314],{"class":1070},"part.type === 'text' && message.role === 'assistant'",[1060,6316,1492],{"class":1278},[1060,6318,6319],{"class":1561}," :value",[1060,6321,1565],{"class":1278},[1060,6323,1492],{"class":1278},[1060,6325,6326],{"class":1070},"part.text",[1060,6328,1492],{"class":1278},[1060,6330,6331],{"class":1561}," :cache-key",[1060,6333,1565],{"class":1278},[1060,6335,1492],{"class":1278},[1060,6337,6338],{"class":1070},"`${message.id}-${index}`",[1060,6340,1492],{"class":1278},[1060,6342,5089],{"class":1561},[1060,6344,1565],{"class":1278},[1060,6346,1492],{"class":1278},[1060,6348,6349],{"class":1070},"*:first:mt-0 *:last:mb-0",[1060,6351,1492],{"class":1278},[1060,6353,1585],{"class":1278},[1060,6355,6356,6358,6360,6363,6365,6367,6370,6372,6374,6376,6378,6381,6383,6385,6388,6390,6392],{"class":1062,"line":3966},[1060,6357,6301],{"class":1278},[1060,6359,960],{"class":1284},[1060,6361,6362],{"class":1561}," v-else-if",[1060,6364,1565],{"class":1278},[1060,6366,1492],{"class":1278},[1060,6368,6369],{"class":1070},"part.type === 'text' && message.role === 'user'",[1060,6371,1492],{"class":1278},[1060,6373,5089],{"class":1561},[1060,6375,1565],{"class":1278},[1060,6377,1492],{"class":1278},[1060,6379,6380],{"class":1070},"whitespace-pre-wrap",[1060,6382,1492],{"class":1278},[1060,6384,2639],{"class":1278},[1060,6386,6387],{"class":1274},"{{ part.text }}",[1060,6389,1609],{"class":1278},[1060,6391,960],{"class":1284},[1060,6393,1539],{"class":1278},[1060,6395,6396,6399,6401],{"class":1062,"line":3977},[1060,6397,6398],{"class":1278},"            \u003C/",[1060,6400,1536],{"class":1284},[1060,6402,1539],{"class":1278},[1060,6404,6405,6408,6410],{"class":1062,"line":3985},[1060,6406,6407],{"class":1278},"          \u003C/",[1060,6409,1536],{"class":1284},[1060,6411,1539],{"class":1278},[1060,6413,6414,6416,6418],{"class":1062,"line":3991},[1060,6415,5131],{"class":1278},[1060,6417,4704],{"class":1284},[1060,6419,1539],{"class":1278},[1060,6421,6422],{"class":1062,"line":3996},[1060,6423,1343],{"emptyLinePlaceholder":21},[1060,6425,6426,6428],{"class":1062,"line":4019},[1060,6427,5105],{"class":1278},[1060,6429,5147],{"class":1284},[1060,6431,6432,6434,6436,6438,6440],{"class":1062,"line":4025},[1060,6433,5153],{"class":1561},[1060,6435,1565],{"class":1278},[1060,6437,1492],{"class":1278},[1060,6439,4816],{"class":1070},[1060,6441,5162],{"class":1278},[1060,6443,6444,6447,6449,6451,6454],{"class":1062,"line":4045},[1060,6445,6446],{"class":1561},"          :error",[1060,6448,1565],{"class":1278},[1060,6450,1492],{"class":1278},[1060,6452,6453],{"class":1070},"chat.error",[1060,6455,5162],{"class":1278},[1060,6457,6458,6460,6462,6464,6466],{"class":1062,"line":4051},[1060,6459,5183],{"class":1561},[1060,6461,1565],{"class":1278},[1060,6463,1492],{"class":1278},[1060,6465,5190],{"class":1070},[1060,6467,5162],{"class":1278},[1060,6469,6470,6472,6474,6476,6479],{"class":1062,"line":4097},[1060,6471,6180],{"class":1561},[1060,6473,1565],{"class":1278},[1060,6475,1492],{"class":1278},[1060,6477,6478],{"class":1070},"sticky bottom-0",[1060,6480,5162],{"class":1278},[1060,6482,6483,6485,6487,6489,6492],{"class":1062,"line":4113},[1060,6484,5213],{"class":1561},[1060,6486,1565],{"class":1278},[1060,6488,1492],{"class":1278},[1060,6490,6491],{"class":1070},"handleSubmit",[1060,6493,5162],{"class":1278},[1060,6495,6496],{"class":1062,"line":4146},[1060,6497,5228],{"class":1278},[1060,6499,6500,6502],{"class":1062,"line":4160},[1060,6501,5234],{"class":1278},[1060,6503,6504],{"class":1284},"UChatPromptSubmit\n",[1060,6506,6507,6510,6512,6514,6516],{"class":1062,"line":4168},[1060,6508,6509],{"class":1561},"            :status",[1060,6511,1565],{"class":1278},[1060,6513,1492],{"class":1278},[1060,6515,6168],{"class":1070},[1060,6517,5162],{"class":1278},[1060,6519,6520,6523,6525,6527,6529],{"class":1062,"line":4173},[1060,6521,6522],{"class":1561},"            color",[1060,6524,1565],{"class":1278},[1060,6526,1492],{"class":1278},[1060,6528,5247],{"class":1070},[1060,6530,5162],{"class":1278},[1060,6532,6533,6536,6538,6540,6543],{"class":1062,"line":4180},[1060,6534,6535],{"class":1561},"            @stop",[1060,6537,1565],{"class":1278},[1060,6539,1492],{"class":1278},[1060,6541,6542],{"class":1070},"chat.stop()",[1060,6544,5162],{"class":1278},[1060,6546,6547,6550,6552,6554,6557],{"class":1062,"line":4185},[1060,6548,6549],{"class":1561},"            @reload",[1060,6551,1565],{"class":1278},[1060,6553,1492],{"class":1278},[1060,6555,6556],{"class":1070},"chat.regenerate()",[1060,6558,5162],{"class":1278},[1060,6560,6561],{"class":1062,"line":4203},[1060,6562,6563],{"class":1278},"          />\n",[1060,6565,6567,6569,6571],{"class":1062,"line":6566},86,[1060,6568,5131],{"class":1278},[1060,6570,4698],{"class":1284},[1060,6572,1539],{"class":1278},[1060,6574,6576,6578,6580],{"class":1062,"line":6575},87,[1060,6577,5265],{"class":1278},[1060,6579,5086],{"class":1284},[1060,6581,1539],{"class":1278},[1060,6583,6585,6587,6589],{"class":1062,"line":6584},88,[1060,6586,1590],{"class":1278},[1060,6588,1536],{"class":1284},[1060,6590,1539],{"class":1278},[1060,6592,6594,6596,6598],{"class":1062,"line":6593},89,[1060,6595,1600],{"class":1278},[1060,6597,5051],{"class":1284},[1060,6599,1539],{"class":1278},[1060,6601,6603,6605,6607],{"class":1062,"line":6602},90,[1060,6604,1609],{"class":1278},[1060,6606,1536],{"class":1284},[1060,6608,1539],{"class":1278},[960,6610,6611],{},"Here's a breakdown of the key parts:",[960,6613,6614],{},[978,6615,6616],{},"The Chat Class",[960,6618,4246,6619,6624,6625,6627],{},[1035,6620,6622],{"href":5335,"rel":6621},[1039],[1057,6623,5339],{}," class from ",[1057,6626,5418],{}," manages the entire conversation state. It handles:",[972,6629,6630,6635,6650,6656,6661],{},[975,6631,6632,6633],{},"Message history with ",[1057,6634,6155],{},[975,6636,6637,6638,1925,6640,2837,6643,2837,6646,2837,6648,1856],{},"Connection status with ",[1057,6639,6168],{},[1057,6641,6642],{},"ready",[1057,6644,6645],{},"submitted",[1057,6647,5322],{},[1057,6649,5802],{},[975,6651,6652,6653],{},"Sending messages with ",[1057,6654,6655],{},"chat.sendMessage()",[975,6657,6658,6659],{},"Stopping generation with ",[1057,6660,6542],{},[975,6662,6663,6664],{},"Regenerating responses with ",[1057,6665,6556],{},[960,6667,4246,6668,6671,6672,6677,6678,6680],{},[1057,6669,6670],{},"onData"," callback receives ",[1035,6673,6676],{"href":6674,"rel":6675},"https://ai-sdk.dev/docs/ai-sdk-ui/streaming-data",[1039],"custom data events"," from the server (like ",[1057,6679,3935],{},"), allowing you to react to server-side events during streaming.",[960,6682,6683],{},[978,6684,6685],{},"UChatMessages Component",[960,6687,4246,6688,6692],{},[1035,6689,6690],{"href":266},[1057,6691,4704],{}," component is purpose-built for AI chatbots with:",[972,6694,6695,6698,6701,6704],{},[975,6696,6697],{},"Auto-scroll to bottom on load",[975,6699,6700],{},"Continuous scrolling as messages stream in",[975,6702,6703],{},"A loading indicator while the assistant processes",[975,6705,6706],{},"An \"Auto scroll\" button when scrolled up",[960,6708,6709],{},[978,6710,6711],{},"Rendering Markdown with MDC",[960,6713,6714,6715,6721,6722,6728,6729,6732],{},"AI models often respond with markdown formatting (code blocks, lists, bold text, etc.). We use the ",[1035,6716,6719],{"href":6717,"rel":6718},"https://github.com/nuxt-content/mdc#mdc",[1039],[1057,6720,6304],{}," component from ",[1035,6723,6726],{"href":6724,"rel":6725},"https://github.com/nuxt-content/mdc",[1039],[1057,6727,1314],{}," to render this content beautifully. The ",[1057,6730,6731],{},"getTextFromMessage"," utility extracts the text content from AI SDK v5 message parts.",[1639,6734,6735],{"to":830},[960,6736,6737],{},"Nuxt UI provides pre-styled prose components, so your markdown content will be automatically styled to match your theme.",[960,6739,6740],{},[978,6741,6742],{},"UChatPromptSubmit Component",[960,6744,4246,6745,6749],{},[1035,6746,6747],{"href":281},[1057,6748,5237],{}," component adapts based on the chat status:",[972,6751,6752,6755,6758],{},[975,6753,6754],{},"Shows a send button when ready",[975,6756,6757],{},"Shows a stop button while streaming",[975,6759,6760],{},"Shows a reload button after an error",[964,6762,6764],{"id":6763},"adding-chat-history","Adding chat history",[960,6766,6767],{},"This section adds a dropdown menu to list previous chats and navigate between them.",[1088,6769,6771],{"id":6770},"listing-chats-api","Listing chats API",[960,6773,6774],{},"First, create an endpoint to fetch all chats:",[1251,6776,6777],{},[1050,6778,6781],{"className":1255,"code":6779,"filename":6780,"language":1257,"meta":1055,"style":1055},"import { defineEventHandler } from 'h3'\nimport { db, schema } from 'hub:db'\nimport { desc } from 'drizzle-orm'\n\nexport default defineEventHandler(async () => {\n  return await db.query.chats.findMany({\n    orderBy: () => desc(schema.chats.createdAt)\n  })\n})\n","server/api/chats.get.ts",[1057,6782,6783,6801,6823,6842,6846,6864,6889,6916,6922],{"__ignoreMap":1055},[1060,6784,6785,6787,6789,6791,6793,6795,6797,6799],{"class":1062,"line":1063},[1060,6786,1681],{"class":1264},[1060,6788,1684],{"class":1278},[1060,6790,2471],{"class":1274},[1060,6792,1706],{"class":1278},[1060,6794,1709],{"class":1264},[1060,6796,1365],{"class":1278},[1060,6798,1088],{"class":1070},[1060,6800,1329],{"class":1278},[1060,6802,6803,6805,6807,6809,6811,6813,6815,6817,6819,6821],{"class":1062,"line":1080},[1060,6804,1681],{"class":1264},[1060,6806,1684],{"class":1278},[1060,6808,2414],{"class":1274},[1060,6810,1690],{"class":1278},[1060,6812,2522],{"class":1274},[1060,6814,1706],{"class":1278},[1060,6816,1709],{"class":1264},[1060,6818,1365],{"class":1278},[1060,6820,2531],{"class":1070},[1060,6822,1329],{"class":1278},[1060,6824,6825,6827,6829,6832,6834,6836,6838,6840],{"class":1062,"line":1294},[1060,6826,1681],{"class":1264},[1060,6828,1684],{"class":1278},[1060,6830,6831],{"class":1274}," desc",[1060,6833,1706],{"class":1278},[1060,6835,1709],{"class":1264},[1060,6837,1365],{"class":1278},[1060,6839,1734],{"class":1070},[1060,6841,1329],{"class":1278},[1060,6843,6844],{"class":1062,"line":1309},[1060,6845,1343],{"emptyLinePlaceholder":21},[1060,6847,6848,6850,6852,6854,6856,6858,6860,6862],{"class":1062,"line":1321},[1060,6849,1265],{"class":1264},[1060,6851,1268],{"class":1264},[1060,6853,2471],{"class":1083},[1060,6855,1275],{"class":1274},[1060,6857,2570],{"class":1561},[1060,6859,4583],{"class":1278},[1060,6861,1799],{"class":1561},[1060,6863,1354],{"class":1278},[1060,6865,6866,6868,6870,6872,6874,6876,6878,6880,6882,6885,6887],{"class":1062,"line":1332},[1060,6867,2813],{"class":1264},[1060,6869,2599],{"class":1264},[1060,6871,2414],{"class":1274},[1060,6873,1782],{"class":1278},[1060,6875,3256],{"class":1274},[1060,6877,1782],{"class":1278},[1060,6879,1761],{"class":1274},[1060,6881,1782],{"class":1278},[1060,6883,6884],{"class":1083},"findMany",[1060,6886,1275],{"class":1284},[1060,6888,1279],{"class":1278},[1060,6890,6891,6894,6896,6898,6900,6902,6904,6906,6908,6910,6912,6914],{"class":1062,"line":1340},[1060,6892,6893],{"class":1083},"    orderBy",[1060,6895,1288],{"class":1278},[1060,6897,4583],{"class":1278},[1060,6899,1799],{"class":1561},[1060,6901,6831],{"class":1083},[1060,6903,1275],{"class":1284},[1060,6905,2690],{"class":1274},[1060,6907,1782],{"class":1278},[1060,6909,1761],{"class":1274},[1060,6911,1782],{"class":1278},[1060,6913,4600],{"class":1274},[1060,6915,1465],{"class":1284},[1060,6917,6918,6920],{"class":1062,"line":1346},[1060,6919,2387],{"class":1278},[1060,6921,1465],{"class":1284},[1060,6923,6924,6926],{"class":1062,"line":1357},[1060,6925,1462],{"class":1278},[1060,6927,1465],{"class":1274},[1088,6929,6931],{"id":6930},"building-the-chats-history-dropdown","Building the chats history dropdown",[960,6933,6934,6935,6940,6941,6946,6947,6940,6954,6956],{},"The component uses ",[1035,6936,6937],{"href":436},[1057,6938,6939],{},"UDropdownMenu"," with a ",[1035,6942,6943],{"href":230},[1057,6944,6945],{},"UButton"," as trigger. Use ",[1035,6948,6951],{"href":6949,"rel":6950},"https://nuxt.com/docs/api/composables/use-fetch",[1039],[1057,6952,6953],{},"useFetch",[1057,6955,6257],{}," to fetch and cache the chat list:",[1251,6958,6959],{},[1050,6960,6963],{"className":1523,"code":6961,"filename":6962,"language":34,"meta":1055,"style":1055},"\u003Cscript setup lang=\"ts\">\nconst route = useRoute()\n\nconst { data: chats } = useFetch('/api/chats', {\n  key: 'chats',\n  default: () => []\n})\n\nconst items = computed(() => [\n  {\n    label: 'New chat',\n    to: '/',\n    icon: 'i-lucide-plus-square',\n    active: route.name === 'index'\n  },\n  ...chats.value.map(chat => ({\n    label: chat.title || 'Untitled',\n    to: `/chat/${chat.id}`,\n    active: route.params.id === chat.id\n  }))\n])\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CUDropdownMenu :items=\"items\" class=\"m-2\">\n    \u003CUButton\n      icon=\"i-lucide-messages-square\"\n      variant=\"ghost\"\n      label=\"Chats History\"\n      color=\"neutral\"\n      class=\"w-fit\"\n    />\n  \u003C/UDropdownMenu>\n\u003C/template>\n","app/components/ChatsHistory.vue",[1057,6964,6965,6985,6997,7001,7031,7046,7060,7066,7070,7090,7095,7111,7127,7143,7167,7171,7196,7221,7243,7269,7275,7279,7287,7291,7299,7330,7337,7351,7365,7379,7391,7405,7410,7418],{"__ignoreMap":1055},[1060,6966,6967,6969,6971,6973,6975,6977,6979,6981,6983],{"class":1062,"line":1063},[1060,6968,1533],{"class":1278},[1060,6970,4733],{"class":1284},[1060,6972,4736],{"class":1561},[1060,6974,4739],{"class":1561},[1060,6976,1565],{"class":1278},[1060,6978,1492],{"class":1278},[1060,6980,1257],{"class":1070},[1060,6982,1492],{"class":1278},[1060,6984,1539],{"class":1278},[1060,6986,6987,6989,6991,6993,6995],{"class":1062,"line":1080},[1060,6988,4754],{"class":1561},[1060,6990,5432],{"class":1274},[1060,6992,1565],{"class":1278},[1060,6994,5437],{"class":1083},[1060,6996,2642],{"class":1274},[1060,6998,6999],{"class":1062,"line":1294},[1060,7000,1343],{"emptyLinePlaceholder":21},[1060,7002,7003,7005,7007,7009,7011,7013,7015,7017,7019,7021,7023,7025,7027,7029],{"class":1062,"line":1309},[1060,7004,4754],{"class":1561},[1060,7006,1684],{"class":1278},[1060,7008,5471],{"class":1284},[1060,7010,1288],{"class":1278},[1060,7012,1750],{"class":1274},[1060,7014,1462],{"class":1278},[1060,7016,2596],{"class":1278},[1060,7018,5485],{"class":1083},[1060,7020,1275],{"class":1274},[1060,7022,1303],{"class":1278},[1060,7024,4878],{"class":1070},[1060,7026,1303],{"class":1278},[1060,7028,1690],{"class":1278},[1060,7030,1354],{"class":1278},[1060,7032,7033,7036,7038,7040,7042,7044],{"class":1062,"line":1321},[1060,7034,7035],{"class":1284},"  key",[1060,7037,1288],{"class":1278},[1060,7039,1365],{"class":1278},[1060,7041,1761],{"class":1070},[1060,7043,1303],{"class":1278},[1060,7045,1306],{"class":1278},[1060,7047,7048,7051,7053,7055,7057],{"class":1062,"line":1332},[1060,7049,7050],{"class":1083},"  default",[1060,7052,1288],{"class":1278},[1060,7054,4583],{"class":1278},[1060,7056,1799],{"class":1561},[1060,7058,7059],{"class":1274}," []\n",[1060,7061,7062,7064],{"class":1062,"line":1340},[1060,7063,1462],{"class":1278},[1060,7065,1465],{"class":1274},[1060,7067,7068],{"class":1062,"line":1346},[1060,7069,1343],{"emptyLinePlaceholder":21},[1060,7071,7072,7074,7077,7079,7082,7084,7086,7088],{"class":1062,"line":1357},[1060,7073,4754],{"class":1561},[1060,7075,7076],{"class":1274}," items ",[1060,7078,1565],{"class":1278},[1060,7080,7081],{"class":1083}," computed",[1060,7083,1275],{"class":1274},[1060,7085,1779],{"class":1278},[1060,7087,1799],{"class":1561},[1060,7089,1291],{"class":1274},[1060,7091,7092],{"class":1062,"line":1373},[1060,7093,7094],{"class":1278},"  {\n",[1060,7096,7097,7100,7102,7104,7107,7109],{"class":1062,"line":1379},[1060,7098,7099],{"class":1284},"    label",[1060,7101,1288],{"class":1278},[1060,7103,1365],{"class":1278},[1060,7105,7106],{"class":1070},"New chat",[1060,7108,1303],{"class":1278},[1060,7110,1306],{"class":1278},[1060,7112,7113,7116,7118,7120,7123,7125],{"class":1062,"line":1384},[1060,7114,7115],{"class":1284},"    to",[1060,7117,1288],{"class":1278},[1060,7119,1365],{"class":1278},[1060,7121,7122],{"class":1070},"/",[1060,7124,1303],{"class":1278},[1060,7126,1306],{"class":1278},[1060,7128,7129,7132,7134,7136,7139,7141],{"class":1062,"line":1407},[1060,7130,7131],{"class":1284},"    icon",[1060,7133,1288],{"class":1278},[1060,7135,1365],{"class":1278},[1060,7137,7138],{"class":1070},"i-lucide-plus-square",[1060,7140,1303],{"class":1278},[1060,7142,1306],{"class":1278},[1060,7144,7145,7148,7150,7153,7155,7158,7161,7163,7165],{"class":1062,"line":1412},[1060,7146,7147],{"class":1284},"    active",[1060,7149,1288],{"class":1278},[1060,7151,7152],{"class":1274}," route",[1060,7154,1782],{"class":1278},[1060,7156,7157],{"class":1274},"name ",[1060,7159,7160],{"class":1278},"===",[1060,7162,1365],{"class":1278},[1060,7164,6291],{"class":1070},[1060,7166,1329],{"class":1278},[1060,7168,7169],{"class":1062,"line":1422},[1060,7170,1376],{"class":1278},[1060,7172,7173,7176,7178,7180,7182,7184,7186,7188,7190,7192,7194],{"class":1062,"line":1432},[1060,7174,7175],{"class":1278},"  ...",[1060,7177,1761],{"class":1274},[1060,7179,1782],{"class":1278},[1060,7181,4821],{"class":1274},[1060,7183,1782],{"class":1278},[1060,7185,4083],{"class":1083},[1060,7187,1275],{"class":1274},[1060,7189,262],{"class":1916},[1060,7191,1799],{"class":1561},[1060,7193,1925],{"class":1274},[1060,7195,1279],{"class":1278},[1060,7197,7198,7200,7202,7204,7206,7209,7212,7214,7217,7219],{"class":1062,"line":1448},[1060,7199,7099],{"class":1284},[1060,7201,1288],{"class":1278},[1060,7203,2763],{"class":1274},[1060,7205,1782],{"class":1278},[1060,7207,7208],{"class":1274},"title ",[1060,7210,7211],{"class":1278},"||",[1060,7213,1365],{"class":1278},[1060,7215,7216],{"class":1070},"Untitled",[1060,7218,1303],{"class":1278},[1060,7220,1306],{"class":1278},[1060,7222,7223,7225,7227,7229,7231,7233,7235,7237,7239,7241],{"class":1062,"line":1454},[1060,7224,7115],{"class":1284},[1060,7226,1288],{"class":1278},[1060,7228,3470],{"class":1278},[1060,7230,5005],{"class":1070},[1060,7232,5008],{"class":1278},[1060,7234,262],{"class":1274},[1060,7236,1782],{"class":1278},[1060,7238,1991],{"class":1274},[1060,7240,5017],{"class":1278},[1060,7242,1306],{"class":1278},[1060,7244,7245,7247,7249,7251,7253,7255,7257,7260,7262,7264,7266],{"class":1062,"line":1459},[1060,7246,7147],{"class":1284},[1060,7248,1288],{"class":1278},[1060,7250,7152],{"class":1274},[1060,7252,1782],{"class":1278},[1060,7254,5502],{"class":1274},[1060,7256,1782],{"class":1278},[1060,7258,7259],{"class":1274},"id ",[1060,7261,7160],{"class":1278},[1060,7263,2763],{"class":1274},[1060,7265,1782],{"class":1278},[1060,7267,7268],{"class":1274},"id\n",[1060,7270,7271,7273],{"class":1062,"line":2248},[1060,7272,2387],{"class":1278},[1060,7274,1946],{"class":1274},[1060,7276,7277],{"class":1062,"line":2261},[1060,7278,2294],{"class":1274},[1060,7280,7281,7283,7285],{"class":1062,"line":2291},[1060,7282,1609],{"class":1278},[1060,7284,4733],{"class":1284},[1060,7286,1539],{"class":1278},[1060,7288,7289],{"class":1062,"line":2297},[1060,7290,1343],{"emptyLinePlaceholder":21},[1060,7292,7293,7295,7297],{"class":1062,"line":2302},[1060,7294,1533],{"class":1278},[1060,7296,1536],{"class":1284},[1060,7298,1539],{"class":1278},[1060,7300,7301,7303,7305,7308,7310,7312,7315,7317,7319,7321,7323,7326,7328],{"class":1062,"line":2334},[1060,7302,1546],{"class":1278},[1060,7304,6939],{"class":1284},[1060,7306,7307],{"class":1561}," :items",[1060,7309,1565],{"class":1278},[1060,7311,1492],{"class":1278},[1060,7313,7314],{"class":1070},"items",[1060,7316,1492],{"class":1278},[1060,7318,5089],{"class":1561},[1060,7320,1565],{"class":1278},[1060,7322,1492],{"class":1278},[1060,7324,7325],{"class":1070},"m-2",[1060,7327,1492],{"class":1278},[1060,7329,1539],{"class":1278},[1060,7331,7332,7334],{"class":1062,"line":2350},[1060,7333,1555],{"class":1278},[1060,7335,7336],{"class":1284},"UButton\n",[1060,7338,7339,7342,7344,7346,7349],{"class":1062,"line":2368},[1060,7340,7341],{"class":1561},"      icon",[1060,7343,1565],{"class":1278},[1060,7345,1492],{"class":1278},[1060,7347,7348],{"class":1070},"i-lucide-messages-square",[1060,7350,5162],{"class":1278},[1060,7352,7353,7356,7358,7360,7363],{"class":1062,"line":2384},[1060,7354,7355],{"class":1561},"      variant",[1060,7357,1565],{"class":1278},[1060,7359,1492],{"class":1278},[1060,7361,7362],{"class":1070},"ghost",[1060,7364,5162],{"class":1278},[1060,7366,7367,7370,7372,7374,7377],{"class":1062,"line":2392},[1060,7368,7369],{"class":1561},"      label",[1060,7371,1565],{"class":1278},[1060,7373,1492],{"class":1278},[1060,7375,7376],{"class":1070},"Chats History",[1060,7378,5162],{"class":1278},[1060,7380,7381,7383,7385,7387,7389],{"class":1062,"line":3342},[1060,7382,5860],{"class":1561},[1060,7384,1565],{"class":1278},[1060,7386,1492],{"class":1278},[1060,7388,5247],{"class":1070},[1060,7390,5162],{"class":1278},[1060,7392,7393,7396,7398,7400,7403],{"class":1062,"line":3381},[1060,7394,7395],{"class":1561},"      class",[1060,7397,1565],{"class":1278},[1060,7399,1492],{"class":1278},[1060,7401,7402],{"class":1070},"w-fit",[1060,7404,5162],{"class":1278},[1060,7406,7407],{"class":1062,"line":3387},[1060,7408,7409],{"class":1278},"    />\n",[1060,7411,7412,7414,7416],{"class":1062,"line":3392},[1060,7413,1600],{"class":1278},[1060,7415,6939],{"class":1284},[1060,7417,1539],{"class":1278},[1060,7419,7420,7422,7424],{"class":1062,"line":3398},[1060,7421,1609],{"class":1278},[1060,7423,1536],{"class":1284},[1060,7425,1539],{"class":1278},[964,7427,7429],{"id":7428},"integrating-history-in-the-home-page","Integrating history in the home page",[1251,7431,7432],{},[1669,7433,7434],{},[1050,7435,7438],{"className":1523,"code":7436,"filename":4723,"highlights":7437,"language":34,"meta":1055,"style":1055},"\u003Cscript setup lang=\"ts\">\nconst input = ref('')\nconst loading = ref(false)\n\nasync function createChat() {\n  if (!input.value.trim()) return\n\n  loading.value = true\n\n  // Create a new chat on the server\n  const chat = await $fetch('/api/chats', {\n    method: 'POST',\n    body: {\n      message: {\n        role: 'user',\n        parts: [{ type: 'text', text: input.value }]\n      }\n    }\n  })\n\n  // Navigate to the chat page\n  navigateTo(`/chat/${chat.id}`)\n}\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CUDashboardPanel :ui=\"{ body: 'p-0 sm:p-0' }\">\n    \u003Ctemplate #header>\n      \u003CChatsHistory />\n    \u003C/template>\n    \u003Ctemplate #body>\n      \u003CUContainer class=\"min-h-dvh flex flex-col justify-center gap-6 py-8\">\n        \u003Ch1 class=\"text-3xl sm:text-4xl text-highlighted font-bold\">\n          How can I help you today?\n        \u003C/h1>\n\n        \u003CUChatPrompt\n          v-model=\"input\"\n          :status=\"loading ? 'streaming' : 'ready'\"\n          variant=\"subtle\"\n          placeholder=\"Ask me anything...\"\n          @submit=\"createChat\"\n        >\n          \u003CUChatPromptSubmit color=\"neutral\" />\n        \u003C/UChatPrompt>\n      \u003C/UContainer>\n    \u003C/template>\n  \u003C/UDashboardPanel>\n\u003C/template>\n",[2384,2392,3342],[1057,7439,7440,7460,7476,7492,7496,7508,7530,7534,7546,7550,7554,7578,7592,7600,7608,7622,7658,7662,7666,7672,7676,7680,7702,7706,7714,7718,7726,7744,7758,7768,7777,7789,7807,7825,7829,7837,7841,7847,7859,7871,7883,7895,7907,7911,7929,7937,7945,7953,7961],{"__ignoreMap":1055},[1060,7441,7442,7444,7446,7448,7450,7452,7454,7456,7458],{"class":1062,"line":1063},[1060,7443,1533],{"class":1278},[1060,7445,4733],{"class":1284},[1060,7447,4736],{"class":1561},[1060,7449,4739],{"class":1561},[1060,7451,1565],{"class":1278},[1060,7453,1492],{"class":1278},[1060,7455,1257],{"class":1070},[1060,7457,1492],{"class":1278},[1060,7459,1539],{"class":1278},[1060,7461,7462,7464,7466,7468,7470,7472,7474],{"class":1062,"line":1080},[1060,7463,4754],{"class":1561},[1060,7465,4757],{"class":1274},[1060,7467,1565],{"class":1278},[1060,7469,4762],{"class":1083},[1060,7471,1275],{"class":1274},[1060,7473,4767],{"class":1278},[1060,7475,1465],{"class":1274},[1060,7477,7478,7480,7482,7484,7486,7488,7490],{"class":1062,"line":1294},[1060,7479,4754],{"class":1561},[1060,7481,4776],{"class":1274},[1060,7483,1565],{"class":1278},[1060,7485,4762],{"class":1083},[1060,7487,1275],{"class":1274},[1060,7489,4785],{"class":1440},[1060,7491,1465],{"class":1274},[1060,7493,7494],{"class":1062,"line":1309},[1060,7495,1343],{"emptyLinePlaceholder":21},[1060,7497,7498,7500,7502,7504,7506],{"class":1062,"line":1321},[1060,7499,2570],{"class":1561},[1060,7501,4798],{"class":1561},[1060,7503,4801],{"class":1083},[1060,7505,1779],{"class":1278},[1060,7507,1354],{"class":1278},[1060,7509,7510,7512,7514,7516,7518,7520,7522,7524,7526,7528],{"class":1062,"line":1332},[1060,7511,3327],{"class":1264},[1060,7513,1925],{"class":1284},[1060,7515,3332],{"class":1278},[1060,7517,4816],{"class":1274},[1060,7519,1782],{"class":1278},[1060,7521,4821],{"class":1274},[1060,7523,1782],{"class":1278},[1060,7525,4826],{"class":1083},[1060,7527,4829],{"class":1284},[1060,7529,4832],{"class":1264},[1060,7531,7532],{"class":1062,"line":1340},[1060,7533,1343],{"emptyLinePlaceholder":21},[1060,7535,7536,7538,7540,7542,7544],{"class":1062,"line":1346},[1060,7537,4841],{"class":1274},[1060,7539,1782],{"class":1278},[1060,7541,4821],{"class":1274},[1060,7543,2596],{"class":1278},[1060,7545,3974],{"class":1440},[1060,7547,7548],{"class":1062,"line":1357},[1060,7549,1343],{"emptyLinePlaceholder":21},[1060,7551,7552],{"class":1062,"line":1373},[1060,7553,4858],{"class":1444},[1060,7555,7556,7558,7560,7562,7564,7566,7568,7570,7572,7574,7576],{"class":1062,"line":1379},[1060,7557,2586],{"class":1561},[1060,7559,2763],{"class":1274},[1060,7561,2596],{"class":1278},[1060,7563,2599],{"class":1264},[1060,7565,4871],{"class":1083},[1060,7567,1275],{"class":1284},[1060,7569,1303],{"class":1278},[1060,7571,4878],{"class":1070},[1060,7573,1303],{"class":1278},[1060,7575,1690],{"class":1278},[1060,7577,1354],{"class":1278},[1060,7579,7580,7582,7584,7586,7588,7590],{"class":1062,"line":1384},[1060,7581,4889],{"class":1284},[1060,7583,1288],{"class":1278},[1060,7585,1365],{"class":1278},[1060,7587,4896],{"class":1070},[1060,7589,1303],{"class":1278},[1060,7591,1306],{"class":1278},[1060,7593,7594,7596,7598],{"class":1062,"line":1407},[1060,7595,4905],{"class":1284},[1060,7597,1288],{"class":1278},[1060,7599,1354],{"class":1278},[1060,7601,7602,7604,7606],{"class":1062,"line":1412},[1060,7603,4914],{"class":1284},[1060,7605,1288],{"class":1278},[1060,7607,1354],{"class":1278},[1060,7609,7610,7612,7614,7616,7618,7620],{"class":1062,"line":1422},[1060,7611,4116],{"class":1284},[1060,7613,1288],{"class":1278},[1060,7615,1365],{"class":1278},[1060,7617,2121],{"class":1070},[1060,7619,1303],{"class":1278},[1060,7621,1306],{"class":1278},[1060,7623,7624,7626,7628,7630,7632,7634,7636,7638,7640,7642,7644,7646,7648,7650,7652,7654,7656],{"class":1062,"line":1432},[1060,7625,4149],{"class":1284},[1060,7627,1288],{"class":1278},[1060,7629,1392],{"class":1284},[1060,7631,1839],{"class":1278},[1060,7633,2493],{"class":1284},[1060,7635,1288],{"class":1278},[1060,7637,1365],{"class":1278},[1060,7639,4951],{"class":1070},[1060,7641,1303],{"class":1278},[1060,7643,1690],{"class":1278},[1060,7645,1693],{"class":1284},[1060,7647,1288],{"class":1278},[1060,7649,4962],{"class":1274},[1060,7651,1782],{"class":1278},[1060,7653,4821],{"class":1274},[1060,7655,1706],{"class":1278},[1060,7657,3631],{"class":1284},[1060,7659,7660],{"class":1062,"line":1448},[1060,7661,3988],{"class":1278},[1060,7663,7664],{"class":1062,"line":1454},[1060,7665,1451],{"class":1278},[1060,7667,7668,7670],{"class":1062,"line":1459},[1060,7669,2387],{"class":1278},[1060,7671,1465],{"class":1284},[1060,7673,7674],{"class":1062,"line":2248},[1060,7675,1343],{"emptyLinePlaceholder":21},[1060,7677,7678],{"class":1062,"line":2261},[1060,7679,4993],{"class":1444},[1060,7681,7682,7684,7686,7688,7690,7692,7694,7696,7698,7700],{"class":1062,"line":2291},[1060,7683,4998],{"class":1083},[1060,7685,1275],{"class":1284},[1060,7687,3476],{"class":1278},[1060,7689,5005],{"class":1070},[1060,7691,5008],{"class":1278},[1060,7693,262],{"class":1274},[1060,7695,1782],{"class":1278},[1060,7697,1991],{"class":1274},[1060,7699,5017],{"class":1278},[1060,7701,1465],{"class":1284},[1060,7703,7704],{"class":1062,"line":2297},[1060,7705,5024],{"class":1278},[1060,7707,7708,7710,7712],{"class":1062,"line":2302},[1060,7709,1609],{"class":1278},[1060,7711,4733],{"class":1284},[1060,7713,1539],{"class":1278},[1060,7715,7716],{"class":1062,"line":2334},[1060,7717,1343],{"emptyLinePlaceholder":21},[1060,7719,7720,7722,7724],{"class":1062,"line":2350},[1060,7721,1533],{"class":1278},[1060,7723,1536],{"class":1284},[1060,7725,1539],{"class":1278},[1060,7727,7728,7730,7732,7734,7736,7738,7740,7742],{"class":1062,"line":2368},[1060,7729,1546],{"class":1278},[1060,7731,5051],{"class":1284},[1060,7733,5054],{"class":1561},[1060,7735,1565],{"class":1278},[1060,7737,1492],{"class":1278},[1060,7739,5061],{"class":1070},[1060,7741,1492],{"class":1278},[1060,7743,1539],{"class":1278},[1060,7745,7747,7749,7751,7753,7756],{"class":7746,"line":2384},[1062,1543],[1060,7748,1555],{"class":1278},[1060,7750,1536],{"class":1284},[1060,7752,5074],{"class":1278},[1060,7754,7755],{"class":1561},"header",[1060,7757,1539],{"class":1278},[1060,7759,7761,7763,7766],{"class":7760,"line":2392},[1062,1543],[1060,7762,1579],{"class":1278},[1060,7764,7765],{"class":1284},"ChatsHistory",[1060,7767,1585],{"class":1278},[1060,7769,7771,7773,7775],{"class":7770,"line":3342},[1062,1543],[1060,7772,1590],{"class":1278},[1060,7774,1536],{"class":1284},[1060,7776,1539],{"class":1278},[1060,7778,7779,7781,7783,7785,7787],{"class":1062,"line":3381},[1060,7780,1555],{"class":1278},[1060,7782,1536],{"class":1284},[1060,7784,5074],{"class":1278},[1060,7786,5077],{"class":1561},[1060,7788,1539],{"class":1278},[1060,7790,7791,7793,7795,7797,7799,7801,7803,7805],{"class":1062,"line":3387},[1060,7792,1579],{"class":1278},[1060,7794,5086],{"class":1284},[1060,7796,5089],{"class":1561},[1060,7798,1565],{"class":1278},[1060,7800,1492],{"class":1278},[1060,7802,5096],{"class":1070},[1060,7804,1492],{"class":1278},[1060,7806,1539],{"class":1278},[1060,7808,7809,7811,7813,7815,7817,7819,7821,7823],{"class":1062,"line":3392},[1060,7810,5105],{"class":1278},[1060,7812,5108],{"class":1284},[1060,7814,5089],{"class":1561},[1060,7816,1565],{"class":1278},[1060,7818,1492],{"class":1278},[1060,7820,5117],{"class":1070},[1060,7822,1492],{"class":1278},[1060,7824,1539],{"class":1278},[1060,7826,7827],{"class":1062,"line":3398},[1060,7828,5126],{"class":1274},[1060,7830,7831,7833,7835],{"class":1062,"line":3418},[1060,7832,5131],{"class":1278},[1060,7834,5108],{"class":1284},[1060,7836,1539],{"class":1278},[1060,7838,7839],{"class":1062,"line":3446},[1060,7840,1343],{"emptyLinePlaceholder":21},[1060,7842,7843,7845],{"class":1062,"line":3462},[1060,7844,5105],{"class":1278},[1060,7846,5147],{"class":1284},[1060,7848,7849,7851,7853,7855,7857],{"class":1062,"line":3481},[1060,7850,5153],{"class":1561},[1060,7852,1565],{"class":1278},[1060,7854,1492],{"class":1278},[1060,7856,4816],{"class":1070},[1060,7858,5162],{"class":1278},[1060,7860,7861,7863,7865,7867,7869],{"class":1062,"line":3509},[1060,7862,5168],{"class":1561},[1060,7864,1565],{"class":1278},[1060,7866,1492],{"class":1278},[1060,7868,5175],{"class":1070},[1060,7870,5162],{"class":1278},[1060,7872,7873,7875,7877,7879,7881],{"class":1062,"line":3517},[1060,7874,5183],{"class":1561},[1060,7876,1565],{"class":1278},[1060,7878,1492],{"class":1278},[1060,7880,5190],{"class":1070},[1060,7882,5162],{"class":1278},[1060,7884,7885,7887,7889,7891,7893],{"class":1062,"line":3522},[1060,7886,5198],{"class":1561},[1060,7888,1565],{"class":1278},[1060,7890,1492],{"class":1278},[1060,7892,5205],{"class":1070},[1060,7894,5162],{"class":1278},[1060,7896,7897,7899,7901,7903,7905],{"class":1062,"line":3588},[1060,7898,5213],{"class":1561},[1060,7900,1565],{"class":1278},[1060,7902,1492],{"class":1278},[1060,7904,5220],{"class":1070},[1060,7906,5162],{"class":1278},[1060,7908,7909],{"class":1062,"line":3593},[1060,7910,5228],{"class":1278},[1060,7912,7913,7915,7917,7919,7921,7923,7925,7927],{"class":1062,"line":3598},[1060,7914,5234],{"class":1278},[1060,7916,5237],{"class":1284},[1060,7918,5240],{"class":1561},[1060,7920,1565],{"class":1278},[1060,7922,1492],{"class":1278},[1060,7924,5247],{"class":1070},[1060,7926,1492],{"class":1278},[1060,7928,1585],{"class":1278},[1060,7930,7931,7933,7935],{"class":1062,"line":3604},[1060,7932,5131],{"class":1278},[1060,7934,4698],{"class":1284},[1060,7936,1539],{"class":1278},[1060,7938,7939,7941,7943],{"class":1062,"line":3634},[1060,7940,5265],{"class":1278},[1060,7942,5086],{"class":1284},[1060,7944,1539],{"class":1278},[1060,7946,7947,7949,7951],{"class":1062,"line":3676},[1060,7948,1590],{"class":1278},[1060,7950,1536],{"class":1284},[1060,7952,1539],{"class":1278},[1060,7954,7955,7957,7959],{"class":1062,"line":3705},[1060,7956,1600],{"class":1278},[1060,7958,5051],{"class":1284},[1060,7960,1539],{"class":1278},[1060,7962,7963,7965,7967],{"class":1062,"line":3717},[1060,7964,1609],{"class":1278},[1060,7966,1536],{"class":1284},[1060,7968,1539],{"class":1278},[964,7970,7972],{"id":7971},"integrating-history-in-the-chat-page","Integrating history in the chat page",[1251,7974,7975],{},[1669,7976,7977],{},[1050,7978,7981],{"className":1523,"code":7979,"filename":5356,"highlights":7980,"language":34,"meta":1055,"style":1055},"\u003Cscript setup lang=\"ts\">\nimport { DefaultChatTransport } from 'ai'\nimport { Chat } from '@ai-sdk/vue'\n\nconst route = useRoute()\nconst toast = useToast()\n\n// Fetch existing chat data\nconst { data: chatData } = await useFetch(`/api/chats/${route.params.id}`)\n\nif (!chatData.value) {\n  throw createError({ statusCode: 404, statusMessage: 'Chat not found', fatal: true })\n}\n\nconst input = ref('')\n\n// Initialize the Chat class from AI SDK\nconst chat = new Chat({\n  id: chatData.value.id,\n  messages: chatData.value.messages,\n  transport: new DefaultChatTransport({\n    api: `/api/chats/${chatData.value.id}`\n  }),\n  onData(dataPart) {\n    // Refresh the chat list when a title is generated\n    if (dataPart.type === 'data-chat-title') {\n      refreshNuxtData('chats')\n    }\n  },\n  onError(error) {\n    toast.add({\n      title: 'Error',\n      description: error.message,\n      color: 'error'\n    })\n  }\n})\n\nfunction handleSubmit(e: Event) {\n  e.preventDefault()\n  if (input.value.trim()) {\n    chat.sendMessage({ text: input.value })\n    input.value = ''\n  }\n}\n\n// Auto-generate response for first message\nonMounted(() => {\n  if (chatData.value?.messages.length === 1) {\n    chat.regenerate()\n  }\n})\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CUDashboardPanel :ui=\"{ body: 'p-0 sm:p-0' }\">\n    \u003Ctemplate #header>\n      \u003CChatsHistory />\n    \u003C/template>\n    \u003Ctemplate #body>\n      \u003CUContainer class=\"min-h-dvh flex flex-col py-4 sm:py-6\">\n        \u003CUChatMessages\n          :messages=\"chat.messages\"\n          :status=\"chat.status\"\n          should-auto-scroll\n          class=\"flex-1\"\n        >\n          \u003Ctemplate #content=\"{ message }\">\n            \u003Ctemplate v-for=\"(part, index) in message.parts\" :key=\"`${message.id}-${part.type}-${index}`\">\n              \u003CMDC v-if=\"part.type === 'text' && message.role === 'assistant'\" :value=\"part.text\" :cache-key=\"`${message.id}-${index}`\" class=\"*:first:mt-0 *:last:mb-0\" />\n              \u003Cp v-else-if=\"part.type === 'text' && message.role === 'user'\" class=\"whitespace-pre-wrap\">{{ part.text }}\u003C/p>\n            \u003C/template>\n          \u003C/template>\n        \u003C/UChatMessages>\n\n        \u003CUChatPrompt\n          v-model=\"input\"\n          :error=\"chat.error\"\n          variant=\"subtle\"\n          class=\"sticky bottom-0\"\n          @submit=\"handleSubmit\"\n        >\n          \u003CUChatPromptSubmit\n            :status=\"chat.status\"\n            color=\"neutral\"\n            @stop=\"chat.stop()\"\n            @reload=\"chat.regenerate()\"\n          />\n        \u003C/UChatPrompt>\n      \u003C/UContainer>\n    \u003C/template>\n  \u003C/UDashboardPanel>\n\u003C/template>\n",[3827,3835,3852],[1057,7982,7983,8003,8021,8039,8043,8055,8067,8071,8075,8117,8121,8137,8177,8181,8185,8201,8205,8209,8225,8243,8261,8275,8299,8307,8319,8323,8347,8361,8365,8369,8381,8393,8407,8421,8433,8439,8443,8449,8453,8471,8481,8501,8527,8539,8543,8547,8551,8555,8567,8595,8605,8609,8615,8623,8627,8635,8653,8665,8674,8683,8696,8714,8720,8732,8744,8748,8760,8764,8788,8854,8902,8938,8946,8954,8962,8966,8972,8984,8996,9008,9020,9032,9036,9042,9054,9066,9078,9090,9094,9102,9110,9119,9128],{"__ignoreMap":1055},[1060,7984,7985,7987,7989,7991,7993,7995,7997,7999,8001],{"class":1062,"line":1063},[1060,7986,1533],{"class":1278},[1060,7988,4733],{"class":1284},[1060,7990,4736],{"class":1561},[1060,7992,4739],{"class":1561},[1060,7994,1565],{"class":1278},[1060,7996,1492],{"class":1278},[1060,7998,1257],{"class":1070},[1060,8000,1492],{"class":1278},[1060,8002,1539],{"class":1278},[1060,8004,8005,8007,8009,8011,8013,8015,8017,8019],{"class":1062,"line":1080},[1060,8006,1681],{"class":1264},[1060,8008,1684],{"class":1278},[1060,8010,5389],{"class":1274},[1060,8012,1706],{"class":1278},[1060,8014,1709],{"class":1264},[1060,8016,1365],{"class":1278},[1060,8018,2507],{"class":1070},[1060,8020,1329],{"class":1278},[1060,8022,8023,8025,8027,8029,8031,8033,8035,8037],{"class":1062,"line":1294},[1060,8024,1681],{"class":1264},[1060,8026,1684],{"class":1278},[1060,8028,5409],{"class":1274},[1060,8030,1706],{"class":1278},[1060,8032,1709],{"class":1264},[1060,8034,1365],{"class":1278},[1060,8036,5418],{"class":1070},[1060,8038,1329],{"class":1278},[1060,8040,8041],{"class":1062,"line":1309},[1060,8042,1343],{"emptyLinePlaceholder":21},[1060,8044,8045,8047,8049,8051,8053],{"class":1062,"line":1321},[1060,8046,4754],{"class":1561},[1060,8048,5432],{"class":1274},[1060,8050,1565],{"class":1278},[1060,8052,5437],{"class":1083},[1060,8054,2642],{"class":1274},[1060,8056,8057,8059,8061,8063,8065],{"class":1062,"line":1332},[1060,8058,4754],{"class":1561},[1060,8060,5446],{"class":1274},[1060,8062,1565],{"class":1278},[1060,8064,5451],{"class":1083},[1060,8066,2642],{"class":1274},[1060,8068,8069],{"class":1062,"line":1340},[1060,8070,1343],{"emptyLinePlaceholder":21},[1060,8072,8073],{"class":1062,"line":1346},[1060,8074,5462],{"class":1444},[1060,8076,8077,8079,8081,8083,8085,8087,8089,8091,8093,8095,8097,8099,8101,8103,8105,8107,8109,8111,8113,8115],{"class":1062,"line":1357},[1060,8078,4754],{"class":1561},[1060,8080,1684],{"class":1278},[1060,8082,5471],{"class":1284},[1060,8084,1288],{"class":1278},[1060,8086,5476],{"class":1274},[1060,8088,1462],{"class":1278},[1060,8090,2596],{"class":1278},[1060,8092,2599],{"class":1264},[1060,8094,5485],{"class":1083},[1060,8096,1275],{"class":1274},[1060,8098,3476],{"class":1278},[1060,8100,5492],{"class":1070},[1060,8102,5008],{"class":1278},[1060,8104,5497],{"class":1274},[1060,8106,1782],{"class":1278},[1060,8108,5502],{"class":1274},[1060,8110,1782],{"class":1278},[1060,8112,1991],{"class":1274},[1060,8114,5017],{"class":1278},[1060,8116,1465],{"class":1274},[1060,8118,8119],{"class":1062,"line":1373},[1060,8120,1343],{"emptyLinePlaceholder":21},[1060,8122,8123,8125,8127,8129,8131,8133,8135],{"class":1062,"line":1379},[1060,8124,5519],{"class":1264},[1060,8126,1925],{"class":1274},[1060,8128,3332],{"class":1278},[1060,8130,5526],{"class":1274},[1060,8132,1782],{"class":1278},[1060,8134,5531],{"class":1274},[1060,8136,1279],{"class":1278},[1060,8138,8139,8141,8143,8145,8147,8149,8151,8153,8155,8157,8159,8161,8163,8165,8167,8169,8171,8173,8175],{"class":1062,"line":1384},[1060,8140,5538],{"class":1264},[1060,8142,2872],{"class":1083},[1060,8144,1275],{"class":1284},[1060,8146,1839],{"class":1278},[1060,8148,3354],{"class":1284},[1060,8150,1288],{"class":1278},[1060,8152,3360],{"class":3359},[1060,8154,1690],{"class":1278},[1060,8156,3365],{"class":1284},[1060,8158,1288],{"class":1278},[1060,8160,1365],{"class":1278},[1060,8162,3372],{"class":1070},[1060,8164,1303],{"class":1278},[1060,8166,1690],{"class":1278},[1060,8168,5567],{"class":1284},[1060,8170,1288],{"class":1278},[1060,8172,5572],{"class":1440},[1060,8174,1706],{"class":1278},[1060,8176,1465],{"class":1284},[1060,8178,8179],{"class":1062,"line":1407},[1060,8180,5024],{"class":1278},[1060,8182,8183],{"class":1062,"line":1412},[1060,8184,1343],{"emptyLinePlaceholder":21},[1060,8186,8187,8189,8191,8193,8195,8197,8199],{"class":1062,"line":1422},[1060,8188,4754],{"class":1561},[1060,8190,4757],{"class":1274},[1060,8192,1565],{"class":1278},[1060,8194,4762],{"class":1083},[1060,8196,1275],{"class":1274},[1060,8198,4767],{"class":1278},[1060,8200,1465],{"class":1274},[1060,8202,8203],{"class":1062,"line":1432},[1060,8204,1343],{"emptyLinePlaceholder":21},[1060,8206,8207],{"class":1062,"line":1448},[1060,8208,5609],{"class":1444},[1060,8210,8211,8213,8215,8217,8219,8221,8223],{"class":1062,"line":1454},[1060,8212,4754],{"class":1561},[1060,8214,5616],{"class":1274},[1060,8216,1565],{"class":1278},[1060,8218,1876],{"class":1278},[1060,8220,5409],{"class":1083},[1060,8222,1275],{"class":1274},[1060,8224,1279],{"class":1278},[1060,8226,8227,8229,8231,8233,8235,8237,8239,8241],{"class":1062,"line":1459},[1060,8228,1772],{"class":1284},[1060,8230,1288],{"class":1278},[1060,8232,5636],{"class":1274},[1060,8234,1782],{"class":1278},[1060,8236,4821],{"class":1274},[1060,8238,1782],{"class":1278},[1060,8240,1991],{"class":1274},[1060,8242,1306],{"class":1278},[1060,8244,8245,8247,8249,8251,8253,8255,8257,8259],{"class":1062,"line":2248},[1060,8246,1932],{"class":1284},[1060,8248,1288],{"class":1278},[1060,8250,5636],{"class":1274},[1060,8252,1782],{"class":1278},[1060,8254,4821],{"class":1274},[1060,8256,1782],{"class":1278},[1060,8258,1970],{"class":1274},[1060,8260,1306],{"class":1278},[1060,8262,8263,8265,8267,8269,8271,8273],{"class":1062,"line":2261},[1060,8264,5671],{"class":1284},[1060,8266,1288],{"class":1278},[1060,8268,1876],{"class":1278},[1060,8270,5389],{"class":1083},[1060,8272,1275],{"class":1274},[1060,8274,1279],{"class":1278},[1060,8276,8277,8279,8281,8283,8285,8287,8289,8291,8293,8295,8297],{"class":1062,"line":2291},[1060,8278,5687],{"class":1284},[1060,8280,1288],{"class":1278},[1060,8282,3470],{"class":1278},[1060,8284,5492],{"class":1070},[1060,8286,5008],{"class":1278},[1060,8288,5526],{"class":1274},[1060,8290,1782],{"class":1278},[1060,8292,4821],{"class":1274},[1060,8294,1782],{"class":1278},[1060,8296,1991],{"class":1274},[1060,8298,5708],{"class":1278},[1060,8300,8301,8303,8305],{"class":1062,"line":2297},[1060,8302,2387],{"class":1278},[1060,8304,1856],{"class":1274},[1060,8306,1306],{"class":1278},[1060,8308,8309,8311,8313,8315,8317],{"class":1062,"line":2302},[1060,8310,5723],{"class":1284},[1060,8312,1275],{"class":1278},[1060,8314,5728],{"class":1916},[1060,8316,1856],{"class":1278},[1060,8318,1354],{"class":1278},[1060,8320,8321],{"class":1062,"line":2334},[1060,8322,5738],{"class":1444},[1060,8324,8325,8327,8329,8331,8333,8335,8337,8339,8341,8343,8345],{"class":1062,"line":2350},[1060,8326,5744],{"class":1264},[1060,8328,1925],{"class":1284},[1060,8330,5728],{"class":1274},[1060,8332,1782],{"class":1278},[1060,8334,5753],{"class":1274},[1060,8336,3649],{"class":1278},[1060,8338,1365],{"class":1278},[1060,8340,3935],{"class":1070},[1060,8342,1303],{"class":1278},[1060,8344,3337],{"class":1284},[1060,8346,1279],{"class":1278},[1060,8348,8349,8351,8353,8355,8357,8359],{"class":1062,"line":2368},[1060,8350,5771],{"class":1083},[1060,8352,1275],{"class":1284},[1060,8354,1303],{"class":1278},[1060,8356,1761],{"class":1070},[1060,8358,1303],{"class":1278},[1060,8360,1465],{"class":1284},[1060,8362,8363],{"class":1062,"line":2384},[1060,8364,1451],{"class":1278},[1060,8366,8367],{"class":1062,"line":2392},[1060,8368,1376],{"class":1278},[1060,8370,8371,8373,8375,8377,8379],{"class":1062,"line":3342},[1060,8372,5797],{"class":1284},[1060,8374,1275],{"class":1278},[1060,8376,5802],{"class":1916},[1060,8378,1856],{"class":1278},[1060,8380,1354],{"class":1278},[1060,8382,8383,8385,8387,8389,8391],{"class":1062,"line":3381},[1060,8384,5812],{"class":1274},[1060,8386,1782],{"class":1278},[1060,8388,5817],{"class":1083},[1060,8390,1275],{"class":1284},[1060,8392,1279],{"class":1278},[1060,8394,8395,8397,8399,8401,8403,8405],{"class":1062,"line":3387},[1060,8396,5827],{"class":1284},[1060,8398,1288],{"class":1278},[1060,8400,1365],{"class":1278},[1060,8402,477],{"class":1070},[1060,8404,1303],{"class":1278},[1060,8406,1306],{"class":1278},[1060,8408,8409,8411,8413,8415,8417,8419],{"class":1062,"line":3392},[1060,8410,5843],{"class":1284},[1060,8412,1288],{"class":1278},[1060,8414,5848],{"class":1274},[1060,8416,1782],{"class":1278},[1060,8418,4088],{"class":1274},[1060,8420,1306],{"class":1278},[1060,8422,8423,8425,8427,8429,8431],{"class":1062,"line":3398},[1060,8424,5860],{"class":1284},[1060,8426,1288],{"class":1278},[1060,8428,1365],{"class":1278},[1060,8430,5802],{"class":1070},[1060,8432,1329],{"class":1278},[1060,8434,8435,8437],{"class":1062,"line":3418},[1060,8436,3512],{"class":1278},[1060,8438,1465],{"class":1284},[1060,8440,8441],{"class":1062,"line":3446},[1060,8442,3384],{"class":1278},[1060,8444,8445,8447],{"class":1062,"line":3462},[1060,8446,1462],{"class":1278},[1060,8448,1465],{"class":1274},[1060,8450,8451],{"class":1062,"line":3481},[1060,8452,1343],{"emptyLinePlaceholder":21},[1060,8454,8455,8457,8459,8461,8463,8465,8467,8469],{"class":1062,"line":3509},[1060,8456,5897],{"class":1561},[1060,8458,5900],{"class":1083},[1060,8460,1275],{"class":1278},[1060,8462,5905],{"class":1916},[1060,8464,1288],{"class":1278},[1060,8466,5910],{"class":1066},[1060,8468,1856],{"class":1278},[1060,8470,1354],{"class":1278},[1060,8472,8473,8475,8477,8479],{"class":1062,"line":3517},[1060,8474,5919],{"class":1274},[1060,8476,1782],{"class":1278},[1060,8478,5924],{"class":1083},[1060,8480,2642],{"class":1284},[1060,8482,8483,8485,8487,8489,8491,8493,8495,8497,8499],{"class":1062,"line":3522},[1060,8484,3327],{"class":1264},[1060,8486,1925],{"class":1284},[1060,8488,4816],{"class":1274},[1060,8490,1782],{"class":1278},[1060,8492,4821],{"class":1274},[1060,8494,1782],{"class":1278},[1060,8496,4826],{"class":1083},[1060,8498,4829],{"class":1284},[1060,8500,1279],{"class":1278},[1060,8502,8503,8505,8507,8509,8511,8513,8515,8517,8519,8521,8523,8525],{"class":1062,"line":3588},[1060,8504,5951],{"class":1274},[1060,8506,1782],{"class":1278},[1060,8508,5956],{"class":1083},[1060,8510,1275],{"class":1284},[1060,8512,1839],{"class":1278},[1060,8514,1693],{"class":1284},[1060,8516,1288],{"class":1278},[1060,8518,4962],{"class":1274},[1060,8520,1782],{"class":1278},[1060,8522,4821],{"class":1274},[1060,8524,1706],{"class":1278},[1060,8526,1465],{"class":1284},[1060,8528,8529,8531,8533,8535,8537],{"class":1062,"line":3593},[1060,8530,5979],{"class":1274},[1060,8532,1782],{"class":1278},[1060,8534,4821],{"class":1274},[1060,8536,2596],{"class":1278},[1060,8538,5988],{"class":1278},[1060,8540,8541],{"class":1062,"line":3598},[1060,8542,3384],{"class":1278},[1060,8544,8545],{"class":1062,"line":3604},[1060,8546,5024],{"class":1278},[1060,8548,8549],{"class":1062,"line":3634},[1060,8550,1343],{"emptyLinePlaceholder":21},[1060,8552,8553],{"class":1062,"line":3676},[1060,8554,6005],{"class":1444},[1060,8556,8557,8559,8561,8563,8565],{"class":1062,"line":3705},[1060,8558,6010],{"class":1083},[1060,8560,1275],{"class":1274},[1060,8562,1779],{"class":1278},[1060,8564,1799],{"class":1561},[1060,8566,1354],{"class":1278},[1060,8568,8569,8571,8573,8575,8577,8579,8581,8583,8585,8587,8589,8591,8593],{"class":1062,"line":3717},[1060,8570,3327],{"class":1264},[1060,8572,1925],{"class":1284},[1060,8574,5526],{"class":1274},[1060,8576,1782],{"class":1278},[1060,8578,4821],{"class":1274},[1060,8580,3644],{"class":1278},[1060,8582,1970],{"class":1274},[1060,8584,1782],{"class":1278},[1060,8586,3622],{"class":1274},[1060,8588,3649],{"class":1278},[1060,8590,3628],{"class":3359},[1060,8592,3337],{"class":1284},[1060,8594,1279],{"class":1278},[1060,8596,8597,8599,8601,8603],{"class":1062,"line":3733},[1060,8598,5951],{"class":1274},[1060,8600,1782],{"class":1278},[1060,8602,6055],{"class":1083},[1060,8604,2642],{"class":1284},[1060,8606,8607],{"class":1062,"line":3747},[1060,8608,3384],{"class":1278},[1060,8610,8611,8613],{"class":1062,"line":3754},[1060,8612,1462],{"class":1278},[1060,8614,1465],{"class":1274},[1060,8616,8617,8619,8621],{"class":1062,"line":3759},[1060,8618,1609],{"class":1278},[1060,8620,4733],{"class":1284},[1060,8622,1539],{"class":1278},[1060,8624,8625],{"class":1062,"line":3764},[1060,8626,1343],{"emptyLinePlaceholder":21},[1060,8628,8629,8631,8633],{"class":1062,"line":3770},[1060,8630,1533],{"class":1278},[1060,8632,1536],{"class":1284},[1060,8634,1539],{"class":1278},[1060,8636,8637,8639,8641,8643,8645,8647,8649,8651],{"class":1062,"line":3787},[1060,8638,1546],{"class":1278},[1060,8640,5051],{"class":1284},[1060,8642,5054],{"class":1561},[1060,8644,1565],{"class":1278},[1060,8646,1492],{"class":1278},[1060,8648,5061],{"class":1070},[1060,8650,1492],{"class":1278},[1060,8652,1539],{"class":1278},[1060,8654,8655,8657,8659,8661,8663],{"class":1062,"line":3809},[1060,8656,1555],{"class":1278},[1060,8658,1536],{"class":1284},[1060,8660,5074],{"class":1278},[1060,8662,7755],{"class":1561},[1060,8664,1539],{"class":1278},[1060,8666,8668,8670,8672],{"class":8667,"line":3827},[1062,1543],[1060,8669,1579],{"class":1278},[1060,8671,7765],{"class":1284},[1060,8673,1585],{"class":1278},[1060,8675,8677,8679,8681],{"class":8676,"line":3835},[1062,1543],[1060,8678,1590],{"class":1278},[1060,8680,1536],{"class":1284},[1060,8682,1539],{"class":1278},[1060,8684,8686,8688,8690,8692,8694],{"class":8685,"line":3852},[1062,1543],[1060,8687,1555],{"class":1278},[1060,8689,1536],{"class":1284},[1060,8691,5074],{"class":1278},[1060,8693,5077],{"class":1561},[1060,8695,1539],{"class":1278},[1060,8697,8698,8700,8702,8704,8706,8708,8710,8712],{"class":1062,"line":3871},[1060,8699,1579],{"class":1278},[1060,8701,5086],{"class":1284},[1060,8703,5089],{"class":1561},[1060,8705,1565],{"class":1278},[1060,8707,1492],{"class":1278},[1060,8709,6132],{"class":1070},[1060,8711,1492],{"class":1278},[1060,8713,1539],{"class":1278},[1060,8715,8716,8718],{"class":1062,"line":3879},[1060,8717,5105],{"class":1278},[1060,8719,6143],{"class":1284},[1060,8721,8722,8724,8726,8728,8730],{"class":1062,"line":3884},[1060,8723,6148],{"class":1561},[1060,8725,1565],{"class":1278},[1060,8727,1492],{"class":1278},[1060,8729,6155],{"class":1070},[1060,8731,5162],{"class":1278},[1060,8733,8734,8736,8738,8740,8742],{"class":1062,"line":3890},[1060,8735,5168],{"class":1561},[1060,8737,1565],{"class":1278},[1060,8739,1492],{"class":1278},[1060,8741,6168],{"class":1070},[1060,8743,5162],{"class":1278},[1060,8745,8746],{"class":1062,"line":3910},[1060,8747,6175],{"class":1561},[1060,8749,8750,8752,8754,8756,8758],{"class":1062,"line":3925},[1060,8751,6180],{"class":1561},[1060,8753,1565],{"class":1278},[1060,8755,1492],{"class":1278},[1060,8757,6187],{"class":1070},[1060,8759,5162],{"class":1278},[1060,8761,8762],{"class":1062,"line":3942},[1060,8763,5228],{"class":1278},[1060,8765,8766,8768,8770,8772,8774,8776,8778,8780,8782,8784,8786],{"class":1062,"line":3966},[1060,8767,5234],{"class":1278},[1060,8769,1536],{"class":1284},[1060,8771,5074],{"class":1278},[1060,8773,350],{"class":1561},[1060,8775,1565],{"class":1278},[1060,8777,1492],{"class":1278},[1060,8779,1839],{"class":1278},[1060,8781,6212],{"class":1274},[1060,8783,1462],{"class":1278},[1060,8785,1492],{"class":1278},[1060,8787,1539],{"class":1278},[1060,8789,8790,8792,8794,8796,8798,8800,8802,8804,8806,8808,8810,8812,8814,8816,8818,8820,8822,8824,8826,8828,8830,8832,8834,8836,8838,8840,8842,8844,8846,8848,8850,8852],{"class":1062,"line":3977},[1060,8791,6223],{"class":1278},[1060,8793,1536],{"class":1284},[1060,8795,6228],{"class":1264},[1060,8797,1565],{"class":1278},[1060,8799,1492],{"class":1278},[1060,8801,6235],{"class":1274},[1060,8803,1690],{"class":1278},[1060,8805,6240],{"class":1274},[1060,8807,6243],{"class":1278},[1060,8809,2591],{"class":1274},[1060,8811,1782],{"class":1278},[1060,8813,2172],{"class":1274},[1060,8815,1492],{"class":1278},[1060,8817,6254],{"class":1278},[1060,8819,6257],{"class":1561},[1060,8821,1565],{"class":1278},[1060,8823,6262],{"class":1278},[1060,8825,4088],{"class":1274},[1060,8827,1782],{"class":1278},[1060,8829,1991],{"class":1274},[1060,8831,1462],{"class":1278},[1060,8833,6273],{"class":1070},[1060,8835,5008],{"class":1278},[1060,8837,6278],{"class":1274},[1060,8839,1782],{"class":1278},[1060,8841,5753],{"class":1274},[1060,8843,1462],{"class":1278},[1060,8845,6273],{"class":1070},[1060,8847,5008],{"class":1278},[1060,8849,6291],{"class":1274},[1060,8851,6294],{"class":1278},[1060,8853,1539],{"class":1278},[1060,8855,8856,8858,8860,8862,8864,8866,8868,8870,8872,8874,8876,8878,8880,8882,8884,8886,8888,8890,8892,8894,8896,8898,8900],{"class":1062,"line":3985},[1060,8857,6301],{"class":1278},[1060,8859,6304],{"class":1284},[1060,8861,6307],{"class":1561},[1060,8863,1565],{"class":1278},[1060,8865,1492],{"class":1278},[1060,8867,6314],{"class":1070},[1060,8869,1492],{"class":1278},[1060,8871,6319],{"class":1561},[1060,8873,1565],{"class":1278},[1060,8875,1492],{"class":1278},[1060,8877,6326],{"class":1070},[1060,8879,1492],{"class":1278},[1060,8881,6331],{"class":1561},[1060,8883,1565],{"class":1278},[1060,8885,1492],{"class":1278},[1060,8887,6338],{"class":1070},[1060,8889,1492],{"class":1278},[1060,8891,5089],{"class":1561},[1060,8893,1565],{"class":1278},[1060,8895,1492],{"class":1278},[1060,8897,6349],{"class":1070},[1060,8899,1492],{"class":1278},[1060,8901,1585],{"class":1278},[1060,8903,8904,8906,8908,8910,8912,8914,8916,8918,8920,8922,8924,8926,8928,8930,8932,8934,8936],{"class":1062,"line":3991},[1060,8905,6301],{"class":1278},[1060,8907,960],{"class":1284},[1060,8909,6362],{"class":1561},[1060,8911,1565],{"class":1278},[1060,8913,1492],{"class":1278},[1060,8915,6369],{"class":1070},[1060,8917,1492],{"class":1278},[1060,8919,5089],{"class":1561},[1060,8921,1565],{"class":1278},[1060,8923,1492],{"class":1278},[1060,8925,6380],{"class":1070},[1060,8927,1492],{"class":1278},[1060,8929,2639],{"class":1278},[1060,8931,6387],{"class":1274},[1060,8933,1609],{"class":1278},[1060,8935,960],{"class":1284},[1060,8937,1539],{"class":1278},[1060,8939,8940,8942,8944],{"class":1062,"line":3996},[1060,8941,6398],{"class":1278},[1060,8943,1536],{"class":1284},[1060,8945,1539],{"class":1278},[1060,8947,8948,8950,8952],{"class":1062,"line":4019},[1060,8949,6407],{"class":1278},[1060,8951,1536],{"class":1284},[1060,8953,1539],{"class":1278},[1060,8955,8956,8958,8960],{"class":1062,"line":4025},[1060,8957,5131],{"class":1278},[1060,8959,4704],{"class":1284},[1060,8961,1539],{"class":1278},[1060,8963,8964],{"class":1062,"line":4045},[1060,8965,1343],{"emptyLinePlaceholder":21},[1060,8967,8968,8970],{"class":1062,"line":4051},[1060,8969,5105],{"class":1278},[1060,8971,5147],{"class":1284},[1060,8973,8974,8976,8978,8980,8982],{"class":1062,"line":4097},[1060,8975,5153],{"class":1561},[1060,8977,1565],{"class":1278},[1060,8979,1492],{"class":1278},[1060,8981,4816],{"class":1070},[1060,8983,5162],{"class":1278},[1060,8985,8986,8988,8990,8992,8994],{"class":1062,"line":4113},[1060,8987,6446],{"class":1561},[1060,8989,1565],{"class":1278},[1060,8991,1492],{"class":1278},[1060,8993,6453],{"class":1070},[1060,8995,5162],{"class":1278},[1060,8997,8998,9000,9002,9004,9006],{"class":1062,"line":4146},[1060,8999,5183],{"class":1561},[1060,9001,1565],{"class":1278},[1060,9003,1492],{"class":1278},[1060,9005,5190],{"class":1070},[1060,9007,5162],{"class":1278},[1060,9009,9010,9012,9014,9016,9018],{"class":1062,"line":4160},[1060,9011,6180],{"class":1561},[1060,9013,1565],{"class":1278},[1060,9015,1492],{"class":1278},[1060,9017,6478],{"class":1070},[1060,9019,5162],{"class":1278},[1060,9021,9022,9024,9026,9028,9030],{"class":1062,"line":4168},[1060,9023,5213],{"class":1561},[1060,9025,1565],{"class":1278},[1060,9027,1492],{"class":1278},[1060,9029,6491],{"class":1070},[1060,9031,5162],{"class":1278},[1060,9033,9034],{"class":1062,"line":4173},[1060,9035,5228],{"class":1278},[1060,9037,9038,9040],{"class":1062,"line":4180},[1060,9039,5234],{"class":1278},[1060,9041,6504],{"class":1284},[1060,9043,9044,9046,9048,9050,9052],{"class":1062,"line":4185},[1060,9045,6509],{"class":1561},[1060,9047,1565],{"class":1278},[1060,9049,1492],{"class":1278},[1060,9051,6168],{"class":1070},[1060,9053,5162],{"class":1278},[1060,9055,9056,9058,9060,9062,9064],{"class":1062,"line":4203},[1060,9057,6522],{"class":1561},[1060,9059,1565],{"class":1278},[1060,9061,1492],{"class":1278},[1060,9063,5247],{"class":1070},[1060,9065,5162],{"class":1278},[1060,9067,9068,9070,9072,9074,9076],{"class":1062,"line":6566},[1060,9069,6535],{"class":1561},[1060,9071,1565],{"class":1278},[1060,9073,1492],{"class":1278},[1060,9075,6542],{"class":1070},[1060,9077,5162],{"class":1278},[1060,9079,9080,9082,9084,9086,9088],{"class":1062,"line":6575},[1060,9081,6549],{"class":1561},[1060,9083,1565],{"class":1278},[1060,9085,1492],{"class":1278},[1060,9087,6556],{"class":1070},[1060,9089,5162],{"class":1278},[1060,9091,9092],{"class":1062,"line":6584},[1060,9093,6563],{"class":1278},[1060,9095,9096,9098,9100],{"class":1062,"line":6593},[1060,9097,5131],{"class":1278},[1060,9099,4698],{"class":1284},[1060,9101,1539],{"class":1278},[1060,9103,9104,9106,9108],{"class":1062,"line":6602},[1060,9105,5265],{"class":1278},[1060,9107,5086],{"class":1284},[1060,9109,1539],{"class":1278},[1060,9111,9113,9115,9117],{"class":1062,"line":9112},91,[1060,9114,1590],{"class":1278},[1060,9116,1536],{"class":1284},[1060,9118,1539],{"class":1278},[1060,9120,9122,9124,9126],{"class":1062,"line":9121},92,[1060,9123,1600],{"class":1278},[1060,9125,5051],{"class":1284},[1060,9127,1539],{"class":1278},[1060,9129,9131,9133,9135],{"class":1062,"line":9130},93,[1060,9132,1609],{"class":1278},[1060,9134,1536],{"class":1284},[1060,9136,1539],{"class":1278},[960,9138,4246,9139,9142,9143,9145],{},[1057,9140,9141],{},"refreshNuxtData('chats')"," call in the chat page's ",[1057,9144,6670],{}," callback (as shown earlier) ensures the chat list updates automatically when a new title is generated.",[964,9147,9149],{"id":9148},"adding-multi-model-support","Adding multi-model support",[960,9151,9152,9153,9156],{},"One of the benefits of using ",[1035,9154,4215],{"href":1037,"rel":9155},[1039]," is the ability to switch between models seamlessly. This section adds a model selector to the chat.",[1088,9158,9160],{"id":9159},"creating-a-models-composable","Creating a models composable",[960,9162,9163,9164,1288],{},"Define the available models and persist the user's selection using ",[1035,9165,9168],{"href":9166,"rel":9167},"https://nuxt.com/docs/api/composables/use-cookie",[1039],[1057,9169,9170],{},"useCookie",[1251,9172,9173],{},[1050,9174,9177],{"className":1255,"code":9175,"filename":9176,"language":1257,"meta":1055,"style":1055},"export function useModels() {\n  const models = [\n    { value: 'openai/gpt-4o-mini', label: 'GPT-4o Mini', icon: 'i-simple-icons-openai' },\n    { value: 'anthropic/claude-3-5-haiku-latest', label: 'Claude 3.5 Haiku', icon: 'i-simple-icons-anthropic' },\n    { value: 'google/gemini-2.0-flash', label: 'Gemini 2.0 Flash', icon: 'i-simple-icons-google' }\n  ]\n\n  const model = useCookie\u003Cstring>('ai-model', {\n    default: () => 'openai/gpt-4o-mini'\n  })\n\n  return {\n    models,\n    model\n  }\n}\n","app/composables/useModels.ts",[1057,9178,9179,9192,9203,9249,9292,9336,9341,9345,9375,9392,9398,9402,9408,9415,9420,9424],{"__ignoreMap":1055},[1060,9180,9181,9183,9185,9188,9190],{"class":1062,"line":1063},[1060,9182,1265],{"class":1264},[1060,9184,4798],{"class":1561},[1060,9186,9187],{"class":1083}," useModels",[1060,9189,1779],{"class":1278},[1060,9191,1354],{"class":1278},[1060,9193,9194,9196,9199,9201],{"class":1062,"line":1080},[1060,9195,2586],{"class":1561},[1060,9197,9198],{"class":1274}," models",[1060,9200,2596],{"class":1278},[1060,9202,1291],{"class":1284},[1060,9204,9205,9208,9211,9213,9215,9217,9219,9221,9224,9226,9228,9231,9233,9235,9238,9240,9242,9245,9247],{"class":1062,"line":1294},[1060,9206,9207],{"class":1278},"    {",[1060,9209,9210],{"class":1284}," value",[1060,9212,1288],{"class":1278},[1060,9214,1365],{"class":1278},[1060,9216,3181],{"class":1070},[1060,9218,1303],{"class":1278},[1060,9220,1690],{"class":1278},[1060,9222,9223],{"class":1284}," label",[1060,9225,1288],{"class":1278},[1060,9227,1365],{"class":1278},[1060,9229,9230],{"class":1070},"GPT-4o Mini",[1060,9232,1303],{"class":1278},[1060,9234,1690],{"class":1278},[1060,9236,9237],{"class":1284}," icon",[1060,9239,1288],{"class":1278},[1060,9241,1365],{"class":1278},[1060,9243,9244],{"class":1070},"i-simple-icons-openai",[1060,9246,1303],{"class":1278},[1060,9248,3963],{"class":1278},[1060,9250,9251,9253,9255,9257,9259,9262,9264,9266,9268,9270,9272,9275,9277,9279,9281,9283,9285,9288,9290],{"class":1062,"line":1309},[1060,9252,9207],{"class":1278},[1060,9254,9210],{"class":1284},[1060,9256,1288],{"class":1278},[1060,9258,1365],{"class":1278},[1060,9260,9261],{"class":1070},"anthropic/claude-3-5-haiku-latest",[1060,9263,1303],{"class":1278},[1060,9265,1690],{"class":1278},[1060,9267,9223],{"class":1284},[1060,9269,1288],{"class":1278},[1060,9271,1365],{"class":1278},[1060,9273,9274],{"class":1070},"Claude 3.5 Haiku",[1060,9276,1303],{"class":1278},[1060,9278,1690],{"class":1278},[1060,9280,9237],{"class":1284},[1060,9282,1288],{"class":1278},[1060,9284,1365],{"class":1278},[1060,9286,9287],{"class":1070},"i-simple-icons-anthropic",[1060,9289,1303],{"class":1278},[1060,9291,3963],{"class":1278},[1060,9293,9294,9296,9298,9300,9302,9305,9307,9309,9311,9313,9315,9318,9320,9322,9324,9326,9328,9331,9333],{"class":1062,"line":1321},[1060,9295,9207],{"class":1278},[1060,9297,9210],{"class":1284},[1060,9299,1288],{"class":1278},[1060,9301,1365],{"class":1278},[1060,9303,9304],{"class":1070},"google/gemini-2.0-flash",[1060,9306,1303],{"class":1278},[1060,9308,1690],{"class":1278},[1060,9310,9223],{"class":1284},[1060,9312,1288],{"class":1278},[1060,9314,1365],{"class":1278},[1060,9316,9317],{"class":1070},"Gemini 2.0 Flash",[1060,9319,1303],{"class":1278},[1060,9321,1690],{"class":1278},[1060,9323,9237],{"class":1284},[1060,9325,1288],{"class":1278},[1060,9327,1365],{"class":1278},[1060,9329,9330],{"class":1070},"i-simple-icons-google",[1060,9332,1303],{"class":1278},[1060,9334,9335],{"class":1278}," }\n",[1060,9337,9338],{"class":1062,"line":1332},[1060,9339,9340],{"class":1284},"  ]\n",[1060,9342,9343],{"class":1062,"line":1340},[1060,9344,1343],{"emptyLinePlaceholder":21},[1060,9346,9347,9349,9351,9353,9356,9358,9360,9362,9364,9366,9369,9371,9373],{"class":1062,"line":1346},[1060,9348,2586],{"class":1561},[1060,9350,3125],{"class":1274},[1060,9352,2596],{"class":1278},[1060,9354,9355],{"class":1083}," useCookie",[1060,9357,1533],{"class":1278},[1060,9359,3098],{"class":1066},[1060,9361,2639],{"class":1278},[1060,9363,1275],{"class":1284},[1060,9365,1303],{"class":1278},[1060,9367,9368],{"class":1070},"ai-model",[1060,9370,1303],{"class":1278},[1060,9372,1690],{"class":1278},[1060,9374,1354],{"class":1278},[1060,9376,9377,9380,9382,9384,9386,9388,9390],{"class":1062,"line":1357},[1060,9378,9379],{"class":1083},"    default",[1060,9381,1288],{"class":1278},[1060,9383,4583],{"class":1278},[1060,9385,1799],{"class":1561},[1060,9387,1365],{"class":1278},[1060,9389,3181],{"class":1070},[1060,9391,1329],{"class":1278},[1060,9393,9394,9396],{"class":1062,"line":1373},[1060,9395,2387],{"class":1278},[1060,9397,1465],{"class":1284},[1060,9399,9400],{"class":1062,"line":1379},[1060,9401,1343],{"emptyLinePlaceholder":21},[1060,9403,9404,9406],{"class":1062,"line":1384},[1060,9405,2813],{"class":1264},[1060,9407,1354],{"class":1278},[1060,9409,9410,9413],{"class":1062,"line":1407},[1060,9411,9412],{"class":1274},"    models",[1060,9414,1306],{"class":1278},[1060,9416,9417],{"class":1062,"line":1412},[1060,9418,9419],{"class":1274},"    model\n",[1060,9421,9422],{"class":1062,"line":1422},[1060,9423,3384],{"class":1278},[1060,9425,9426],{"class":1062,"line":1432},[1060,9427,5024],{"class":1278},[1088,9429,9431],{"id":9430},"building-the-model-selector","Building the model selector",[960,9433,1616,9434,9439],{},[1035,9435,9436],{"href":714},[1057,9437,9438],{},"USelectMenu"," component that displays the available models:",[1251,9441,9442],{},[1050,9443,9446],{"className":1523,"code":9444,"filename":9445,"language":34,"meta":1055,"style":1055},"\u003Cscript setup lang=\"ts\">\nconst model = defineModel\u003Cstring>({ required: true })\n\nconst { models } = useModels()\n\nconst selectedModel = computed(() =>\n  models.find(m => m.value === model.value)\n)\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CUSelectMenu\n    v-model=\"model\"\n    :items=\"models\"\n    :icon=\"selectedModel?.icon\"\n    variant=\"ghost\"\n    value-key=\"value\"\n  />\n\u003C/template>\n","app/components/ModelSelect.vue",[1057,9447,9448,9468,9501,9505,9522,9526,9544,9578,9582,9590,9594,9602,9609,9622,9636,9650,9663,9676,9681],{"__ignoreMap":1055},[1060,9449,9450,9452,9454,9456,9458,9460,9462,9464,9466],{"class":1062,"line":1063},[1060,9451,1533],{"class":1278},[1060,9453,4733],{"class":1284},[1060,9455,4736],{"class":1561},[1060,9457,4739],{"class":1561},[1060,9459,1565],{"class":1278},[1060,9461,1492],{"class":1278},[1060,9463,1257],{"class":1070},[1060,9465,1492],{"class":1278},[1060,9467,1539],{"class":1278},[1060,9469,9470,9472,9475,9477,9480,9482,9484,9486,9488,9490,9493,9495,9497,9499],{"class":1062,"line":1080},[1060,9471,4754],{"class":1561},[1060,9473,9474],{"class":1274}," model ",[1060,9476,1565],{"class":1278},[1060,9478,9479],{"class":1083}," defineModel",[1060,9481,1533],{"class":1278},[1060,9483,3098],{"class":1066},[1060,9485,2639],{"class":1278},[1060,9487,1275],{"class":1274},[1060,9489,1839],{"class":1278},[1060,9491,9492],{"class":1284}," required",[1060,9494,1288],{"class":1278},[1060,9496,5572],{"class":1440},[1060,9498,1706],{"class":1278},[1060,9500,1465],{"class":1274},[1060,9502,9503],{"class":1062,"line":1294},[1060,9504,1343],{"emptyLinePlaceholder":21},[1060,9506,9507,9509,9511,9514,9516,9518,9520],{"class":1062,"line":1309},[1060,9508,4754],{"class":1561},[1060,9510,1684],{"class":1278},[1060,9512,9513],{"class":1274}," models ",[1060,9515,1462],{"class":1278},[1060,9517,2596],{"class":1278},[1060,9519,9187],{"class":1083},[1060,9521,2642],{"class":1274},[1060,9523,9524],{"class":1062,"line":1321},[1060,9525,1343],{"emptyLinePlaceholder":21},[1060,9527,9528,9530,9533,9535,9537,9539,9541],{"class":1062,"line":1332},[1060,9529,4754],{"class":1561},[1060,9531,9532],{"class":1274}," selectedModel ",[1060,9534,1565],{"class":1278},[1060,9536,7081],{"class":1083},[1060,9538,1275],{"class":1274},[1060,9540,1779],{"class":1278},[1060,9542,9543],{"class":1561}," =>\n",[1060,9545,9546,9549,9551,9554,9556,9559,9561,9564,9566,9569,9571,9573,9575],{"class":1062,"line":1340},[1060,9547,9548],{"class":1274},"  models",[1060,9550,1782],{"class":1278},[1060,9552,9553],{"class":1083},"find",[1060,9555,1275],{"class":1274},[1060,9557,9558],{"class":1916},"m",[1060,9560,1799],{"class":1561},[1060,9562,9563],{"class":1274}," m",[1060,9565,1782],{"class":1278},[1060,9567,9568],{"class":1274},"value ",[1060,9570,7160],{"class":1278},[1060,9572,3125],{"class":1274},[1060,9574,1782],{"class":1278},[1060,9576,9577],{"class":1274},"value)\n",[1060,9579,9580],{"class":1062,"line":1346},[1060,9581,1465],{"class":1274},[1060,9583,9584,9586,9588],{"class":1062,"line":1357},[1060,9585,1609],{"class":1278},[1060,9587,4733],{"class":1284},[1060,9589,1539],{"class":1278},[1060,9591,9592],{"class":1062,"line":1373},[1060,9593,1343],{"emptyLinePlaceholder":21},[1060,9595,9596,9598,9600],{"class":1062,"line":1379},[1060,9597,1533],{"class":1278},[1060,9599,1536],{"class":1284},[1060,9601,1539],{"class":1278},[1060,9603,9604,9606],{"class":1062,"line":1384},[1060,9605,1546],{"class":1278},[1060,9607,9608],{"class":1284},"USelectMenu\n",[1060,9610,9611,9614,9616,9618,9620],{"class":1062,"line":1407},[1060,9612,9613],{"class":1561},"    v-model",[1060,9615,1565],{"class":1278},[1060,9617,1492],{"class":1278},[1060,9619,4259],{"class":1070},[1060,9621,5162],{"class":1278},[1060,9623,9624,9627,9629,9631,9634],{"class":1062,"line":1412},[1060,9625,9626],{"class":1561},"    :items",[1060,9628,1565],{"class":1278},[1060,9630,1492],{"class":1278},[1060,9632,9633],{"class":1070},"models",[1060,9635,5162],{"class":1278},[1060,9637,9638,9641,9643,9645,9648],{"class":1062,"line":1422},[1060,9639,9640],{"class":1561},"    :icon",[1060,9642,1565],{"class":1278},[1060,9644,1492],{"class":1278},[1060,9646,9647],{"class":1070},"selectedModel?.icon",[1060,9649,5162],{"class":1278},[1060,9651,9652,9655,9657,9659,9661],{"class":1062,"line":1432},[1060,9653,9654],{"class":1561},"    variant",[1060,9656,1565],{"class":1278},[1060,9658,1492],{"class":1278},[1060,9660,7362],{"class":1070},[1060,9662,5162],{"class":1278},[1060,9664,9665,9668,9670,9672,9674],{"class":1062,"line":1448},[1060,9666,9667],{"class":1561},"    value-key",[1060,9669,1565],{"class":1278},[1060,9671,1492],{"class":1278},[1060,9673,4821],{"class":1070},[1060,9675,5162],{"class":1278},[1060,9677,9678],{"class":1062,"line":1454},[1060,9679,9680],{"class":1278},"  />\n",[1060,9682,9683,9685,9687],{"class":1062,"line":1459},[1060,9684,1609],{"class":1278},[1060,9686,1536],{"class":1284},[1060,9688,1539],{"class":1278},[1088,9690,9692],{"id":9691},"integrating-with-the-chat","Integrating with the chat",[960,9694,9695],{},"Update the chat page to include the model selector and pass the selected model to the server:",[1251,9697,9698],{},[1669,9699,9700],{},[1050,9701,9704],{"className":1523,"code":9702,"filename":5356,"highlights":9703,"language":34,"meta":1055,"style":1055},"\u003Cscript setup lang=\"ts\">\nimport { DefaultChatTransport } from 'ai'\nimport { Chat } from '@ai-sdk/vue'\n\nconst route = useRoute()\nconst toast = useToast()\nconst { model } = useModels()\n\nconst { data: chatData } = await useFetch(`/api/chats/${route.params.id}`)\n\nif (!chatData.value) {\n  throw createError({ statusCode: 404, statusMessage: 'Chat not found', fatal: true })\n}\n\nconst input = ref('')\n\nconst chat = new Chat({\n  id: chatData.value.id,\n  messages: chatData.value.messages,\n  transport: new DefaultChatTransport({\n    api: `/api/chats/${chatData.value.id}`,\n    body: {\n      model: model.value // Pass the selected model\n    }\n  }),\n  onData(dataPart) {\n    if (dataPart.type === 'data-chat-title') {\n      refreshNuxtData('chats')\n    }\n  },\n  onError(error) {\n    toast.add({\n      title: 'Error',\n      description: error.message,\n      color: 'error'\n    })\n  }\n})\n\nfunction handleSubmit(e: Event) {\n  e.preventDefault()\n  if (input.value.trim()) {\n    chat.sendMessage({ text: input.value })\n    input.value = ''\n  }\n}\n\nonMounted(() => {\n  if (chatData.value?.messages.length === 1) {\n    chat.regenerate()\n  }\n})\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CUDashboardPanel :ui=\"{ body: 'p-0 sm:p-0' }\">\n    \u003Ctemplate #header>\n      \u003CChatsHistory />\n    \u003C/template>\n    \u003Ctemplate #body>\n      \u003CUContainer class=\"min-h-dvh flex flex-col py-4 sm:py-6\">\n        \u003CUChatMessages\n          :messages=\"chat.messages\"\n          :status=\"chat.status\"\n          should-auto-scroll\n          class=\"flex-1\"\n        >\n          \u003Ctemplate #content=\"{ message }\">\n            \u003Ctemplate v-for=\"(part, index) in message.parts\" :key=\"`${message.id}-${part.type}-${index}`\">\n              \u003CMDC v-if=\"part.type === 'text' && message.role === 'assistant'\" :value=\"part.text\" :cache-key=\"`${message.id}-${index}`\" class=\"*:first:mt-0 *:last:mb-0\" />\n              \u003Cp v-else-if=\"part.type === 'text' && message.role === 'user'\" class=\"whitespace-pre-wrap\">{{ part.text }}\u003C/p>\n            \u003C/template>\n          \u003C/template>\n        \u003C/UChatMessages>\n\n        \u003CUChatPrompt\n          v-model=\"input\"\n          :error=\"chat.error\"\n          variant=\"subtle\"\n          class=\"sticky bottom-0\"\n          @submit=\"handleSubmit\"\n        >\n          \u003Ctemplate #footer>\n            \u003CModelSelect v-model=\"model\" />\n          \u003C/template>\n\n          \u003CUChatPromptSubmit\n            :status=\"chat.status\"\n            color=\"neutral\"\n            @stop=\"chat.stop()\"\n            @reload=\"chat.regenerate()\"\n          />\n        \u003C/UChatPrompt>\n      \u003C/UContainer>\n    \u003C/template>\n  \u003C/UDashboardPanel>\n\u003C/template>\n",[1346,2297,2302,2334,4203,6566,6575],[1057,9705,9706,9726,9744,9762,9766,9778,9790,9806,9811,9853,9857,9873,9913,9917,9921,9937,9941,9957,9975,9993,10007,10033,10041,10057,10062,10071,10083,10107,10121,10125,10129,10141,10153,10167,10181,10193,10199,10203,10209,10213,10231,10241,10261,10287,10299,10303,10307,10311,10323,10351,10361,10365,10371,10379,10383,10391,10409,10421,10429,10437,10449,10467,10473,10485,10497,10501,10513,10517,10541,10607,10655,10691,10699,10707,10715,10719,10725,10737,10749,10761,10773,10785,10789,10802,10822,10831,10836,10843,10855,10867,10879,10891,10895,10903,10912,10921,10930],{"__ignoreMap":1055},[1060,9707,9708,9710,9712,9714,9716,9718,9720,9722,9724],{"class":1062,"line":1063},[1060,9709,1533],{"class":1278},[1060,9711,4733],{"class":1284},[1060,9713,4736],{"class":1561},[1060,9715,4739],{"class":1561},[1060,9717,1565],{"class":1278},[1060,9719,1492],{"class":1278},[1060,9721,1257],{"class":1070},[1060,9723,1492],{"class":1278},[1060,9725,1539],{"class":1278},[1060,9727,9728,9730,9732,9734,9736,9738,9740,9742],{"class":1062,"line":1080},[1060,9729,1681],{"class":1264},[1060,9731,1684],{"class":1278},[1060,9733,5389],{"class":1274},[1060,9735,1706],{"class":1278},[1060,9737,1709],{"class":1264},[1060,9739,1365],{"class":1278},[1060,9741,2507],{"class":1070},[1060,9743,1329],{"class":1278},[1060,9745,9746,9748,9750,9752,9754,9756,9758,9760],{"class":1062,"line":1294},[1060,9747,1681],{"class":1264},[1060,9749,1684],{"class":1278},[1060,9751,5409],{"class":1274},[1060,9753,1706],{"class":1278},[1060,9755,1709],{"class":1264},[1060,9757,1365],{"class":1278},[1060,9759,5418],{"class":1070},[1060,9761,1329],{"class":1278},[1060,9763,9764],{"class":1062,"line":1309},[1060,9765,1343],{"emptyLinePlaceholder":21},[1060,9767,9768,9770,9772,9774,9776],{"class":1062,"line":1321},[1060,9769,4754],{"class":1561},[1060,9771,5432],{"class":1274},[1060,9773,1565],{"class":1278},[1060,9775,5437],{"class":1083},[1060,9777,2642],{"class":1274},[1060,9779,9780,9782,9784,9786,9788],{"class":1062,"line":1332},[1060,9781,4754],{"class":1561},[1060,9783,5446],{"class":1274},[1060,9785,1565],{"class":1278},[1060,9787,5451],{"class":1083},[1060,9789,2642],{"class":1274},[1060,9791,9792,9794,9796,9798,9800,9802,9804],{"class":1062,"line":1340},[1060,9793,4754],{"class":1561},[1060,9795,1684],{"class":1278},[1060,9797,9474],{"class":1274},[1060,9799,1462],{"class":1278},[1060,9801,2596],{"class":1278},[1060,9803,9187],{"class":1083},[1060,9805,2642],{"class":1274},[1060,9807,9809],{"class":9808,"line":1346},[1062,1543],[1060,9810,1343],{"emptyLinePlaceholder":21},[1060,9812,9813,9815,9817,9819,9821,9823,9825,9827,9829,9831,9833,9835,9837,9839,9841,9843,9845,9847,9849,9851],{"class":1062,"line":1357},[1060,9814,4754],{"class":1561},[1060,9816,1684],{"class":1278},[1060,9818,5471],{"class":1284},[1060,9820,1288],{"class":1278},[1060,9822,5476],{"class":1274},[1060,9824,1462],{"class":1278},[1060,9826,2596],{"class":1278},[1060,9828,2599],{"class":1264},[1060,9830,5485],{"class":1083},[1060,9832,1275],{"class":1274},[1060,9834,3476],{"class":1278},[1060,9836,5492],{"class":1070},[1060,9838,5008],{"class":1278},[1060,9840,5497],{"class":1274},[1060,9842,1782],{"class":1278},[1060,9844,5502],{"class":1274},[1060,9846,1782],{"class":1278},[1060,9848,1991],{"class":1274},[1060,9850,5017],{"class":1278},[1060,9852,1465],{"class":1274},[1060,9854,9855],{"class":1062,"line":1373},[1060,9856,1343],{"emptyLinePlaceholder":21},[1060,9858,9859,9861,9863,9865,9867,9869,9871],{"class":1062,"line":1379},[1060,9860,5519],{"class":1264},[1060,9862,1925],{"class":1274},[1060,9864,3332],{"class":1278},[1060,9866,5526],{"class":1274},[1060,9868,1782],{"class":1278},[1060,9870,5531],{"class":1274},[1060,9872,1279],{"class":1278},[1060,9874,9875,9877,9879,9881,9883,9885,9887,9889,9891,9893,9895,9897,9899,9901,9903,9905,9907,9909,9911],{"class":1062,"line":1384},[1060,9876,5538],{"class":1264},[1060,9878,2872],{"class":1083},[1060,9880,1275],{"class":1284},[1060,9882,1839],{"class":1278},[1060,9884,3354],{"class":1284},[1060,9886,1288],{"class":1278},[1060,9888,3360],{"class":3359},[1060,9890,1690],{"class":1278},[1060,9892,3365],{"class":1284},[1060,9894,1288],{"class":1278},[1060,9896,1365],{"class":1278},[1060,9898,3372],{"class":1070},[1060,9900,1303],{"class":1278},[1060,9902,1690],{"class":1278},[1060,9904,5567],{"class":1284},[1060,9906,1288],{"class":1278},[1060,9908,5572],{"class":1440},[1060,9910,1706],{"class":1278},[1060,9912,1465],{"class":1284},[1060,9914,9915],{"class":1062,"line":1407},[1060,9916,5024],{"class":1278},[1060,9918,9919],{"class":1062,"line":1412},[1060,9920,1343],{"emptyLinePlaceholder":21},[1060,9922,9923,9925,9927,9929,9931,9933,9935],{"class":1062,"line":1422},[1060,9924,4754],{"class":1561},[1060,9926,4757],{"class":1274},[1060,9928,1565],{"class":1278},[1060,9930,4762],{"class":1083},[1060,9932,1275],{"class":1274},[1060,9934,4767],{"class":1278},[1060,9936,1465],{"class":1274},[1060,9938,9939],{"class":1062,"line":1432},[1060,9940,1343],{"emptyLinePlaceholder":21},[1060,9942,9943,9945,9947,9949,9951,9953,9955],{"class":1062,"line":1448},[1060,9944,4754],{"class":1561},[1060,9946,5616],{"class":1274},[1060,9948,1565],{"class":1278},[1060,9950,1876],{"class":1278},[1060,9952,5409],{"class":1083},[1060,9954,1275],{"class":1274},[1060,9956,1279],{"class":1278},[1060,9958,9959,9961,9963,9965,9967,9969,9971,9973],{"class":1062,"line":1454},[1060,9960,1772],{"class":1284},[1060,9962,1288],{"class":1278},[1060,9964,5636],{"class":1274},[1060,9966,1782],{"class":1278},[1060,9968,4821],{"class":1274},[1060,9970,1782],{"class":1278},[1060,9972,1991],{"class":1274},[1060,9974,1306],{"class":1278},[1060,9976,9977,9979,9981,9983,9985,9987,9989,9991],{"class":1062,"line":1459},[1060,9978,1932],{"class":1284},[1060,9980,1288],{"class":1278},[1060,9982,5636],{"class":1274},[1060,9984,1782],{"class":1278},[1060,9986,4821],{"class":1274},[1060,9988,1782],{"class":1278},[1060,9990,1970],{"class":1274},[1060,9992,1306],{"class":1278},[1060,9994,9995,9997,9999,10001,10003,10005],{"class":1062,"line":2248},[1060,9996,5671],{"class":1284},[1060,9998,1288],{"class":1278},[1060,10000,1876],{"class":1278},[1060,10002,5389],{"class":1083},[1060,10004,1275],{"class":1274},[1060,10006,1279],{"class":1278},[1060,10008,10009,10011,10013,10015,10017,10019,10021,10023,10025,10027,10029,10031],{"class":1062,"line":2261},[1060,10010,5687],{"class":1284},[1060,10012,1288],{"class":1278},[1060,10014,3470],{"class":1278},[1060,10016,5492],{"class":1070},[1060,10018,5008],{"class":1278},[1060,10020,5526],{"class":1274},[1060,10022,1782],{"class":1278},[1060,10024,4821],{"class":1274},[1060,10026,1782],{"class":1278},[1060,10028,1991],{"class":1274},[1060,10030,5017],{"class":1278},[1060,10032,1306],{"class":1278},[1060,10034,10035,10037,10039],{"class":1062,"line":2291},[1060,10036,4905],{"class":1284},[1060,10038,1288],{"class":1278},[1060,10040,1354],{"class":1278},[1060,10042,10044,10046,10048,10050,10052,10054],{"class":10043,"line":2297},[1062,1543],[1060,10045,3449],{"class":1284},[1060,10047,1288],{"class":1278},[1060,10049,3125],{"class":1274},[1060,10051,1782],{"class":1278},[1060,10053,9568],{"class":1274},[1060,10055,10056],{"class":1444},"// Pass the selected model\n",[1060,10058,10060],{"class":10059,"line":2302},[1062,1543],[1060,10061,1451],{"class":1278},[1060,10063,10065,10067,10069],{"class":10064,"line":2334},[1062,1543],[1060,10066,2387],{"class":1278},[1060,10068,1856],{"class":1274},[1060,10070,1306],{"class":1278},[1060,10072,10073,10075,10077,10079,10081],{"class":1062,"line":2350},[1060,10074,5723],{"class":1284},[1060,10076,1275],{"class":1278},[1060,10078,5728],{"class":1916},[1060,10080,1856],{"class":1278},[1060,10082,1354],{"class":1278},[1060,10084,10085,10087,10089,10091,10093,10095,10097,10099,10101,10103,10105],{"class":1062,"line":2368},[1060,10086,5744],{"class":1264},[1060,10088,1925],{"class":1284},[1060,10090,5728],{"class":1274},[1060,10092,1782],{"class":1278},[1060,10094,5753],{"class":1274},[1060,10096,3649],{"class":1278},[1060,10098,1365],{"class":1278},[1060,10100,3935],{"class":1070},[1060,10102,1303],{"class":1278},[1060,10104,3337],{"class":1284},[1060,10106,1279],{"class":1278},[1060,10108,10109,10111,10113,10115,10117,10119],{"class":1062,"line":2384},[1060,10110,5771],{"class":1083},[1060,10112,1275],{"class":1284},[1060,10114,1303],{"class":1278},[1060,10116,1761],{"class":1070},[1060,10118,1303],{"class":1278},[1060,10120,1465],{"class":1284},[1060,10122,10123],{"class":1062,"line":2392},[1060,10124,1451],{"class":1278},[1060,10126,10127],{"class":1062,"line":3342},[1060,10128,1376],{"class":1278},[1060,10130,10131,10133,10135,10137,10139],{"class":1062,"line":3381},[1060,10132,5797],{"class":1284},[1060,10134,1275],{"class":1278},[1060,10136,5802],{"class":1916},[1060,10138,1856],{"class":1278},[1060,10140,1354],{"class":1278},[1060,10142,10143,10145,10147,10149,10151],{"class":1062,"line":3387},[1060,10144,5812],{"class":1274},[1060,10146,1782],{"class":1278},[1060,10148,5817],{"class":1083},[1060,10150,1275],{"class":1284},[1060,10152,1279],{"class":1278},[1060,10154,10155,10157,10159,10161,10163,10165],{"class":1062,"line":3392},[1060,10156,5827],{"class":1284},[1060,10158,1288],{"class":1278},[1060,10160,1365],{"class":1278},[1060,10162,477],{"class":1070},[1060,10164,1303],{"class":1278},[1060,10166,1306],{"class":1278},[1060,10168,10169,10171,10173,10175,10177,10179],{"class":1062,"line":3398},[1060,10170,5843],{"class":1284},[1060,10172,1288],{"class":1278},[1060,10174,5848],{"class":1274},[1060,10176,1782],{"class":1278},[1060,10178,4088],{"class":1274},[1060,10180,1306],{"class":1278},[1060,10182,10183,10185,10187,10189,10191],{"class":1062,"line":3418},[1060,10184,5860],{"class":1284},[1060,10186,1288],{"class":1278},[1060,10188,1365],{"class":1278},[1060,10190,5802],{"class":1070},[1060,10192,1329],{"class":1278},[1060,10194,10195,10197],{"class":1062,"line":3446},[1060,10196,3512],{"class":1278},[1060,10198,1465],{"class":1284},[1060,10200,10201],{"class":1062,"line":3462},[1060,10202,3384],{"class":1278},[1060,10204,10205,10207],{"class":1062,"line":3481},[1060,10206,1462],{"class":1278},[1060,10208,1465],{"class":1274},[1060,10210,10211],{"class":1062,"line":3509},[1060,10212,1343],{"emptyLinePlaceholder":21},[1060,10214,10215,10217,10219,10221,10223,10225,10227,10229],{"class":1062,"line":3517},[1060,10216,5897],{"class":1561},[1060,10218,5900],{"class":1083},[1060,10220,1275],{"class":1278},[1060,10222,5905],{"class":1916},[1060,10224,1288],{"class":1278},[1060,10226,5910],{"class":1066},[1060,10228,1856],{"class":1278},[1060,10230,1354],{"class":1278},[1060,10232,10233,10235,10237,10239],{"class":1062,"line":3522},[1060,10234,5919],{"class":1274},[1060,10236,1782],{"class":1278},[1060,10238,5924],{"class":1083},[1060,10240,2642],{"class":1284},[1060,10242,10243,10245,10247,10249,10251,10253,10255,10257,10259],{"class":1062,"line":3588},[1060,10244,3327],{"class":1264},[1060,10246,1925],{"class":1284},[1060,10248,4816],{"class":1274},[1060,10250,1782],{"class":1278},[1060,10252,4821],{"class":1274},[1060,10254,1782],{"class":1278},[1060,10256,4826],{"class":1083},[1060,10258,4829],{"class":1284},[1060,10260,1279],{"class":1278},[1060,10262,10263,10265,10267,10269,10271,10273,10275,10277,10279,10281,10283,10285],{"class":1062,"line":3593},[1060,10264,5951],{"class":1274},[1060,10266,1782],{"class":1278},[1060,10268,5956],{"class":1083},[1060,10270,1275],{"class":1284},[1060,10272,1839],{"class":1278},[1060,10274,1693],{"class":1284},[1060,10276,1288],{"class":1278},[1060,10278,4962],{"class":1274},[1060,10280,1782],{"class":1278},[1060,10282,4821],{"class":1274},[1060,10284,1706],{"class":1278},[1060,10286,1465],{"class":1284},[1060,10288,10289,10291,10293,10295,10297],{"class":1062,"line":3598},[1060,10290,5979],{"class":1274},[1060,10292,1782],{"class":1278},[1060,10294,4821],{"class":1274},[1060,10296,2596],{"class":1278},[1060,10298,5988],{"class":1278},[1060,10300,10301],{"class":1062,"line":3604},[1060,10302,3384],{"class":1278},[1060,10304,10305],{"class":1062,"line":3634},[1060,10306,5024],{"class":1278},[1060,10308,10309],{"class":1062,"line":3676},[1060,10310,1343],{"emptyLinePlaceholder":21},[1060,10312,10313,10315,10317,10319,10321],{"class":1062,"line":3705},[1060,10314,6010],{"class":1083},[1060,10316,1275],{"class":1274},[1060,10318,1779],{"class":1278},[1060,10320,1799],{"class":1561},[1060,10322,1354],{"class":1278},[1060,10324,10325,10327,10329,10331,10333,10335,10337,10339,10341,10343,10345,10347,10349],{"class":1062,"line":3717},[1060,10326,3327],{"class":1264},[1060,10328,1925],{"class":1284},[1060,10330,5526],{"class":1274},[1060,10332,1782],{"class":1278},[1060,10334,4821],{"class":1274},[1060,10336,3644],{"class":1278},[1060,10338,1970],{"class":1274},[1060,10340,1782],{"class":1278},[1060,10342,3622],{"class":1274},[1060,10344,3649],{"class":1278},[1060,10346,3628],{"class":3359},[1060,10348,3337],{"class":1284},[1060,10350,1279],{"class":1278},[1060,10352,10353,10355,10357,10359],{"class":1062,"line":3733},[1060,10354,5951],{"class":1274},[1060,10356,1782],{"class":1278},[1060,10358,6055],{"class":1083},[1060,10360,2642],{"class":1284},[1060,10362,10363],{"class":1062,"line":3747},[1060,10364,3384],{"class":1278},[1060,10366,10367,10369],{"class":1062,"line":3754},[1060,10368,1462],{"class":1278},[1060,10370,1465],{"class":1274},[1060,10372,10373,10375,10377],{"class":1062,"line":3759},[1060,10374,1609],{"class":1278},[1060,10376,4733],{"class":1284},[1060,10378,1539],{"class":1278},[1060,10380,10381],{"class":1062,"line":3764},[1060,10382,1343],{"emptyLinePlaceholder":21},[1060,10384,10385,10387,10389],{"class":1062,"line":3770},[1060,10386,1533],{"class":1278},[1060,10388,1536],{"class":1284},[1060,10390,1539],{"class":1278},[1060,10392,10393,10395,10397,10399,10401,10403,10405,10407],{"class":1062,"line":3787},[1060,10394,1546],{"class":1278},[1060,10396,5051],{"class":1284},[1060,10398,5054],{"class":1561},[1060,10400,1565],{"class":1278},[1060,10402,1492],{"class":1278},[1060,10404,5061],{"class":1070},[1060,10406,1492],{"class":1278},[1060,10408,1539],{"class":1278},[1060,10410,10411,10413,10415,10417,10419],{"class":1062,"line":3809},[1060,10412,1555],{"class":1278},[1060,10414,1536],{"class":1284},[1060,10416,5074],{"class":1278},[1060,10418,7755],{"class":1561},[1060,10420,1539],{"class":1278},[1060,10422,10423,10425,10427],{"class":1062,"line":3827},[1060,10424,1579],{"class":1278},[1060,10426,7765],{"class":1284},[1060,10428,1585],{"class":1278},[1060,10430,10431,10433,10435],{"class":1062,"line":3835},[1060,10432,1590],{"class":1278},[1060,10434,1536],{"class":1284},[1060,10436,1539],{"class":1278},[1060,10438,10439,10441,10443,10445,10447],{"class":1062,"line":3852},[1060,10440,1555],{"class":1278},[1060,10442,1536],{"class":1284},[1060,10444,5074],{"class":1278},[1060,10446,5077],{"class":1561},[1060,10448,1539],{"class":1278},[1060,10450,10451,10453,10455,10457,10459,10461,10463,10465],{"class":1062,"line":3871},[1060,10452,1579],{"class":1278},[1060,10454,5086],{"class":1284},[1060,10456,5089],{"class":1561},[1060,10458,1565],{"class":1278},[1060,10460,1492],{"class":1278},[1060,10462,6132],{"class":1070},[1060,10464,1492],{"class":1278},[1060,10466,1539],{"class":1278},[1060,10468,10469,10471],{"class":1062,"line":3879},[1060,10470,5105],{"class":1278},[1060,10472,6143],{"class":1284},[1060,10474,10475,10477,10479,10481,10483],{"class":1062,"line":3884},[1060,10476,6148],{"class":1561},[1060,10478,1565],{"class":1278},[1060,10480,1492],{"class":1278},[1060,10482,6155],{"class":1070},[1060,10484,5162],{"class":1278},[1060,10486,10487,10489,10491,10493,10495],{"class":1062,"line":3890},[1060,10488,5168],{"class":1561},[1060,10490,1565],{"class":1278},[1060,10492,1492],{"class":1278},[1060,10494,6168],{"class":1070},[1060,10496,5162],{"class":1278},[1060,10498,10499],{"class":1062,"line":3910},[1060,10500,6175],{"class":1561},[1060,10502,10503,10505,10507,10509,10511],{"class":1062,"line":3925},[1060,10504,6180],{"class":1561},[1060,10506,1565],{"class":1278},[1060,10508,1492],{"class":1278},[1060,10510,6187],{"class":1070},[1060,10512,5162],{"class":1278},[1060,10514,10515],{"class":1062,"line":3942},[1060,10516,5228],{"class":1278},[1060,10518,10519,10521,10523,10525,10527,10529,10531,10533,10535,10537,10539],{"class":1062,"line":3966},[1060,10520,5234],{"class":1278},[1060,10522,1536],{"class":1284},[1060,10524,5074],{"class":1278},[1060,10526,350],{"class":1561},[1060,10528,1565],{"class":1278},[1060,10530,1492],{"class":1278},[1060,10532,1839],{"class":1278},[1060,10534,6212],{"class":1274},[1060,10536,1462],{"class":1278},[1060,10538,1492],{"class":1278},[1060,10540,1539],{"class":1278},[1060,10542,10543,10545,10547,10549,10551,10553,10555,10557,10559,10561,10563,10565,10567,10569,10571,10573,10575,10577,10579,10581,10583,10585,10587,10589,10591,10593,10595,10597,10599,10601,10603,10605],{"class":1062,"line":3977},[1060,10544,6223],{"class":1278},[1060,10546,1536],{"class":1284},[1060,10548,6228],{"class":1264},[1060,10550,1565],{"class":1278},[1060,10552,1492],{"class":1278},[1060,10554,6235],{"class":1274},[1060,10556,1690],{"class":1278},[1060,10558,6240],{"class":1274},[1060,10560,6243],{"class":1278},[1060,10562,2591],{"class":1274},[1060,10564,1782],{"class":1278},[1060,10566,2172],{"class":1274},[1060,10568,1492],{"class":1278},[1060,10570,6254],{"class":1278},[1060,10572,6257],{"class":1561},[1060,10574,1565],{"class":1278},[1060,10576,6262],{"class":1278},[1060,10578,4088],{"class":1274},[1060,10580,1782],{"class":1278},[1060,10582,1991],{"class":1274},[1060,10584,1462],{"class":1278},[1060,10586,6273],{"class":1070},[1060,10588,5008],{"class":1278},[1060,10590,6278],{"class":1274},[1060,10592,1782],{"class":1278},[1060,10594,5753],{"class":1274},[1060,10596,1462],{"class":1278},[1060,10598,6273],{"class":1070},[1060,10600,5008],{"class":1278},[1060,10602,6291],{"class":1274},[1060,10604,6294],{"class":1278},[1060,10606,1539],{"class":1278},[1060,10608,10609,10611,10613,10615,10617,10619,10621,10623,10625,10627,10629,10631,10633,10635,10637,10639,10641,10643,10645,10647,10649,10651,10653],{"class":1062,"line":3985},[1060,10610,6301],{"class":1278},[1060,10612,6304],{"class":1284},[1060,10614,6307],{"class":1561},[1060,10616,1565],{"class":1278},[1060,10618,1492],{"class":1278},[1060,10620,6314],{"class":1070},[1060,10622,1492],{"class":1278},[1060,10624,6319],{"class":1561},[1060,10626,1565],{"class":1278},[1060,10628,1492],{"class":1278},[1060,10630,6326],{"class":1070},[1060,10632,1492],{"class":1278},[1060,10634,6331],{"class":1561},[1060,10636,1565],{"class":1278},[1060,10638,1492],{"class":1278},[1060,10640,6338],{"class":1070},[1060,10642,1492],{"class":1278},[1060,10644,5089],{"class":1561},[1060,10646,1565],{"class":1278},[1060,10648,1492],{"class":1278},[1060,10650,6349],{"class":1070},[1060,10652,1492],{"class":1278},[1060,10654,1585],{"class":1278},[1060,10656,10657,10659,10661,10663,10665,10667,10669,10671,10673,10675,10677,10679,10681,10683,10685,10687,10689],{"class":1062,"line":3991},[1060,10658,6301],{"class":1278},[1060,10660,960],{"class":1284},[1060,10662,6362],{"class":1561},[1060,10664,1565],{"class":1278},[1060,10666,1492],{"class":1278},[1060,10668,6369],{"class":1070},[1060,10670,1492],{"class":1278},[1060,10672,5089],{"class":1561},[1060,10674,1565],{"class":1278},[1060,10676,1492],{"class":1278},[1060,10678,6380],{"class":1070},[1060,10680,1492],{"class":1278},[1060,10682,2639],{"class":1278},[1060,10684,6387],{"class":1274},[1060,10686,1609],{"class":1278},[1060,10688,960],{"class":1284},[1060,10690,1539],{"class":1278},[1060,10692,10693,10695,10697],{"class":1062,"line":3996},[1060,10694,6398],{"class":1278},[1060,10696,1536],{"class":1284},[1060,10698,1539],{"class":1278},[1060,10700,10701,10703,10705],{"class":1062,"line":4019},[1060,10702,6407],{"class":1278},[1060,10704,1536],{"class":1284},[1060,10706,1539],{"class":1278},[1060,10708,10709,10711,10713],{"class":1062,"line":4025},[1060,10710,5131],{"class":1278},[1060,10712,4704],{"class":1284},[1060,10714,1539],{"class":1278},[1060,10716,10717],{"class":1062,"line":4045},[1060,10718,1343],{"emptyLinePlaceholder":21},[1060,10720,10721,10723],{"class":1062,"line":4051},[1060,10722,5105],{"class":1278},[1060,10724,5147],{"class":1284},[1060,10726,10727,10729,10731,10733,10735],{"class":1062,"line":4097},[1060,10728,5153],{"class":1561},[1060,10730,1565],{"class":1278},[1060,10732,1492],{"class":1278},[1060,10734,4816],{"class":1070},[1060,10736,5162],{"class":1278},[1060,10738,10739,10741,10743,10745,10747],{"class":1062,"line":4113},[1060,10740,6446],{"class":1561},[1060,10742,1565],{"class":1278},[1060,10744,1492],{"class":1278},[1060,10746,6453],{"class":1070},[1060,10748,5162],{"class":1278},[1060,10750,10751,10753,10755,10757,10759],{"class":1062,"line":4146},[1060,10752,5183],{"class":1561},[1060,10754,1565],{"class":1278},[1060,10756,1492],{"class":1278},[1060,10758,5190],{"class":1070},[1060,10760,5162],{"class":1278},[1060,10762,10763,10765,10767,10769,10771],{"class":1062,"line":4160},[1060,10764,6180],{"class":1561},[1060,10766,1565],{"class":1278},[1060,10768,1492],{"class":1278},[1060,10770,6478],{"class":1070},[1060,10772,5162],{"class":1278},[1060,10774,10775,10777,10779,10781,10783],{"class":1062,"line":4168},[1060,10776,5213],{"class":1561},[1060,10778,1565],{"class":1278},[1060,10780,1492],{"class":1278},[1060,10782,6491],{"class":1070},[1060,10784,5162],{"class":1278},[1060,10786,10787],{"class":1062,"line":4173},[1060,10788,5228],{"class":1278},[1060,10790,10791,10793,10795,10797,10800],{"class":1062,"line":4180},[1060,10792,5234],{"class":1278},[1060,10794,1536],{"class":1284},[1060,10796,5074],{"class":1278},[1060,10798,10799],{"class":1561},"footer",[1060,10801,1539],{"class":1278},[1060,10803,10804,10806,10809,10812,10814,10816,10818,10820],{"class":1062,"line":4185},[1060,10805,6223],{"class":1278},[1060,10807,10808],{"class":1284},"ModelSelect",[1060,10810,10811],{"class":1561}," v-model",[1060,10813,1565],{"class":1278},[1060,10815,1492],{"class":1278},[1060,10817,4259],{"class":1070},[1060,10819,1492],{"class":1278},[1060,10821,1585],{"class":1278},[1060,10823,10825,10827,10829],{"class":10824,"line":4203},[1062,1543],[1060,10826,6407],{"class":1278},[1060,10828,1536],{"class":1284},[1060,10830,1539],{"class":1278},[1060,10832,10834],{"class":10833,"line":6566},[1062,1543],[1060,10835,1343],{"emptyLinePlaceholder":21},[1060,10837,10839,10841],{"class":10838,"line":6575},[1062,1543],[1060,10840,5234],{"class":1278},[1060,10842,6504],{"class":1284},[1060,10844,10845,10847,10849,10851,10853],{"class":1062,"line":6584},[1060,10846,6509],{"class":1561},[1060,10848,1565],{"class":1278},[1060,10850,1492],{"class":1278},[1060,10852,6168],{"class":1070},[1060,10854,5162],{"class":1278},[1060,10856,10857,10859,10861,10863,10865],{"class":1062,"line":6593},[1060,10858,6522],{"class":1561},[1060,10860,1565],{"class":1278},[1060,10862,1492],{"class":1278},[1060,10864,5247],{"class":1070},[1060,10866,5162],{"class":1278},[1060,10868,10869,10871,10873,10875,10877],{"class":1062,"line":6602},[1060,10870,6535],{"class":1561},[1060,10872,1565],{"class":1278},[1060,10874,1492],{"class":1278},[1060,10876,6542],{"class":1070},[1060,10878,5162],{"class":1278},[1060,10880,10881,10883,10885,10887,10889],{"class":1062,"line":9112},[1060,10882,6549],{"class":1561},[1060,10884,1565],{"class":1278},[1060,10886,1492],{"class":1278},[1060,10888,6556],{"class":1070},[1060,10890,5162],{"class":1278},[1060,10892,10893],{"class":1062,"line":9121},[1060,10894,6563],{"class":1278},[1060,10896,10897,10899,10901],{"class":1062,"line":9130},[1060,10898,5131],{"class":1278},[1060,10900,4698],{"class":1284},[1060,10902,1539],{"class":1278},[1060,10904,10906,10908,10910],{"class":1062,"line":10905},94,[1060,10907,5265],{"class":1278},[1060,10909,5086],{"class":1284},[1060,10911,1539],{"class":1278},[1060,10913,10915,10917,10919],{"class":1062,"line":10914},95,[1060,10916,1590],{"class":1278},[1060,10918,1536],{"class":1284},[1060,10920,1539],{"class":1278},[1060,10922,10924,10926,10928],{"class":1062,"line":10923},96,[1060,10925,1600],{"class":1278},[1060,10927,5051],{"class":1284},[1060,10929,1539],{"class":1278},[1060,10931,10933,10935,10937],{"class":1062,"line":10932},97,[1060,10934,1609],{"class":1278},[1060,10936,1536],{"class":1284},[1060,10938,1539],{"class":1278},[964,10940,10942],{"id":10941},"going-further","Going further",[960,10944,10945],{},"You now have a working AI chatbot with database persistence! To take it further, consider adding:",[960,10947,10948],{},[978,10949,10950],{},"User Authentication",[960,10952,10953,10954,10959],{},"Add authentication with ",[1035,10955,10958],{"href":10956,"rel":10957},"https://github.com/atinux/nuxt-auth-utils",[1039],"nuxt-auth-utils"," to let users access their chat history across devices and keep conversations private.",[960,10961,10962],{},[978,10963,10964],{},"AI Tools",[960,10966,10967,10968,10973],{},"Extend your chatbot with ",[1035,10969,10972],{"href":10970,"rel":10971},"https://ai-sdk.dev/docs/ai-sdk-core/tools-and-tool-calling",[1039],"AI SDK tools"," that can fetch real-time data, generate charts, or interact with external APIs:",[1050,10975,10977],{"className":1255,"code":10976,"language":1257,"meta":1055,"style":1055},"import { tool } from 'ai'\nimport { z } from 'zod'\n\nconst weatherTool = tool({\n  description: 'Get the current weather for a location',\n  parameters: z.object({\n    location: z.string().describe('The city name')\n  }),\n  execute: async ({ location }) => {\n    // Fetch weather data from an API\n    return { location, temperature: 22, condition: 'Sunny' }\n  }\n})\n",[1057,10978,10979,10998,11016,11020,11035,11051,11068,11099,11107,11127,11132,11167,11171],{"__ignoreMap":1055},[1060,10980,10981,10983,10985,10988,10990,10992,10994,10996],{"class":1062,"line":1063},[1060,10982,1681],{"class":1264},[1060,10984,1684],{"class":1278},[1060,10986,10987],{"class":1274}," tool",[1060,10989,1706],{"class":1278},[1060,10991,1709],{"class":1264},[1060,10993,1365],{"class":1278},[1060,10995,2507],{"class":1070},[1060,10997,1329],{"class":1278},[1060,10999,11000,11002,11004,11006,11008,11010,11012,11014],{"class":1062,"line":1080},[1060,11001,1681],{"class":1264},[1060,11003,1684],{"class":1278},[1060,11005,2542],{"class":1274},[1060,11007,1706],{"class":1278},[1060,11009,1709],{"class":1264},[1060,11011,1365],{"class":1278},[1060,11013,2551],{"class":1070},[1060,11015,1329],{"class":1278},[1060,11017,11018],{"class":1062,"line":1294},[1060,11019,1343],{"emptyLinePlaceholder":21},[1060,11021,11022,11024,11027,11029,11031,11033],{"class":1062,"line":1309},[1060,11023,4754],{"class":1561},[1060,11025,11026],{"class":1274}," weatherTool ",[1060,11028,1565],{"class":1278},[1060,11030,10987],{"class":1083},[1060,11032,1275],{"class":1274},[1060,11034,1279],{"class":1278},[1060,11036,11037,11040,11042,11044,11047,11049],{"class":1062,"line":1321},[1060,11038,11039],{"class":1284},"  description",[1060,11041,1288],{"class":1278},[1060,11043,1365],{"class":1278},[1060,11045,11046],{"class":1070},"Get the current weather for a location",[1060,11048,1303],{"class":1278},[1060,11050,1306],{"class":1278},[1060,11052,11053,11056,11058,11060,11062,11064,11066],{"class":1062,"line":1332},[1060,11054,11055],{"class":1284},"  parameters",[1060,11057,1288],{"class":1278},[1060,11059,2542],{"class":1274},[1060,11061,1782],{"class":1278},[1060,11063,2614],{"class":1083},[1060,11065,1275],{"class":1274},[1060,11067,1279],{"class":1278},[1060,11069,11070,11073,11075,11077,11079,11081,11083,11085,11088,11090,11092,11095,11097],{"class":1062,"line":1340},[1060,11071,11072],{"class":1284},"    location",[1060,11074,1288],{"class":1278},[1060,11076,2542],{"class":1274},[1060,11078,1782],{"class":1278},[1060,11080,3098],{"class":1083},[1060,11082,1779],{"class":1274},[1060,11084,1782],{"class":1278},[1060,11086,11087],{"class":1083},"describe",[1060,11089,1275],{"class":1274},[1060,11091,1303],{"class":1278},[1060,11093,11094],{"class":1070},"The city name",[1060,11096,1303],{"class":1278},[1060,11098,1465],{"class":1274},[1060,11100,11101,11103,11105],{"class":1062,"line":1346},[1060,11102,2387],{"class":1278},[1060,11104,1856],{"class":1274},[1060,11106,1306],{"class":1278},[1060,11108,11109,11112,11114,11116,11118,11121,11123,11125],{"class":1062,"line":1357},[1060,11110,11111],{"class":1083},"  execute",[1060,11113,1288],{"class":1278},[1060,11115,3795],{"class":1561},[1060,11117,1913],{"class":1278},[1060,11119,11120],{"class":1916}," location",[1060,11122,1920],{"class":1278},[1060,11124,1799],{"class":1561},[1060,11126,1354],{"class":1278},[1060,11128,11129],{"class":1062,"line":1373},[1060,11130,11131],{"class":1444},"    // Fetch weather data from an API\n",[1060,11133,11134,11137,11139,11141,11143,11146,11148,11151,11153,11156,11158,11160,11163,11165],{"class":1062,"line":1379},[1060,11135,11136],{"class":1264},"    return",[1060,11138,1684],{"class":1278},[1060,11140,11120],{"class":1274},[1060,11142,1690],{"class":1278},[1060,11144,11145],{"class":1284}," temperature",[1060,11147,1288],{"class":1278},[1060,11149,11150],{"class":3359}," 22",[1060,11152,1690],{"class":1278},[1060,11154,11155],{"class":1284}," condition",[1060,11157,1288],{"class":1278},[1060,11159,1365],{"class":1278},[1060,11161,11162],{"class":1070},"Sunny",[1060,11164,1303],{"class":1278},[1060,11166,9335],{"class":1278},[1060,11168,11169],{"class":1062,"line":1384},[1060,11170,3384],{"class":1278},[1060,11172,11173,11175],{"class":1062,"line":1407},[1060,11174,1462],{"class":1278},[1060,11176,1465],{"class":1274},[1007,11178,11180],{"icon":11179,"target":1010,"to":1011},"i-lucide-rocket",[960,11181,11182,11183,11185,11186,1782],{},"The official ",[978,11184,1017],{}," includes all these features and more. Get started instantly with ",[1057,11187,11188],{},"npx nuxi@latest init -t ui/chat my-chat-app",[964,11190,11192],{"id":11191},"deploying-to-vercel","Deploying to Vercel",[960,11194,11195],{},"Deploy your chatbot to Vercel with zero configuration:",[1050,11197,11199],{"className":1052,"code":11198,"language":1054,"meta":1055,"style":1055},"npx vercel deploy\n",[1057,11200,11201],{"__ignoreMap":1055},[1060,11202,11203,11205,11208],{"class":1062,"line":1063},[1060,11204,1067],{"class":1066},[1060,11206,11207],{"class":1070}," vercel",[1060,11209,11210],{"class":1070}," deploy\n",[960,11212,11213],{},"Then, in the Vercel dashboard:",[972,11215,11216,11222],{},[975,11217,11218,11219,11221],{},"Enable ",[978,11220,4215],{}," and add credits so requests can be processed.",[975,11223,11224,11225,11228],{},"Add a ",[978,11226,11227],{},"Turso"," database from the Vercel Marketplace and connect it to your project (it will provision the database and add the required environment variables automatically).",[11230,11231,11232],"blockquote",{},[960,11233,11234,11235,11240,11241,11243],{},"Note: On Vercel, you ",[978,11236,11237,11238],{},"don’t need to manually add ",[1057,11239,1632],{}," — Vercel handles the gateway configuration for deployments. Keep using ",[1057,11242,1619],{}," locally for development.",[1639,11245,11246],{"to":1037,"target":1010},[960,11247,11248,11249,1782],{},"Learn more about setting up AI Gateway in the ",[978,11250,11251],{},"Vercel AI Gateway documentation",[964,11253,11255],{"id":11254},"conclusion","Conclusion",[960,11257,11258],{},"You've built a complete AI chatbot with:",[972,11260,11261,11267,11273,11278,11283],{},[975,11262,11263,11266],{},[978,11264,11265],{},"A complete chat interface"," using Nuxt UI components",[975,11268,11269,11272],{},[978,11270,11271],{},"Real-time streaming responses"," with the AI SDK",[975,11274,11275,11277],{},[978,11276,992],{}," with MDC for rich content display",[975,11279,11280,11282],{},[978,11281,998],{}," via AI Gateway",[975,11284,11285,11288],{},[978,11286,11287],{},"Database persistence"," with SQLite (local) / Turso (production) and Drizzle ORM",[960,11290,11291],{},"The combination of Nuxt's full-stack capabilities, Nuxt UI's purpose-built chat components, a local SQLite dev database with a production Turso database, and the AI SDK's streaming infrastructure makes building AI applications straightforward and enjoyable.",[960,11293,11294],{},[978,11295,11296],{},"Resources:",[972,11298,11299,11306,11313,11320,11326],{},[975,11300,11301],{},[1035,11302,11305],{"href":11303,"rel":11304},"https://ui.nuxt.com/components/chat-messages",[1039],"Nuxt UI Chat Components",[975,11307,11308],{},[1035,11309,11312],{"href":11310,"rel":11311},"https://hub.nuxt.com/docs/features/database",[1039],"NuxtHub Database",[975,11314,11315],{},[1035,11316,11319],{"href":11317,"rel":11318},"https://ai-sdk.dev",[1039],"AI SDK Documentation",[975,11321,11322],{},[1035,11323,11325],{"href":1037,"rel":11324},[1039],"AI Gateway Documentation",[975,11327,11328],{},[1035,11329,11331],{"href":1011,"rel":11330},[1039],"AI Chat Template",[960,11333,11334],{},"We're excited to see what you'll build!",[11336,11337,11338],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":1055,"searchDepth":1080,"depth":1080,"links":11340},[11341,11342,11343,11349,11354,11357,11358,11362,11363,11364,11369,11370,11371],{"id":966,"depth":1080,"text":967},{"id":1021,"depth":1080,"text":1022},{"id":1044,"depth":1080,"text":1045,"children":11344},[11345,11346,11347,11348],{"id":1090,"depth":1294,"text":1091},{"id":1241,"depth":1294,"text":1242},{"id":1510,"depth":1294,"text":1511},{"id":1650,"depth":1294,"text":1651},{"id":2430,"depth":1080,"text":2431,"children":11350},[11351,11352,11353],{"id":2442,"depth":1294,"text":2443},{"id":2825,"depth":1294,"text":2826},{"id":4307,"depth":1294,"text":4308},{"id":4689,"depth":1080,"text":4690,"children":11355},[11356],{"id":4708,"depth":1294,"text":4709},{"id":5328,"depth":1080,"text":5329},{"id":6763,"depth":1080,"text":6764,"children":11359},[11360,11361],{"id":6770,"depth":1294,"text":6771},{"id":6930,"depth":1294,"text":6931},{"id":7428,"depth":1080,"text":7429},{"id":7971,"depth":1080,"text":7972},{"id":9148,"depth":1080,"text":9149,"children":11365},[11366,11367,11368],{"id":9159,"depth":1294,"text":9160},{"id":9430,"depth":1294,"text":9431},{"id":9691,"depth":1294,"text":9692},{"id":10941,"depth":1080,"text":10942},{"id":11191,"depth":1080,"text":11192},{"id":11254,"depth":1080,"text":11255},"2025-12-16T10:00:00.000Z","Learn how to build a full-featured AI chatbot with streaming responses, multiple models support, and a beautiful UI using Nuxt, Nuxt UI, and Vercel AI SDK.","md","/assets/blog/building-nuxt-ai-chatbot.png",{"category":11377},"Tutorial","/blog/how-to-build-an-ai-chat",{"title":944,"description":11373},"blog/how-to-build-an-ai-chat","sF-X00IyVVRUYqwN17Ubpm4H6Z1IRgi6gKRm3dRrqnY",{"data":11383,"body":11384},{},{"type":11385,"children":11386},"root",[11387],{"type":178,"tag":960,"props":11388,"children":11389},{},[11390,11392,11399],{"type":4951,"value":11391},"Nuxt ",{"type":178,"tag":1060,"props":11393,"children":11396},{"className":11394},[11395],"text-primary",[11397],{"type":4951,"value":11398},"UI",{"type":4951,"value":11400}," Blog",{"data":11402,"body":11403},{},{"type":11385,"children":11404},[11405],{"type":178,"tag":960,"props":11406,"children":11407},{},[11408],{"type":4951,"value":932},1772538727433]