[{"data":1,"prerenderedAt":11413},["ShallowReactive",2],{"navigation":3,"blog":918,"blog-posts":930,"blog-hero-title":11386,"blog-hero-description":11405},[4],{"title":5,"path":6,"stem":7,"children":8,"page":36},"Docs","/docs","docs",[9,157,781,817],{"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},"AI Tools","/docs/getting-started/ai","docs/1.getting-started/7.ai",[145,151],{"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":71,"framework":16,"category":16,"description":16,"icon":158,"path":159,"stem":160,"children":161,"page":36},"i-lucide-square-code","/docs/components","docs/2.components",[162,168,174,180,186,191,196,201,206,211,216,222,227,232,237,242,247,252,258,263,268,273,278,284,289,294,299,305,310,315,320,325,330,335,340,346,351,356,361,366,372,378,383,388,393,398,403,408,413,418,423,428,433,440,445,450,455,460,465,470,475,480,485,490,495,500,505,510,515,520,525,530,535,540,545,550,555,561,566,571,576,581,586,591,596,601,606,611,616,621,626,631,636,641,646,651,656,661,666,671,676,681,686,691,696,701,706,711,716,721,726,731,736,741,746,751,756,761,766,771,776],{"title":163,"path":164,"stem":165,"framework":16,"category":166,"description":167},"Accordion","/docs/components/accordion","docs/2.components/accordion","data","A stacked set of collapsible panels.",{"title":169,"path":170,"stem":171,"framework":16,"category":172,"description":173},"Alert","/docs/components/alert","docs/2.components/alert","element","A callout to draw user's attention.",{"title":175,"path":176,"stem":177,"framework":16,"category":178,"description":179},"App","/docs/components/app","docs/2.components/app","layout","Wraps your app to provide global configurations and more.",{"title":181,"path":182,"stem":183,"framework":16,"category":184,"description":185},"AuthForm","/docs/components/auth-form","docs/2.components/auth-form","page","A customizable Form to create login, register or password reset forms.",{"title":187,"path":188,"stem":189,"framework":16,"category":172,"description":190},"Avatar","/docs/components/avatar","docs/2.components/avatar","An img element with fallback and Nuxt Image support.",{"title":192,"path":193,"stem":194,"framework":16,"category":172,"description":195},"AvatarGroup","/docs/components/avatar-group","docs/2.components/avatar-group","Stack multiple avatars in a group.",{"title":197,"path":198,"stem":199,"framework":16,"category":172,"description":200},"Badge","/docs/components/badge","docs/2.components/badge","A short text to represent a status or a category.",{"title":202,"path":203,"stem":204,"framework":16,"category":172,"description":205},"Banner","/docs/components/banner","docs/2.components/banner","Display a banner at the top of your website to inform users about important information.",{"title":207,"path":208,"stem":209,"framework":16,"category":184,"description":210},"BlogPost","/docs/components/blog-post","docs/2.components/blog-post","A customizable article to display in a blog page.",{"title":212,"path":213,"stem":214,"framework":16,"category":184,"description":215},"BlogPosts","/docs/components/blog-posts","docs/2.components/blog-posts","Display a list of blog posts in a responsive grid layout.",{"title":217,"path":218,"stem":219,"framework":16,"category":220,"description":221},"Breadcrumb","/docs/components/breadcrumb","docs/2.components/breadcrumb","navigation","A hierarchy of links to navigate through a website.",{"title":223,"path":224,"stem":225,"framework":16,"category":172,"description":226},"Button","/docs/components/button","docs/2.components/button","A button element that can act as a link or trigger an action.",{"title":228,"path":229,"stem":230,"framework":16,"category":172,"description":231},"Calendar","/docs/components/calendar","docs/2.components/calendar","A calendar component for selecting single dates, multiple dates or date ranges.",{"title":233,"path":234,"stem":235,"framework":16,"category":172,"description":236},"Card","/docs/components/card","docs/2.components/card","Display content in a card with a header, body and footer.",{"title":238,"path":239,"stem":240,"framework":16,"category":166,"description":241},"Carousel","/docs/components/carousel","docs/2.components/carousel","A carousel with motion and swipe built using Embla.",{"title":243,"path":244,"stem":245,"framework":16,"category":184,"description":246},"ChangelogVersion","/docs/components/changelog-version","docs/2.components/changelog-version","A customizable article to display in a changelog.",{"title":248,"path":249,"stem":250,"framework":16,"category":184,"description":251},"ChangelogVersions","/docs/components/changelog-versions","docs/2.components/changelog-versions","Display a list of changelog versions in a timeline.",{"title":253,"path":254,"stem":255,"framework":16,"category":256,"description":257},"ChatMessage","/docs/components/chat-message","docs/2.components/chat-message","chat","Display a chat message with icon, avatar, and actions.",{"title":259,"path":260,"stem":261,"framework":16,"category":256,"description":262},"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":264,"path":265,"stem":266,"framework":16,"category":256,"description":267},"ChatPalette","/docs/components/chat-palette","docs/2.components/chat-palette","A chat palette to create a chatbot interface inside an overlay.",{"title":269,"path":270,"stem":271,"framework":16,"category":256,"description":272},"ChatPrompt","/docs/components/chat-prompt","docs/2.components/chat-prompt","An enhanced Textarea for submitting prompts in AI chat interfaces.",{"title":274,"path":275,"stem":276,"framework":16,"category":256,"description":277},"ChatPromptSubmit","/docs/components/chat-prompt-submit","docs/2.components/chat-prompt-submit","A Button for submitting chat prompts with automatic status handling.",{"title":279,"path":280,"stem":281,"framework":16,"category":282,"description":283},"Checkbox","/docs/components/checkbox","docs/2.components/checkbox","form","An input element to toggle between checked and unchecked states.",{"title":285,"path":286,"stem":287,"framework":16,"category":282,"description":288},"CheckboxGroup","/docs/components/checkbox-group","docs/2.components/checkbox-group","A set of checklist buttons to select multiple option from a list.",{"title":290,"path":291,"stem":292,"framework":16,"category":172,"description":293},"Chip","/docs/components/chip","docs/2.components/chip","An indicator of a numeric value or a state.",{"title":295,"path":296,"stem":297,"framework":16,"category":172,"description":298},"Collapsible","/docs/components/collapsible","docs/2.components/collapsible","A collapsible element to toggle visibility of its content.",{"title":300,"path":301,"stem":302,"framework":16,"category":303,"description":304},"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":306,"path":307,"stem":308,"framework":16,"category":303,"description":309},"ColorModeButton","/docs/components/color-mode-button","docs/2.components/color-mode-button","A Button to switch between light and dark mode.",{"title":311,"path":312,"stem":313,"framework":16,"category":303,"description":314},"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":316,"path":317,"stem":318,"framework":16,"category":303,"description":319},"ColorModeSelect","/docs/components/color-mode-select","docs/2.components/color-mode-select","A Select to switch between system, dark & light mode.",{"title":321,"path":322,"stem":323,"framework":16,"category":303,"description":324},"ColorModeSwitch","/docs/components/color-mode-switch","docs/2.components/color-mode-switch","A switch to toggle between light and dark mode.",{"title":326,"path":327,"stem":328,"framework":16,"category":282,"description":329},"ColorPicker","/docs/components/color-picker","docs/2.components/color-picker","A component to select a color.",{"title":331,"path":332,"stem":333,"framework":16,"category":220,"description":334},"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":336,"path":337,"stem":338,"framework":16,"category":178,"description":339},"Container","/docs/components/container","docs/2.components/container","A container lets you center and constrain the width of your content.",{"title":341,"path":342,"stem":343,"framework":28,"category":344,"description":345},"ContentNavigation","/docs/components/content-navigation","docs/2.components/content-navigation","content","An accordion-style navigation component for organizing page links.",{"title":347,"path":348,"stem":349,"framework":28,"category":344,"description":350},"ContentSearch","/docs/components/content-search","docs/2.components/content-search","A ready to use CommandPalette to add to your documentation.",{"title":352,"path":353,"stem":354,"framework":28,"category":344,"description":355},"ContentSearchButton","/docs/components/content-search-button","docs/2.components/content-search-button","A pre-styled Button to open the ContentSearch modal.",{"title":357,"path":358,"stem":359,"framework":28,"category":344,"description":360},"ContentSurround","/docs/components/content-surround","docs/2.components/content-surround","A pair of prev and next links to navigate between pages.",{"title":362,"path":363,"stem":364,"framework":28,"category":344,"description":365},"ContentToc","/docs/components/content-toc","docs/2.components/content-toc","A sticky Table of Contents with automatic active anchor link highlighting.",{"title":367,"path":368,"stem":369,"framework":16,"category":370,"description":371},"ContextMenu","/docs/components/context-menu","docs/2.components/context-menu","overlay","A menu to display actions when right-clicking on an element.",{"title":373,"path":374,"stem":375,"framework":16,"category":376,"description":377},"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":379,"path":380,"stem":381,"framework":16,"category":376,"description":382},"DashboardNavbar","/docs/components/dashboard-navbar","docs/2.components/dashboard-navbar","A responsive navbar to display in a dashboard.",{"title":384,"path":385,"stem":386,"framework":16,"category":376,"description":387},"DashboardPanel","/docs/components/dashboard-panel","docs/2.components/dashboard-panel","A resizable panel to display in a dashboard.",{"title":389,"path":390,"stem":391,"framework":16,"category":376,"description":392},"DashboardResizeHandle","/docs/components/dashboard-resize-handle","docs/2.components/dashboard-resize-handle","A handle to resize a sidebar or panel.",{"title":394,"path":395,"stem":396,"framework":16,"category":376,"description":397},"DashboardSearch","/docs/components/dashboard-search","docs/2.components/dashboard-search","A ready to use CommandPalette to add to your dashboard.",{"title":399,"path":400,"stem":401,"framework":16,"category":376,"description":402},"DashboardSearchButton","/docs/components/dashboard-search-button","docs/2.components/dashboard-search-button","A pre-styled Button to open the DashboardSearch modal.",{"title":404,"path":405,"stem":406,"framework":16,"category":376,"description":407},"DashboardSidebar","/docs/components/dashboard-sidebar","docs/2.components/dashboard-sidebar","A resizable and collapsible sidebar to display in a dashboard.",{"title":409,"path":410,"stem":411,"framework":16,"category":376,"description":412},"DashboardSidebarCollapse","/docs/components/dashboard-sidebar-collapse","docs/2.components/dashboard-sidebar-collapse","A Button to collapse the sidebar on desktop.",{"title":414,"path":415,"stem":416,"framework":16,"category":376,"description":417},"DashboardSidebarToggle","/docs/components/dashboard-sidebar-toggle","docs/2.components/dashboard-sidebar-toggle","A Button to toggle the sidebar on mobile.",{"title":419,"path":420,"stem":421,"framework":16,"category":376,"description":422},"DashboardToolbar","/docs/components/dashboard-toolbar","docs/2.components/dashboard-toolbar","A toolbar to display under the navbar in a dashboard.",{"title":424,"path":425,"stem":426,"framework":16,"category":370,"description":427},"Drawer","/docs/components/drawer","docs/2.components/drawer","A drawer that smoothly slides in & out of the screen.",{"title":429,"path":430,"stem":431,"framework":16,"category":370,"description":432},"DropdownMenu","/docs/components/dropdown-menu","docs/2.components/dropdown-menu","A menu to display actions when clicking on an element.",{"title":434,"path":435,"stem":436,"framework":16,"category":437,"description":438,"badge":439},"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":441,"path":442,"stem":443,"framework":16,"category":437,"description":444,"badge":439},"EditorDragHandle","/docs/components/editor-drag-handle","docs/2.components/editor-drag-handle","A draggable handle for reordering and selecting blocks in the editor.",{"title":446,"path":447,"stem":448,"framework":16,"category":437,"description":449,"badge":439},"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":451,"path":452,"stem":453,"framework":16,"category":437,"description":454,"badge":439},"EditorMentionMenu","/docs/components/editor-mention-menu","docs/2.components/editor-mention-menu","A mention menu that displays user suggestions when typing the @ character in the editor.",{"title":456,"path":457,"stem":458,"framework":16,"category":437,"description":459,"badge":439},"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":461,"path":462,"stem":463,"framework":16,"category":437,"description":464,"badge":439},"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":466,"path":467,"stem":468,"framework":16,"category":166,"description":469},"Empty","/docs/components/empty","docs/2.components/empty","A component to display an empty state.",{"title":471,"path":472,"stem":473,"framework":16,"category":178,"description":474},"Error","/docs/components/error","docs/2.components/error","A pre-built error component with NuxtError support.",{"title":476,"path":477,"stem":478,"framework":16,"category":172,"description":479},"FieldGroup","/docs/components/field-group","docs/2.components/field-group","Group multiple button-like elements together.",{"title":481,"path":482,"stem":483,"framework":16,"category":282,"description":484},"FileUpload","/docs/components/file-upload","docs/2.components/file-upload","An input element to upload files.",{"title":486,"path":487,"stem":488,"framework":16,"category":178,"description":489},"Footer","/docs/components/footer","docs/2.components/footer","A responsive footer component.",{"title":491,"path":492,"stem":493,"framework":16,"category":220,"description":494},"FooterColumns","/docs/components/footer-columns","docs/2.components/footer-columns","A list of links as columns to display in your Footer.",{"title":496,"path":497,"stem":498,"framework":16,"category":282,"description":499},"Form","/docs/components/form","docs/2.components/form","A form component with built-in validation and submission handling.",{"title":501,"path":502,"stem":503,"framework":16,"category":282,"description":504},"FormField","/docs/components/form-field","docs/2.components/form-field","A wrapper for form elements that provides validation and error handling.",{"title":506,"path":507,"stem":508,"framework":16,"category":178,"description":509},"Header","/docs/components/header","docs/2.components/header","A responsive header component.",{"title":511,"path":512,"stem":513,"framework":16,"category":172,"description":514},"Icon","/docs/components/icon","docs/2.components/icon","A component to display any icon from Iconify or another component.",{"title":516,"path":517,"stem":518,"framework":16,"category":282,"description":519},"Input","/docs/components/input","docs/2.components/input","An input element to enter text.",{"title":521,"path":522,"stem":523,"framework":16,"category":282,"description":524},"InputDate","/docs/components/input-date","docs/2.components/input-date","An input component for date selection.",{"title":526,"path":527,"stem":528,"framework":16,"category":282,"description":529},"InputMenu","/docs/components/input-menu","docs/2.components/input-menu","An autocomplete input with real-time suggestions.",{"title":531,"path":532,"stem":533,"framework":16,"category":282,"description":534},"InputNumber","/docs/components/input-number","docs/2.components/input-number","An input for numerical values with a customizable range.",{"title":536,"path":537,"stem":538,"framework":16,"category":282,"description":539},"InputTags","/docs/components/input-tags","docs/2.components/input-tags","An input element that displays interactive tags.",{"title":541,"path":542,"stem":543,"framework":16,"category":282,"description":544},"InputTime","/docs/components/input-time","docs/2.components/input-time","An input for selecting a time.",{"title":546,"path":547,"stem":548,"framework":16,"category":172,"description":549},"Kbd","/docs/components/kbd","docs/2.components/kbd","A kbd element to display a keyboard key.",{"title":551,"path":552,"stem":553,"framework":16,"category":220,"description":554},"Link","/docs/components/link","docs/2.components/link","A wrapper around \u003CNuxtLink> with extra props.",{"title":556,"path":557,"stem":558,"framework":16,"category":559,"description":560},"LocaleSelect","/docs/components/locale-select","docs/2.components/locale-select","i18n","A Select to switch between locales.",{"title":562,"path":563,"stem":564,"framework":16,"category":178,"description":565},"Main","/docs/components/main","docs/2.components/main","A main element that fills the available viewport height.",{"title":567,"path":568,"stem":569,"framework":16,"category":166,"description":570},"Marquee","/docs/components/marquee","docs/2.components/marquee","A component to create infinite scrolling content.",{"title":572,"path":573,"stem":574,"framework":16,"category":370,"description":575},"Modal","/docs/components/modal","docs/2.components/modal","A dialog window that can be used to display a message or request user input.",{"title":577,"path":578,"stem":579,"framework":16,"category":220,"description":580},"NavigationMenu","/docs/components/navigation-menu","docs/2.components/navigation-menu","A list of links that can be displayed horizontally or vertically.",{"title":582,"path":583,"stem":584,"framework":16,"category":184,"description":585},"Page","/docs/components/page","docs/2.components/page","A grid layout for your pages with left and right columns.",{"title":587,"path":588,"stem":589,"framework":16,"category":184,"description":590},"PageAnchors","/docs/components/page-anchors","docs/2.components/page-anchors","A list of anchors to be displayed in the page.",{"title":592,"path":593,"stem":594,"framework":16,"category":184,"description":595},"PageAside","/docs/components/page-aside","docs/2.components/page-aside","A sticky aside to display your page navigation.",{"title":597,"path":598,"stem":599,"framework":16,"category":184,"description":600},"PageBody","/docs/components/page-body","docs/2.components/page-body","The main content of your page.",{"title":602,"path":603,"stem":604,"framework":16,"category":184,"description":605},"PageCard","/docs/components/page-card","docs/2.components/page-card","A pre-styled card component that displays a title, description and optional link.",{"title":607,"path":608,"stem":609,"framework":16,"category":184,"description":610},"PageColumns","/docs/components/page-columns","docs/2.components/page-columns","A responsive multi-column layout system for organizing content side-by-side.",{"title":612,"path":613,"stem":614,"framework":16,"category":184,"description":615},"PageCTA","/docs/components/page-cta","docs/2.components/page-cta","A call to action section to display in your pages.",{"title":617,"path":618,"stem":619,"framework":16,"category":184,"description":620},"PageFeature","/docs/components/page-feature","docs/2.components/page-feature","A component to showcase key features of your application.",{"title":622,"path":623,"stem":624,"framework":16,"category":184,"description":625},"PageGrid","/docs/components/page-grid","docs/2.components/page-grid","A responsive grid system for displaying content in a flexible layout.",{"title":627,"path":628,"stem":629,"framework":16,"category":184,"description":630},"PageHeader","/docs/components/page-header","docs/2.components/page-header","A responsive header for your pages.",{"title":632,"path":633,"stem":634,"framework":16,"category":184,"description":635},"PageHero","/docs/components/page-hero","docs/2.components/page-hero","A responsive hero for your pages.",{"title":637,"path":638,"stem":639,"framework":16,"category":184,"description":640},"PageLinks","/docs/components/page-links","docs/2.components/page-links","A list of links to be displayed in the page.",{"title":642,"path":643,"stem":644,"framework":16,"category":184,"description":645},"PageList","/docs/components/page-list","docs/2.components/page-list","A vertical list layout for displaying content in a stacked format.",{"title":647,"path":648,"stem":649,"framework":16,"category":184,"description":650},"PageLogos","/docs/components/page-logos","docs/2.components/page-logos","A list of logos or images to display on your pages.",{"title":652,"path":653,"stem":654,"framework":16,"category":184,"description":655},"PageSection","/docs/components/page-section","docs/2.components/page-section","A responsive section for your pages.",{"title":657,"path":658,"stem":659,"framework":16,"category":220,"description":660},"Pagination","/docs/components/pagination","docs/2.components/pagination","A list of buttons or links to navigate through pages.",{"title":662,"path":663,"stem":664,"framework":16,"category":282,"description":665},"PinInput","/docs/components/pin-input","docs/2.components/pin-input","An input element to enter a pin.",{"title":667,"path":668,"stem":669,"framework":16,"category":370,"description":670},"Popover","/docs/components/popover","docs/2.components/popover","A non-modal dialog that floats around a trigger element.",{"title":672,"path":673,"stem":674,"framework":16,"category":184,"description":675},"PricingPlan","/docs/components/pricing-plan","docs/2.components/pricing-plan","A customizable pricing plan to display in a pricing page.",{"title":677,"path":678,"stem":679,"framework":16,"category":184,"description":680},"PricingPlans","/docs/components/pricing-plans","docs/2.components/pricing-plans","Display a list of pricing plans in a responsive grid layout.",{"title":682,"path":683,"stem":684,"framework":16,"category":184,"description":685},"PricingTable","/docs/components/pricing-table","docs/2.components/pricing-table","A responsive pricing table component that displays tiered pricing plans with feature comparisons.",{"title":687,"path":688,"stem":689,"framework":16,"category":172,"description":690},"Progress","/docs/components/progress","docs/2.components/progress","An indicator showing the progress of a task.",{"title":692,"path":693,"stem":694,"framework":16,"category":282,"description":695},"RadioGroup","/docs/components/radio-group","docs/2.components/radio-group","A set of radio buttons to select a single option from a list.",{"title":697,"path":698,"stem":699,"framework":16,"category":166,"description":700,"badge":439},"ScrollArea","/docs/components/scroll-area","docs/2.components/scroll-area","A flexible scroll container with virtualization support.",{"title":702,"path":703,"stem":704,"framework":16,"category":282,"description":705},"Select","/docs/components/select","docs/2.components/select","A select element to choose from a list of options.",{"title":707,"path":708,"stem":709,"framework":16,"category":282,"description":710},"SelectMenu","/docs/components/select-menu","docs/2.components/select-menu","An advanced searchable select element.",{"title":712,"path":713,"stem":714,"framework":16,"category":172,"description":715},"Separator","/docs/components/separator","docs/2.components/separator","Separates content horizontally or vertically.",{"title":717,"path":718,"stem":719,"framework":16,"category":172,"description":720},"Skeleton","/docs/components/skeleton","docs/2.components/skeleton","A placeholder to show while content is loading.",{"title":722,"path":723,"stem":724,"framework":16,"category":370,"description":725},"Slideover","/docs/components/slideover","docs/2.components/slideover","A dialog that slides in from any side of the screen.",{"title":727,"path":728,"stem":729,"framework":16,"category":282,"description":730},"Slider","/docs/components/slider","docs/2.components/slider","An input to select a numeric value within a range.",{"title":732,"path":733,"stem":734,"framework":16,"category":220,"description":735},"Stepper","/docs/components/stepper","docs/2.components/stepper","A set of steps that are used to indicate progress through a multi-step process.",{"title":737,"path":738,"stem":739,"framework":16,"category":282,"description":740},"Switch","/docs/components/switch","docs/2.components/switch","A control that toggles between two states.",{"title":742,"path":743,"stem":744,"framework":16,"category":166,"description":745},"Table","/docs/components/table","docs/2.components/table","A responsive table element to display data in rows and columns.",{"title":747,"path":748,"stem":749,"framework":16,"category":220,"description":750},"Tabs","/docs/components/tabs","docs/2.components/tabs","A set of tab panels that are displayed one at a time.",{"title":752,"path":753,"stem":754,"framework":16,"category":282,"description":755},"Textarea","/docs/components/textarea","docs/2.components/textarea","A textarea element to input multi-line text.",{"title":757,"path":758,"stem":759,"framework":16,"category":166,"description":760},"Timeline","/docs/components/timeline","docs/2.components/timeline","A component that displays a sequence of events with dates, titles, icons or avatars.",{"title":762,"path":763,"stem":764,"framework":16,"category":370,"description":765},"Toast","/docs/components/toast","docs/2.components/toast","A succinct message to provide information or feedback to the user.",{"title":767,"path":768,"stem":769,"framework":16,"category":370,"description":770},"Tooltip","/docs/components/tooltip","docs/2.components/tooltip","A popup that reveals information when hovering over an element.",{"title":772,"path":773,"stem":774,"framework":16,"category":166,"description":775},"Tree","/docs/components/tree","docs/2.components/tree","A tree view component to display and interact with hierarchical data structures.",{"title":777,"path":778,"stem":779,"framework":16,"category":166,"description":780},"User","/docs/components/user","docs/2.components/user","Display user information with name, description and avatar.",{"title":782,"framework":16,"category":16,"description":16,"icon":783,"path":784,"stem":785,"children":786,"page":36},"Composables","i-lucide-square-function","/docs/composables","docs/3.composables",[787,792,797,802,807,812],{"title":788,"path":789,"stem":790,"framework":16,"category":16,"description":791},"defineLocale","/docs/composables/define-locale","docs/3.composables/define-locale","A utility to create a custom locale for your app.",{"title":793,"path":794,"stem":795,"framework":16,"category":16,"description":796},"defineShortcuts","/docs/composables/define-shortcuts","docs/3.composables/define-shortcuts","A composable to define keyboard shortcuts in your app.",{"title":798,"path":799,"stem":800,"framework":16,"category":16,"description":801},"extendLocale","/docs/composables/extend-locale","docs/3.composables/extend-locale","A utility to extend an existing locale with custom translations.",{"title":803,"path":804,"stem":805,"framework":16,"category":16,"description":806},"extractShortcuts","/docs/composables/extract-shortcuts","docs/3.composables/extract-shortcuts","A utility to extract keyboard shortcuts from menu items.",{"title":808,"path":809,"stem":810,"framework":16,"category":16,"description":811},"useOverlay","/docs/composables/use-overlay","docs/3.composables/use-overlay","A composable to programmatically control overlays.",{"title":813,"path":814,"stem":815,"framework":16,"category":16,"description":816},"useToast","/docs/composables/use-toast","docs/3.composables/use-toast","A composable to display toast notifications in your app.",{"title":818,"path":819,"stem":820,"children":821,"framework":28,"category":16,"description":16,"icon":917},"Typography","/docs/typography","docs/4.typography/1.index",[822,824,829,834,839,844,849,853,858,862,867,872,877,882,887,891,896,900,904,908,913],{"title":15,"path":819,"stem":820,"framework":28,"category":16,"description":823},"Beautiful typography components and utilities to style your content with Nuxt UI.",{"title":825,"path":826,"stem":827,"framework":28,"category":16,"description":828},"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":830,"path":831,"stem":832,"framework":28,"category":16,"description":833},"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":835,"path":836,"stem":837,"framework":28,"category":16,"description":838},"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":840,"path":841,"stem":842,"framework":28,"category":16,"description":843},"Code","/docs/typography/code","docs/4.typography/5.code","Display inline code and syntax-highlighted code blocks with copy-to-clipboard support.",{"title":163,"path":845,"stem":846,"framework":28,"category":847,"description":848},"/docs/typography/accordion","docs/4.typography/accordion","components","Create expandable content sections for better information organization.",{"title":197,"path":850,"stem":851,"framework":28,"category":847,"description":852},"/docs/typography/badge","docs/4.typography/badge","Display version numbers, status labels, and tags within your content.",{"title":854,"path":855,"stem":856,"framework":28,"category":847,"description":857},"Callout","/docs/typography/callout","docs/4.typography/callout","Highlight important information with eye-catching colored boxes and icons.",{"title":233,"path":859,"stem":860,"framework":28,"category":847,"description":861},"/docs/typography/card","docs/4.typography/card","Create highlighted content blocks with optional links and navigation.",{"title":863,"path":864,"stem":865,"framework":28,"category":847,"description":866},"CardGroup","/docs/typography/card-group","docs/4.typography/card-group","Organize multiple cards in responsive grid layouts for better content presentation.",{"title":868,"path":869,"stem":870,"framework":28,"category":847,"description":871},"CodeCollapse","/docs/typography/code-collapse","docs/4.typography/code-collapse","Make long code blocks collapsible to save space and improve readability.",{"title":873,"path":874,"stem":875,"framework":28,"category":847,"description":876},"CodeGroup","/docs/typography/code-group","docs/4.typography/code-group","Group multiple code examples in tabbed interfaces for easy comparison.",{"title":878,"path":879,"stem":880,"framework":28,"category":847,"description":881},"CodePreview","/docs/typography/code-preview","docs/4.typography/code-preview","Display code examples with a preview and their source for clearer documentation.",{"title":883,"path":884,"stem":885,"framework":28,"category":847,"description":886},"CodeTree","/docs/typography/code-tree","docs/4.typography/code-tree","Visualize file and folder structures with syntax-highlighted code.",{"title":295,"path":888,"stem":889,"framework":28,"category":847,"description":890},"/docs/typography/collapsible","docs/4.typography/collapsible","Toggle content visibility with smooth expand and collapse animations.",{"title":892,"path":893,"stem":894,"framework":28,"category":847,"description":895},"Field","/docs/typography/field","docs/4.typography/field","Document API parameters, props, and configuration options clearly.",{"title":476,"path":897,"stem":898,"framework":28,"category":847,"description":899},"/docs/typography/field-group","docs/4.typography/field-group","Group related fields together for comprehensive API documentation.",{"title":511,"path":901,"stem":902,"framework":28,"category":847,"description":903},"/docs/typography/icon","docs/4.typography/icon","Display icons from popular icon libraries to enhance your content.",{"title":546,"path":905,"stem":906,"framework":28,"category":847,"description":907},"/docs/typography/kbd","docs/4.typography/kbd","Display keyboard shortcuts and key combinations with proper styling.",{"title":909,"path":910,"stem":911,"framework":28,"category":847,"description":912},"Steps","/docs/typography/steps","docs/4.typography/steps","Transform headings into numbered step-by-step guides and tutorials.",{"title":747,"path":914,"stem":915,"framework":28,"category":847,"description":916},"/docs/typography/tabs","docs/4.typography/tabs","Organize related content in interactive tabbed interfaces.","i-lucide-square-pilcrow",{"id":919,"title":920,"body":16,"description":921,"extension":922,"hero":923,"meta":925,"navigation":36,"path":926,"seo":927,"stem":928,"__hash__":929},"blog/blog.yml","Blog","Tutorials, guides, and insights to help you build beautiful applications with Nuxt UI.","yml",{"title":924,"description":921},"Nuxt [UI]{.text-primary} Blog",{},"/blog",{"title":920,"description":921},"blog","ESl67YJxs4hhxlk_OHymZ1sSoeclVge2lYINtoN5zxg",[931],{"id":932,"title":933,"authors":934,"body":945,"date":11376,"description":11377,"extension":11378,"image":11379,"meta":11380,"navigation":36,"path":11382,"seo":11383,"stem":11384,"__hash__":11385},"posts/blog/how-to-build-an-ai-chat.md","Build an AI Chatbot with Nuxt, Nuxt UI, and AI SDK",[935,940],{"name":936,"avatar":937,"to":939},"Hugo Richard",{"src":938},"https://github.com/hugorcd.png","https://x.com/hugorcd",{"name":941,"avatar":942,"to":944},"Benjamin Canac",{"src":943},"https://github.com/benjamincanac.png","https://x.com/benjamincanac",{"type":946,"value":947,"toc":11343},"minimark",[948,952,957,960,995,1008,1012,1015,1031,1035,1038,1076,1081,1084,1228,1232,1239,1455,1458,1497,1501,1508,1603,1610,1627,1637,1641,1655,2386,2389,2407,2417,2421,2429,2433,2444,2812,2816,2843,4197,4200,4205,4212,4217,4228,4233,4242,4260,4265,4281,4294,4298,4301,4676,4680,4695,4699,4707,5283,5290,5315,5319,5338,6598,6601,6606,6617,6655,6670,6675,6682,6696,6701,6722,6727,6732,6739,6750,6754,6757,6761,6764,6917,6921,6946,7422,7426,7965,7969,9133,9142,9146,9153,9157,9167,9433,9437,9445,9694,9698,9701,10944,10948,10951,10956,10965,10969,10978,11181,11193,11197,11200,11215,11218,11233,11248,11256,11260,11263,11293,11296,11301,11336,11339],[949,950,951],"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.",[953,954,956],"h2",{"id":955},"what-were-building","What we're building",[949,958,959],{},"By the end of this tutorial, you'll have a fully functional AI chatbot with:",[961,962,963,971,977,983,989],"ul",{},[964,965,966,970],"li",{},[967,968,969],"strong",{},"Streaming responses"," that appear in real-time as the AI generates them",[964,972,973,976],{},[967,974,975],{},"A beautiful chat interface"," built with Nuxt UI's purpose-built chat components",[964,978,979,982],{},[967,980,981],{},"Markdown rendering"," for rich AI responses with code highlighting",[964,984,985,988],{},[967,986,987],{},"Multi-model support"," allowing users to switch between OpenAI, Anthropic, and Google models",[964,990,991,994],{},[967,992,993],{},"Server-side AI integration"," using Nitro API routes and the AI SDK",[996,997,1001],"callout",{"icon":998,"target":999,"to":1000},"i-simple-icons-github","_blank","https://github.com/nuxt-ui-templates/chat",[949,1002,1003,1004,1007],{},"Check out the complete ",[967,1005,1006],{},"AI Chat template"," on GitHub for a production-ready implementation with authentication, database persistence, and more.",[953,1009,1011],{"id":1010},"prerequisites","Prerequisites",[949,1013,1014],{},"Before we start, make sure you have:",[961,1016,1017,1020],{},[964,1018,1019],{},"Node.js 20+ installed",[964,1021,1022,1023,1030],{},"A ",[1024,1025,1029],"a",{"href":1026,"rel":1027},"https://vercel.com/docs/ai-gateway",[1028],"nofollow","Vercel AI Gateway"," API key (provides access to multiple AI providers through a single endpoint)",[953,1032,1034],{"id":1033},"project-setup","Project setup",[949,1036,1037],{},"Start by creating a new Nuxt project:",[1039,1040,1045],"pre",{"className":1041,"code":1042,"language":1043,"meta":1044,"style":1044},"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","",[1046,1047,1048,1067],"code",{"__ignoreMap":1044},[1049,1050,1053,1057,1061,1064],"span",{"class":1051,"line":1052},"line",1,[1049,1054,1056],{"class":1055},"sBMFI","npx",[1049,1058,1060],{"class":1059},"sfazB"," nuxi@latest",[1049,1062,1063],{"class":1059}," init",[1049,1065,1066],{"class":1059}," nuxt-ai-chat\n",[1049,1068,1070,1074],{"class":1051,"line":1069},2,[1049,1071,1073],{"class":1072},"s2Zo4","cd",[1049,1075,1066],{"class":1059},[1077,1078,1080],"h3",{"id":1079},"installing-dependencies","Installing dependencies",[949,1082,1083],{},"Install Nuxt UI and the AI-specific dependencies:",[1085,1086,1088,1131,1163,1196],"code-group",{"sync":1087},"pm",[1039,1089,1092],{"className":1041,"code":1090,"filename":1091,"language":1043,"meta":1044,"style":1044},"pnpm add @nuxt/ui tailwindcss @nuxtjs/mdc @nuxthub/core drizzle-orm drizzle-kit @libsql/client ai @ai-sdk/vue zod\n","pnpm",[1046,1093,1094],{"__ignoreMap":1044},[1049,1095,1096,1098,1101,1104,1107,1110,1113,1116,1119,1122,1125,1128],{"class":1051,"line":1052},[1049,1097,1091],{"class":1055},[1049,1099,1100],{"class":1059}," add",[1049,1102,1103],{"class":1059}," @nuxt/ui",[1049,1105,1106],{"class":1059}," tailwindcss",[1049,1108,1109],{"class":1059}," @nuxtjs/mdc",[1049,1111,1112],{"class":1059}," @nuxthub/core",[1049,1114,1115],{"class":1059}," drizzle-orm",[1049,1117,1118],{"class":1059}," drizzle-kit",[1049,1120,1121],{"class":1059}," @libsql/client",[1049,1123,1124],{"class":1059}," ai",[1049,1126,1127],{"class":1059}," @ai-sdk/vue",[1049,1129,1130],{"class":1059}," zod\n",[1039,1132,1135],{"className":1041,"code":1133,"filename":1134,"language":1043,"meta":1044,"style":1044},"yarn add @nuxt/ui tailwindcss @nuxtjs/mdc @nuxthub/core drizzle-orm drizzle-kit @libsql/client ai @ai-sdk/vue zod\n","yarn",[1046,1136,1137],{"__ignoreMap":1044},[1049,1138,1139,1141,1143,1145,1147,1149,1151,1153,1155,1157,1159,1161],{"class":1051,"line":1052},[1049,1140,1134],{"class":1055},[1049,1142,1100],{"class":1059},[1049,1144,1103],{"class":1059},[1049,1146,1106],{"class":1059},[1049,1148,1109],{"class":1059},[1049,1150,1112],{"class":1059},[1049,1152,1115],{"class":1059},[1049,1154,1118],{"class":1059},[1049,1156,1121],{"class":1059},[1049,1158,1124],{"class":1059},[1049,1160,1127],{"class":1059},[1049,1162,1130],{"class":1059},[1039,1164,1167],{"className":1041,"code":1165,"filename":1166,"language":1043,"meta":1044,"style":1044},"npm install @nuxt/ui tailwindcss @nuxtjs/mdc @nuxthub/core drizzle-orm drizzle-kit @libsql/client ai @ai-sdk/vue zod\n","npm",[1046,1168,1169],{"__ignoreMap":1044},[1049,1170,1171,1173,1176,1178,1180,1182,1184,1186,1188,1190,1192,1194],{"class":1051,"line":1052},[1049,1172,1166],{"class":1055},[1049,1174,1175],{"class":1059}," install",[1049,1177,1103],{"class":1059},[1049,1179,1106],{"class":1059},[1049,1181,1109],{"class":1059},[1049,1183,1112],{"class":1059},[1049,1185,1115],{"class":1059},[1049,1187,1118],{"class":1059},[1049,1189,1121],{"class":1059},[1049,1191,1124],{"class":1059},[1049,1193,1127],{"class":1059},[1049,1195,1130],{"class":1059},[1039,1197,1200],{"className":1041,"code":1198,"filename":1199,"language":1043,"meta":1044,"style":1044},"bun add @nuxt/ui tailwindcss @nuxtjs/mdc @nuxthub/core drizzle-orm drizzle-kit @libsql/client ai @ai-sdk/vue zod\n","bun",[1046,1201,1202],{"__ignoreMap":1044},[1049,1203,1204,1206,1208,1210,1212,1214,1216,1218,1220,1222,1224,1226],{"class":1051,"line":1052},[1049,1205,1199],{"class":1055},[1049,1207,1100],{"class":1059},[1049,1209,1103],{"class":1059},[1049,1211,1106],{"class":1059},[1049,1213,1109],{"class":1059},[1049,1215,1112],{"class":1059},[1049,1217,1115],{"class":1059},[1049,1219,1118],{"class":1059},[1049,1221,1121],{"class":1059},[1049,1223,1124],{"class":1059},[1049,1225,1127],{"class":1059},[1049,1227,1130],{"class":1059},[1077,1229,1231],{"id":1230},"configuration","Configuration",[949,1233,1234,1235,1238],{},"Update your ",[1046,1236,1237],{},"nuxt.config.ts"," to register the modules:",[1240,1241,1242],"code-tree-intersection",{},[1039,1243,1247],{"className":1244,"code":1245,"filename":1237,"language":1246,"meta":1044,"style":1044},"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",[1046,1248,1249,1269,1281,1296,1308,1319,1327,1333,1344,1360,1366,1371,1394,1399,1409,1419,1435,1441,1446],{"__ignoreMap":1044},[1049,1250,1251,1255,1258,1261,1265],{"class":1051,"line":1052},[1049,1252,1254],{"class":1253},"s7zQu","export",[1049,1256,1257],{"class":1253}," default",[1049,1259,1260],{"class":1072}," defineNuxtConfig",[1049,1262,1264],{"class":1263},"sTEyZ","(",[1049,1266,1268],{"class":1267},"sMK4o","{\n",[1049,1270,1271,1275,1278],{"class":1051,"line":1069},[1049,1272,1274],{"class":1273},"swJcz","  modules",[1049,1276,1277],{"class":1267},":",[1049,1279,1280],{"class":1263}," [\n",[1049,1282,1284,1287,1290,1293],{"class":1051,"line":1283},3,[1049,1285,1286],{"class":1267},"    '",[1049,1288,1289],{"class":1059},"@nuxt/ui",[1049,1291,1292],{"class":1267},"'",[1049,1294,1295],{"class":1267},",\n",[1049,1297,1299,1301,1304,1306],{"class":1051,"line":1298},4,[1049,1300,1286],{"class":1267},[1049,1302,1303],{"class":1059},"@nuxtjs/mdc",[1049,1305,1292],{"class":1267},[1049,1307,1295],{"class":1267},[1049,1309,1311,1313,1316],{"class":1051,"line":1310},5,[1049,1312,1286],{"class":1267},[1049,1314,1315],{"class":1059},"@nuxthub/core",[1049,1317,1318],{"class":1267},"'\n",[1049,1320,1322,1325],{"class":1051,"line":1321},6,[1049,1323,1324],{"class":1263},"  ]",[1049,1326,1295],{"class":1267},[1049,1328,1330],{"class":1051,"line":1329},7,[1049,1331,1332],{"emptyLinePlaceholder":21},"\n",[1049,1334,1336,1339,1341],{"class":1051,"line":1335},8,[1049,1337,1338],{"class":1273},"  hub",[1049,1340,1277],{"class":1267},[1049,1342,1343],{"class":1267}," {\n",[1049,1345,1347,1350,1352,1355,1358],{"class":1051,"line":1346},9,[1049,1348,1349],{"class":1273},"    db",[1049,1351,1277],{"class":1267},[1049,1353,1354],{"class":1267}," '",[1049,1356,1357],{"class":1059},"sqlite",[1049,1359,1318],{"class":1267},[1049,1361,1363],{"class":1051,"line":1362},10,[1049,1364,1365],{"class":1267},"  },\n",[1049,1367,1369],{"class":1051,"line":1368},11,[1049,1370,1332],{"emptyLinePlaceholder":21},[1049,1372,1374,1377,1379,1382,1384,1387,1389,1392],{"class":1051,"line":1373},12,[1049,1375,1376],{"class":1273},"  css",[1049,1378,1277],{"class":1267},[1049,1380,1381],{"class":1263}," [",[1049,1383,1292],{"class":1267},[1049,1385,1386],{"class":1059},"~/assets/css/main.css",[1049,1388,1292],{"class":1267},[1049,1390,1391],{"class":1263},"]",[1049,1393,1295],{"class":1267},[1049,1395,1397],{"class":1051,"line":1396},13,[1049,1398,1332],{"emptyLinePlaceholder":21},[1049,1400,1402,1405,1407],{"class":1051,"line":1401},14,[1049,1403,1404],{"class":1273},"  mdc",[1049,1406,1277],{"class":1267},[1049,1408,1343],{"class":1267},[1049,1410,1412,1415,1417],{"class":1051,"line":1411},15,[1049,1413,1414],{"class":1273},"    headings",[1049,1416,1277],{"class":1267},[1049,1418,1343],{"class":1267},[1049,1420,1422,1425,1427,1431],{"class":1051,"line":1421},16,[1049,1423,1424],{"class":1273},"      anchorLinks",[1049,1426,1277],{"class":1267},[1049,1428,1430],{"class":1429},"sfNiH"," false",[1049,1432,1434],{"class":1433},"sHwdD"," // Disable anchor links in AI responses\n",[1049,1436,1438],{"class":1051,"line":1437},17,[1049,1439,1440],{"class":1267},"    }\n",[1049,1442,1444],{"class":1051,"line":1443},18,[1049,1445,1365],{"class":1267},[1049,1447,1449,1452],{"class":1051,"line":1448},19,[1049,1450,1451],{"class":1267},"}",[1049,1453,1454],{"class":1263},")\n",[949,1456,1457],{},"Create the main CSS file to import Tailwind CSS and Nuxt UI:",[1240,1459,1460],{},[1039,1461,1466],{"className":1462,"code":1463,"filename":1464,"language":1465,"meta":1044,"style":1044},"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",[1046,1467,1468,1485],{"__ignoreMap":1044},[1049,1469,1470,1473,1476,1479,1482],{"class":1051,"line":1052},[1049,1471,1472],{"class":1253},"@import",[1049,1474,1475],{"class":1267}," \"",[1049,1477,1478],{"class":1059},"tailwindcss",[1049,1480,1481],{"class":1267},"\"",[1049,1483,1484],{"class":1267},";\n",[1049,1486,1487,1489,1491,1493,1495],{"class":1051,"line":1069},[1049,1488,1472],{"class":1253},[1049,1490,1475],{"class":1267},[1049,1492,1289],{"class":1059},[1049,1494,1481],{"class":1267},[1049,1496,1484],{"class":1267},[1077,1498,1500],{"id":1499},"setting-up-the-app","Setting up the app",[949,1502,1503,1504,1507],{},"Nuxt UI requires wrapping your app with ",[1046,1505,1506],{},"UApp"," for modals, toasts, and overlays to work properly:",[1240,1509,1510],{},[1039,1511,1516],{"className":1512,"code":1513,"filename":1514,"highlights":1515,"language":34,"meta":1044,"style":1044},"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",[1069,1321],[1046,1517,1518,1529,1540,1564,1575,1584,1594],{"__ignoreMap":1044},[1049,1519,1520,1523,1526],{"class":1051,"line":1052},[1049,1521,1522],{"class":1267},"\u003C",[1049,1524,1525],{"class":1273},"template",[1049,1527,1528],{"class":1267},">\n",[1049,1530,1533,1536,1538],{"class":1531,"line":1069},[1051,1532],"highlight",[1049,1534,1535],{"class":1267},"  \u003C",[1049,1537,1506],{"class":1273},[1049,1539,1528],{"class":1267},[1049,1541,1542,1545,1548,1552,1555,1557,1560,1562],{"class":1051,"line":1283},[1049,1543,1544],{"class":1267},"    \u003C",[1049,1546,1547],{"class":1273},"UDashboardGroup",[1049,1549,1551],{"class":1550},"spNyl"," unit",[1049,1553,1554],{"class":1267},"=",[1049,1556,1481],{"class":1267},[1049,1558,1559],{"class":1059},"rem",[1049,1561,1481],{"class":1267},[1049,1563,1528],{"class":1267},[1049,1565,1566,1569,1572],{"class":1051,"line":1298},[1049,1567,1568],{"class":1267},"      \u003C",[1049,1570,1571],{"class":1273},"NuxtPage",[1049,1573,1574],{"class":1267}," />\n",[1049,1576,1577,1580,1582],{"class":1051,"line":1310},[1049,1578,1579],{"class":1267},"    \u003C/",[1049,1581,1547],{"class":1273},[1049,1583,1528],{"class":1267},[1049,1585,1587,1590,1592],{"class":1586,"line":1321},[1051,1532],[1049,1588,1589],{"class":1267},"  \u003C/",[1049,1591,1506],{"class":1273},[1049,1593,1528],{"class":1267},[1049,1595,1596,1599,1601],{"class":1051,"line":1329},[1049,1597,1598],{"class":1267},"\u003C/",[1049,1600,1525],{"class":1273},[1049,1602,1528],{"class":1267},[949,1604,1605,1606,1609],{},"Create a ",[1046,1607,1608],{},".env"," file with your AI Gateway API key:",[1240,1611,1612],{},[1039,1613,1615],{"className":1041,"code":1614,"filename":1608,"language":1043,"meta":1044,"style":1044},"AI_GATEWAY_API_KEY=your-api-key-here\n",[1046,1616,1617],{"__ignoreMap":1044},[1049,1618,1619,1622,1624],{"class":1051,"line":1052},[1049,1620,1621],{"class":1263},"AI_GATEWAY_API_KEY",[1049,1623,1554],{"class":1267},[1049,1625,1626],{"class":1059},"your-api-key-here\n",[1628,1629,1630],"note",{},[949,1631,1632,1633,1636],{},"With ",[1024,1634,1029],{"href":1026,"rel":1635},[1028],", 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.",[1077,1638,1640],{"id":1639},"setting-up-the-database","Setting up the database",[949,1642,1643,1648,1649,1654],{},[1024,1644,1647],{"href":1645,"rel":1646},"https://hub.nuxt.com",[1028],"NuxtHub"," provides a zero-config database powered by ",[1024,1650,1653],{"href":1651,"rel":1652},"https://orm.drizzle.team",[1028],"Drizzle ORM",". Here is the schema for the chat application:",[1240,1656,1657],{},[1658,1659,1660],"code-collapse",{},[1039,1661,1664],{"className":1244,"code":1662,"filename":1663,"language":1246,"meta":1044,"style":1044},"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",[1046,1665,1666,1706,1726,1730,1757,1802,1815,1872,1878,1882,1917,1929,1936,1940,1966,2011,2077,2146,2185,2235,2248,2278,2284,2289,2321,2337,2355,2371,2379],{"__ignoreMap":1044},[1049,1667,1668,1671,1674,1677,1680,1683,1685,1688,1690,1693,1696,1699,1701,1704],{"class":1051,"line":1052},[1049,1669,1670],{"class":1253},"import",[1049,1672,1673],{"class":1267}," {",[1049,1675,1676],{"class":1263}," sqliteTable",[1049,1678,1679],{"class":1267},",",[1049,1681,1682],{"class":1263}," text",[1049,1684,1679],{"class":1267},[1049,1686,1687],{"class":1263}," integer",[1049,1689,1679],{"class":1267},[1049,1691,1692],{"class":1263}," index",[1049,1694,1695],{"class":1267}," }",[1049,1697,1698],{"class":1253}," from",[1049,1700,1354],{"class":1267},[1049,1702,1703],{"class":1059},"drizzle-orm/sqlite-core",[1049,1705,1318],{"class":1267},[1049,1707,1708,1710,1712,1715,1717,1719,1721,1724],{"class":1051,"line":1069},[1049,1709,1670],{"class":1253},[1049,1711,1673],{"class":1267},[1049,1713,1714],{"class":1263}," relations",[1049,1716,1695],{"class":1267},[1049,1718,1698],{"class":1253},[1049,1720,1354],{"class":1267},[1049,1722,1723],{"class":1059},"drizzle-orm",[1049,1725,1318],{"class":1267},[1049,1727,1728],{"class":1051,"line":1283},[1049,1729,1332],{"emptyLinePlaceholder":21},[1049,1731,1732,1734,1737,1740,1742,1744,1746,1748,1751,1753,1755],{"class":1051,"line":1298},[1049,1733,1254],{"class":1253},[1049,1735,1736],{"class":1550}," const",[1049,1738,1739],{"class":1263}," chats ",[1049,1741,1554],{"class":1267},[1049,1743,1676],{"class":1072},[1049,1745,1264],{"class":1263},[1049,1747,1292],{"class":1267},[1049,1749,1750],{"class":1059},"chats",[1049,1752,1292],{"class":1267},[1049,1754,1679],{"class":1267},[1049,1756,1343],{"class":1267},[1049,1758,1759,1762,1764,1766,1769,1772,1775,1777,1779,1782,1784,1786,1789,1792,1794,1797,1800],{"class":1051,"line":1310},[1049,1760,1761],{"class":1273},"  id",[1049,1763,1277],{"class":1267},[1049,1765,1682],{"class":1072},[1049,1767,1768],{"class":1263},"()",[1049,1770,1771],{"class":1267},".",[1049,1773,1774],{"class":1072},"primaryKey",[1049,1776,1768],{"class":1263},[1049,1778,1771],{"class":1267},[1049,1780,1781],{"class":1072},"$defaultFn",[1049,1783,1264],{"class":1263},[1049,1785,1768],{"class":1267},[1049,1787,1788],{"class":1550}," =>",[1049,1790,1791],{"class":1263}," crypto",[1049,1793,1771],{"class":1267},[1049,1795,1796],{"class":1072},"randomUUID",[1049,1798,1799],{"class":1263},"())",[1049,1801,1295],{"class":1267},[1049,1803,1804,1807,1809,1811,1813],{"class":1051,"line":1321},[1049,1805,1806],{"class":1273},"  title",[1049,1808,1277],{"class":1267},[1049,1810,1682],{"class":1072},[1049,1812,1768],{"class":1263},[1049,1814,1295],{"class":1267},[1049,1816,1817,1820,1822,1824,1826,1829,1832,1834,1836,1839,1841,1843,1846,1848,1851,1853,1855,1857,1859,1861,1863,1866,1869],{"class":1051,"line":1329},[1049,1818,1819],{"class":1273},"  createdAt",[1049,1821,1277],{"class":1267},[1049,1823,1687],{"class":1072},[1049,1825,1264],{"class":1263},[1049,1827,1828],{"class":1267},"{",[1049,1830,1831],{"class":1273}," mode",[1049,1833,1277],{"class":1267},[1049,1835,1354],{"class":1267},[1049,1837,1838],{"class":1059},"timestamp",[1049,1840,1292],{"class":1267},[1049,1842,1695],{"class":1267},[1049,1844,1845],{"class":1263},")",[1049,1847,1771],{"class":1267},[1049,1849,1850],{"class":1072},"notNull",[1049,1852,1768],{"class":1263},[1049,1854,1771],{"class":1267},[1049,1856,1781],{"class":1072},[1049,1858,1264],{"class":1263},[1049,1860,1768],{"class":1267},[1049,1862,1788],{"class":1550},[1049,1864,1865],{"class":1267}," new",[1049,1867,1868],{"class":1072}," Date",[1049,1870,1871],{"class":1263},"())\n",[1049,1873,1874,1876],{"class":1051,"line":1335},[1049,1875,1451],{"class":1267},[1049,1877,1454],{"class":1263},[1049,1879,1880],{"class":1051,"line":1346},[1049,1881,1332],{"emptyLinePlaceholder":21},[1049,1883,1884,1886,1888,1891,1893,1895,1898,1900,1903,1907,1910,1912,1915],{"class":1051,"line":1362},[1049,1885,1254],{"class":1253},[1049,1887,1736],{"class":1550},[1049,1889,1890],{"class":1263}," chatsRelations ",[1049,1892,1554],{"class":1267},[1049,1894,1714],{"class":1072},[1049,1896,1897],{"class":1263},"(chats",[1049,1899,1679],{"class":1267},[1049,1901,1902],{"class":1267}," ({",[1049,1904,1906],{"class":1905},"sHdIc"," many",[1049,1908,1909],{"class":1267}," })",[1049,1911,1788],{"class":1550},[1049,1913,1914],{"class":1263}," (",[1049,1916,1268],{"class":1267},[1049,1918,1919,1922,1924,1926],{"class":1051,"line":1368},[1049,1920,1921],{"class":1273},"  messages",[1049,1923,1277],{"class":1267},[1049,1925,1906],{"class":1072},[1049,1927,1928],{"class":1263},"(messages)\n",[1049,1930,1931,1933],{"class":1051,"line":1373},[1049,1932,1451],{"class":1267},[1049,1934,1935],{"class":1263},"))\n",[1049,1937,1938],{"class":1051,"line":1396},[1049,1939,1332],{"emptyLinePlaceholder":21},[1049,1941,1942,1944,1946,1949,1951,1953,1955,1957,1960,1962,1964],{"class":1051,"line":1401},[1049,1943,1254],{"class":1253},[1049,1945,1736],{"class":1550},[1049,1947,1948],{"class":1263}," messages ",[1049,1950,1554],{"class":1267},[1049,1952,1676],{"class":1072},[1049,1954,1264],{"class":1263},[1049,1956,1292],{"class":1267},[1049,1958,1959],{"class":1059},"messages",[1049,1961,1292],{"class":1267},[1049,1963,1679],{"class":1267},[1049,1965,1343],{"class":1267},[1049,1967,1968,1970,1972,1974,1976,1978,1981,1983,1985,1987,1989,1991,1993,1995,1997,1999,2001,2003,2005,2007,2009],{"class":1051,"line":1411},[1049,1969,1761],{"class":1273},[1049,1971,1277],{"class":1267},[1049,1973,1682],{"class":1072},[1049,1975,1264],{"class":1263},[1049,1977,1292],{"class":1267},[1049,1979,1980],{"class":1059},"id",[1049,1982,1292],{"class":1267},[1049,1984,1845],{"class":1263},[1049,1986,1771],{"class":1267},[1049,1988,1774],{"class":1072},[1049,1990,1768],{"class":1263},[1049,1992,1771],{"class":1267},[1049,1994,1781],{"class":1072},[1049,1996,1264],{"class":1263},[1049,1998,1768],{"class":1267},[1049,2000,1788],{"class":1550},[1049,2002,1791],{"class":1263},[1049,2004,1771],{"class":1267},[1049,2006,1796],{"class":1072},[1049,2008,1799],{"class":1263},[1049,2010,1295],{"class":1267},[1049,2012,2013,2016,2018,2020,2022,2024,2027,2029,2031,2033,2035,2037,2039,2042,2044,2046,2048,2051,2053,2055,2057,2059,2062,2064,2066,2069,2071,2073,2075],{"class":1051,"line":1421},[1049,2014,2015],{"class":1273},"  chatId",[1049,2017,1277],{"class":1267},[1049,2019,1682],{"class":1072},[1049,2021,1264],{"class":1263},[1049,2023,1292],{"class":1267},[1049,2025,2026],{"class":1059},"chat_id",[1049,2028,1292],{"class":1267},[1049,2030,1845],{"class":1263},[1049,2032,1771],{"class":1267},[1049,2034,1850],{"class":1072},[1049,2036,1768],{"class":1263},[1049,2038,1771],{"class":1267},[1049,2040,2041],{"class":1072},"references",[1049,2043,1264],{"class":1263},[1049,2045,1768],{"class":1267},[1049,2047,1788],{"class":1550},[1049,2049,2050],{"class":1263}," chats",[1049,2052,1771],{"class":1267},[1049,2054,1980],{"class":1263},[1049,2056,1679],{"class":1267},[1049,2058,1673],{"class":1267},[1049,2060,2061],{"class":1273}," onDelete",[1049,2063,1277],{"class":1267},[1049,2065,1354],{"class":1267},[1049,2067,2068],{"class":1059},"cascade",[1049,2070,1292],{"class":1267},[1049,2072,1695],{"class":1267},[1049,2074,1845],{"class":1263},[1049,2076,1295],{"class":1267},[1049,2078,2079,2082,2084,2086,2088,2090,2093,2095,2097,2099,2102,2104,2106,2108,2111,2113,2115,2117,2120,2122,2124,2126,2129,2131,2134,2136,2138,2140,2142,2144],{"class":1051,"line":1437},[1049,2080,2081],{"class":1273},"  role",[1049,2083,1277],{"class":1267},[1049,2085,1682],{"class":1072},[1049,2087,1264],{"class":1263},[1049,2089,1292],{"class":1267},[1049,2091,2092],{"class":1059},"role",[1049,2094,1292],{"class":1267},[1049,2096,1679],{"class":1267},[1049,2098,1673],{"class":1267},[1049,2100,2101],{"class":1273}," enum",[1049,2103,1277],{"class":1267},[1049,2105,1381],{"class":1263},[1049,2107,1292],{"class":1267},[1049,2109,2110],{"class":1059},"user",[1049,2112,1292],{"class":1267},[1049,2114,1679],{"class":1267},[1049,2116,1354],{"class":1267},[1049,2118,2119],{"class":1059},"assistant",[1049,2121,1292],{"class":1267},[1049,2123,1679],{"class":1267},[1049,2125,1354],{"class":1267},[1049,2127,2128],{"class":1059},"system",[1049,2130,1292],{"class":1267},[1049,2132,2133],{"class":1263},"] ",[1049,2135,1451],{"class":1267},[1049,2137,1845],{"class":1263},[1049,2139,1771],{"class":1267},[1049,2141,1850],{"class":1072},[1049,2143,1768],{"class":1263},[1049,2145,1295],{"class":1267},[1049,2147,2148,2151,2153,2155,2157,2159,2162,2164,2166,2168,2170,2172,2174,2177,2179,2181,2183],{"class":1051,"line":1443},[1049,2149,2150],{"class":1273},"  parts",[1049,2152,1277],{"class":1267},[1049,2154,1682],{"class":1072},[1049,2156,1264],{"class":1263},[1049,2158,1292],{"class":1267},[1049,2160,2161],{"class":1059},"parts",[1049,2163,1292],{"class":1267},[1049,2165,1679],{"class":1267},[1049,2167,1673],{"class":1267},[1049,2169,1831],{"class":1273},[1049,2171,1277],{"class":1267},[1049,2173,1354],{"class":1267},[1049,2175,2176],{"class":1059},"json",[1049,2178,1292],{"class":1267},[1049,2180,1695],{"class":1267},[1049,2182,1845],{"class":1263},[1049,2184,1295],{"class":1267},[1049,2186,2187,2189,2191,2193,2195,2197,2199,2201,2203,2205,2207,2209,2211,2213,2215,2217,2219,2221,2223,2225,2227,2229,2231,2233],{"class":1051,"line":1448},[1049,2188,1819],{"class":1273},[1049,2190,1277],{"class":1267},[1049,2192,1687],{"class":1072},[1049,2194,1264],{"class":1263},[1049,2196,1828],{"class":1267},[1049,2198,1831],{"class":1273},[1049,2200,1277],{"class":1267},[1049,2202,1354],{"class":1267},[1049,2204,1838],{"class":1059},[1049,2206,1292],{"class":1267},[1049,2208,1695],{"class":1267},[1049,2210,1845],{"class":1263},[1049,2212,1771],{"class":1267},[1049,2214,1850],{"class":1072},[1049,2216,1768],{"class":1263},[1049,2218,1771],{"class":1267},[1049,2220,1781],{"class":1072},[1049,2222,1264],{"class":1263},[1049,2224,1768],{"class":1267},[1049,2226,1788],{"class":1550},[1049,2228,1865],{"class":1267},[1049,2230,1868],{"class":1072},[1049,2232,1799],{"class":1263},[1049,2234,1295],{"class":1267},[1049,2236,2238,2241,2244,2246],{"class":1051,"line":2237},20,[1049,2239,2240],{"class":1267},"},",[1049,2242,2243],{"class":1905}," table",[1049,2245,1788],{"class":1550},[1049,2247,1280],{"class":1263},[1049,2249,2251,2254,2256,2258,2261,2263,2265,2267,2270,2273,2275],{"class":1051,"line":2250},21,[1049,2252,2253],{"class":1072},"  index",[1049,2255,1264],{"class":1263},[1049,2257,1292],{"class":1267},[1049,2259,2260],{"class":1059},"messages_chat_id_idx",[1049,2262,1292],{"class":1267},[1049,2264,1845],{"class":1263},[1049,2266,1771],{"class":1267},[1049,2268,2269],{"class":1072},"on",[1049,2271,2272],{"class":1263},"(table",[1049,2274,1771],{"class":1267},[1049,2276,2277],{"class":1263},"chatId)\n",[1049,2279,2281],{"class":1051,"line":2280},22,[1049,2282,2283],{"class":1263},"])\n",[1049,2285,2287],{"class":1051,"line":2286},23,[1049,2288,1332],{"emptyLinePlaceholder":21},[1049,2290,2292,2294,2296,2299,2301,2303,2306,2308,2310,2313,2315,2317,2319],{"class":1051,"line":2291},24,[1049,2293,1254],{"class":1253},[1049,2295,1736],{"class":1550},[1049,2297,2298],{"class":1263}," messagesRelations ",[1049,2300,1554],{"class":1267},[1049,2302,1714],{"class":1072},[1049,2304,2305],{"class":1263},"(messages",[1049,2307,1679],{"class":1267},[1049,2309,1902],{"class":1267},[1049,2311,2312],{"class":1905}," one",[1049,2314,1909],{"class":1267},[1049,2316,1788],{"class":1550},[1049,2318,1914],{"class":1263},[1049,2320,1268],{"class":1267},[1049,2322,2324,2327,2329,2331,2333,2335],{"class":1051,"line":2323},25,[1049,2325,2326],{"class":1273},"  chat",[1049,2328,1277],{"class":1267},[1049,2330,2312],{"class":1072},[1049,2332,1897],{"class":1263},[1049,2334,1679],{"class":1267},[1049,2336,1343],{"class":1267},[1049,2338,2340,2343,2345,2348,2350,2353],{"class":1051,"line":2339},26,[1049,2341,2342],{"class":1273},"    fields",[1049,2344,1277],{"class":1267},[1049,2346,2347],{"class":1263}," [messages",[1049,2349,1771],{"class":1267},[1049,2351,2352],{"class":1263},"chatId]",[1049,2354,1295],{"class":1267},[1049,2356,2358,2361,2363,2366,2368],{"class":1051,"line":2357},27,[1049,2359,2360],{"class":1273},"    references",[1049,2362,1277],{"class":1267},[1049,2364,2365],{"class":1263}," [chats",[1049,2367,1771],{"class":1267},[1049,2369,2370],{"class":1263},"id]\n",[1049,2372,2374,2377],{"class":1051,"line":2373},28,[1049,2375,2376],{"class":1267},"  }",[1049,2378,1454],{"class":1263},[1049,2380,2382,2384],{"class":1051,"line":2381},29,[1049,2383,1451],{"class":1267},[1049,2385,1935],{"class":1263},[949,2387,2388],{},"Generate the database migrations from your schema:",[1039,2390,2392],{"className":1041,"code":2391,"language":1043,"meta":1044,"style":1044},"npx nuxt db generate\n",[1046,2393,2394],{"__ignoreMap":1044},[1049,2395,2396,2398,2401,2404],{"class":1051,"line":1052},[1049,2397,1056],{"class":1055},[1049,2399,2400],{"class":1059}," nuxt",[1049,2402,2403],{"class":1059}," db",[1049,2405,2406],{"class":1059}," generate\n",[2408,2409,2410],"tip",{},[949,2411,2412,2413,2416],{},"Migrations are automatically applied when you start the development server with ",[1046,2414,2415],{},"npx nuxt dev",". NuxtHub uses SQLite locally, so no external database is required during development.",[953,2418,2420],{"id":2419},"building-the-backend","Building the backend",[949,2422,2423,2424,1771],{},"This section covers integrating AI on the server. The following API endpoints handle chat creation, AI streaming, and data persistence using ",[1024,2425,2428],{"href":2426,"rel":2427},"https://nitro.build",[1028],"Nitro",[1077,2430,2432],{"id":2431},"creating-a-chat","Creating a chat",[949,2434,2435,2436,2443],{},"First, create the endpoint that initializes a new chat and saves the first message to the database. This uses the ",[1024,2437,2440],{"href":2438,"rel":2439},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/ui-message",[1028],[1046,2441,2442],{},"UIMessage"," type from the AI SDK:",[1240,2445,2446],{},[1039,2447,2450],{"className":1244,"code":2448,"filename":2449,"language":1246,"meta":1044,"style":1044},"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",[1046,2451,2452,2476,2499,2523,2543,2547,2571,2608,2632,2645,2649,2654,2705,2709,2714,2743,2759,2774,2788,2794,2798,2806],{"__ignoreMap":1044},[1049,2453,2454,2456,2458,2461,2463,2466,2468,2470,2472,2474],{"class":1051,"line":1052},[1049,2455,1670],{"class":1253},[1049,2457,1673],{"class":1267},[1049,2459,2460],{"class":1263}," defineEventHandler",[1049,2462,1679],{"class":1267},[1049,2464,2465],{"class":1263}," readValidatedBody",[1049,2467,1695],{"class":1267},[1049,2469,1698],{"class":1253},[1049,2471,1354],{"class":1267},[1049,2473,1077],{"class":1059},[1049,2475,1318],{"class":1267},[1049,2477,2478,2480,2483,2485,2488,2490,2492,2494,2497],{"class":1051,"line":1069},[1049,2479,1670],{"class":1253},[1049,2481,2482],{"class":1253}," type",[1049,2484,1673],{"class":1267},[1049,2486,2487],{"class":1263}," UIMessage",[1049,2489,1695],{"class":1267},[1049,2491,1698],{"class":1253},[1049,2493,1354],{"class":1267},[1049,2495,2496],{"class":1059},"ai",[1049,2498,1318],{"class":1267},[1049,2500,2501,2503,2505,2507,2509,2512,2514,2516,2518,2521],{"class":1051,"line":1283},[1049,2502,1670],{"class":1253},[1049,2504,1673],{"class":1267},[1049,2506,2403],{"class":1263},[1049,2508,1679],{"class":1267},[1049,2510,2511],{"class":1263}," schema",[1049,2513,1695],{"class":1267},[1049,2515,1698],{"class":1253},[1049,2517,1354],{"class":1267},[1049,2519,2520],{"class":1059},"hub:db",[1049,2522,1318],{"class":1267},[1049,2524,2525,2527,2529,2532,2534,2536,2538,2541],{"class":1051,"line":1298},[1049,2526,1670],{"class":1253},[1049,2528,1673],{"class":1267},[1049,2530,2531],{"class":1263}," z",[1049,2533,1695],{"class":1267},[1049,2535,1698],{"class":1253},[1049,2537,1354],{"class":1267},[1049,2539,2540],{"class":1059},"zod",[1049,2542,1318],{"class":1267},[1049,2544,2545],{"class":1051,"line":1310},[1049,2546,1332],{"emptyLinePlaceholder":21},[1049,2548,2549,2551,2553,2555,2557,2560,2562,2565,2567,2569],{"class":1051,"line":1321},[1049,2550,1254],{"class":1253},[1049,2552,1257],{"class":1253},[1049,2554,2460],{"class":1072},[1049,2556,1264],{"class":1263},[1049,2558,2559],{"class":1550},"async",[1049,2561,1914],{"class":1267},[1049,2563,2564],{"class":1905},"event",[1049,2566,1845],{"class":1267},[1049,2568,1788],{"class":1550},[1049,2570,1343],{"class":1267},[1049,2572,2573,2576,2578,2581,2583,2586,2589,2591,2593,2595,2597,2599,2601,2604,2606],{"class":1051,"line":1329},[1049,2574,2575],{"class":1550},"  const",[1049,2577,1673],{"class":1267},[1049,2579,2580],{"class":1263}," message",[1049,2582,1695],{"class":1267},[1049,2584,2585],{"class":1267}," =",[1049,2587,2588],{"class":1253}," await",[1049,2590,2465],{"class":1072},[1049,2592,1264],{"class":1273},[1049,2594,2564],{"class":1263},[1049,2596,1679],{"class":1267},[1049,2598,2531],{"class":1263},[1049,2600,1771],{"class":1267},[1049,2602,2603],{"class":1072},"object",[1049,2605,1264],{"class":1273},[1049,2607,1268],{"class":1267},[1049,2609,2610,2613,2615,2617,2619,2622,2624,2626,2629],{"class":1051,"line":1335},[1049,2611,2612],{"class":1273},"    message",[1049,2614,1277],{"class":1267},[1049,2616,2531],{"class":1263},[1049,2618,1771],{"class":1267},[1049,2620,2621],{"class":1072},"custom",[1049,2623,1522],{"class":1267},[1049,2625,2442],{"class":1055},[1049,2627,2628],{"class":1267},">",[1049,2630,2631],{"class":1273},"()\n",[1049,2633,2634,2636,2638,2640,2643],{"class":1051,"line":1346},[1049,2635,2376],{"class":1267},[1049,2637,1845],{"class":1273},[1049,2639,1771],{"class":1267},[1049,2641,2642],{"class":1263},"parse",[1049,2644,1454],{"class":1273},[1049,2646,2647],{"class":1051,"line":1362},[1049,2648,1332],{"emptyLinePlaceholder":21},[1049,2650,2651],{"class":1051,"line":1368},[1049,2652,2653],{"class":1433},"  // Create a new chat\n",[1049,2655,2656,2658,2660,2662,2664,2666,2668,2670,2672,2675,2677,2680,2682,2684,2686,2688,2691,2693,2696,2698,2700,2703],{"class":1051,"line":1373},[1049,2657,2575],{"class":1550},[1049,2659,1381],{"class":1267},[1049,2661,256],{"class":1263},[1049,2663,1391],{"class":1267},[1049,2665,2585],{"class":1267},[1049,2667,2588],{"class":1253},[1049,2669,2403],{"class":1263},[1049,2671,1771],{"class":1267},[1049,2673,2674],{"class":1072},"insert",[1049,2676,1264],{"class":1273},[1049,2678,2679],{"class":1263},"schema",[1049,2681,1771],{"class":1267},[1049,2683,1750],{"class":1263},[1049,2685,1845],{"class":1273},[1049,2687,1771],{"class":1267},[1049,2689,2690],{"class":1072},"values",[1049,2692,1264],{"class":1273},[1049,2694,2695],{"class":1267},"{}",[1049,2697,1845],{"class":1273},[1049,2699,1771],{"class":1267},[1049,2701,2702],{"class":1072},"returning",[1049,2704,2631],{"class":1273},[1049,2706,2707],{"class":1051,"line":1396},[1049,2708,1332],{"emptyLinePlaceholder":21},[1049,2710,2711],{"class":1051,"line":1401},[1049,2712,2713],{"class":1433},"  // Save the first user message\n",[1049,2715,2716,2719,2721,2723,2725,2727,2729,2731,2733,2735,2737,2739,2741],{"class":1051,"line":1411},[1049,2717,2718],{"class":1253},"  await",[1049,2720,2403],{"class":1263},[1049,2722,1771],{"class":1267},[1049,2724,2674],{"class":1072},[1049,2726,1264],{"class":1273},[1049,2728,2679],{"class":1263},[1049,2730,1771],{"class":1267},[1049,2732,1959],{"class":1263},[1049,2734,1845],{"class":1273},[1049,2736,1771],{"class":1267},[1049,2738,2690],{"class":1072},[1049,2740,1264],{"class":1273},[1049,2742,1268],{"class":1267},[1049,2744,2745,2748,2750,2753,2755,2757],{"class":1051,"line":1421},[1049,2746,2747],{"class":1273},"    chatId",[1049,2749,1277],{"class":1267},[1049,2751,2752],{"class":1263}," chat",[1049,2754,1771],{"class":1267},[1049,2756,1980],{"class":1263},[1049,2758,1295],{"class":1267},[1049,2760,2761,2764,2766,2768,2770,2772],{"class":1051,"line":1437},[1049,2762,2763],{"class":1273},"    role",[1049,2765,1277],{"class":1267},[1049,2767,1354],{"class":1267},[1049,2769,2110],{"class":1059},[1049,2771,1292],{"class":1267},[1049,2773,1295],{"class":1267},[1049,2775,2776,2779,2781,2783,2785],{"class":1051,"line":1443},[1049,2777,2778],{"class":1273},"    parts",[1049,2780,1277],{"class":1267},[1049,2782,2580],{"class":1263},[1049,2784,1771],{"class":1267},[1049,2786,2787],{"class":1263},"parts\n",[1049,2789,2790,2792],{"class":1051,"line":1448},[1049,2791,2376],{"class":1267},[1049,2793,1454],{"class":1273},[1049,2795,2796],{"class":1051,"line":2237},[1049,2797,1332],{"emptyLinePlaceholder":21},[1049,2799,2800,2803],{"class":1051,"line":2250},[1049,2801,2802],{"class":1253},"  return",[1049,2804,2805],{"class":1263}," chat\n",[1049,2807,2808,2810],{"class":1051,"line":2280},[1049,2809,1451],{"class":1267},[1049,2811,1454],{"class":1263},[1077,2813,2815],{"id":2814},"streaming-ai-responses","Streaming AI responses",[949,2817,2818,2819,2826,2827,2834,2835,2842],{},"Next, create the endpoint that handles the AI conversation. This endpoint uses ",[1024,2820,2823],{"href":2821,"rel":2822},"https://ai-sdk.dev/docs/reference/ai-sdk-core/stream-text",[1028],[1046,2824,2825],{},"streamText",", ",[1024,2828,2831],{"href":2829,"rel":2830},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/create-ui-message-stream",[1028],[1046,2832,2833],{},"createUIMessageStream",", and ",[1024,2836,2839],{"href":2837,"rel":2838},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/create-ui-message-stream-response",[1028],[1046,2840,2841],{},"createUIMessageStreamResponse"," from the AI SDK:",[1240,2844,2845],{},[1658,2846,2847],{},[1039,2848,2851],{"className":1244,"code":2849,"filename":2850,"language":1246,"meta":1044,"style":1044},"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",[1046,2852,2853,2885,2904,2926,2944,2950,2957,2964,2971,2978,2983,2995,3015,3019,3041,3074,3090,3102,3106,3144,3177,3208,3220,3224,3229,3259,3302,3308,3312,3329,3368,3374,3379,3385,3405,3433,3449,3468,3496,3504,3509,3575,3580,3585,3591,3621,3663,3692,3704,3720,3734,3741,3746,3751,3757,3774,3796,3814,3822,3839,3858,3866,3871,3877,3897,3912,3929,3953,3964,3972,3978,3983,4006,4012,4032,4038,4084,4100,4133,4147,4155,4160,4167,4172,4190],{"__ignoreMap":1044},[1049,2854,2855,2857,2859,2862,2864,2866,2868,2871,2873,2875,2877,2879,2881,2883],{"class":1051,"line":1052},[1049,2856,1670],{"class":1253},[1049,2858,1673],{"class":1267},[1049,2860,2861],{"class":1263}," createError",[1049,2863,1679],{"class":1267},[1049,2865,2460],{"class":1263},[1049,2867,1679],{"class":1267},[1049,2869,2870],{"class":1263}," getValidatedRouterParams",[1049,2872,1679],{"class":1267},[1049,2874,2465],{"class":1263},[1049,2876,1695],{"class":1267},[1049,2878,1698],{"class":1253},[1049,2880,1354],{"class":1267},[1049,2882,1077],{"class":1059},[1049,2884,1318],{"class":1267},[1049,2886,2887,2889,2891,2894,2896,2898,2900,2902],{"class":1051,"line":1069},[1049,2888,1670],{"class":1253},[1049,2890,1673],{"class":1267},[1049,2892,2893],{"class":1263}," eq",[1049,2895,1695],{"class":1267},[1049,2897,1698],{"class":1253},[1049,2899,1354],{"class":1267},[1049,2901,1723],{"class":1059},[1049,2903,1318],{"class":1267},[1049,2905,2906,2908,2910,2912,2914,2916,2918,2920,2922,2924],{"class":1051,"line":1283},[1049,2907,1670],{"class":1253},[1049,2909,1673],{"class":1267},[1049,2911,2403],{"class":1263},[1049,2913,1679],{"class":1267},[1049,2915,2511],{"class":1263},[1049,2917,1695],{"class":1267},[1049,2919,1698],{"class":1253},[1049,2921,1354],{"class":1267},[1049,2923,2520],{"class":1059},[1049,2925,1318],{"class":1267},[1049,2927,2928,2930,2932,2934,2936,2938,2940,2942],{"class":1051,"line":1298},[1049,2929,1670],{"class":1253},[1049,2931,1673],{"class":1267},[1049,2933,2531],{"class":1263},[1049,2935,1695],{"class":1267},[1049,2937,1698],{"class":1253},[1049,2939,1354],{"class":1267},[1049,2941,2540],{"class":1059},[1049,2943,1318],{"class":1267},[1049,2945,2946,2948],{"class":1051,"line":1310},[1049,2947,1670],{"class":1253},[1049,2949,1343],{"class":1267},[1049,2951,2952,2955],{"class":1051,"line":1321},[1049,2953,2954],{"class":1263},"  convertToModelMessages",[1049,2956,1295],{"class":1267},[1049,2958,2959,2962],{"class":1051,"line":1329},[1049,2960,2961],{"class":1263},"  createUIMessageStream",[1049,2963,1295],{"class":1267},[1049,2965,2966,2969],{"class":1051,"line":1335},[1049,2967,2968],{"class":1263},"  createUIMessageStreamResponse",[1049,2970,1295],{"class":1267},[1049,2972,2973,2976],{"class":1051,"line":1346},[1049,2974,2975],{"class":1263},"  generateText",[1049,2977,1295],{"class":1267},[1049,2979,2980],{"class":1051,"line":1362},[1049,2981,2982],{"class":1263},"  streamText\n",[1049,2984,2985,2987,2989,2991,2993],{"class":1051,"line":1368},[1049,2986,1451],{"class":1267},[1049,2988,1698],{"class":1253},[1049,2990,1354],{"class":1267},[1049,2992,2496],{"class":1059},[1049,2994,1318],{"class":1267},[1049,2996,2997,2999,3001,3003,3005,3007,3009,3011,3013],{"class":1051,"line":1373},[1049,2998,1670],{"class":1253},[1049,3000,2482],{"class":1253},[1049,3002,1673],{"class":1267},[1049,3004,2487],{"class":1263},[1049,3006,1695],{"class":1267},[1049,3008,1698],{"class":1253},[1049,3010,1354],{"class":1267},[1049,3012,2496],{"class":1059},[1049,3014,1318],{"class":1267},[1049,3016,3017],{"class":1051,"line":1396},[1049,3018,1332],{"emptyLinePlaceholder":21},[1049,3020,3021,3023,3025,3027,3029,3031,3033,3035,3037,3039],{"class":1051,"line":1401},[1049,3022,1254],{"class":1253},[1049,3024,1257],{"class":1253},[1049,3026,2460],{"class":1072},[1049,3028,1264],{"class":1263},[1049,3030,2559],{"class":1550},[1049,3032,1914],{"class":1267},[1049,3034,2564],{"class":1905},[1049,3036,1845],{"class":1267},[1049,3038,1788],{"class":1550},[1049,3040,1343],{"class":1267},[1049,3042,3043,3045,3047,3050,3052,3054,3056,3058,3060,3062,3064,3066,3068,3070,3072],{"class":1051,"line":1411},[1049,3044,2575],{"class":1550},[1049,3046,1673],{"class":1267},[1049,3048,3049],{"class":1263}," id",[1049,3051,1695],{"class":1267},[1049,3053,2585],{"class":1267},[1049,3055,2588],{"class":1253},[1049,3057,2870],{"class":1072},[1049,3059,1264],{"class":1273},[1049,3061,2564],{"class":1263},[1049,3063,1679],{"class":1267},[1049,3065,2531],{"class":1263},[1049,3067,1771],{"class":1267},[1049,3069,2603],{"class":1072},[1049,3071,1264],{"class":1273},[1049,3073,1268],{"class":1267},[1049,3075,3076,3079,3081,3083,3085,3088],{"class":1051,"line":1421},[1049,3077,3078],{"class":1273},"    id",[1049,3080,1277],{"class":1267},[1049,3082,2531],{"class":1263},[1049,3084,1771],{"class":1267},[1049,3086,3087],{"class":1072},"string",[1049,3089,2631],{"class":1273},[1049,3091,3092,3094,3096,3098,3100],{"class":1051,"line":1437},[1049,3093,2376],{"class":1267},[1049,3095,1845],{"class":1273},[1049,3097,1771],{"class":1267},[1049,3099,2642],{"class":1263},[1049,3101,1454],{"class":1273},[1049,3103,3104],{"class":1051,"line":1443},[1049,3105,1332],{"emptyLinePlaceholder":21},[1049,3107,3108,3110,3112,3115,3117,3120,3122,3124,3126,3128,3130,3132,3134,3136,3138,3140,3142],{"class":1051,"line":1448},[1049,3109,2575],{"class":1550},[1049,3111,1673],{"class":1267},[1049,3113,3114],{"class":1263}," model",[1049,3116,1679],{"class":1267},[1049,3118,3119],{"class":1263}," messages",[1049,3121,1695],{"class":1267},[1049,3123,2585],{"class":1267},[1049,3125,2588],{"class":1253},[1049,3127,2465],{"class":1072},[1049,3129,1264],{"class":1273},[1049,3131,2564],{"class":1263},[1049,3133,1679],{"class":1267},[1049,3135,2531],{"class":1263},[1049,3137,1771],{"class":1267},[1049,3139,2603],{"class":1072},[1049,3141,1264],{"class":1273},[1049,3143,1268],{"class":1267},[1049,3145,3146,3149,3151,3153,3155,3157,3159,3161,3164,3166,3168,3171,3173,3175],{"class":1051,"line":2237},[1049,3147,3148],{"class":1273},"    model",[1049,3150,1277],{"class":1267},[1049,3152,2531],{"class":1263},[1049,3154,1771],{"class":1267},[1049,3156,3087],{"class":1072},[1049,3158,1768],{"class":1273},[1049,3160,1771],{"class":1267},[1049,3162,3163],{"class":1072},"default",[1049,3165,1264],{"class":1273},[1049,3167,1292],{"class":1267},[1049,3169,3170],{"class":1059},"openai/gpt-4o-mini",[1049,3172,1292],{"class":1267},[1049,3174,1845],{"class":1273},[1049,3176,1295],{"class":1267},[1049,3178,3179,3182,3184,3186,3188,3191,3193,3196,3198,3200,3202,3204,3206],{"class":1051,"line":2250},[1049,3180,3181],{"class":1273},"    messages",[1049,3183,1277],{"class":1267},[1049,3185,2531],{"class":1263},[1049,3187,1771],{"class":1267},[1049,3189,3190],{"class":1072},"array",[1049,3192,1264],{"class":1273},[1049,3194,3195],{"class":1263},"z",[1049,3197,1771],{"class":1267},[1049,3199,2621],{"class":1072},[1049,3201,1522],{"class":1267},[1049,3203,2442],{"class":1055},[1049,3205,2628],{"class":1267},[1049,3207,1871],{"class":1273},[1049,3209,3210,3212,3214,3216,3218],{"class":1051,"line":2280},[1049,3211,2376],{"class":1267},[1049,3213,1845],{"class":1273},[1049,3215,1771],{"class":1267},[1049,3217,2642],{"class":1263},[1049,3219,1454],{"class":1273},[1049,3221,3222],{"class":1051,"line":2286},[1049,3223,1332],{"emptyLinePlaceholder":21},[1049,3225,3226],{"class":1051,"line":2291},[1049,3227,3228],{"class":1433},"  // Fetch the chat from the database\n",[1049,3230,3231,3233,3235,3237,3239,3241,3243,3246,3248,3250,3252,3255,3257],{"class":1051,"line":2323},[1049,3232,2575],{"class":1550},[1049,3234,2752],{"class":1263},[1049,3236,2585],{"class":1267},[1049,3238,2588],{"class":1253},[1049,3240,2403],{"class":1263},[1049,3242,1771],{"class":1267},[1049,3244,3245],{"class":1263},"query",[1049,3247,1771],{"class":1267},[1049,3249,1750],{"class":1263},[1049,3251,1771],{"class":1267},[1049,3253,3254],{"class":1072},"findFirst",[1049,3256,1264],{"class":1273},[1049,3258,1268],{"class":1267},[1049,3260,3261,3264,3266,3268,3270,3272,3274,3276,3278,3280,3282,3284,3286,3288,3290,3292,3294,3297,3300],{"class":1051,"line":2339},[1049,3262,3263],{"class":1072},"    where",[1049,3265,1277],{"class":1267},[1049,3267,1914],{"class":1267},[1049,3269,256],{"class":1905},[1049,3271,1679],{"class":1267},[1049,3273,1673],{"class":1267},[1049,3275,2893],{"class":1905},[1049,3277,1909],{"class":1267},[1049,3279,1788],{"class":1550},[1049,3281,2893],{"class":1072},[1049,3283,1264],{"class":1273},[1049,3285,256],{"class":1263},[1049,3287,1771],{"class":1267},[1049,3289,1980],{"class":1263},[1049,3291,1679],{"class":1267},[1049,3293,3049],{"class":1263},[1049,3295,3296],{"class":1253}," as",[1049,3298,3299],{"class":1055}," string",[1049,3301,1454],{"class":1273},[1049,3303,3304,3306],{"class":1051,"line":2357},[1049,3305,2376],{"class":1267},[1049,3307,1454],{"class":1273},[1049,3309,3310],{"class":1051,"line":2373},[1049,3311,1332],{"emptyLinePlaceholder":21},[1049,3313,3314,3317,3319,3322,3324,3327],{"class":1051,"line":2381},[1049,3315,3316],{"class":1253},"  if",[1049,3318,1914],{"class":1273},[1049,3320,3321],{"class":1267},"!",[1049,3323,256],{"class":1263},[1049,3325,3326],{"class":1273},") ",[1049,3328,1268],{"class":1267},[1049,3330,3332,3335,3337,3339,3341,3344,3346,3350,3352,3355,3357,3359,3362,3364,3366],{"class":1051,"line":3331},30,[1049,3333,3334],{"class":1253},"    throw",[1049,3336,2861],{"class":1072},[1049,3338,1264],{"class":1273},[1049,3340,1828],{"class":1267},[1049,3342,3343],{"class":1273}," statusCode",[1049,3345,1277],{"class":1267},[1049,3347,3349],{"class":3348},"sbssI"," 404",[1049,3351,1679],{"class":1267},[1049,3353,3354],{"class":1273}," statusMessage",[1049,3356,1277],{"class":1267},[1049,3358,1354],{"class":1267},[1049,3360,3361],{"class":1059},"Chat not found",[1049,3363,1292],{"class":1267},[1049,3365,1695],{"class":1267},[1049,3367,1454],{"class":1273},[1049,3369,3371],{"class":1051,"line":3370},31,[1049,3372,3373],{"class":1267},"  }\n",[1049,3375,3377],{"class":1051,"line":3376},32,[1049,3378,1332],{"emptyLinePlaceholder":21},[1049,3380,3382],{"class":1051,"line":3381},33,[1049,3383,3384],{"class":1433},"  // Generate a title for the chat if it doesn't have one\n",[1049,3386,3388,3390,3392,3394,3396,3398,3401,3403],{"class":1051,"line":3387},34,[1049,3389,3316],{"class":1253},[1049,3391,1914],{"class":1273},[1049,3393,3321],{"class":1267},[1049,3395,256],{"class":1263},[1049,3397,1771],{"class":1267},[1049,3399,3400],{"class":1263},"title",[1049,3402,3326],{"class":1273},[1049,3404,1268],{"class":1267},[1049,3406,3408,3411,3413,3415,3417,3420,3422,3424,3426,3429,3431],{"class":1051,"line":3407},35,[1049,3409,3410],{"class":1550},"    const",[1049,3412,1673],{"class":1267},[1049,3414,1682],{"class":1273},[1049,3416,1277],{"class":1267},[1049,3418,3419],{"class":1263}," title",[1049,3421,1695],{"class":1267},[1049,3423,2585],{"class":1267},[1049,3425,2588],{"class":1253},[1049,3427,3428],{"class":1072}," generateText",[1049,3430,1264],{"class":1273},[1049,3432,1268],{"class":1267},[1049,3434,3436,3439,3441,3443,3445,3447],{"class":1051,"line":3435},36,[1049,3437,3438],{"class":1273},"      model",[1049,3440,1277],{"class":1267},[1049,3442,1354],{"class":1267},[1049,3444,3170],{"class":1059},[1049,3446,1292],{"class":1267},[1049,3448,1295],{"class":1267},[1049,3450,3452,3455,3457,3460,3463,3466],{"class":1051,"line":3451},37,[1049,3453,3454],{"class":1273},"      system",[1049,3456,1277],{"class":1267},[1049,3458,3459],{"class":1267}," `",[1049,3461,3462],{"class":1059},"Generate a short title (max 30 characters) based on the user's message. No quotes or punctuation.",[1049,3464,3465],{"class":1267},"`",[1049,3467,1295],{"class":1267},[1049,3469,3471,3474,3476,3479,3481,3484,3486,3488,3491,3494],{"class":1051,"line":3470},38,[1049,3472,3473],{"class":1273},"      prompt",[1049,3475,1277],{"class":1267},[1049,3477,3478],{"class":1263}," JSON",[1049,3480,1771],{"class":1267},[1049,3482,3483],{"class":1072},"stringify",[1049,3485,1264],{"class":1273},[1049,3487,1959],{"class":1263},[1049,3489,3490],{"class":1273},"[",[1049,3492,3493],{"class":3348},"0",[1049,3495,2283],{"class":1273},[1049,3497,3499,3502],{"class":1051,"line":3498},39,[1049,3500,3501],{"class":1267},"    }",[1049,3503,1454],{"class":1273},[1049,3505,3507],{"class":1051,"line":3506},40,[1049,3508,1332],{"emptyLinePlaceholder":21},[1049,3510,3512,3515,3517,3519,3522,3524,3526,3528,3530,3532,3534,3537,3539,3541,3543,3545,3547,3549,3552,3554,3557,3559,3561,3563,3565,3567,3569,3571,3573],{"class":1051,"line":3511},41,[1049,3513,3514],{"class":1253},"    await",[1049,3516,2403],{"class":1263},[1049,3518,1771],{"class":1267},[1049,3520,3521],{"class":1072},"update",[1049,3523,1264],{"class":1273},[1049,3525,2679],{"class":1263},[1049,3527,1771],{"class":1267},[1049,3529,1750],{"class":1263},[1049,3531,1845],{"class":1273},[1049,3533,1771],{"class":1267},[1049,3535,3536],{"class":1072},"set",[1049,3538,1264],{"class":1273},[1049,3540,1828],{"class":1267},[1049,3542,3419],{"class":1263},[1049,3544,1695],{"class":1267},[1049,3546,1845],{"class":1273},[1049,3548,1771],{"class":1267},[1049,3550,3551],{"class":1072},"where",[1049,3553,1264],{"class":1273},[1049,3555,3556],{"class":1072},"eq",[1049,3558,1264],{"class":1273},[1049,3560,2679],{"class":1263},[1049,3562,1771],{"class":1267},[1049,3564,1750],{"class":1263},[1049,3566,1771],{"class":1267},[1049,3568,1980],{"class":1263},[1049,3570,1679],{"class":1267},[1049,3572,3049],{"class":1263},[1049,3574,1935],{"class":1273},[1049,3576,3578],{"class":1051,"line":3577},42,[1049,3579,3373],{"class":1267},[1049,3581,3583],{"class":1051,"line":3582},43,[1049,3584,1332],{"emptyLinePlaceholder":21},[1049,3586,3588],{"class":1051,"line":3587},44,[1049,3589,3590],{"class":1433},"  // Save the user message if it's a follow-up\n",[1049,3592,3594,3596,3599,3601,3603,3605,3607,3609,3612,3615,3618],{"class":1051,"line":3593},45,[1049,3595,2575],{"class":1550},[1049,3597,3598],{"class":1263}," lastMessage",[1049,3600,2585],{"class":1267},[1049,3602,3119],{"class":1263},[1049,3604,3490],{"class":1273},[1049,3606,1959],{"class":1263},[1049,3608,1771],{"class":1267},[1049,3610,3611],{"class":1263},"length",[1049,3613,3614],{"class":1267}," -",[1049,3616,3617],{"class":3348}," 1",[1049,3619,3620],{"class":1273},"]\n",[1049,3622,3624,3626,3628,3631,3634,3636,3639,3641,3643,3645,3648,3650,3652,3654,3657,3659,3661],{"class":1051,"line":3623},46,[1049,3625,3316],{"class":1253},[1049,3627,1914],{"class":1273},[1049,3629,3630],{"class":1263},"lastMessage",[1049,3632,3633],{"class":1267},"?.",[1049,3635,2092],{"class":1263},[1049,3637,3638],{"class":1267}," ===",[1049,3640,1354],{"class":1267},[1049,3642,2110],{"class":1059},[1049,3644,1292],{"class":1267},[1049,3646,3647],{"class":1267}," &&",[1049,3649,3119],{"class":1263},[1049,3651,1771],{"class":1267},[1049,3653,3611],{"class":1263},[1049,3655,3656],{"class":1267}," >",[1049,3658,3617],{"class":3348},[1049,3660,3326],{"class":1273},[1049,3662,1268],{"class":1267},[1049,3664,3666,3668,3670,3672,3674,3676,3678,3680,3682,3684,3686,3688,3690],{"class":1051,"line":3665},47,[1049,3667,3514],{"class":1253},[1049,3669,2403],{"class":1263},[1049,3671,1771],{"class":1267},[1049,3673,2674],{"class":1072},[1049,3675,1264],{"class":1273},[1049,3677,2679],{"class":1263},[1049,3679,1771],{"class":1267},[1049,3681,1959],{"class":1263},[1049,3683,1845],{"class":1273},[1049,3685,1771],{"class":1267},[1049,3687,2690],{"class":1072},[1049,3689,1264],{"class":1273},[1049,3691,1268],{"class":1267},[1049,3693,3695,3698,3700,3702],{"class":1051,"line":3694},48,[1049,3696,3697],{"class":1273},"      chatId",[1049,3699,1277],{"class":1267},[1049,3701,3049],{"class":1263},[1049,3703,1295],{"class":1267},[1049,3705,3707,3710,3712,3714,3716,3718],{"class":1051,"line":3706},49,[1049,3708,3709],{"class":1273},"      role",[1049,3711,1277],{"class":1267},[1049,3713,1354],{"class":1267},[1049,3715,2110],{"class":1059},[1049,3717,1292],{"class":1267},[1049,3719,1295],{"class":1267},[1049,3721,3723,3726,3728,3730,3732],{"class":1051,"line":3722},50,[1049,3724,3725],{"class":1273},"      parts",[1049,3727,1277],{"class":1267},[1049,3729,3598],{"class":1263},[1049,3731,1771],{"class":1267},[1049,3733,2787],{"class":1263},[1049,3735,3737,3739],{"class":1051,"line":3736},51,[1049,3738,3501],{"class":1267},[1049,3740,1454],{"class":1273},[1049,3742,3744],{"class":1051,"line":3743},52,[1049,3745,3373],{"class":1267},[1049,3747,3749],{"class":1051,"line":3748},53,[1049,3750,1332],{"emptyLinePlaceholder":21},[1049,3752,3754],{"class":1051,"line":3753},54,[1049,3755,3756],{"class":1433},"  // Create the streaming response\n",[1049,3758,3760,3762,3765,3767,3770,3772],{"class":1051,"line":3759},55,[1049,3761,2575],{"class":1550},[1049,3763,3764],{"class":1263}," stream",[1049,3766,2585],{"class":1267},[1049,3768,3769],{"class":1072}," createUIMessageStream",[1049,3771,1264],{"class":1273},[1049,3773,1268],{"class":1267},[1049,3775,3777,3780,3782,3785,3787,3790,3792,3794],{"class":1051,"line":3776},56,[1049,3778,3779],{"class":1072},"    execute",[1049,3781,1277],{"class":1267},[1049,3783,3784],{"class":1550}," async",[1049,3786,1902],{"class":1267},[1049,3788,3789],{"class":1905}," writer",[1049,3791,1909],{"class":1267},[1049,3793,1788],{"class":1550},[1049,3795,1343],{"class":1267},[1049,3797,3799,3802,3805,3807,3810,3812],{"class":1051,"line":3798},57,[1049,3800,3801],{"class":1550},"      const",[1049,3803,3804],{"class":1263}," result",[1049,3806,2585],{"class":1267},[1049,3808,3809],{"class":1072}," streamText",[1049,3811,1264],{"class":1273},[1049,3813,1268],{"class":1267},[1049,3815,3817,3820],{"class":1051,"line":3816},58,[1049,3818,3819],{"class":1263},"        model",[1049,3821,1295],{"class":1267},[1049,3823,3825,3828,3830,3832,3835,3837],{"class":1051,"line":3824},59,[1049,3826,3827],{"class":1273},"        system",[1049,3829,1277],{"class":1267},[1049,3831,3459],{"class":1267},[1049,3833,3834],{"class":1059},"You are a helpful AI assistant. Be concise and friendly.",[1049,3836,3465],{"class":1267},[1049,3838,1295],{"class":1267},[1049,3840,3842,3845,3847,3849,3852,3854,3856],{"class":1051,"line":3841},60,[1049,3843,3844],{"class":1273},"        messages",[1049,3846,1277],{"class":1267},[1049,3848,2588],{"class":1253},[1049,3850,3851],{"class":1072}," convertToModelMessages",[1049,3853,1264],{"class":1273},[1049,3855,1959],{"class":1263},[1049,3857,1454],{"class":1273},[1049,3859,3861,3864],{"class":1051,"line":3860},61,[1049,3862,3863],{"class":1267},"      }",[1049,3865,1454],{"class":1273},[1049,3867,3869],{"class":1051,"line":3868},62,[1049,3870,1332],{"emptyLinePlaceholder":21},[1049,3872,3874],{"class":1051,"line":3873},63,[1049,3875,3876],{"class":1433},"      // Notify the client that a title was generated\n",[1049,3878,3880,3883,3885,3887,3889,3891,3893,3895],{"class":1051,"line":3879},64,[1049,3881,3882],{"class":1253},"      if",[1049,3884,1914],{"class":1273},[1049,3886,3321],{"class":1267},[1049,3888,256],{"class":1263},[1049,3890,1771],{"class":1267},[1049,3892,3400],{"class":1263},[1049,3894,3326],{"class":1273},[1049,3896,1268],{"class":1267},[1049,3898,3900,3903,3905,3908,3910],{"class":1051,"line":3899},65,[1049,3901,3902],{"class":1263},"        writer",[1049,3904,1771],{"class":1267},[1049,3906,3907],{"class":1072},"write",[1049,3909,1264],{"class":1273},[1049,3911,1268],{"class":1267},[1049,3913,3915,3918,3920,3922,3925,3927],{"class":1051,"line":3914},66,[1049,3916,3917],{"class":1273},"          type",[1049,3919,1277],{"class":1267},[1049,3921,1354],{"class":1267},[1049,3923,3924],{"class":1059},"data-chat-title",[1049,3926,1292],{"class":1267},[1049,3928,1295],{"class":1267},[1049,3930,3932,3935,3937,3939,3941,3943,3945,3948,3950],{"class":1051,"line":3931},67,[1049,3933,3934],{"class":1273},"          data",[1049,3936,1277],{"class":1267},[1049,3938,1673],{"class":1267},[1049,3940,2580],{"class":1273},[1049,3942,1277],{"class":1267},[1049,3944,1354],{"class":1267},[1049,3946,3947],{"class":1059},"Title generated",[1049,3949,1292],{"class":1267},[1049,3951,3952],{"class":1267}," },\n",[1049,3954,3956,3959,3961],{"class":1051,"line":3955},68,[1049,3957,3958],{"class":1273},"          transient",[1049,3960,1277],{"class":1267},[1049,3962,3963],{"class":1429}," true\n",[1049,3965,3967,3970],{"class":1051,"line":3966},69,[1049,3968,3969],{"class":1267},"        }",[1049,3971,1454],{"class":1273},[1049,3973,3975],{"class":1051,"line":3974},70,[1049,3976,3977],{"class":1267},"      }\n",[1049,3979,3981],{"class":1051,"line":3980},71,[1049,3982,1332],{"emptyLinePlaceholder":21},[1049,3984,3986,3989,3991,3994,3996,3999,4001,4004],{"class":1051,"line":3985},72,[1049,3987,3988],{"class":1263},"      writer",[1049,3990,1771],{"class":1267},[1049,3992,3993],{"class":1072},"merge",[1049,3995,1264],{"class":1273},[1049,3997,3998],{"class":1263},"result",[1049,4000,1771],{"class":1267},[1049,4002,4003],{"class":1072},"toUIMessageStream",[1049,4005,1871],{"class":1273},[1049,4007,4009],{"class":1051,"line":4008},73,[1049,4010,4011],{"class":1267},"    },\n",[1049,4013,4015,4018,4020,4022,4024,4026,4028,4030],{"class":1051,"line":4014},74,[1049,4016,4017],{"class":1072},"    onFinish",[1049,4019,1277],{"class":1267},[1049,4021,3784],{"class":1550},[1049,4023,1902],{"class":1267},[1049,4025,3119],{"class":1905},[1049,4027,1909],{"class":1267},[1049,4029,1788],{"class":1550},[1049,4031,1343],{"class":1267},[1049,4033,4035],{"class":1051,"line":4034},75,[1049,4036,4037],{"class":1433},"      // Save the assistant's response to the database\n",[1049,4039,4041,4044,4046,4048,4050,4052,4054,4056,4058,4060,4062,4064,4066,4068,4070,4073,4075,4078,4080,4082],{"class":1051,"line":4040},76,[1049,4042,4043],{"class":1253},"      await",[1049,4045,2403],{"class":1263},[1049,4047,1771],{"class":1267},[1049,4049,2674],{"class":1072},[1049,4051,1264],{"class":1273},[1049,4053,2679],{"class":1263},[1049,4055,1771],{"class":1267},[1049,4057,1959],{"class":1263},[1049,4059,1845],{"class":1273},[1049,4061,1771],{"class":1267},[1049,4063,2690],{"class":1072},[1049,4065,1264],{"class":1273},[1049,4067,1959],{"class":1263},[1049,4069,1771],{"class":1267},[1049,4071,4072],{"class":1072},"map",[1049,4074,1264],{"class":1273},[1049,4076,4077],{"class":1905},"message",[1049,4079,1788],{"class":1550},[1049,4081,1914],{"class":1273},[1049,4083,1268],{"class":1267},[1049,4085,4087,4090,4092,4094,4096,4098],{"class":1051,"line":4086},77,[1049,4088,4089],{"class":1273},"        chatId",[1049,4091,1277],{"class":1267},[1049,4093,2752],{"class":1263},[1049,4095,1771],{"class":1267},[1049,4097,1980],{"class":1263},[1049,4099,1295],{"class":1267},[1049,4101,4103,4106,4108,4110,4112,4114,4116,4118,4120,4122,4125,4127,4129,4131],{"class":1051,"line":4102},78,[1049,4104,4105],{"class":1273},"        role",[1049,4107,1277],{"class":1267},[1049,4109,2580],{"class":1263},[1049,4111,1771],{"class":1267},[1049,4113,2092],{"class":1263},[1049,4115,3296],{"class":1253},[1049,4117,1354],{"class":1267},[1049,4119,2110],{"class":1059},[1049,4121,1292],{"class":1267},[1049,4123,4124],{"class":1267}," |",[1049,4126,1354],{"class":1267},[1049,4128,2119],{"class":1059},[1049,4130,1292],{"class":1267},[1049,4132,1295],{"class":1267},[1049,4134,4136,4139,4141,4143,4145],{"class":1051,"line":4135},79,[1049,4137,4138],{"class":1273},"        parts",[1049,4140,1277],{"class":1267},[1049,4142,2580],{"class":1263},[1049,4144,1771],{"class":1267},[1049,4146,2787],{"class":1263},[1049,4148,4150,4152],{"class":1051,"line":4149},80,[1049,4151,3863],{"class":1267},[1049,4153,4154],{"class":1273},")))\n",[1049,4156,4158],{"class":1051,"line":4157},81,[1049,4159,1440],{"class":1267},[1049,4161,4163,4165],{"class":1051,"line":4162},82,[1049,4164,2376],{"class":1267},[1049,4166,1454],{"class":1273},[1049,4168,4170],{"class":1051,"line":4169},83,[1049,4171,1332],{"emptyLinePlaceholder":21},[1049,4173,4175,4177,4180,4182,4184,4186,4188],{"class":1051,"line":4174},84,[1049,4176,2802],{"class":1253},[1049,4178,4179],{"class":1072}," createUIMessageStreamResponse",[1049,4181,1264],{"class":1273},[1049,4183,1828],{"class":1267},[1049,4185,3764],{"class":1263},[1049,4187,1695],{"class":1267},[1049,4189,1454],{"class":1273},[1049,4191,4193,4195],{"class":1051,"line":4192},85,[1049,4194,1451],{"class":1267},[1049,4196,1454],{"class":1263},[949,4198,4199],{},"Here's what each part does:",[949,4201,4202],{},[967,4203,4204],{},"AI Gateway",[949,4206,4207,4208,4211],{},"Thanks to ",[1024,4209,1029],{"href":1026,"rel":4210},[1028],", we can use any AI model supported by the gateway just by specifying the model name.",[949,4213,4214],{},[967,4215,4216],{},"Automatic Title Generation",[949,4218,4219,4220,4227],{},"When a chat doesn't have a title yet, we use ",[1024,4221,4224],{"href":4222,"rel":4223},"https://ai-sdk.dev/docs/reference/ai-sdk-core/generate-text#generatetext",[1028],[1046,4225,4226],{},"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\".",[949,4229,4230],{},[967,4231,4232],{},"Streaming with streamText",[949,4234,4235,4236,4241],{},"The ",[1024,4237,4239],{"href":2821,"rel":4238},[1028],[1046,4240,2825],{}," function generates a streaming response from the AI model. Key options include:",[961,4243,4244,4250,4255],{},[964,4245,4246,4249],{},[1046,4247,4248],{},"model",": The AI model to use",[964,4251,4252,4254],{},[1046,4253,2128],{},": Instructions that guide the AI's behavior",[964,4256,4257,4259],{},[1046,4258,1959],{},": The conversation history",[949,4261,4262],{},[967,4263,4264],{},"UIMessageStream",[949,4266,4235,4267,4273,4274,4280],{},[1024,4268,4271],{"href":4269,"rel":4270},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/create-ui-message-stream#createuimessagestream",[1028],[1046,4272,2833],{}," and ",[1024,4275,4278],{"href":4276,"rel":4277},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/create-ui-message-stream-response#createuimessagestreamresponse",[1028],[1046,4279,2841],{}," 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.",[949,4282,4235,4283,4286,4287,4289,4290,4293],{},[1046,4284,4285],{},"writer.write()"," method allows sending custom data events to the client (like ",[1046,4288,3924],{},"), while ",[1046,4291,4292],{},"onFinish"," is called when streaming completes, perfect for persisting the assistant's response.",[1077,4295,4297],{"id":4296},"fetching-a-chat","Fetching a chat",[949,4299,4300],{},"Add an endpoint to fetch existing chat data from your database:",[1240,4302,4303],{},[1039,4304,4307],{"className":1244,"code":4305,"filename":4306,"language":1246,"meta":1044,"style":1044},"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",[1046,4308,4309,4335,4358,4380,4398,4402,4424,4456,4470,4482,4486,4514,4545,4554,4563,4592,4596,4600,4606,4610,4624,4656,4660,4664,4670],{"__ignoreMap":1044},[1049,4310,4311,4313,4315,4317,4319,4321,4323,4325,4327,4329,4331,4333],{"class":1051,"line":1052},[1049,4312,1670],{"class":1253},[1049,4314,1673],{"class":1267},[1049,4316,2861],{"class":1263},[1049,4318,1679],{"class":1267},[1049,4320,2460],{"class":1263},[1049,4322,1679],{"class":1267},[1049,4324,2870],{"class":1263},[1049,4326,1695],{"class":1267},[1049,4328,1698],{"class":1253},[1049,4330,1354],{"class":1267},[1049,4332,1077],{"class":1059},[1049,4334,1318],{"class":1267},[1049,4336,4337,4339,4341,4344,4346,4348,4350,4352,4354,4356],{"class":1051,"line":1069},[1049,4338,1670],{"class":1253},[1049,4340,1673],{"class":1267},[1049,4342,4343],{"class":1263}," asc",[1049,4345,1679],{"class":1267},[1049,4347,2893],{"class":1263},[1049,4349,1695],{"class":1267},[1049,4351,1698],{"class":1253},[1049,4353,1354],{"class":1267},[1049,4355,1723],{"class":1059},[1049,4357,1318],{"class":1267},[1049,4359,4360,4362,4364,4366,4368,4370,4372,4374,4376,4378],{"class":1051,"line":1283},[1049,4361,1670],{"class":1253},[1049,4363,1673],{"class":1267},[1049,4365,2403],{"class":1263},[1049,4367,1679],{"class":1267},[1049,4369,2511],{"class":1263},[1049,4371,1695],{"class":1267},[1049,4373,1698],{"class":1253},[1049,4375,1354],{"class":1267},[1049,4377,2520],{"class":1059},[1049,4379,1318],{"class":1267},[1049,4381,4382,4384,4386,4388,4390,4392,4394,4396],{"class":1051,"line":1298},[1049,4383,1670],{"class":1253},[1049,4385,1673],{"class":1267},[1049,4387,2531],{"class":1263},[1049,4389,1695],{"class":1267},[1049,4391,1698],{"class":1253},[1049,4393,1354],{"class":1267},[1049,4395,2540],{"class":1059},[1049,4397,1318],{"class":1267},[1049,4399,4400],{"class":1051,"line":1310},[1049,4401,1332],{"emptyLinePlaceholder":21},[1049,4403,4404,4406,4408,4410,4412,4414,4416,4418,4420,4422],{"class":1051,"line":1321},[1049,4405,1254],{"class":1253},[1049,4407,1257],{"class":1253},[1049,4409,2460],{"class":1072},[1049,4411,1264],{"class":1263},[1049,4413,2559],{"class":1550},[1049,4415,1914],{"class":1267},[1049,4417,2564],{"class":1905},[1049,4419,1845],{"class":1267},[1049,4421,1788],{"class":1550},[1049,4423,1343],{"class":1267},[1049,4425,4426,4428,4430,4432,4434,4436,4438,4440,4442,4444,4446,4448,4450,4452,4454],{"class":1051,"line":1329},[1049,4427,2575],{"class":1550},[1049,4429,1673],{"class":1267},[1049,4431,3049],{"class":1263},[1049,4433,1695],{"class":1267},[1049,4435,2585],{"class":1267},[1049,4437,2588],{"class":1253},[1049,4439,2870],{"class":1072},[1049,4441,1264],{"class":1273},[1049,4443,2564],{"class":1263},[1049,4445,1679],{"class":1267},[1049,4447,2531],{"class":1263},[1049,4449,1771],{"class":1267},[1049,4451,2603],{"class":1072},[1049,4453,1264],{"class":1273},[1049,4455,1268],{"class":1267},[1049,4457,4458,4460,4462,4464,4466,4468],{"class":1051,"line":1335},[1049,4459,3078],{"class":1273},[1049,4461,1277],{"class":1267},[1049,4463,2531],{"class":1263},[1049,4465,1771],{"class":1267},[1049,4467,3087],{"class":1072},[1049,4469,2631],{"class":1273},[1049,4471,4472,4474,4476,4478,4480],{"class":1051,"line":1346},[1049,4473,2376],{"class":1267},[1049,4475,1845],{"class":1273},[1049,4477,1771],{"class":1267},[1049,4479,2642],{"class":1263},[1049,4481,1454],{"class":1273},[1049,4483,4484],{"class":1051,"line":1362},[1049,4485,1332],{"emptyLinePlaceholder":21},[1049,4487,4488,4490,4492,4494,4496,4498,4500,4502,4504,4506,4508,4510,4512],{"class":1051,"line":1368},[1049,4489,2575],{"class":1550},[1049,4491,2752],{"class":1263},[1049,4493,2585],{"class":1267},[1049,4495,2588],{"class":1253},[1049,4497,2403],{"class":1263},[1049,4499,1771],{"class":1267},[1049,4501,3245],{"class":1263},[1049,4503,1771],{"class":1267},[1049,4505,1750],{"class":1263},[1049,4507,1771],{"class":1267},[1049,4509,3254],{"class":1072},[1049,4511,1264],{"class":1273},[1049,4513,1268],{"class":1267},[1049,4515,4516,4518,4520,4522,4524,4526,4528,4530,4532,4534,4536,4538,4540,4543],{"class":1051,"line":1373},[1049,4517,3263],{"class":1273},[1049,4519,1277],{"class":1267},[1049,4521,1914],{"class":1273},[1049,4523,3556],{"class":1072},[1049,4525,1264],{"class":1273},[1049,4527,2679],{"class":1263},[1049,4529,1771],{"class":1267},[1049,4531,1750],{"class":1263},[1049,4533,1771],{"class":1267},[1049,4535,1980],{"class":1263},[1049,4537,1679],{"class":1267},[1049,4539,3049],{"class":1263},[1049,4541,4542],{"class":1273},"))",[1049,4544,1295],{"class":1267},[1049,4546,4547,4550,4552],{"class":1051,"line":1396},[1049,4548,4549],{"class":1273},"    with",[1049,4551,1277],{"class":1267},[1049,4553,1343],{"class":1267},[1049,4555,4556,4559,4561],{"class":1051,"line":1401},[1049,4557,4558],{"class":1273},"      messages",[1049,4560,1277],{"class":1267},[1049,4562,1343],{"class":1267},[1049,4564,4565,4568,4570,4573,4575,4577,4579,4581,4583,4585,4587,4590],{"class":1051,"line":1411},[1049,4566,4567],{"class":1072},"        orderBy",[1049,4569,1277],{"class":1267},[1049,4571,4572],{"class":1267}," ()",[1049,4574,1788],{"class":1550},[1049,4576,4343],{"class":1072},[1049,4578,1264],{"class":1273},[1049,4580,2679],{"class":1263},[1049,4582,1771],{"class":1267},[1049,4584,1959],{"class":1263},[1049,4586,1771],{"class":1267},[1049,4588,4589],{"class":1263},"createdAt",[1049,4591,1454],{"class":1273},[1049,4593,4594],{"class":1051,"line":1421},[1049,4595,3977],{"class":1267},[1049,4597,4598],{"class":1051,"line":1437},[1049,4599,1440],{"class":1267},[1049,4601,4602,4604],{"class":1051,"line":1443},[1049,4603,2376],{"class":1267},[1049,4605,1454],{"class":1273},[1049,4607,4608],{"class":1051,"line":1448},[1049,4609,1332],{"emptyLinePlaceholder":21},[1049,4611,4612,4614,4616,4618,4620,4622],{"class":1051,"line":2237},[1049,4613,3316],{"class":1253},[1049,4615,1914],{"class":1273},[1049,4617,3321],{"class":1267},[1049,4619,256],{"class":1263},[1049,4621,3326],{"class":1273},[1049,4623,1268],{"class":1267},[1049,4625,4626,4628,4630,4632,4634,4636,4638,4640,4642,4644,4646,4648,4650,4652,4654],{"class":1051,"line":2250},[1049,4627,3334],{"class":1253},[1049,4629,2861],{"class":1072},[1049,4631,1264],{"class":1273},[1049,4633,1828],{"class":1267},[1049,4635,3343],{"class":1273},[1049,4637,1277],{"class":1267},[1049,4639,3349],{"class":3348},[1049,4641,1679],{"class":1267},[1049,4643,3354],{"class":1273},[1049,4645,1277],{"class":1267},[1049,4647,1354],{"class":1267},[1049,4649,3361],{"class":1059},[1049,4651,1292],{"class":1267},[1049,4653,1695],{"class":1267},[1049,4655,1454],{"class":1273},[1049,4657,4658],{"class":1051,"line":2280},[1049,4659,3373],{"class":1267},[1049,4661,4662],{"class":1051,"line":2286},[1049,4663,1332],{"emptyLinePlaceholder":21},[1049,4665,4666,4668],{"class":1051,"line":2291},[1049,4667,2802],{"class":1253},[1049,4669,2805],{"class":1263},[1049,4671,4672,4674],{"class":1051,"line":2323},[1049,4673,1451],{"class":1267},[1049,4675,1454],{"class":1263},[953,4677,4679],{"id":4678},"wire-up-the-ui","Wire up the UI",[949,4681,4682,4683,4688,4689,4694],{},"Nuxt UI provides purpose-built components for AI chat interfaces: ",[1024,4684,4685],{"href":270},[1046,4686,4687],{},"UChatPrompt"," for the input area and ",[1024,4690,4691],{"href":260},[1046,4692,4693],{},"UChatMessages"," for displaying the conversation.",[1077,4696,4698],{"id":4697},"creating-the-home-page","Creating the home page",[949,4700,4701,4702,4706],{},"The home page is where users start a new conversation. The ",[1024,4703,4704],{"href":270},[1046,4705,4687],{}," component provides a textarea with auto-resize, keyboard shortcuts, and a submit button:",[1240,4708,4709],{},[1039,4710,4714],{"className":1512,"code":4711,"filename":4712,"highlights":4713,"language":34,"meta":1044,"style":1044},"\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",[3387,3407,3435,3451,3470,3498,3506,3511,3577],[1046,4715,4716,4739,4759,4777,4781,4795,4822,4826,4839,4843,4848,4874,4890,4899,4908,4922,4960,4964,4968,4974,4978,4983,5009,5014,5022,5026,5034,5055,5069,5090,5111,5116,5125,5129,5137,5152,5167,5182,5197,5212,5218,5241,5250,5259,5267,5275],{"__ignoreMap":1044},[1049,4717,4718,4720,4723,4726,4729,4731,4733,4735,4737],{"class":1051,"line":1052},[1049,4719,1522],{"class":1267},[1049,4721,4722],{"class":1273},"script",[1049,4724,4725],{"class":1550}," setup",[1049,4727,4728],{"class":1550}," lang",[1049,4730,1554],{"class":1267},[1049,4732,1481],{"class":1267},[1049,4734,1246],{"class":1059},[1049,4736,1481],{"class":1267},[1049,4738,1528],{"class":1267},[1049,4740,4741,4744,4747,4749,4752,4754,4757],{"class":1051,"line":1069},[1049,4742,4743],{"class":1550},"const",[1049,4745,4746],{"class":1263}," input ",[1049,4748,1554],{"class":1267},[1049,4750,4751],{"class":1072}," ref",[1049,4753,1264],{"class":1263},[1049,4755,4756],{"class":1267},"''",[1049,4758,1454],{"class":1263},[1049,4760,4761,4763,4766,4768,4770,4772,4775],{"class":1051,"line":1283},[1049,4762,4743],{"class":1550},[1049,4764,4765],{"class":1263}," loading ",[1049,4767,1554],{"class":1267},[1049,4769,4751],{"class":1072},[1049,4771,1264],{"class":1263},[1049,4773,4774],{"class":1429},"false",[1049,4776,1454],{"class":1263},[1049,4778,4779],{"class":1051,"line":1298},[1049,4780,1332],{"emptyLinePlaceholder":21},[1049,4782,4783,4785,4788,4791,4793],{"class":1051,"line":1310},[1049,4784,2559],{"class":1550},[1049,4786,4787],{"class":1550}," function",[1049,4789,4790],{"class":1072}," createChat",[1049,4792,1768],{"class":1267},[1049,4794,1343],{"class":1267},[1049,4796,4797,4799,4801,4803,4806,4808,4811,4813,4816,4819],{"class":1051,"line":1321},[1049,4798,3316],{"class":1253},[1049,4800,1914],{"class":1273},[1049,4802,3321],{"class":1267},[1049,4804,4805],{"class":1263},"input",[1049,4807,1771],{"class":1267},[1049,4809,4810],{"class":1263},"value",[1049,4812,1771],{"class":1267},[1049,4814,4815],{"class":1072},"trim",[1049,4817,4818],{"class":1273},"()) ",[1049,4820,4821],{"class":1253},"return\n",[1049,4823,4824],{"class":1051,"line":1329},[1049,4825,1332],{"emptyLinePlaceholder":21},[1049,4827,4828,4831,4833,4835,4837],{"class":1051,"line":1335},[1049,4829,4830],{"class":1263},"  loading",[1049,4832,1771],{"class":1267},[1049,4834,4810],{"class":1263},[1049,4836,2585],{"class":1267},[1049,4838,3963],{"class":1429},[1049,4840,4841],{"class":1051,"line":1346},[1049,4842,1332],{"emptyLinePlaceholder":21},[1049,4844,4845],{"class":1051,"line":1362},[1049,4846,4847],{"class":1433},"  // Create a new chat on the server\n",[1049,4849,4850,4852,4854,4856,4858,4861,4863,4865,4868,4870,4872],{"class":1051,"line":1368},[1049,4851,2575],{"class":1550},[1049,4853,2752],{"class":1263},[1049,4855,2585],{"class":1267},[1049,4857,2588],{"class":1253},[1049,4859,4860],{"class":1072}," $fetch",[1049,4862,1264],{"class":1273},[1049,4864,1292],{"class":1267},[1049,4866,4867],{"class":1059},"/api/chats",[1049,4869,1292],{"class":1267},[1049,4871,1679],{"class":1267},[1049,4873,1343],{"class":1267},[1049,4875,4876,4879,4881,4883,4886,4888],{"class":1051,"line":1373},[1049,4877,4878],{"class":1273},"    method",[1049,4880,1277],{"class":1267},[1049,4882,1354],{"class":1267},[1049,4884,4885],{"class":1059},"POST",[1049,4887,1292],{"class":1267},[1049,4889,1295],{"class":1267},[1049,4891,4892,4895,4897],{"class":1051,"line":1396},[1049,4893,4894],{"class":1273},"    body",[1049,4896,1277],{"class":1267},[1049,4898,1343],{"class":1267},[1049,4900,4901,4904,4906],{"class":1051,"line":1401},[1049,4902,4903],{"class":1273},"      message",[1049,4905,1277],{"class":1267},[1049,4907,1343],{"class":1267},[1049,4909,4910,4912,4914,4916,4918,4920],{"class":1051,"line":1411},[1049,4911,4105],{"class":1273},[1049,4913,1277],{"class":1267},[1049,4915,1354],{"class":1267},[1049,4917,2110],{"class":1059},[1049,4919,1292],{"class":1267},[1049,4921,1295],{"class":1267},[1049,4923,4924,4926,4928,4930,4932,4934,4936,4938,4941,4943,4945,4947,4949,4952,4954,4956,4958],{"class":1051,"line":1421},[1049,4925,4138],{"class":1273},[1049,4927,1277],{"class":1267},[1049,4929,1381],{"class":1273},[1049,4931,1828],{"class":1267},[1049,4933,2482],{"class":1273},[1049,4935,1277],{"class":1267},[1049,4937,1354],{"class":1267},[1049,4939,4940],{"class":1059},"text",[1049,4942,1292],{"class":1267},[1049,4944,1679],{"class":1267},[1049,4946,1682],{"class":1273},[1049,4948,1277],{"class":1267},[1049,4950,4951],{"class":1263}," input",[1049,4953,1771],{"class":1267},[1049,4955,4810],{"class":1263},[1049,4957,1695],{"class":1267},[1049,4959,3620],{"class":1273},[1049,4961,4962],{"class":1051,"line":1437},[1049,4963,3977],{"class":1267},[1049,4965,4966],{"class":1051,"line":1443},[1049,4967,1440],{"class":1267},[1049,4969,4970,4972],{"class":1051,"line":1448},[1049,4971,2376],{"class":1267},[1049,4973,1454],{"class":1273},[1049,4975,4976],{"class":1051,"line":2237},[1049,4977,1332],{"emptyLinePlaceholder":21},[1049,4979,4980],{"class":1051,"line":2250},[1049,4981,4982],{"class":1433},"  // Navigate to the chat page\n",[1049,4984,4985,4988,4990,4992,4995,4998,5000,5002,5004,5007],{"class":1051,"line":2280},[1049,4986,4987],{"class":1072},"  navigateTo",[1049,4989,1264],{"class":1273},[1049,4991,3465],{"class":1267},[1049,4993,4994],{"class":1059},"/chat/",[1049,4996,4997],{"class":1267},"${",[1049,4999,256],{"class":1263},[1049,5001,1771],{"class":1267},[1049,5003,1980],{"class":1263},[1049,5005,5006],{"class":1267},"}`",[1049,5008,1454],{"class":1273},[1049,5010,5011],{"class":1051,"line":2286},[1049,5012,5013],{"class":1267},"}\n",[1049,5015,5016,5018,5020],{"class":1051,"line":2291},[1049,5017,1598],{"class":1267},[1049,5019,4722],{"class":1273},[1049,5021,1528],{"class":1267},[1049,5023,5024],{"class":1051,"line":2323},[1049,5025,1332],{"emptyLinePlaceholder":21},[1049,5027,5028,5030,5032],{"class":1051,"line":2339},[1049,5029,1522],{"class":1267},[1049,5031,1525],{"class":1273},[1049,5033,1528],{"class":1267},[1049,5035,5036,5038,5041,5044,5046,5048,5051,5053],{"class":1051,"line":2357},[1049,5037,1535],{"class":1267},[1049,5039,5040],{"class":1273},"UDashboardPanel",[1049,5042,5043],{"class":1550}," :ui",[1049,5045,1554],{"class":1267},[1049,5047,1481],{"class":1267},[1049,5049,5050],{"class":1059},"{ body: 'p-0 sm:p-0' }",[1049,5052,1481],{"class":1267},[1049,5054,1528],{"class":1267},[1049,5056,5057,5059,5061,5064,5067],{"class":1051,"line":2373},[1049,5058,1544],{"class":1267},[1049,5060,1525],{"class":1273},[1049,5062,5063],{"class":1267}," #",[1049,5065,5066],{"class":1550},"body",[1049,5068,1528],{"class":1267},[1049,5070,5071,5073,5076,5079,5081,5083,5086,5088],{"class":1051,"line":2381},[1049,5072,1568],{"class":1267},[1049,5074,5075],{"class":1273},"UContainer",[1049,5077,5078],{"class":1550}," class",[1049,5080,1554],{"class":1267},[1049,5082,1481],{"class":1267},[1049,5084,5085],{"class":1059},"min-h-dvh flex flex-col justify-center gap-6 py-8",[1049,5087,1481],{"class":1267},[1049,5089,1528],{"class":1267},[1049,5091,5092,5095,5098,5100,5102,5104,5107,5109],{"class":1051,"line":3331},[1049,5093,5094],{"class":1267},"        \u003C",[1049,5096,5097],{"class":1273},"h1",[1049,5099,5078],{"class":1550},[1049,5101,1554],{"class":1267},[1049,5103,1481],{"class":1267},[1049,5105,5106],{"class":1059},"text-3xl sm:text-4xl text-highlighted font-bold",[1049,5108,1481],{"class":1267},[1049,5110,1528],{"class":1267},[1049,5112,5113],{"class":1051,"line":3370},[1049,5114,5115],{"class":1263},"          How can I help you today?\n",[1049,5117,5118,5121,5123],{"class":1051,"line":3376},[1049,5119,5120],{"class":1267},"        \u003C/",[1049,5122,5097],{"class":1273},[1049,5124,1528],{"class":1267},[1049,5126,5127],{"class":1051,"line":3381},[1049,5128,1332],{"emptyLinePlaceholder":21},[1049,5130,5132,5134],{"class":5131,"line":3387},[1051,1532],[1049,5133,5094],{"class":1267},[1049,5135,5136],{"class":1273},"UChatPrompt\n",[1049,5138,5140,5143,5145,5147,5149],{"class":5139,"line":3407},[1051,1532],[1049,5141,5142],{"class":1550},"          v-model",[1049,5144,1554],{"class":1267},[1049,5146,1481],{"class":1267},[1049,5148,4805],{"class":1059},[1049,5150,5151],{"class":1267},"\"\n",[1049,5153,5155,5158,5160,5162,5165],{"class":5154,"line":3435},[1051,1532],[1049,5156,5157],{"class":1550},"          :status",[1049,5159,1554],{"class":1267},[1049,5161,1481],{"class":1267},[1049,5163,5164],{"class":1059},"loading ? 'streaming' : 'ready'",[1049,5166,5151],{"class":1267},[1049,5168,5170,5173,5175,5177,5180],{"class":5169,"line":3451},[1051,1532],[1049,5171,5172],{"class":1550},"          variant",[1049,5174,1554],{"class":1267},[1049,5176,1481],{"class":1267},[1049,5178,5179],{"class":1059},"subtle",[1049,5181,5151],{"class":1267},[1049,5183,5185,5188,5190,5192,5195],{"class":5184,"line":3470},[1051,1532],[1049,5186,5187],{"class":1550},"          placeholder",[1049,5189,1554],{"class":1267},[1049,5191,1481],{"class":1267},[1049,5193,5194],{"class":1059},"Ask me anything...",[1049,5196,5151],{"class":1267},[1049,5198,5200,5203,5205,5207,5210],{"class":5199,"line":3498},[1051,1532],[1049,5201,5202],{"class":1550},"          @submit",[1049,5204,1554],{"class":1267},[1049,5206,1481],{"class":1267},[1049,5208,5209],{"class":1059},"createChat",[1049,5211,5151],{"class":1267},[1049,5213,5215],{"class":5214,"line":3506},[1051,1532],[1049,5216,5217],{"class":1267},"        >\n",[1049,5219,5221,5224,5227,5230,5232,5234,5237,5239],{"class":5220,"line":3511},[1051,1532],[1049,5222,5223],{"class":1267},"          \u003C",[1049,5225,5226],{"class":1273},"UChatPromptSubmit",[1049,5228,5229],{"class":1550}," color",[1049,5231,1554],{"class":1267},[1049,5233,1481],{"class":1267},[1049,5235,5236],{"class":1059},"neutral",[1049,5238,1481],{"class":1267},[1049,5240,1574],{"class":1267},[1049,5242,5244,5246,5248],{"class":5243,"line":3577},[1051,1532],[1049,5245,5120],{"class":1267},[1049,5247,4687],{"class":1273},[1049,5249,1528],{"class":1267},[1049,5251,5252,5255,5257],{"class":1051,"line":3582},[1049,5253,5254],{"class":1267},"      \u003C/",[1049,5256,5075],{"class":1273},[1049,5258,1528],{"class":1267},[1049,5260,5261,5263,5265],{"class":1051,"line":3587},[1049,5262,1579],{"class":1267},[1049,5264,1525],{"class":1273},[1049,5266,1528],{"class":1267},[1049,5268,5269,5271,5273],{"class":1051,"line":3593},[1049,5270,1589],{"class":1267},[1049,5272,5040],{"class":1273},[1049,5274,1528],{"class":1267},[1049,5276,5277,5279,5281],{"class":1051,"line":3623},[1049,5278,1598],{"class":1267},[1049,5280,1525],{"class":1273},[1049,5282,1528],{"class":1267},[949,5284,4235,5285,5289],{},[1024,5286,5287],{"href":270},[1046,5288,4687],{}," component automatically handles:",[961,5291,5292,5299,5302,5312],{},[964,5293,5294,5295],{},"Form submission when pressing ",[5296,5297],"kbd",{"value":5298},"enter",[964,5300,5301],{},"Auto-resizing as you type",[964,5303,5304,5305,5308,5309],{},"A loading state when ",[1046,5306,5307],{},"status"," is set to ",[1046,5310,5311],{},"streaming",[964,5313,5314],{},"Focus management and keyboard shortcuts",[953,5316,5318],{"id":5317},"creating-the-chat-page","Creating the chat page",[949,5320,5321,5322,5329,5330,5337],{},"The chat page is where the actual conversation happens. It integrates the AI SDK's ",[1024,5323,5326],{"href":5324,"rel":5325},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/chat",[1028],[1046,5327,5328],{},"Chat"," class and ",[1024,5331,5334],{"href":5332,"rel":5333},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/default-chat-transport",[1028],[1046,5335,5336],{},"DefaultChatTransport"," for real-time streaming.",[1240,5339,5340],{},[1658,5341,5342],{},[1039,5343,5347],{"className":1512,"code":5344,"filename":5345,"highlights":5346,"language":34,"meta":1044,"style":1044},"\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",[1069,1283,1298,1448,2237,2250,2280,2286,2291,2323,2339,2357,2373,2381,3331,3370,3376,3381,3387,3407,3435,3451,3470],[1046,5348,5349,5369,5389,5410,5415,5429,5443,5447,5452,5500,5504,5523,5566,5570,5574,5590,5594,5599,5616,5636,5655,5671,5698,5707,5722,5728,5755,5771,5776,5781,5796,5811,5827,5844,5858,5865,5870,5877,5882,5904,5916,5936,5964,5978,5982,5986,5990,5995,6008,6036,6047,6051,6057,6065,6069,6077,6095,6107,6126,6133,6147,6160,6165,6179,6183,6208,6286,6343,6383,6392,6401,6409,6413,6419,6431,6445,6457,6470,6483,6487,6494,6507,6520,6534,6548,6553,6562,6571,6580,6589],{"__ignoreMap":1044},[1049,5350,5351,5353,5355,5357,5359,5361,5363,5365,5367],{"class":1051,"line":1052},[1049,5352,1522],{"class":1267},[1049,5354,4722],{"class":1273},[1049,5356,4725],{"class":1550},[1049,5358,4728],{"class":1550},[1049,5360,1554],{"class":1267},[1049,5362,1481],{"class":1267},[1049,5364,1246],{"class":1059},[1049,5366,1481],{"class":1267},[1049,5368,1528],{"class":1267},[1049,5370,5372,5374,5376,5379,5381,5383,5385,5387],{"class":5371,"line":1069},[1051,1532],[1049,5373,1670],{"class":1253},[1049,5375,1673],{"class":1267},[1049,5377,5378],{"class":1263}," DefaultChatTransport",[1049,5380,1695],{"class":1267},[1049,5382,1698],{"class":1253},[1049,5384,1354],{"class":1267},[1049,5386,2496],{"class":1059},[1049,5388,1318],{"class":1267},[1049,5390,5392,5394,5396,5399,5401,5403,5405,5408],{"class":5391,"line":1283},[1051,1532],[1049,5393,1670],{"class":1253},[1049,5395,1673],{"class":1267},[1049,5397,5398],{"class":1263}," Chat",[1049,5400,1695],{"class":1267},[1049,5402,1698],{"class":1253},[1049,5404,1354],{"class":1267},[1049,5406,5407],{"class":1059},"@ai-sdk/vue",[1049,5409,1318],{"class":1267},[1049,5411,5413],{"class":5412,"line":1298},[1051,1532],[1049,5414,1332],{"emptyLinePlaceholder":21},[1049,5416,5417,5419,5422,5424,5427],{"class":1051,"line":1310},[1049,5418,4743],{"class":1550},[1049,5420,5421],{"class":1263}," route ",[1049,5423,1554],{"class":1267},[1049,5425,5426],{"class":1072}," useRoute",[1049,5428,2631],{"class":1263},[1049,5430,5431,5433,5436,5438,5441],{"class":1051,"line":1321},[1049,5432,4743],{"class":1550},[1049,5434,5435],{"class":1263}," toast ",[1049,5437,1554],{"class":1267},[1049,5439,5440],{"class":1072}," useToast",[1049,5442,2631],{"class":1263},[1049,5444,5445],{"class":1051,"line":1329},[1049,5446,1332],{"emptyLinePlaceholder":21},[1049,5448,5449],{"class":1051,"line":1335},[1049,5450,5451],{"class":1433},"// Fetch existing chat data\n",[1049,5453,5454,5456,5458,5461,5463,5466,5468,5470,5472,5475,5477,5479,5482,5484,5487,5489,5492,5494,5496,5498],{"class":1051,"line":1346},[1049,5455,4743],{"class":1550},[1049,5457,1673],{"class":1267},[1049,5459,5460],{"class":1273}," data",[1049,5462,1277],{"class":1267},[1049,5464,5465],{"class":1263}," chatData ",[1049,5467,1451],{"class":1267},[1049,5469,2585],{"class":1267},[1049,5471,2588],{"class":1253},[1049,5473,5474],{"class":1072}," useFetch",[1049,5476,1264],{"class":1263},[1049,5478,3465],{"class":1267},[1049,5480,5481],{"class":1059},"/api/chats/",[1049,5483,4997],{"class":1267},[1049,5485,5486],{"class":1263},"route",[1049,5488,1771],{"class":1267},[1049,5490,5491],{"class":1263},"params",[1049,5493,1771],{"class":1267},[1049,5495,1980],{"class":1263},[1049,5497,5006],{"class":1267},[1049,5499,1454],{"class":1263},[1049,5501,5502],{"class":1051,"line":1362},[1049,5503,1332],{"emptyLinePlaceholder":21},[1049,5505,5506,5509,5511,5513,5516,5518,5521],{"class":1051,"line":1368},[1049,5507,5508],{"class":1253},"if",[1049,5510,1914],{"class":1263},[1049,5512,3321],{"class":1267},[1049,5514,5515],{"class":1263},"chatData",[1049,5517,1771],{"class":1267},[1049,5519,5520],{"class":1263},"value) ",[1049,5522,1268],{"class":1267},[1049,5524,5525,5528,5530,5532,5534,5536,5538,5540,5542,5544,5546,5548,5550,5552,5554,5557,5559,5562,5564],{"class":1051,"line":1373},[1049,5526,5527],{"class":1253},"  throw",[1049,5529,2861],{"class":1072},[1049,5531,1264],{"class":1273},[1049,5533,1828],{"class":1267},[1049,5535,3343],{"class":1273},[1049,5537,1277],{"class":1267},[1049,5539,3349],{"class":3348},[1049,5541,1679],{"class":1267},[1049,5543,3354],{"class":1273},[1049,5545,1277],{"class":1267},[1049,5547,1354],{"class":1267},[1049,5549,3361],{"class":1059},[1049,5551,1292],{"class":1267},[1049,5553,1679],{"class":1267},[1049,5555,5556],{"class":1273}," fatal",[1049,5558,1277],{"class":1267},[1049,5560,5561],{"class":1429}," true",[1049,5563,1695],{"class":1267},[1049,5565,1454],{"class":1273},[1049,5567,5568],{"class":1051,"line":1396},[1049,5569,5013],{"class":1267},[1049,5571,5572],{"class":1051,"line":1401},[1049,5573,1332],{"emptyLinePlaceholder":21},[1049,5575,5576,5578,5580,5582,5584,5586,5588],{"class":1051,"line":1411},[1049,5577,4743],{"class":1550},[1049,5579,4746],{"class":1263},[1049,5581,1554],{"class":1267},[1049,5583,4751],{"class":1072},[1049,5585,1264],{"class":1263},[1049,5587,4756],{"class":1267},[1049,5589,1454],{"class":1263},[1049,5591,5592],{"class":1051,"line":1421},[1049,5593,1332],{"emptyLinePlaceholder":21},[1049,5595,5596],{"class":1051,"line":1437},[1049,5597,5598],{"class":1433},"// Initialize the Chat class from AI SDK\n",[1049,5600,5601,5603,5606,5608,5610,5612,5614],{"class":1051,"line":1443},[1049,5602,4743],{"class":1550},[1049,5604,5605],{"class":1263}," chat ",[1049,5607,1554],{"class":1267},[1049,5609,1865],{"class":1267},[1049,5611,5398],{"class":1072},[1049,5613,1264],{"class":1263},[1049,5615,1268],{"class":1267},[1049,5617,5619,5621,5623,5626,5628,5630,5632,5634],{"class":5618,"line":1448},[1051,1532],[1049,5620,1761],{"class":1273},[1049,5622,1277],{"class":1267},[1049,5624,5625],{"class":1263}," chatData",[1049,5627,1771],{"class":1267},[1049,5629,4810],{"class":1263},[1049,5631,1771],{"class":1267},[1049,5633,1980],{"class":1263},[1049,5635,1295],{"class":1267},[1049,5637,5639,5641,5643,5645,5647,5649,5651,5653],{"class":5638,"line":2237},[1051,1532],[1049,5640,1921],{"class":1273},[1049,5642,1277],{"class":1267},[1049,5644,5625],{"class":1263},[1049,5646,1771],{"class":1267},[1049,5648,4810],{"class":1263},[1049,5650,1771],{"class":1267},[1049,5652,1959],{"class":1263},[1049,5654,1295],{"class":1267},[1049,5656,5658,5661,5663,5665,5667,5669],{"class":5657,"line":2250},[1051,1532],[1049,5659,5660],{"class":1273},"  transport",[1049,5662,1277],{"class":1267},[1049,5664,1865],{"class":1267},[1049,5666,5378],{"class":1072},[1049,5668,1264],{"class":1263},[1049,5670,1268],{"class":1267},[1049,5672,5674,5677,5679,5681,5683,5685,5687,5689,5691,5693,5695],{"class":5673,"line":2280},[1051,1532],[1049,5675,5676],{"class":1273},"    api",[1049,5678,1277],{"class":1267},[1049,5680,3459],{"class":1267},[1049,5682,5481],{"class":1059},[1049,5684,4997],{"class":1267},[1049,5686,5515],{"class":1263},[1049,5688,1771],{"class":1267},[1049,5690,4810],{"class":1263},[1049,5692,1771],{"class":1267},[1049,5694,1980],{"class":1263},[1049,5696,5697],{"class":1267},"}`\n",[1049,5699,5701,5703,5705],{"class":5700,"line":2286},[1051,1532],[1049,5702,2376],{"class":1267},[1049,5704,1845],{"class":1263},[1049,5706,1295],{"class":1267},[1049,5708,5710,5713,5715,5718,5720],{"class":5709,"line":2291},[1051,1532],[1049,5711,5712],{"class":1273},"  onData",[1049,5714,1264],{"class":1267},[1049,5716,5717],{"class":1905},"dataPart",[1049,5719,1845],{"class":1267},[1049,5721,1343],{"class":1267},[1049,5723,5725],{"class":5724,"line":2323},[1051,1532],[1049,5726,5727],{"class":1433},"    // Refresh the chat list when a title is generated\n",[1049,5729,5731,5734,5736,5738,5740,5743,5745,5747,5749,5751,5753],{"class":5730,"line":2339},[1051,1532],[1049,5732,5733],{"class":1253},"    if",[1049,5735,1914],{"class":1273},[1049,5737,5717],{"class":1263},[1049,5739,1771],{"class":1267},[1049,5741,5742],{"class":1263},"type",[1049,5744,3638],{"class":1267},[1049,5746,1354],{"class":1267},[1049,5748,3924],{"class":1059},[1049,5750,1292],{"class":1267},[1049,5752,3326],{"class":1273},[1049,5754,1268],{"class":1267},[1049,5756,5758,5761,5763,5765,5767,5769],{"class":5757,"line":2357},[1051,1532],[1049,5759,5760],{"class":1072},"      refreshNuxtData",[1049,5762,1264],{"class":1273},[1049,5764,1292],{"class":1267},[1049,5766,1750],{"class":1059},[1049,5768,1292],{"class":1267},[1049,5770,1454],{"class":1273},[1049,5772,5774],{"class":5773,"line":2373},[1051,1532],[1049,5775,1440],{"class":1267},[1049,5777,5779],{"class":5778,"line":2381},[1051,1532],[1049,5780,1365],{"class":1267},[1049,5782,5784,5787,5789,5792,5794],{"class":5783,"line":3331},[1051,1532],[1049,5785,5786],{"class":1273},"  onError",[1049,5788,1264],{"class":1267},[1049,5790,5791],{"class":1905},"error",[1049,5793,1845],{"class":1267},[1049,5795,1343],{"class":1267},[1049,5797,5799,5802,5804,5807,5809],{"class":5798,"line":3370},[1051,1532],[1049,5800,5801],{"class":1263},"    toast",[1049,5803,1771],{"class":1267},[1049,5805,5806],{"class":1072},"add",[1049,5808,1264],{"class":1273},[1049,5810,1268],{"class":1267},[1049,5812,5814,5817,5819,5821,5823,5825],{"class":5813,"line":3376},[1051,1532],[1049,5815,5816],{"class":1273},"      title",[1049,5818,1277],{"class":1267},[1049,5820,1354],{"class":1267},[1049,5822,471],{"class":1059},[1049,5824,1292],{"class":1267},[1049,5826,1295],{"class":1267},[1049,5828,5830,5833,5835,5838,5840,5842],{"class":5829,"line":3381},[1051,1532],[1049,5831,5832],{"class":1273},"      description",[1049,5834,1277],{"class":1267},[1049,5836,5837],{"class":1263}," error",[1049,5839,1771],{"class":1267},[1049,5841,4077],{"class":1263},[1049,5843,1295],{"class":1267},[1049,5845,5847,5850,5852,5854,5856],{"class":5846,"line":3387},[1051,1532],[1049,5848,5849],{"class":1273},"      color",[1049,5851,1277],{"class":1267},[1049,5853,1354],{"class":1267},[1049,5855,5791],{"class":1059},[1049,5857,1318],{"class":1267},[1049,5859,5861,5863],{"class":5860,"line":3407},[1051,1532],[1049,5862,3501],{"class":1267},[1049,5864,1454],{"class":1273},[1049,5866,5868],{"class":5867,"line":3435},[1051,1532],[1049,5869,3373],{"class":1267},[1049,5871,5873,5875],{"class":5872,"line":3451},[1051,1532],[1049,5874,1451],{"class":1267},[1049,5876,1454],{"class":1263},[1049,5878,5880],{"class":5879,"line":3470},[1051,1532],[1049,5881,1332],{"emptyLinePlaceholder":21},[1049,5883,5884,5887,5890,5892,5895,5897,5900,5902],{"class":1051,"line":3498},[1049,5885,5886],{"class":1550},"function",[1049,5888,5889],{"class":1072}," handleSubmit",[1049,5891,1264],{"class":1267},[1049,5893,5894],{"class":1905},"e",[1049,5896,1277],{"class":1267},[1049,5898,5899],{"class":1055}," Event",[1049,5901,1845],{"class":1267},[1049,5903,1343],{"class":1267},[1049,5905,5906,5909,5911,5914],{"class":1051,"line":3506},[1049,5907,5908],{"class":1263},"  e",[1049,5910,1771],{"class":1267},[1049,5912,5913],{"class":1072},"preventDefault",[1049,5915,2631],{"class":1273},[1049,5917,5918,5920,5922,5924,5926,5928,5930,5932,5934],{"class":1051,"line":3511},[1049,5919,3316],{"class":1253},[1049,5921,1914],{"class":1273},[1049,5923,4805],{"class":1263},[1049,5925,1771],{"class":1267},[1049,5927,4810],{"class":1263},[1049,5929,1771],{"class":1267},[1049,5931,4815],{"class":1072},[1049,5933,4818],{"class":1273},[1049,5935,1268],{"class":1267},[1049,5937,5938,5941,5943,5946,5948,5950,5952,5954,5956,5958,5960,5962],{"class":1051,"line":3577},[1049,5939,5940],{"class":1263},"    chat",[1049,5942,1771],{"class":1267},[1049,5944,5945],{"class":1072},"sendMessage",[1049,5947,1264],{"class":1273},[1049,5949,1828],{"class":1267},[1049,5951,1682],{"class":1273},[1049,5953,1277],{"class":1267},[1049,5955,4951],{"class":1263},[1049,5957,1771],{"class":1267},[1049,5959,4810],{"class":1263},[1049,5961,1695],{"class":1267},[1049,5963,1454],{"class":1273},[1049,5965,5966,5969,5971,5973,5975],{"class":1051,"line":3582},[1049,5967,5968],{"class":1263},"    input",[1049,5970,1771],{"class":1267},[1049,5972,4810],{"class":1263},[1049,5974,2585],{"class":1267},[1049,5976,5977],{"class":1267}," ''\n",[1049,5979,5980],{"class":1051,"line":3587},[1049,5981,3373],{"class":1267},[1049,5983,5984],{"class":1051,"line":3593},[1049,5985,5013],{"class":1267},[1049,5987,5988],{"class":1051,"line":3623},[1049,5989,1332],{"emptyLinePlaceholder":21},[1049,5991,5992],{"class":1051,"line":3665},[1049,5993,5994],{"class":1433},"// Auto-generate response for first message\n",[1049,5996,5997,6000,6002,6004,6006],{"class":1051,"line":3694},[1049,5998,5999],{"class":1072},"onMounted",[1049,6001,1264],{"class":1263},[1049,6003,1768],{"class":1267},[1049,6005,1788],{"class":1550},[1049,6007,1343],{"class":1267},[1049,6009,6010,6012,6014,6016,6018,6020,6022,6024,6026,6028,6030,6032,6034],{"class":1051,"line":3706},[1049,6011,3316],{"class":1253},[1049,6013,1914],{"class":1273},[1049,6015,5515],{"class":1263},[1049,6017,1771],{"class":1267},[1049,6019,4810],{"class":1263},[1049,6021,3633],{"class":1267},[1049,6023,1959],{"class":1263},[1049,6025,1771],{"class":1267},[1049,6027,3611],{"class":1263},[1049,6029,3638],{"class":1267},[1049,6031,3617],{"class":3348},[1049,6033,3326],{"class":1273},[1049,6035,1268],{"class":1267},[1049,6037,6038,6040,6042,6045],{"class":1051,"line":3722},[1049,6039,5940],{"class":1263},[1049,6041,1771],{"class":1267},[1049,6043,6044],{"class":1072},"regenerate",[1049,6046,2631],{"class":1273},[1049,6048,6049],{"class":1051,"line":3736},[1049,6050,3373],{"class":1267},[1049,6052,6053,6055],{"class":1051,"line":3743},[1049,6054,1451],{"class":1267},[1049,6056,1454],{"class":1263},[1049,6058,6059,6061,6063],{"class":1051,"line":3748},[1049,6060,1598],{"class":1267},[1049,6062,4722],{"class":1273},[1049,6064,1528],{"class":1267},[1049,6066,6067],{"class":1051,"line":3753},[1049,6068,1332],{"emptyLinePlaceholder":21},[1049,6070,6071,6073,6075],{"class":1051,"line":3759},[1049,6072,1522],{"class":1267},[1049,6074,1525],{"class":1273},[1049,6076,1528],{"class":1267},[1049,6078,6079,6081,6083,6085,6087,6089,6091,6093],{"class":1051,"line":3776},[1049,6080,1535],{"class":1267},[1049,6082,5040],{"class":1273},[1049,6084,5043],{"class":1550},[1049,6086,1554],{"class":1267},[1049,6088,1481],{"class":1267},[1049,6090,5050],{"class":1059},[1049,6092,1481],{"class":1267},[1049,6094,1528],{"class":1267},[1049,6096,6097,6099,6101,6103,6105],{"class":1051,"line":3798},[1049,6098,1544],{"class":1267},[1049,6100,1525],{"class":1273},[1049,6102,5063],{"class":1267},[1049,6104,5066],{"class":1550},[1049,6106,1528],{"class":1267},[1049,6108,6109,6111,6113,6115,6117,6119,6122,6124],{"class":1051,"line":3816},[1049,6110,1568],{"class":1267},[1049,6112,5075],{"class":1273},[1049,6114,5078],{"class":1550},[1049,6116,1554],{"class":1267},[1049,6118,1481],{"class":1267},[1049,6120,6121],{"class":1059},"min-h-dvh flex flex-col py-4 sm:py-6",[1049,6123,1481],{"class":1267},[1049,6125,1528],{"class":1267},[1049,6127,6128,6130],{"class":1051,"line":3824},[1049,6129,5094],{"class":1267},[1049,6131,6132],{"class":1273},"UChatMessages\n",[1049,6134,6135,6138,6140,6142,6145],{"class":1051,"line":3841},[1049,6136,6137],{"class":1550},"          :messages",[1049,6139,1554],{"class":1267},[1049,6141,1481],{"class":1267},[1049,6143,6144],{"class":1059},"chat.messages",[1049,6146,5151],{"class":1267},[1049,6148,6149,6151,6153,6155,6158],{"class":1051,"line":3860},[1049,6150,5157],{"class":1550},[1049,6152,1554],{"class":1267},[1049,6154,1481],{"class":1267},[1049,6156,6157],{"class":1059},"chat.status",[1049,6159,5151],{"class":1267},[1049,6161,6162],{"class":1051,"line":3868},[1049,6163,6164],{"class":1550},"          should-auto-scroll\n",[1049,6166,6167,6170,6172,6174,6177],{"class":1051,"line":3873},[1049,6168,6169],{"class":1550},"          class",[1049,6171,1554],{"class":1267},[1049,6173,1481],{"class":1267},[1049,6175,6176],{"class":1059},"flex-1",[1049,6178,5151],{"class":1267},[1049,6180,6181],{"class":1051,"line":3879},[1049,6182,5217],{"class":1267},[1049,6184,6185,6187,6189,6191,6193,6195,6197,6199,6202,6204,6206],{"class":1051,"line":3899},[1049,6186,5223],{"class":1267},[1049,6188,1525],{"class":1273},[1049,6190,5063],{"class":1267},[1049,6192,344],{"class":1550},[1049,6194,1554],{"class":1267},[1049,6196,1481],{"class":1267},[1049,6198,1828],{"class":1267},[1049,6200,6201],{"class":1263}," message ",[1049,6203,1451],{"class":1267},[1049,6205,1481],{"class":1267},[1049,6207,1528],{"class":1267},[1049,6209,6210,6213,6215,6218,6220,6222,6225,6227,6230,6233,6235,6237,6239,6241,6244,6247,6249,6252,6254,6256,6258,6260,6263,6265,6268,6270,6272,6274,6276,6278,6281,6284],{"class":1051,"line":3914},[1049,6211,6212],{"class":1267},"            \u003C",[1049,6214,1525],{"class":1273},[1049,6216,6217],{"class":1253}," v-for",[1049,6219,1554],{"class":1267},[1049,6221,1481],{"class":1267},[1049,6223,6224],{"class":1263},"(part",[1049,6226,1679],{"class":1267},[1049,6228,6229],{"class":1263}," index) ",[1049,6231,6232],{"class":1267},"in",[1049,6234,2580],{"class":1263},[1049,6236,1771],{"class":1267},[1049,6238,2161],{"class":1263},[1049,6240,1481],{"class":1267},[1049,6242,6243],{"class":1267}," :",[1049,6245,6246],{"class":1550},"key",[1049,6248,1554],{"class":1267},[1049,6250,6251],{"class":1267},"\"`${",[1049,6253,4077],{"class":1263},[1049,6255,1771],{"class":1267},[1049,6257,1980],{"class":1263},[1049,6259,1451],{"class":1267},[1049,6261,6262],{"class":1059},"-",[1049,6264,4997],{"class":1267},[1049,6266,6267],{"class":1263},"part",[1049,6269,1771],{"class":1267},[1049,6271,5742],{"class":1263},[1049,6273,1451],{"class":1267},[1049,6275,6262],{"class":1059},[1049,6277,4997],{"class":1267},[1049,6279,6280],{"class":1263},"index",[1049,6282,6283],{"class":1267},"}`\"",[1049,6285,1528],{"class":1267},[1049,6287,6288,6291,6294,6297,6299,6301,6304,6306,6309,6311,6313,6316,6318,6321,6323,6325,6328,6330,6332,6334,6336,6339,6341],{"class":1051,"line":3931},[1049,6289,6290],{"class":1267},"              \u003C",[1049,6292,6293],{"class":1273},"MDC",[1049,6295,6296],{"class":1550}," v-if",[1049,6298,1554],{"class":1267},[1049,6300,1481],{"class":1267},[1049,6302,6303],{"class":1059},"part.type === 'text' && message.role === 'assistant'",[1049,6305,1481],{"class":1267},[1049,6307,6308],{"class":1550}," :value",[1049,6310,1554],{"class":1267},[1049,6312,1481],{"class":1267},[1049,6314,6315],{"class":1059},"part.text",[1049,6317,1481],{"class":1267},[1049,6319,6320],{"class":1550}," :cache-key",[1049,6322,1554],{"class":1267},[1049,6324,1481],{"class":1267},[1049,6326,6327],{"class":1059},"`${message.id}-${index}`",[1049,6329,1481],{"class":1267},[1049,6331,5078],{"class":1550},[1049,6333,1554],{"class":1267},[1049,6335,1481],{"class":1267},[1049,6337,6338],{"class":1059},"*:first:mt-0 *:last:mb-0",[1049,6340,1481],{"class":1267},[1049,6342,1574],{"class":1267},[1049,6344,6345,6347,6349,6352,6354,6356,6359,6361,6363,6365,6367,6370,6372,6374,6377,6379,6381],{"class":1051,"line":3955},[1049,6346,6290],{"class":1267},[1049,6348,949],{"class":1273},[1049,6350,6351],{"class":1550}," v-else-if",[1049,6353,1554],{"class":1267},[1049,6355,1481],{"class":1267},[1049,6357,6358],{"class":1059},"part.type === 'text' && message.role === 'user'",[1049,6360,1481],{"class":1267},[1049,6362,5078],{"class":1550},[1049,6364,1554],{"class":1267},[1049,6366,1481],{"class":1267},[1049,6368,6369],{"class":1059},"whitespace-pre-wrap",[1049,6371,1481],{"class":1267},[1049,6373,2628],{"class":1267},[1049,6375,6376],{"class":1263},"{{ part.text }}",[1049,6378,1598],{"class":1267},[1049,6380,949],{"class":1273},[1049,6382,1528],{"class":1267},[1049,6384,6385,6388,6390],{"class":1051,"line":3966},[1049,6386,6387],{"class":1267},"            \u003C/",[1049,6389,1525],{"class":1273},[1049,6391,1528],{"class":1267},[1049,6393,6394,6397,6399],{"class":1051,"line":3974},[1049,6395,6396],{"class":1267},"          \u003C/",[1049,6398,1525],{"class":1273},[1049,6400,1528],{"class":1267},[1049,6402,6403,6405,6407],{"class":1051,"line":3980},[1049,6404,5120],{"class":1267},[1049,6406,4693],{"class":1273},[1049,6408,1528],{"class":1267},[1049,6410,6411],{"class":1051,"line":3985},[1049,6412,1332],{"emptyLinePlaceholder":21},[1049,6414,6415,6417],{"class":1051,"line":4008},[1049,6416,5094],{"class":1267},[1049,6418,5136],{"class":1273},[1049,6420,6421,6423,6425,6427,6429],{"class":1051,"line":4014},[1049,6422,5142],{"class":1550},[1049,6424,1554],{"class":1267},[1049,6426,1481],{"class":1267},[1049,6428,4805],{"class":1059},[1049,6430,5151],{"class":1267},[1049,6432,6433,6436,6438,6440,6443],{"class":1051,"line":4034},[1049,6434,6435],{"class":1550},"          :error",[1049,6437,1554],{"class":1267},[1049,6439,1481],{"class":1267},[1049,6441,6442],{"class":1059},"chat.error",[1049,6444,5151],{"class":1267},[1049,6446,6447,6449,6451,6453,6455],{"class":1051,"line":4040},[1049,6448,5172],{"class":1550},[1049,6450,1554],{"class":1267},[1049,6452,1481],{"class":1267},[1049,6454,5179],{"class":1059},[1049,6456,5151],{"class":1267},[1049,6458,6459,6461,6463,6465,6468],{"class":1051,"line":4086},[1049,6460,6169],{"class":1550},[1049,6462,1554],{"class":1267},[1049,6464,1481],{"class":1267},[1049,6466,6467],{"class":1059},"sticky bottom-0",[1049,6469,5151],{"class":1267},[1049,6471,6472,6474,6476,6478,6481],{"class":1051,"line":4102},[1049,6473,5202],{"class":1550},[1049,6475,1554],{"class":1267},[1049,6477,1481],{"class":1267},[1049,6479,6480],{"class":1059},"handleSubmit",[1049,6482,5151],{"class":1267},[1049,6484,6485],{"class":1051,"line":4135},[1049,6486,5217],{"class":1267},[1049,6488,6489,6491],{"class":1051,"line":4149},[1049,6490,5223],{"class":1267},[1049,6492,6493],{"class":1273},"UChatPromptSubmit\n",[1049,6495,6496,6499,6501,6503,6505],{"class":1051,"line":4157},[1049,6497,6498],{"class":1550},"            :status",[1049,6500,1554],{"class":1267},[1049,6502,1481],{"class":1267},[1049,6504,6157],{"class":1059},[1049,6506,5151],{"class":1267},[1049,6508,6509,6512,6514,6516,6518],{"class":1051,"line":4162},[1049,6510,6511],{"class":1550},"            color",[1049,6513,1554],{"class":1267},[1049,6515,1481],{"class":1267},[1049,6517,5236],{"class":1059},[1049,6519,5151],{"class":1267},[1049,6521,6522,6525,6527,6529,6532],{"class":1051,"line":4169},[1049,6523,6524],{"class":1550},"            @stop",[1049,6526,1554],{"class":1267},[1049,6528,1481],{"class":1267},[1049,6530,6531],{"class":1059},"chat.stop()",[1049,6533,5151],{"class":1267},[1049,6535,6536,6539,6541,6543,6546],{"class":1051,"line":4174},[1049,6537,6538],{"class":1550},"            @reload",[1049,6540,1554],{"class":1267},[1049,6542,1481],{"class":1267},[1049,6544,6545],{"class":1059},"chat.regenerate()",[1049,6547,5151],{"class":1267},[1049,6549,6550],{"class":1051,"line":4192},[1049,6551,6552],{"class":1267},"          />\n",[1049,6554,6556,6558,6560],{"class":1051,"line":6555},86,[1049,6557,5120],{"class":1267},[1049,6559,4687],{"class":1273},[1049,6561,1528],{"class":1267},[1049,6563,6565,6567,6569],{"class":1051,"line":6564},87,[1049,6566,5254],{"class":1267},[1049,6568,5075],{"class":1273},[1049,6570,1528],{"class":1267},[1049,6572,6574,6576,6578],{"class":1051,"line":6573},88,[1049,6575,1579],{"class":1267},[1049,6577,1525],{"class":1273},[1049,6579,1528],{"class":1267},[1049,6581,6583,6585,6587],{"class":1051,"line":6582},89,[1049,6584,1589],{"class":1267},[1049,6586,5040],{"class":1273},[1049,6588,1528],{"class":1267},[1049,6590,6592,6594,6596],{"class":1051,"line":6591},90,[1049,6593,1598],{"class":1267},[1049,6595,1525],{"class":1273},[1049,6597,1528],{"class":1267},[949,6599,6600],{},"Here's a breakdown of the key parts:",[949,6602,6603],{},[967,6604,6605],{},"The Chat Class",[949,6607,4235,6608,6613,6614,6616],{},[1024,6609,6611],{"href":5324,"rel":6610},[1028],[1046,6612,5328],{}," class from ",[1046,6615,5407],{}," manages the entire conversation state. It handles:",[961,6618,6619,6624,6639,6645,6650],{},[964,6620,6621,6622],{},"Message history with ",[1046,6623,6144],{},[964,6625,6626,6627,1914,6629,2826,6632,2826,6635,2826,6637,1845],{},"Connection status with ",[1046,6628,6157],{},[1046,6630,6631],{},"ready",[1046,6633,6634],{},"submitted",[1046,6636,5311],{},[1046,6638,5791],{},[964,6640,6641,6642],{},"Sending messages with ",[1046,6643,6644],{},"chat.sendMessage()",[964,6646,6647,6648],{},"Stopping generation with ",[1046,6649,6531],{},[964,6651,6652,6653],{},"Regenerating responses with ",[1046,6654,6545],{},[949,6656,4235,6657,6660,6661,6666,6667,6669],{},[1046,6658,6659],{},"onData"," callback receives ",[1024,6662,6665],{"href":6663,"rel":6664},"https://ai-sdk.dev/docs/ai-sdk-ui/streaming-data",[1028],"custom data events"," from the server (like ",[1046,6668,3924],{},"), allowing you to react to server-side events during streaming.",[949,6671,6672],{},[967,6673,6674],{},"UChatMessages Component",[949,6676,4235,6677,6681],{},[1024,6678,6679],{"href":260},[1046,6680,4693],{}," component is purpose-built for AI chatbots with:",[961,6683,6684,6687,6690,6693],{},[964,6685,6686],{},"Auto-scroll to bottom on load",[964,6688,6689],{},"Continuous scrolling as messages stream in",[964,6691,6692],{},"A loading indicator while the assistant processes",[964,6694,6695],{},"An \"Auto scroll\" button when scrolled up",[949,6697,6698],{},[967,6699,6700],{},"Rendering Markdown with MDC",[949,6702,6703,6704,6710,6711,6717,6718,6721],{},"AI models often respond with markdown formatting (code blocks, lists, bold text, etc.). We use the ",[1024,6705,6708],{"href":6706,"rel":6707},"https://github.com/nuxt-content/mdc#mdc",[1028],[1046,6709,6293],{}," component from ",[1024,6712,6715],{"href":6713,"rel":6714},"https://github.com/nuxt-content/mdc",[1028],[1046,6716,1303],{}," to render this content beautifully. The ",[1046,6719,6720],{},"getTextFromMessage"," utility extracts the text content from AI SDK v5 message parts.",[1628,6723,6724],{"to":819},[949,6725,6726],{},"Nuxt UI provides pre-styled prose components, so your markdown content will be automatically styled to match your theme.",[949,6728,6729],{},[967,6730,6731],{},"UChatPromptSubmit Component",[949,6733,4235,6734,6738],{},[1024,6735,6736],{"href":275},[1046,6737,5226],{}," component adapts based on the chat status:",[961,6740,6741,6744,6747],{},[964,6742,6743],{},"Shows a send button when ready",[964,6745,6746],{},"Shows a stop button while streaming",[964,6748,6749],{},"Shows a reload button after an error",[953,6751,6753],{"id":6752},"adding-chat-history","Adding chat history",[949,6755,6756],{},"This section adds a dropdown menu to list previous chats and navigate between them.",[1077,6758,6760],{"id":6759},"listing-chats-api","Listing chats API",[949,6762,6763],{},"First, create an endpoint to fetch all chats:",[1240,6765,6766],{},[1039,6767,6770],{"className":1244,"code":6768,"filename":6769,"language":1246,"meta":1044,"style":1044},"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",[1046,6771,6772,6790,6812,6831,6835,6853,6878,6905,6911],{"__ignoreMap":1044},[1049,6773,6774,6776,6778,6780,6782,6784,6786,6788],{"class":1051,"line":1052},[1049,6775,1670],{"class":1253},[1049,6777,1673],{"class":1267},[1049,6779,2460],{"class":1263},[1049,6781,1695],{"class":1267},[1049,6783,1698],{"class":1253},[1049,6785,1354],{"class":1267},[1049,6787,1077],{"class":1059},[1049,6789,1318],{"class":1267},[1049,6791,6792,6794,6796,6798,6800,6802,6804,6806,6808,6810],{"class":1051,"line":1069},[1049,6793,1670],{"class":1253},[1049,6795,1673],{"class":1267},[1049,6797,2403],{"class":1263},[1049,6799,1679],{"class":1267},[1049,6801,2511],{"class":1263},[1049,6803,1695],{"class":1267},[1049,6805,1698],{"class":1253},[1049,6807,1354],{"class":1267},[1049,6809,2520],{"class":1059},[1049,6811,1318],{"class":1267},[1049,6813,6814,6816,6818,6821,6823,6825,6827,6829],{"class":1051,"line":1283},[1049,6815,1670],{"class":1253},[1049,6817,1673],{"class":1267},[1049,6819,6820],{"class":1263}," desc",[1049,6822,1695],{"class":1267},[1049,6824,1698],{"class":1253},[1049,6826,1354],{"class":1267},[1049,6828,1723],{"class":1059},[1049,6830,1318],{"class":1267},[1049,6832,6833],{"class":1051,"line":1298},[1049,6834,1332],{"emptyLinePlaceholder":21},[1049,6836,6837,6839,6841,6843,6845,6847,6849,6851],{"class":1051,"line":1310},[1049,6838,1254],{"class":1253},[1049,6840,1257],{"class":1253},[1049,6842,2460],{"class":1072},[1049,6844,1264],{"class":1263},[1049,6846,2559],{"class":1550},[1049,6848,4572],{"class":1267},[1049,6850,1788],{"class":1550},[1049,6852,1343],{"class":1267},[1049,6854,6855,6857,6859,6861,6863,6865,6867,6869,6871,6874,6876],{"class":1051,"line":1321},[1049,6856,2802],{"class":1253},[1049,6858,2588],{"class":1253},[1049,6860,2403],{"class":1263},[1049,6862,1771],{"class":1267},[1049,6864,3245],{"class":1263},[1049,6866,1771],{"class":1267},[1049,6868,1750],{"class":1263},[1049,6870,1771],{"class":1267},[1049,6872,6873],{"class":1072},"findMany",[1049,6875,1264],{"class":1273},[1049,6877,1268],{"class":1267},[1049,6879,6880,6883,6885,6887,6889,6891,6893,6895,6897,6899,6901,6903],{"class":1051,"line":1329},[1049,6881,6882],{"class":1072},"    orderBy",[1049,6884,1277],{"class":1267},[1049,6886,4572],{"class":1267},[1049,6888,1788],{"class":1550},[1049,6890,6820],{"class":1072},[1049,6892,1264],{"class":1273},[1049,6894,2679],{"class":1263},[1049,6896,1771],{"class":1267},[1049,6898,1750],{"class":1263},[1049,6900,1771],{"class":1267},[1049,6902,4589],{"class":1263},[1049,6904,1454],{"class":1273},[1049,6906,6907,6909],{"class":1051,"line":1335},[1049,6908,2376],{"class":1267},[1049,6910,1454],{"class":1273},[1049,6912,6913,6915],{"class":1051,"line":1346},[1049,6914,1451],{"class":1267},[1049,6916,1454],{"class":1263},[1077,6918,6920],{"id":6919},"building-the-chats-history-dropdown","Building the chats history dropdown",[949,6922,6923,6924,6929,6930,6935,6936,6929,6943,6945],{},"The component uses ",[1024,6925,6926],{"href":430},[1046,6927,6928],{},"UDropdownMenu"," with a ",[1024,6931,6932],{"href":224},[1046,6933,6934],{},"UButton"," as trigger. Use ",[1024,6937,6940],{"href":6938,"rel":6939},"https://nuxt.com/docs/api/composables/use-fetch",[1028],[1046,6941,6942],{},"useFetch",[1046,6944,6246],{}," to fetch and cache the chat list:",[1240,6947,6948],{},[1039,6949,6952],{"className":1512,"code":6950,"filename":6951,"language":34,"meta":1044,"style":1044},"\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",[1046,6953,6954,6974,6986,6990,7020,7035,7049,7055,7059,7079,7084,7100,7116,7136,7160,7164,7189,7214,7236,7262,7268,7272,7280,7284,7292,7323,7330,7347,7361,7375,7387,7401,7406,7414],{"__ignoreMap":1044},[1049,6955,6956,6958,6960,6962,6964,6966,6968,6970,6972],{"class":1051,"line":1052},[1049,6957,1522],{"class":1267},[1049,6959,4722],{"class":1273},[1049,6961,4725],{"class":1550},[1049,6963,4728],{"class":1550},[1049,6965,1554],{"class":1267},[1049,6967,1481],{"class":1267},[1049,6969,1246],{"class":1059},[1049,6971,1481],{"class":1267},[1049,6973,1528],{"class":1267},[1049,6975,6976,6978,6980,6982,6984],{"class":1051,"line":1069},[1049,6977,4743],{"class":1550},[1049,6979,5421],{"class":1263},[1049,6981,1554],{"class":1267},[1049,6983,5426],{"class":1072},[1049,6985,2631],{"class":1263},[1049,6987,6988],{"class":1051,"line":1283},[1049,6989,1332],{"emptyLinePlaceholder":21},[1049,6991,6992,6994,6996,6998,7000,7002,7004,7006,7008,7010,7012,7014,7016,7018],{"class":1051,"line":1298},[1049,6993,4743],{"class":1550},[1049,6995,1673],{"class":1267},[1049,6997,5460],{"class":1273},[1049,6999,1277],{"class":1267},[1049,7001,1739],{"class":1263},[1049,7003,1451],{"class":1267},[1049,7005,2585],{"class":1267},[1049,7007,5474],{"class":1072},[1049,7009,1264],{"class":1263},[1049,7011,1292],{"class":1267},[1049,7013,4867],{"class":1059},[1049,7015,1292],{"class":1267},[1049,7017,1679],{"class":1267},[1049,7019,1343],{"class":1267},[1049,7021,7022,7025,7027,7029,7031,7033],{"class":1051,"line":1310},[1049,7023,7024],{"class":1273},"  key",[1049,7026,1277],{"class":1267},[1049,7028,1354],{"class":1267},[1049,7030,1750],{"class":1059},[1049,7032,1292],{"class":1267},[1049,7034,1295],{"class":1267},[1049,7036,7037,7040,7042,7044,7046],{"class":1051,"line":1321},[1049,7038,7039],{"class":1072},"  default",[1049,7041,1277],{"class":1267},[1049,7043,4572],{"class":1267},[1049,7045,1788],{"class":1550},[1049,7047,7048],{"class":1263}," []\n",[1049,7050,7051,7053],{"class":1051,"line":1329},[1049,7052,1451],{"class":1267},[1049,7054,1454],{"class":1263},[1049,7056,7057],{"class":1051,"line":1335},[1049,7058,1332],{"emptyLinePlaceholder":21},[1049,7060,7061,7063,7066,7068,7071,7073,7075,7077],{"class":1051,"line":1346},[1049,7062,4743],{"class":1550},[1049,7064,7065],{"class":1263}," items ",[1049,7067,1554],{"class":1267},[1049,7069,7070],{"class":1072}," computed",[1049,7072,1264],{"class":1263},[1049,7074,1768],{"class":1267},[1049,7076,1788],{"class":1550},[1049,7078,1280],{"class":1263},[1049,7080,7081],{"class":1051,"line":1362},[1049,7082,7083],{"class":1267},"  {\n",[1049,7085,7086,7089,7091,7093,7096,7098],{"class":1051,"line":1368},[1049,7087,7088],{"class":1273},"    label",[1049,7090,1277],{"class":1267},[1049,7092,1354],{"class":1267},[1049,7094,7095],{"class":1059},"New chat",[1049,7097,1292],{"class":1267},[1049,7099,1295],{"class":1267},[1049,7101,7102,7105,7107,7109,7112,7114],{"class":1051,"line":1373},[1049,7103,7104],{"class":1273},"    to",[1049,7106,1277],{"class":1267},[1049,7108,1354],{"class":1267},[1049,7110,7111],{"class":1059},"/",[1049,7113,1292],{"class":1267},[1049,7115,1295],{"class":1267},[1049,7117,7118,7121,7123,7125,7132,7134],{"class":1051,"line":1396},[1049,7119,7120],{"class":1273},"    icon",[1049,7122,1277],{"class":1267},[1049,7124,1354],{"class":1267},[1049,7126,7127,7131],{"class":1059},[7128,7129],"i",{"class":7130},"shiki-icon-highlight sRy2g","i-lucide-plus-square",[1049,7133,1292],{"class":1267},[1049,7135,1295],{"class":1267},[1049,7137,7138,7141,7143,7146,7148,7151,7154,7156,7158],{"class":1051,"line":1401},[1049,7139,7140],{"class":1273},"    active",[1049,7142,1277],{"class":1267},[1049,7144,7145],{"class":1263}," route",[1049,7147,1771],{"class":1267},[1049,7149,7150],{"class":1263},"name ",[1049,7152,7153],{"class":1267},"===",[1049,7155,1354],{"class":1267},[1049,7157,6280],{"class":1059},[1049,7159,1318],{"class":1267},[1049,7161,7162],{"class":1051,"line":1411},[1049,7163,1365],{"class":1267},[1049,7165,7166,7169,7171,7173,7175,7177,7179,7181,7183,7185,7187],{"class":1051,"line":1421},[1049,7167,7168],{"class":1267},"  ...",[1049,7170,1750],{"class":1263},[1049,7172,1771],{"class":1267},[1049,7174,4810],{"class":1263},[1049,7176,1771],{"class":1267},[1049,7178,4072],{"class":1072},[1049,7180,1264],{"class":1263},[1049,7182,256],{"class":1905},[1049,7184,1788],{"class":1550},[1049,7186,1914],{"class":1263},[1049,7188,1268],{"class":1267},[1049,7190,7191,7193,7195,7197,7199,7202,7205,7207,7210,7212],{"class":1051,"line":1437},[1049,7192,7088],{"class":1273},[1049,7194,1277],{"class":1267},[1049,7196,2752],{"class":1263},[1049,7198,1771],{"class":1267},[1049,7200,7201],{"class":1263},"title ",[1049,7203,7204],{"class":1267},"||",[1049,7206,1354],{"class":1267},[1049,7208,7209],{"class":1059},"Untitled",[1049,7211,1292],{"class":1267},[1049,7213,1295],{"class":1267},[1049,7215,7216,7218,7220,7222,7224,7226,7228,7230,7232,7234],{"class":1051,"line":1443},[1049,7217,7104],{"class":1273},[1049,7219,1277],{"class":1267},[1049,7221,3459],{"class":1267},[1049,7223,4994],{"class":1059},[1049,7225,4997],{"class":1267},[1049,7227,256],{"class":1263},[1049,7229,1771],{"class":1267},[1049,7231,1980],{"class":1263},[1049,7233,5006],{"class":1267},[1049,7235,1295],{"class":1267},[1049,7237,7238,7240,7242,7244,7246,7248,7250,7253,7255,7257,7259],{"class":1051,"line":1448},[1049,7239,7140],{"class":1273},[1049,7241,1277],{"class":1267},[1049,7243,7145],{"class":1263},[1049,7245,1771],{"class":1267},[1049,7247,5491],{"class":1263},[1049,7249,1771],{"class":1267},[1049,7251,7252],{"class":1263},"id ",[1049,7254,7153],{"class":1267},[1049,7256,2752],{"class":1263},[1049,7258,1771],{"class":1267},[1049,7260,7261],{"class":1263},"id\n",[1049,7263,7264,7266],{"class":1051,"line":2237},[1049,7265,2376],{"class":1267},[1049,7267,1935],{"class":1263},[1049,7269,7270],{"class":1051,"line":2250},[1049,7271,2283],{"class":1263},[1049,7273,7274,7276,7278],{"class":1051,"line":2280},[1049,7275,1598],{"class":1267},[1049,7277,4722],{"class":1273},[1049,7279,1528],{"class":1267},[1049,7281,7282],{"class":1051,"line":2286},[1049,7283,1332],{"emptyLinePlaceholder":21},[1049,7285,7286,7288,7290],{"class":1051,"line":2291},[1049,7287,1522],{"class":1267},[1049,7289,1525],{"class":1273},[1049,7291,1528],{"class":1267},[1049,7293,7294,7296,7298,7301,7303,7305,7308,7310,7312,7314,7316,7319,7321],{"class":1051,"line":2323},[1049,7295,1535],{"class":1267},[1049,7297,6928],{"class":1273},[1049,7299,7300],{"class":1550}," :items",[1049,7302,1554],{"class":1267},[1049,7304,1481],{"class":1267},[1049,7306,7307],{"class":1059},"items",[1049,7309,1481],{"class":1267},[1049,7311,5078],{"class":1550},[1049,7313,1554],{"class":1267},[1049,7315,1481],{"class":1267},[1049,7317,7318],{"class":1059},"m-2",[1049,7320,1481],{"class":1267},[1049,7322,1528],{"class":1267},[1049,7324,7325,7327],{"class":1051,"line":2339},[1049,7326,1544],{"class":1267},[1049,7328,7329],{"class":1273},"UButton\n",[1049,7331,7332,7335,7337,7339,7345],{"class":1051,"line":2357},[1049,7333,7334],{"class":1550},"      icon",[1049,7336,1554],{"class":1267},[1049,7338,1481],{"class":1267},[1049,7340,7341,7344],{"class":1059},[7128,7342],{"class":7343},"shiki-icon-highlight sdATh","i-lucide-messages-square",[1049,7346,5151],{"class":1267},[1049,7348,7349,7352,7354,7356,7359],{"class":1051,"line":2373},[1049,7350,7351],{"class":1550},"      variant",[1049,7353,1554],{"class":1267},[1049,7355,1481],{"class":1267},[1049,7357,7358],{"class":1059},"ghost",[1049,7360,5151],{"class":1267},[1049,7362,7363,7366,7368,7370,7373],{"class":1051,"line":2381},[1049,7364,7365],{"class":1550},"      label",[1049,7367,1554],{"class":1267},[1049,7369,1481],{"class":1267},[1049,7371,7372],{"class":1059},"Chats History",[1049,7374,5151],{"class":1267},[1049,7376,7377,7379,7381,7383,7385],{"class":1051,"line":3331},[1049,7378,5849],{"class":1550},[1049,7380,1554],{"class":1267},[1049,7382,1481],{"class":1267},[1049,7384,5236],{"class":1059},[1049,7386,5151],{"class":1267},[1049,7388,7389,7392,7394,7396,7399],{"class":1051,"line":3370},[1049,7390,7391],{"class":1550},"      class",[1049,7393,1554],{"class":1267},[1049,7395,1481],{"class":1267},[1049,7397,7398],{"class":1059},"w-fit",[1049,7400,5151],{"class":1267},[1049,7402,7403],{"class":1051,"line":3376},[1049,7404,7405],{"class":1267},"    />\n",[1049,7407,7408,7410,7412],{"class":1051,"line":3381},[1049,7409,1589],{"class":1267},[1049,7411,6928],{"class":1273},[1049,7413,1528],{"class":1267},[1049,7415,7416,7418,7420],{"class":1051,"line":3387},[1049,7417,1598],{"class":1267},[1049,7419,1525],{"class":1273},[1049,7421,1528],{"class":1267},[953,7423,7425],{"id":7424},"integrating-history-in-the-home-page","Integrating history in the home page",[1240,7427,7428],{},[1658,7429,7430],{},[1039,7431,7434],{"className":1512,"code":7432,"filename":4712,"highlights":7433,"language":34,"meta":1044,"style":1044},"\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",[2373,2381,3331],[1046,7435,7436,7456,7472,7488,7492,7504,7526,7530,7542,7546,7550,7574,7588,7596,7604,7618,7654,7658,7662,7668,7672,7676,7698,7702,7710,7714,7722,7740,7754,7764,7773,7785,7803,7821,7825,7833,7837,7843,7855,7867,7879,7891,7903,7907,7925,7933,7941,7949,7957],{"__ignoreMap":1044},[1049,7437,7438,7440,7442,7444,7446,7448,7450,7452,7454],{"class":1051,"line":1052},[1049,7439,1522],{"class":1267},[1049,7441,4722],{"class":1273},[1049,7443,4725],{"class":1550},[1049,7445,4728],{"class":1550},[1049,7447,1554],{"class":1267},[1049,7449,1481],{"class":1267},[1049,7451,1246],{"class":1059},[1049,7453,1481],{"class":1267},[1049,7455,1528],{"class":1267},[1049,7457,7458,7460,7462,7464,7466,7468,7470],{"class":1051,"line":1069},[1049,7459,4743],{"class":1550},[1049,7461,4746],{"class":1263},[1049,7463,1554],{"class":1267},[1049,7465,4751],{"class":1072},[1049,7467,1264],{"class":1263},[1049,7469,4756],{"class":1267},[1049,7471,1454],{"class":1263},[1049,7473,7474,7476,7478,7480,7482,7484,7486],{"class":1051,"line":1283},[1049,7475,4743],{"class":1550},[1049,7477,4765],{"class":1263},[1049,7479,1554],{"class":1267},[1049,7481,4751],{"class":1072},[1049,7483,1264],{"class":1263},[1049,7485,4774],{"class":1429},[1049,7487,1454],{"class":1263},[1049,7489,7490],{"class":1051,"line":1298},[1049,7491,1332],{"emptyLinePlaceholder":21},[1049,7493,7494,7496,7498,7500,7502],{"class":1051,"line":1310},[1049,7495,2559],{"class":1550},[1049,7497,4787],{"class":1550},[1049,7499,4790],{"class":1072},[1049,7501,1768],{"class":1267},[1049,7503,1343],{"class":1267},[1049,7505,7506,7508,7510,7512,7514,7516,7518,7520,7522,7524],{"class":1051,"line":1321},[1049,7507,3316],{"class":1253},[1049,7509,1914],{"class":1273},[1049,7511,3321],{"class":1267},[1049,7513,4805],{"class":1263},[1049,7515,1771],{"class":1267},[1049,7517,4810],{"class":1263},[1049,7519,1771],{"class":1267},[1049,7521,4815],{"class":1072},[1049,7523,4818],{"class":1273},[1049,7525,4821],{"class":1253},[1049,7527,7528],{"class":1051,"line":1329},[1049,7529,1332],{"emptyLinePlaceholder":21},[1049,7531,7532,7534,7536,7538,7540],{"class":1051,"line":1335},[1049,7533,4830],{"class":1263},[1049,7535,1771],{"class":1267},[1049,7537,4810],{"class":1263},[1049,7539,2585],{"class":1267},[1049,7541,3963],{"class":1429},[1049,7543,7544],{"class":1051,"line":1346},[1049,7545,1332],{"emptyLinePlaceholder":21},[1049,7547,7548],{"class":1051,"line":1362},[1049,7549,4847],{"class":1433},[1049,7551,7552,7554,7556,7558,7560,7562,7564,7566,7568,7570,7572],{"class":1051,"line":1368},[1049,7553,2575],{"class":1550},[1049,7555,2752],{"class":1263},[1049,7557,2585],{"class":1267},[1049,7559,2588],{"class":1253},[1049,7561,4860],{"class":1072},[1049,7563,1264],{"class":1273},[1049,7565,1292],{"class":1267},[1049,7567,4867],{"class":1059},[1049,7569,1292],{"class":1267},[1049,7571,1679],{"class":1267},[1049,7573,1343],{"class":1267},[1049,7575,7576,7578,7580,7582,7584,7586],{"class":1051,"line":1373},[1049,7577,4878],{"class":1273},[1049,7579,1277],{"class":1267},[1049,7581,1354],{"class":1267},[1049,7583,4885],{"class":1059},[1049,7585,1292],{"class":1267},[1049,7587,1295],{"class":1267},[1049,7589,7590,7592,7594],{"class":1051,"line":1396},[1049,7591,4894],{"class":1273},[1049,7593,1277],{"class":1267},[1049,7595,1343],{"class":1267},[1049,7597,7598,7600,7602],{"class":1051,"line":1401},[1049,7599,4903],{"class":1273},[1049,7601,1277],{"class":1267},[1049,7603,1343],{"class":1267},[1049,7605,7606,7608,7610,7612,7614,7616],{"class":1051,"line":1411},[1049,7607,4105],{"class":1273},[1049,7609,1277],{"class":1267},[1049,7611,1354],{"class":1267},[1049,7613,2110],{"class":1059},[1049,7615,1292],{"class":1267},[1049,7617,1295],{"class":1267},[1049,7619,7620,7622,7624,7626,7628,7630,7632,7634,7636,7638,7640,7642,7644,7646,7648,7650,7652],{"class":1051,"line":1421},[1049,7621,4138],{"class":1273},[1049,7623,1277],{"class":1267},[1049,7625,1381],{"class":1273},[1049,7627,1828],{"class":1267},[1049,7629,2482],{"class":1273},[1049,7631,1277],{"class":1267},[1049,7633,1354],{"class":1267},[1049,7635,4940],{"class":1059},[1049,7637,1292],{"class":1267},[1049,7639,1679],{"class":1267},[1049,7641,1682],{"class":1273},[1049,7643,1277],{"class":1267},[1049,7645,4951],{"class":1263},[1049,7647,1771],{"class":1267},[1049,7649,4810],{"class":1263},[1049,7651,1695],{"class":1267},[1049,7653,3620],{"class":1273},[1049,7655,7656],{"class":1051,"line":1437},[1049,7657,3977],{"class":1267},[1049,7659,7660],{"class":1051,"line":1443},[1049,7661,1440],{"class":1267},[1049,7663,7664,7666],{"class":1051,"line":1448},[1049,7665,2376],{"class":1267},[1049,7667,1454],{"class":1273},[1049,7669,7670],{"class":1051,"line":2237},[1049,7671,1332],{"emptyLinePlaceholder":21},[1049,7673,7674],{"class":1051,"line":2250},[1049,7675,4982],{"class":1433},[1049,7677,7678,7680,7682,7684,7686,7688,7690,7692,7694,7696],{"class":1051,"line":2280},[1049,7679,4987],{"class":1072},[1049,7681,1264],{"class":1273},[1049,7683,3465],{"class":1267},[1049,7685,4994],{"class":1059},[1049,7687,4997],{"class":1267},[1049,7689,256],{"class":1263},[1049,7691,1771],{"class":1267},[1049,7693,1980],{"class":1263},[1049,7695,5006],{"class":1267},[1049,7697,1454],{"class":1273},[1049,7699,7700],{"class":1051,"line":2286},[1049,7701,5013],{"class":1267},[1049,7703,7704,7706,7708],{"class":1051,"line":2291},[1049,7705,1598],{"class":1267},[1049,7707,4722],{"class":1273},[1049,7709,1528],{"class":1267},[1049,7711,7712],{"class":1051,"line":2323},[1049,7713,1332],{"emptyLinePlaceholder":21},[1049,7715,7716,7718,7720],{"class":1051,"line":2339},[1049,7717,1522],{"class":1267},[1049,7719,1525],{"class":1273},[1049,7721,1528],{"class":1267},[1049,7723,7724,7726,7728,7730,7732,7734,7736,7738],{"class":1051,"line":2357},[1049,7725,1535],{"class":1267},[1049,7727,5040],{"class":1273},[1049,7729,5043],{"class":1550},[1049,7731,1554],{"class":1267},[1049,7733,1481],{"class":1267},[1049,7735,5050],{"class":1059},[1049,7737,1481],{"class":1267},[1049,7739,1528],{"class":1267},[1049,7741,7743,7745,7747,7749,7752],{"class":7742,"line":2373},[1051,1532],[1049,7744,1544],{"class":1267},[1049,7746,1525],{"class":1273},[1049,7748,5063],{"class":1267},[1049,7750,7751],{"class":1550},"header",[1049,7753,1528],{"class":1267},[1049,7755,7757,7759,7762],{"class":7756,"line":2381},[1051,1532],[1049,7758,1568],{"class":1267},[1049,7760,7761],{"class":1273},"ChatsHistory",[1049,7763,1574],{"class":1267},[1049,7765,7767,7769,7771],{"class":7766,"line":3331},[1051,1532],[1049,7768,1579],{"class":1267},[1049,7770,1525],{"class":1273},[1049,7772,1528],{"class":1267},[1049,7774,7775,7777,7779,7781,7783],{"class":1051,"line":3370},[1049,7776,1544],{"class":1267},[1049,7778,1525],{"class":1273},[1049,7780,5063],{"class":1267},[1049,7782,5066],{"class":1550},[1049,7784,1528],{"class":1267},[1049,7786,7787,7789,7791,7793,7795,7797,7799,7801],{"class":1051,"line":3376},[1049,7788,1568],{"class":1267},[1049,7790,5075],{"class":1273},[1049,7792,5078],{"class":1550},[1049,7794,1554],{"class":1267},[1049,7796,1481],{"class":1267},[1049,7798,5085],{"class":1059},[1049,7800,1481],{"class":1267},[1049,7802,1528],{"class":1267},[1049,7804,7805,7807,7809,7811,7813,7815,7817,7819],{"class":1051,"line":3381},[1049,7806,5094],{"class":1267},[1049,7808,5097],{"class":1273},[1049,7810,5078],{"class":1550},[1049,7812,1554],{"class":1267},[1049,7814,1481],{"class":1267},[1049,7816,5106],{"class":1059},[1049,7818,1481],{"class":1267},[1049,7820,1528],{"class":1267},[1049,7822,7823],{"class":1051,"line":3387},[1049,7824,5115],{"class":1263},[1049,7826,7827,7829,7831],{"class":1051,"line":3407},[1049,7828,5120],{"class":1267},[1049,7830,5097],{"class":1273},[1049,7832,1528],{"class":1267},[1049,7834,7835],{"class":1051,"line":3435},[1049,7836,1332],{"emptyLinePlaceholder":21},[1049,7838,7839,7841],{"class":1051,"line":3451},[1049,7840,5094],{"class":1267},[1049,7842,5136],{"class":1273},[1049,7844,7845,7847,7849,7851,7853],{"class":1051,"line":3470},[1049,7846,5142],{"class":1550},[1049,7848,1554],{"class":1267},[1049,7850,1481],{"class":1267},[1049,7852,4805],{"class":1059},[1049,7854,5151],{"class":1267},[1049,7856,7857,7859,7861,7863,7865],{"class":1051,"line":3498},[1049,7858,5157],{"class":1550},[1049,7860,1554],{"class":1267},[1049,7862,1481],{"class":1267},[1049,7864,5164],{"class":1059},[1049,7866,5151],{"class":1267},[1049,7868,7869,7871,7873,7875,7877],{"class":1051,"line":3506},[1049,7870,5172],{"class":1550},[1049,7872,1554],{"class":1267},[1049,7874,1481],{"class":1267},[1049,7876,5179],{"class":1059},[1049,7878,5151],{"class":1267},[1049,7880,7881,7883,7885,7887,7889],{"class":1051,"line":3511},[1049,7882,5187],{"class":1550},[1049,7884,1554],{"class":1267},[1049,7886,1481],{"class":1267},[1049,7888,5194],{"class":1059},[1049,7890,5151],{"class":1267},[1049,7892,7893,7895,7897,7899,7901],{"class":1051,"line":3577},[1049,7894,5202],{"class":1550},[1049,7896,1554],{"class":1267},[1049,7898,1481],{"class":1267},[1049,7900,5209],{"class":1059},[1049,7902,5151],{"class":1267},[1049,7904,7905],{"class":1051,"line":3582},[1049,7906,5217],{"class":1267},[1049,7908,7909,7911,7913,7915,7917,7919,7921,7923],{"class":1051,"line":3587},[1049,7910,5223],{"class":1267},[1049,7912,5226],{"class":1273},[1049,7914,5229],{"class":1550},[1049,7916,1554],{"class":1267},[1049,7918,1481],{"class":1267},[1049,7920,5236],{"class":1059},[1049,7922,1481],{"class":1267},[1049,7924,1574],{"class":1267},[1049,7926,7927,7929,7931],{"class":1051,"line":3593},[1049,7928,5120],{"class":1267},[1049,7930,4687],{"class":1273},[1049,7932,1528],{"class":1267},[1049,7934,7935,7937,7939],{"class":1051,"line":3623},[1049,7936,5254],{"class":1267},[1049,7938,5075],{"class":1273},[1049,7940,1528],{"class":1267},[1049,7942,7943,7945,7947],{"class":1051,"line":3665},[1049,7944,1579],{"class":1267},[1049,7946,1525],{"class":1273},[1049,7948,1528],{"class":1267},[1049,7950,7951,7953,7955],{"class":1051,"line":3694},[1049,7952,1589],{"class":1267},[1049,7954,5040],{"class":1273},[1049,7956,1528],{"class":1267},[1049,7958,7959,7961,7963],{"class":1051,"line":3706},[1049,7960,1598],{"class":1267},[1049,7962,1525],{"class":1273},[1049,7964,1528],{"class":1267},[953,7966,7968],{"id":7967},"integrating-history-in-the-chat-page","Integrating history in the chat page",[1240,7970,7971],{},[1658,7972,7973],{},[1039,7974,7977],{"className":1512,"code":7975,"filename":5345,"highlights":7976,"language":34,"meta":1044,"style":1044},"\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",[3816,3824,3841],[1046,7978,7979,7999,8017,8035,8039,8051,8063,8067,8071,8113,8117,8133,8173,8177,8181,8197,8201,8205,8221,8239,8257,8271,8295,8303,8315,8319,8343,8357,8361,8365,8377,8389,8403,8417,8429,8435,8439,8445,8449,8467,8477,8497,8523,8535,8539,8543,8547,8551,8563,8591,8601,8605,8611,8619,8623,8631,8649,8661,8670,8679,8692,8710,8716,8728,8740,8744,8756,8760,8784,8850,8898,8934,8942,8950,8958,8962,8968,8980,8992,9004,9016,9028,9032,9038,9050,9062,9074,9086,9090,9098,9106,9115,9124],{"__ignoreMap":1044},[1049,7980,7981,7983,7985,7987,7989,7991,7993,7995,7997],{"class":1051,"line":1052},[1049,7982,1522],{"class":1267},[1049,7984,4722],{"class":1273},[1049,7986,4725],{"class":1550},[1049,7988,4728],{"class":1550},[1049,7990,1554],{"class":1267},[1049,7992,1481],{"class":1267},[1049,7994,1246],{"class":1059},[1049,7996,1481],{"class":1267},[1049,7998,1528],{"class":1267},[1049,8000,8001,8003,8005,8007,8009,8011,8013,8015],{"class":1051,"line":1069},[1049,8002,1670],{"class":1253},[1049,8004,1673],{"class":1267},[1049,8006,5378],{"class":1263},[1049,8008,1695],{"class":1267},[1049,8010,1698],{"class":1253},[1049,8012,1354],{"class":1267},[1049,8014,2496],{"class":1059},[1049,8016,1318],{"class":1267},[1049,8018,8019,8021,8023,8025,8027,8029,8031,8033],{"class":1051,"line":1283},[1049,8020,1670],{"class":1253},[1049,8022,1673],{"class":1267},[1049,8024,5398],{"class":1263},[1049,8026,1695],{"class":1267},[1049,8028,1698],{"class":1253},[1049,8030,1354],{"class":1267},[1049,8032,5407],{"class":1059},[1049,8034,1318],{"class":1267},[1049,8036,8037],{"class":1051,"line":1298},[1049,8038,1332],{"emptyLinePlaceholder":21},[1049,8040,8041,8043,8045,8047,8049],{"class":1051,"line":1310},[1049,8042,4743],{"class":1550},[1049,8044,5421],{"class":1263},[1049,8046,1554],{"class":1267},[1049,8048,5426],{"class":1072},[1049,8050,2631],{"class":1263},[1049,8052,8053,8055,8057,8059,8061],{"class":1051,"line":1321},[1049,8054,4743],{"class":1550},[1049,8056,5435],{"class":1263},[1049,8058,1554],{"class":1267},[1049,8060,5440],{"class":1072},[1049,8062,2631],{"class":1263},[1049,8064,8065],{"class":1051,"line":1329},[1049,8066,1332],{"emptyLinePlaceholder":21},[1049,8068,8069],{"class":1051,"line":1335},[1049,8070,5451],{"class":1433},[1049,8072,8073,8075,8077,8079,8081,8083,8085,8087,8089,8091,8093,8095,8097,8099,8101,8103,8105,8107,8109,8111],{"class":1051,"line":1346},[1049,8074,4743],{"class":1550},[1049,8076,1673],{"class":1267},[1049,8078,5460],{"class":1273},[1049,8080,1277],{"class":1267},[1049,8082,5465],{"class":1263},[1049,8084,1451],{"class":1267},[1049,8086,2585],{"class":1267},[1049,8088,2588],{"class":1253},[1049,8090,5474],{"class":1072},[1049,8092,1264],{"class":1263},[1049,8094,3465],{"class":1267},[1049,8096,5481],{"class":1059},[1049,8098,4997],{"class":1267},[1049,8100,5486],{"class":1263},[1049,8102,1771],{"class":1267},[1049,8104,5491],{"class":1263},[1049,8106,1771],{"class":1267},[1049,8108,1980],{"class":1263},[1049,8110,5006],{"class":1267},[1049,8112,1454],{"class":1263},[1049,8114,8115],{"class":1051,"line":1362},[1049,8116,1332],{"emptyLinePlaceholder":21},[1049,8118,8119,8121,8123,8125,8127,8129,8131],{"class":1051,"line":1368},[1049,8120,5508],{"class":1253},[1049,8122,1914],{"class":1263},[1049,8124,3321],{"class":1267},[1049,8126,5515],{"class":1263},[1049,8128,1771],{"class":1267},[1049,8130,5520],{"class":1263},[1049,8132,1268],{"class":1267},[1049,8134,8135,8137,8139,8141,8143,8145,8147,8149,8151,8153,8155,8157,8159,8161,8163,8165,8167,8169,8171],{"class":1051,"line":1373},[1049,8136,5527],{"class":1253},[1049,8138,2861],{"class":1072},[1049,8140,1264],{"class":1273},[1049,8142,1828],{"class":1267},[1049,8144,3343],{"class":1273},[1049,8146,1277],{"class":1267},[1049,8148,3349],{"class":3348},[1049,8150,1679],{"class":1267},[1049,8152,3354],{"class":1273},[1049,8154,1277],{"class":1267},[1049,8156,1354],{"class":1267},[1049,8158,3361],{"class":1059},[1049,8160,1292],{"class":1267},[1049,8162,1679],{"class":1267},[1049,8164,5556],{"class":1273},[1049,8166,1277],{"class":1267},[1049,8168,5561],{"class":1429},[1049,8170,1695],{"class":1267},[1049,8172,1454],{"class":1273},[1049,8174,8175],{"class":1051,"line":1396},[1049,8176,5013],{"class":1267},[1049,8178,8179],{"class":1051,"line":1401},[1049,8180,1332],{"emptyLinePlaceholder":21},[1049,8182,8183,8185,8187,8189,8191,8193,8195],{"class":1051,"line":1411},[1049,8184,4743],{"class":1550},[1049,8186,4746],{"class":1263},[1049,8188,1554],{"class":1267},[1049,8190,4751],{"class":1072},[1049,8192,1264],{"class":1263},[1049,8194,4756],{"class":1267},[1049,8196,1454],{"class":1263},[1049,8198,8199],{"class":1051,"line":1421},[1049,8200,1332],{"emptyLinePlaceholder":21},[1049,8202,8203],{"class":1051,"line":1437},[1049,8204,5598],{"class":1433},[1049,8206,8207,8209,8211,8213,8215,8217,8219],{"class":1051,"line":1443},[1049,8208,4743],{"class":1550},[1049,8210,5605],{"class":1263},[1049,8212,1554],{"class":1267},[1049,8214,1865],{"class":1267},[1049,8216,5398],{"class":1072},[1049,8218,1264],{"class":1263},[1049,8220,1268],{"class":1267},[1049,8222,8223,8225,8227,8229,8231,8233,8235,8237],{"class":1051,"line":1448},[1049,8224,1761],{"class":1273},[1049,8226,1277],{"class":1267},[1049,8228,5625],{"class":1263},[1049,8230,1771],{"class":1267},[1049,8232,4810],{"class":1263},[1049,8234,1771],{"class":1267},[1049,8236,1980],{"class":1263},[1049,8238,1295],{"class":1267},[1049,8240,8241,8243,8245,8247,8249,8251,8253,8255],{"class":1051,"line":2237},[1049,8242,1921],{"class":1273},[1049,8244,1277],{"class":1267},[1049,8246,5625],{"class":1263},[1049,8248,1771],{"class":1267},[1049,8250,4810],{"class":1263},[1049,8252,1771],{"class":1267},[1049,8254,1959],{"class":1263},[1049,8256,1295],{"class":1267},[1049,8258,8259,8261,8263,8265,8267,8269],{"class":1051,"line":2250},[1049,8260,5660],{"class":1273},[1049,8262,1277],{"class":1267},[1049,8264,1865],{"class":1267},[1049,8266,5378],{"class":1072},[1049,8268,1264],{"class":1263},[1049,8270,1268],{"class":1267},[1049,8272,8273,8275,8277,8279,8281,8283,8285,8287,8289,8291,8293],{"class":1051,"line":2280},[1049,8274,5676],{"class":1273},[1049,8276,1277],{"class":1267},[1049,8278,3459],{"class":1267},[1049,8280,5481],{"class":1059},[1049,8282,4997],{"class":1267},[1049,8284,5515],{"class":1263},[1049,8286,1771],{"class":1267},[1049,8288,4810],{"class":1263},[1049,8290,1771],{"class":1267},[1049,8292,1980],{"class":1263},[1049,8294,5697],{"class":1267},[1049,8296,8297,8299,8301],{"class":1051,"line":2286},[1049,8298,2376],{"class":1267},[1049,8300,1845],{"class":1263},[1049,8302,1295],{"class":1267},[1049,8304,8305,8307,8309,8311,8313],{"class":1051,"line":2291},[1049,8306,5712],{"class":1273},[1049,8308,1264],{"class":1267},[1049,8310,5717],{"class":1905},[1049,8312,1845],{"class":1267},[1049,8314,1343],{"class":1267},[1049,8316,8317],{"class":1051,"line":2323},[1049,8318,5727],{"class":1433},[1049,8320,8321,8323,8325,8327,8329,8331,8333,8335,8337,8339,8341],{"class":1051,"line":2339},[1049,8322,5733],{"class":1253},[1049,8324,1914],{"class":1273},[1049,8326,5717],{"class":1263},[1049,8328,1771],{"class":1267},[1049,8330,5742],{"class":1263},[1049,8332,3638],{"class":1267},[1049,8334,1354],{"class":1267},[1049,8336,3924],{"class":1059},[1049,8338,1292],{"class":1267},[1049,8340,3326],{"class":1273},[1049,8342,1268],{"class":1267},[1049,8344,8345,8347,8349,8351,8353,8355],{"class":1051,"line":2357},[1049,8346,5760],{"class":1072},[1049,8348,1264],{"class":1273},[1049,8350,1292],{"class":1267},[1049,8352,1750],{"class":1059},[1049,8354,1292],{"class":1267},[1049,8356,1454],{"class":1273},[1049,8358,8359],{"class":1051,"line":2373},[1049,8360,1440],{"class":1267},[1049,8362,8363],{"class":1051,"line":2381},[1049,8364,1365],{"class":1267},[1049,8366,8367,8369,8371,8373,8375],{"class":1051,"line":3331},[1049,8368,5786],{"class":1273},[1049,8370,1264],{"class":1267},[1049,8372,5791],{"class":1905},[1049,8374,1845],{"class":1267},[1049,8376,1343],{"class":1267},[1049,8378,8379,8381,8383,8385,8387],{"class":1051,"line":3370},[1049,8380,5801],{"class":1263},[1049,8382,1771],{"class":1267},[1049,8384,5806],{"class":1072},[1049,8386,1264],{"class":1273},[1049,8388,1268],{"class":1267},[1049,8390,8391,8393,8395,8397,8399,8401],{"class":1051,"line":3376},[1049,8392,5816],{"class":1273},[1049,8394,1277],{"class":1267},[1049,8396,1354],{"class":1267},[1049,8398,471],{"class":1059},[1049,8400,1292],{"class":1267},[1049,8402,1295],{"class":1267},[1049,8404,8405,8407,8409,8411,8413,8415],{"class":1051,"line":3381},[1049,8406,5832],{"class":1273},[1049,8408,1277],{"class":1267},[1049,8410,5837],{"class":1263},[1049,8412,1771],{"class":1267},[1049,8414,4077],{"class":1263},[1049,8416,1295],{"class":1267},[1049,8418,8419,8421,8423,8425,8427],{"class":1051,"line":3387},[1049,8420,5849],{"class":1273},[1049,8422,1277],{"class":1267},[1049,8424,1354],{"class":1267},[1049,8426,5791],{"class":1059},[1049,8428,1318],{"class":1267},[1049,8430,8431,8433],{"class":1051,"line":3407},[1049,8432,3501],{"class":1267},[1049,8434,1454],{"class":1273},[1049,8436,8437],{"class":1051,"line":3435},[1049,8438,3373],{"class":1267},[1049,8440,8441,8443],{"class":1051,"line":3451},[1049,8442,1451],{"class":1267},[1049,8444,1454],{"class":1263},[1049,8446,8447],{"class":1051,"line":3470},[1049,8448,1332],{"emptyLinePlaceholder":21},[1049,8450,8451,8453,8455,8457,8459,8461,8463,8465],{"class":1051,"line":3498},[1049,8452,5886],{"class":1550},[1049,8454,5889],{"class":1072},[1049,8456,1264],{"class":1267},[1049,8458,5894],{"class":1905},[1049,8460,1277],{"class":1267},[1049,8462,5899],{"class":1055},[1049,8464,1845],{"class":1267},[1049,8466,1343],{"class":1267},[1049,8468,8469,8471,8473,8475],{"class":1051,"line":3506},[1049,8470,5908],{"class":1263},[1049,8472,1771],{"class":1267},[1049,8474,5913],{"class":1072},[1049,8476,2631],{"class":1273},[1049,8478,8479,8481,8483,8485,8487,8489,8491,8493,8495],{"class":1051,"line":3511},[1049,8480,3316],{"class":1253},[1049,8482,1914],{"class":1273},[1049,8484,4805],{"class":1263},[1049,8486,1771],{"class":1267},[1049,8488,4810],{"class":1263},[1049,8490,1771],{"class":1267},[1049,8492,4815],{"class":1072},[1049,8494,4818],{"class":1273},[1049,8496,1268],{"class":1267},[1049,8498,8499,8501,8503,8505,8507,8509,8511,8513,8515,8517,8519,8521],{"class":1051,"line":3577},[1049,8500,5940],{"class":1263},[1049,8502,1771],{"class":1267},[1049,8504,5945],{"class":1072},[1049,8506,1264],{"class":1273},[1049,8508,1828],{"class":1267},[1049,8510,1682],{"class":1273},[1049,8512,1277],{"class":1267},[1049,8514,4951],{"class":1263},[1049,8516,1771],{"class":1267},[1049,8518,4810],{"class":1263},[1049,8520,1695],{"class":1267},[1049,8522,1454],{"class":1273},[1049,8524,8525,8527,8529,8531,8533],{"class":1051,"line":3582},[1049,8526,5968],{"class":1263},[1049,8528,1771],{"class":1267},[1049,8530,4810],{"class":1263},[1049,8532,2585],{"class":1267},[1049,8534,5977],{"class":1267},[1049,8536,8537],{"class":1051,"line":3587},[1049,8538,3373],{"class":1267},[1049,8540,8541],{"class":1051,"line":3593},[1049,8542,5013],{"class":1267},[1049,8544,8545],{"class":1051,"line":3623},[1049,8546,1332],{"emptyLinePlaceholder":21},[1049,8548,8549],{"class":1051,"line":3665},[1049,8550,5994],{"class":1433},[1049,8552,8553,8555,8557,8559,8561],{"class":1051,"line":3694},[1049,8554,5999],{"class":1072},[1049,8556,1264],{"class":1263},[1049,8558,1768],{"class":1267},[1049,8560,1788],{"class":1550},[1049,8562,1343],{"class":1267},[1049,8564,8565,8567,8569,8571,8573,8575,8577,8579,8581,8583,8585,8587,8589],{"class":1051,"line":3706},[1049,8566,3316],{"class":1253},[1049,8568,1914],{"class":1273},[1049,8570,5515],{"class":1263},[1049,8572,1771],{"class":1267},[1049,8574,4810],{"class":1263},[1049,8576,3633],{"class":1267},[1049,8578,1959],{"class":1263},[1049,8580,1771],{"class":1267},[1049,8582,3611],{"class":1263},[1049,8584,3638],{"class":1267},[1049,8586,3617],{"class":3348},[1049,8588,3326],{"class":1273},[1049,8590,1268],{"class":1267},[1049,8592,8593,8595,8597,8599],{"class":1051,"line":3722},[1049,8594,5940],{"class":1263},[1049,8596,1771],{"class":1267},[1049,8598,6044],{"class":1072},[1049,8600,2631],{"class":1273},[1049,8602,8603],{"class":1051,"line":3736},[1049,8604,3373],{"class":1267},[1049,8606,8607,8609],{"class":1051,"line":3743},[1049,8608,1451],{"class":1267},[1049,8610,1454],{"class":1263},[1049,8612,8613,8615,8617],{"class":1051,"line":3748},[1049,8614,1598],{"class":1267},[1049,8616,4722],{"class":1273},[1049,8618,1528],{"class":1267},[1049,8620,8621],{"class":1051,"line":3753},[1049,8622,1332],{"emptyLinePlaceholder":21},[1049,8624,8625,8627,8629],{"class":1051,"line":3759},[1049,8626,1522],{"class":1267},[1049,8628,1525],{"class":1273},[1049,8630,1528],{"class":1267},[1049,8632,8633,8635,8637,8639,8641,8643,8645,8647],{"class":1051,"line":3776},[1049,8634,1535],{"class":1267},[1049,8636,5040],{"class":1273},[1049,8638,5043],{"class":1550},[1049,8640,1554],{"class":1267},[1049,8642,1481],{"class":1267},[1049,8644,5050],{"class":1059},[1049,8646,1481],{"class":1267},[1049,8648,1528],{"class":1267},[1049,8650,8651,8653,8655,8657,8659],{"class":1051,"line":3798},[1049,8652,1544],{"class":1267},[1049,8654,1525],{"class":1273},[1049,8656,5063],{"class":1267},[1049,8658,7751],{"class":1550},[1049,8660,1528],{"class":1267},[1049,8662,8664,8666,8668],{"class":8663,"line":3816},[1051,1532],[1049,8665,1568],{"class":1267},[1049,8667,7761],{"class":1273},[1049,8669,1574],{"class":1267},[1049,8671,8673,8675,8677],{"class":8672,"line":3824},[1051,1532],[1049,8674,1579],{"class":1267},[1049,8676,1525],{"class":1273},[1049,8678,1528],{"class":1267},[1049,8680,8682,8684,8686,8688,8690],{"class":8681,"line":3841},[1051,1532],[1049,8683,1544],{"class":1267},[1049,8685,1525],{"class":1273},[1049,8687,5063],{"class":1267},[1049,8689,5066],{"class":1550},[1049,8691,1528],{"class":1267},[1049,8693,8694,8696,8698,8700,8702,8704,8706,8708],{"class":1051,"line":3860},[1049,8695,1568],{"class":1267},[1049,8697,5075],{"class":1273},[1049,8699,5078],{"class":1550},[1049,8701,1554],{"class":1267},[1049,8703,1481],{"class":1267},[1049,8705,6121],{"class":1059},[1049,8707,1481],{"class":1267},[1049,8709,1528],{"class":1267},[1049,8711,8712,8714],{"class":1051,"line":3868},[1049,8713,5094],{"class":1267},[1049,8715,6132],{"class":1273},[1049,8717,8718,8720,8722,8724,8726],{"class":1051,"line":3873},[1049,8719,6137],{"class":1550},[1049,8721,1554],{"class":1267},[1049,8723,1481],{"class":1267},[1049,8725,6144],{"class":1059},[1049,8727,5151],{"class":1267},[1049,8729,8730,8732,8734,8736,8738],{"class":1051,"line":3879},[1049,8731,5157],{"class":1550},[1049,8733,1554],{"class":1267},[1049,8735,1481],{"class":1267},[1049,8737,6157],{"class":1059},[1049,8739,5151],{"class":1267},[1049,8741,8742],{"class":1051,"line":3899},[1049,8743,6164],{"class":1550},[1049,8745,8746,8748,8750,8752,8754],{"class":1051,"line":3914},[1049,8747,6169],{"class":1550},[1049,8749,1554],{"class":1267},[1049,8751,1481],{"class":1267},[1049,8753,6176],{"class":1059},[1049,8755,5151],{"class":1267},[1049,8757,8758],{"class":1051,"line":3931},[1049,8759,5217],{"class":1267},[1049,8761,8762,8764,8766,8768,8770,8772,8774,8776,8778,8780,8782],{"class":1051,"line":3955},[1049,8763,5223],{"class":1267},[1049,8765,1525],{"class":1273},[1049,8767,5063],{"class":1267},[1049,8769,344],{"class":1550},[1049,8771,1554],{"class":1267},[1049,8773,1481],{"class":1267},[1049,8775,1828],{"class":1267},[1049,8777,6201],{"class":1263},[1049,8779,1451],{"class":1267},[1049,8781,1481],{"class":1267},[1049,8783,1528],{"class":1267},[1049,8785,8786,8788,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],{"class":1051,"line":3966},[1049,8787,6212],{"class":1267},[1049,8789,1525],{"class":1273},[1049,8791,6217],{"class":1253},[1049,8793,1554],{"class":1267},[1049,8795,1481],{"class":1267},[1049,8797,6224],{"class":1263},[1049,8799,1679],{"class":1267},[1049,8801,6229],{"class":1263},[1049,8803,6232],{"class":1267},[1049,8805,2580],{"class":1263},[1049,8807,1771],{"class":1267},[1049,8809,2161],{"class":1263},[1049,8811,1481],{"class":1267},[1049,8813,6243],{"class":1267},[1049,8815,6246],{"class":1550},[1049,8817,1554],{"class":1267},[1049,8819,6251],{"class":1267},[1049,8821,4077],{"class":1263},[1049,8823,1771],{"class":1267},[1049,8825,1980],{"class":1263},[1049,8827,1451],{"class":1267},[1049,8829,6262],{"class":1059},[1049,8831,4997],{"class":1267},[1049,8833,6267],{"class":1263},[1049,8835,1771],{"class":1267},[1049,8837,5742],{"class":1263},[1049,8839,1451],{"class":1267},[1049,8841,6262],{"class":1059},[1049,8843,4997],{"class":1267},[1049,8845,6280],{"class":1263},[1049,8847,6283],{"class":1267},[1049,8849,1528],{"class":1267},[1049,8851,8852,8854,8856,8858,8860,8862,8864,8866,8868,8870,8872,8874,8876,8878,8880,8882,8884,8886,8888,8890,8892,8894,8896],{"class":1051,"line":3974},[1049,8853,6290],{"class":1267},[1049,8855,6293],{"class":1273},[1049,8857,6296],{"class":1550},[1049,8859,1554],{"class":1267},[1049,8861,1481],{"class":1267},[1049,8863,6303],{"class":1059},[1049,8865,1481],{"class":1267},[1049,8867,6308],{"class":1550},[1049,8869,1554],{"class":1267},[1049,8871,1481],{"class":1267},[1049,8873,6315],{"class":1059},[1049,8875,1481],{"class":1267},[1049,8877,6320],{"class":1550},[1049,8879,1554],{"class":1267},[1049,8881,1481],{"class":1267},[1049,8883,6327],{"class":1059},[1049,8885,1481],{"class":1267},[1049,8887,5078],{"class":1550},[1049,8889,1554],{"class":1267},[1049,8891,1481],{"class":1267},[1049,8893,6338],{"class":1059},[1049,8895,1481],{"class":1267},[1049,8897,1574],{"class":1267},[1049,8899,8900,8902,8904,8906,8908,8910,8912,8914,8916,8918,8920,8922,8924,8926,8928,8930,8932],{"class":1051,"line":3980},[1049,8901,6290],{"class":1267},[1049,8903,949],{"class":1273},[1049,8905,6351],{"class":1550},[1049,8907,1554],{"class":1267},[1049,8909,1481],{"class":1267},[1049,8911,6358],{"class":1059},[1049,8913,1481],{"class":1267},[1049,8915,5078],{"class":1550},[1049,8917,1554],{"class":1267},[1049,8919,1481],{"class":1267},[1049,8921,6369],{"class":1059},[1049,8923,1481],{"class":1267},[1049,8925,2628],{"class":1267},[1049,8927,6376],{"class":1263},[1049,8929,1598],{"class":1267},[1049,8931,949],{"class":1273},[1049,8933,1528],{"class":1267},[1049,8935,8936,8938,8940],{"class":1051,"line":3985},[1049,8937,6387],{"class":1267},[1049,8939,1525],{"class":1273},[1049,8941,1528],{"class":1267},[1049,8943,8944,8946,8948],{"class":1051,"line":4008},[1049,8945,6396],{"class":1267},[1049,8947,1525],{"class":1273},[1049,8949,1528],{"class":1267},[1049,8951,8952,8954,8956],{"class":1051,"line":4014},[1049,8953,5120],{"class":1267},[1049,8955,4693],{"class":1273},[1049,8957,1528],{"class":1267},[1049,8959,8960],{"class":1051,"line":4034},[1049,8961,1332],{"emptyLinePlaceholder":21},[1049,8963,8964,8966],{"class":1051,"line":4040},[1049,8965,5094],{"class":1267},[1049,8967,5136],{"class":1273},[1049,8969,8970,8972,8974,8976,8978],{"class":1051,"line":4086},[1049,8971,5142],{"class":1550},[1049,8973,1554],{"class":1267},[1049,8975,1481],{"class":1267},[1049,8977,4805],{"class":1059},[1049,8979,5151],{"class":1267},[1049,8981,8982,8984,8986,8988,8990],{"class":1051,"line":4102},[1049,8983,6435],{"class":1550},[1049,8985,1554],{"class":1267},[1049,8987,1481],{"class":1267},[1049,8989,6442],{"class":1059},[1049,8991,5151],{"class":1267},[1049,8993,8994,8996,8998,9000,9002],{"class":1051,"line":4135},[1049,8995,5172],{"class":1550},[1049,8997,1554],{"class":1267},[1049,8999,1481],{"class":1267},[1049,9001,5179],{"class":1059},[1049,9003,5151],{"class":1267},[1049,9005,9006,9008,9010,9012,9014],{"class":1051,"line":4149},[1049,9007,6169],{"class":1550},[1049,9009,1554],{"class":1267},[1049,9011,1481],{"class":1267},[1049,9013,6467],{"class":1059},[1049,9015,5151],{"class":1267},[1049,9017,9018,9020,9022,9024,9026],{"class":1051,"line":4157},[1049,9019,5202],{"class":1550},[1049,9021,1554],{"class":1267},[1049,9023,1481],{"class":1267},[1049,9025,6480],{"class":1059},[1049,9027,5151],{"class":1267},[1049,9029,9030],{"class":1051,"line":4162},[1049,9031,5217],{"class":1267},[1049,9033,9034,9036],{"class":1051,"line":4169},[1049,9035,5223],{"class":1267},[1049,9037,6493],{"class":1273},[1049,9039,9040,9042,9044,9046,9048],{"class":1051,"line":4174},[1049,9041,6498],{"class":1550},[1049,9043,1554],{"class":1267},[1049,9045,1481],{"class":1267},[1049,9047,6157],{"class":1059},[1049,9049,5151],{"class":1267},[1049,9051,9052,9054,9056,9058,9060],{"class":1051,"line":4192},[1049,9053,6511],{"class":1550},[1049,9055,1554],{"class":1267},[1049,9057,1481],{"class":1267},[1049,9059,5236],{"class":1059},[1049,9061,5151],{"class":1267},[1049,9063,9064,9066,9068,9070,9072],{"class":1051,"line":6555},[1049,9065,6524],{"class":1550},[1049,9067,1554],{"class":1267},[1049,9069,1481],{"class":1267},[1049,9071,6531],{"class":1059},[1049,9073,5151],{"class":1267},[1049,9075,9076,9078,9080,9082,9084],{"class":1051,"line":6564},[1049,9077,6538],{"class":1550},[1049,9079,1554],{"class":1267},[1049,9081,1481],{"class":1267},[1049,9083,6545],{"class":1059},[1049,9085,5151],{"class":1267},[1049,9087,9088],{"class":1051,"line":6573},[1049,9089,6552],{"class":1267},[1049,9091,9092,9094,9096],{"class":1051,"line":6582},[1049,9093,5120],{"class":1267},[1049,9095,4687],{"class":1273},[1049,9097,1528],{"class":1267},[1049,9099,9100,9102,9104],{"class":1051,"line":6591},[1049,9101,5254],{"class":1267},[1049,9103,5075],{"class":1273},[1049,9105,1528],{"class":1267},[1049,9107,9109,9111,9113],{"class":1051,"line":9108},91,[1049,9110,1579],{"class":1267},[1049,9112,1525],{"class":1273},[1049,9114,1528],{"class":1267},[1049,9116,9118,9120,9122],{"class":1051,"line":9117},92,[1049,9119,1589],{"class":1267},[1049,9121,5040],{"class":1273},[1049,9123,1528],{"class":1267},[1049,9125,9127,9129,9131],{"class":1051,"line":9126},93,[1049,9128,1598],{"class":1267},[1049,9130,1525],{"class":1273},[1049,9132,1528],{"class":1267},[949,9134,4235,9135,9138,9139,9141],{},[1046,9136,9137],{},"refreshNuxtData('chats')"," call in the chat page's ",[1046,9140,6659],{}," callback (as shown earlier) ensures the chat list updates automatically when a new title is generated.",[953,9143,9145],{"id":9144},"adding-multi-model-support","Adding multi-model support",[949,9147,9148,9149,9152],{},"One of the benefits of using ",[1024,9150,4204],{"href":1026,"rel":9151},[1028]," is the ability to switch between models seamlessly. This section adds a model selector to the chat.",[1077,9154,9156],{"id":9155},"creating-a-models-composable","Creating a models composable",[949,9158,9159,9160,1277],{},"Define the available models and persist the user's selection using ",[1024,9161,9164],{"href":9162,"rel":9163},"https://nuxt.com/docs/api/composables/use-cookie",[1028],[1046,9165,9166],{},"useCookie",[1240,9168,9169],{},[1039,9170,9173],{"className":1244,"code":9171,"filename":9172,"language":1246,"meta":1044,"style":1044},"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",[1046,9174,9175,9188,9199,9248,9294,9341,9346,9350,9380,9397,9403,9407,9413,9420,9425,9429],{"__ignoreMap":1044},[1049,9176,9177,9179,9181,9184,9186],{"class":1051,"line":1052},[1049,9178,1254],{"class":1253},[1049,9180,4787],{"class":1550},[1049,9182,9183],{"class":1072}," useModels",[1049,9185,1768],{"class":1267},[1049,9187,1343],{"class":1267},[1049,9189,9190,9192,9195,9197],{"class":1051,"line":1069},[1049,9191,2575],{"class":1550},[1049,9193,9194],{"class":1263}," models",[1049,9196,2585],{"class":1267},[1049,9198,1280],{"class":1273},[1049,9200,9201,9204,9207,9209,9211,9213,9215,9217,9220,9222,9224,9227,9229,9231,9234,9236,9238,9244,9246],{"class":1051,"line":1283},[1049,9202,9203],{"class":1267},"    {",[1049,9205,9206],{"class":1273}," value",[1049,9208,1277],{"class":1267},[1049,9210,1354],{"class":1267},[1049,9212,3170],{"class":1059},[1049,9214,1292],{"class":1267},[1049,9216,1679],{"class":1267},[1049,9218,9219],{"class":1273}," label",[1049,9221,1277],{"class":1267},[1049,9223,1354],{"class":1267},[1049,9225,9226],{"class":1059},"GPT-4o Mini",[1049,9228,1292],{"class":1267},[1049,9230,1679],{"class":1267},[1049,9232,9233],{"class":1273}," icon",[1049,9235,1277],{"class":1267},[1049,9237,1354],{"class":1267},[1049,9239,9240,9243],{"class":1059},[7128,9241],{"class":9242},"shiki-icon-highlight sh9xi","i-simple-icons-openai",[1049,9245,1292],{"class":1267},[1049,9247,3952],{"class":1267},[1049,9249,9250,9252,9254,9256,9258,9261,9263,9265,9267,9269,9271,9274,9276,9278,9280,9282,9284,9290,9292],{"class":1051,"line":1298},[1049,9251,9203],{"class":1267},[1049,9253,9206],{"class":1273},[1049,9255,1277],{"class":1267},[1049,9257,1354],{"class":1267},[1049,9259,9260],{"class":1059},"anthropic/claude-3-5-haiku-latest",[1049,9262,1292],{"class":1267},[1049,9264,1679],{"class":1267},[1049,9266,9219],{"class":1273},[1049,9268,1277],{"class":1267},[1049,9270,1354],{"class":1267},[1049,9272,9273],{"class":1059},"Claude 3.5 Haiku",[1049,9275,1292],{"class":1267},[1049,9277,1679],{"class":1267},[1049,9279,9233],{"class":1273},[1049,9281,1277],{"class":1267},[1049,9283,1354],{"class":1267},[1049,9285,9286,9289],{"class":1059},[7128,9287],{"class":9288},"shiki-icon-highlight sNknm","i-simple-icons-anthropic",[1049,9291,1292],{"class":1267},[1049,9293,3952],{"class":1267},[1049,9295,9296,9298,9300,9302,9304,9307,9309,9311,9313,9315,9317,9320,9322,9324,9326,9328,9330,9336,9338],{"class":1051,"line":1310},[1049,9297,9203],{"class":1267},[1049,9299,9206],{"class":1273},[1049,9301,1277],{"class":1267},[1049,9303,1354],{"class":1267},[1049,9305,9306],{"class":1059},"google/gemini-2.0-flash",[1049,9308,1292],{"class":1267},[1049,9310,1679],{"class":1267},[1049,9312,9219],{"class":1273},[1049,9314,1277],{"class":1267},[1049,9316,1354],{"class":1267},[1049,9318,9319],{"class":1059},"Gemini 2.0 Flash",[1049,9321,1292],{"class":1267},[1049,9323,1679],{"class":1267},[1049,9325,9233],{"class":1273},[1049,9327,1277],{"class":1267},[1049,9329,1354],{"class":1267},[1049,9331,9332,9335],{"class":1059},[7128,9333],{"class":9334},"shiki-icon-highlight scZL3","i-simple-icons-google",[1049,9337,1292],{"class":1267},[1049,9339,9340],{"class":1267}," }\n",[1049,9342,9343],{"class":1051,"line":1321},[1049,9344,9345],{"class":1273},"  ]\n",[1049,9347,9348],{"class":1051,"line":1329},[1049,9349,1332],{"emptyLinePlaceholder":21},[1049,9351,9352,9354,9356,9358,9361,9363,9365,9367,9369,9371,9374,9376,9378],{"class":1051,"line":1335},[1049,9353,2575],{"class":1550},[1049,9355,3114],{"class":1263},[1049,9357,2585],{"class":1267},[1049,9359,9360],{"class":1072}," useCookie",[1049,9362,1522],{"class":1267},[1049,9364,3087],{"class":1055},[1049,9366,2628],{"class":1267},[1049,9368,1264],{"class":1273},[1049,9370,1292],{"class":1267},[1049,9372,9373],{"class":1059},"ai-model",[1049,9375,1292],{"class":1267},[1049,9377,1679],{"class":1267},[1049,9379,1343],{"class":1267},[1049,9381,9382,9385,9387,9389,9391,9393,9395],{"class":1051,"line":1346},[1049,9383,9384],{"class":1072},"    default",[1049,9386,1277],{"class":1267},[1049,9388,4572],{"class":1267},[1049,9390,1788],{"class":1550},[1049,9392,1354],{"class":1267},[1049,9394,3170],{"class":1059},[1049,9396,1318],{"class":1267},[1049,9398,9399,9401],{"class":1051,"line":1362},[1049,9400,2376],{"class":1267},[1049,9402,1454],{"class":1273},[1049,9404,9405],{"class":1051,"line":1368},[1049,9406,1332],{"emptyLinePlaceholder":21},[1049,9408,9409,9411],{"class":1051,"line":1373},[1049,9410,2802],{"class":1253},[1049,9412,1343],{"class":1267},[1049,9414,9415,9418],{"class":1051,"line":1396},[1049,9416,9417],{"class":1263},"    models",[1049,9419,1295],{"class":1267},[1049,9421,9422],{"class":1051,"line":1401},[1049,9423,9424],{"class":1263},"    model\n",[1049,9426,9427],{"class":1051,"line":1411},[1049,9428,3373],{"class":1267},[1049,9430,9431],{"class":1051,"line":1421},[1049,9432,5013],{"class":1267},[1077,9434,9436],{"id":9435},"building-the-model-selector","Building the model selector",[949,9438,1605,9439,9444],{},[1024,9440,9441],{"href":708},[1046,9442,9443],{},"USelectMenu"," component that displays the available models:",[1240,9446,9447],{},[1039,9448,9451],{"className":1512,"code":9449,"filename":9450,"language":34,"meta":1044,"style":1044},"\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",[1046,9452,9453,9473,9506,9510,9527,9531,9549,9583,9587,9595,9599,9607,9614,9627,9641,9655,9668,9681,9686],{"__ignoreMap":1044},[1049,9454,9455,9457,9459,9461,9463,9465,9467,9469,9471],{"class":1051,"line":1052},[1049,9456,1522],{"class":1267},[1049,9458,4722],{"class":1273},[1049,9460,4725],{"class":1550},[1049,9462,4728],{"class":1550},[1049,9464,1554],{"class":1267},[1049,9466,1481],{"class":1267},[1049,9468,1246],{"class":1059},[1049,9470,1481],{"class":1267},[1049,9472,1528],{"class":1267},[1049,9474,9475,9477,9480,9482,9485,9487,9489,9491,9493,9495,9498,9500,9502,9504],{"class":1051,"line":1069},[1049,9476,4743],{"class":1550},[1049,9478,9479],{"class":1263}," model ",[1049,9481,1554],{"class":1267},[1049,9483,9484],{"class":1072}," defineModel",[1049,9486,1522],{"class":1267},[1049,9488,3087],{"class":1055},[1049,9490,2628],{"class":1267},[1049,9492,1264],{"class":1263},[1049,9494,1828],{"class":1267},[1049,9496,9497],{"class":1273}," required",[1049,9499,1277],{"class":1267},[1049,9501,5561],{"class":1429},[1049,9503,1695],{"class":1267},[1049,9505,1454],{"class":1263},[1049,9507,9508],{"class":1051,"line":1283},[1049,9509,1332],{"emptyLinePlaceholder":21},[1049,9511,9512,9514,9516,9519,9521,9523,9525],{"class":1051,"line":1298},[1049,9513,4743],{"class":1550},[1049,9515,1673],{"class":1267},[1049,9517,9518],{"class":1263}," models ",[1049,9520,1451],{"class":1267},[1049,9522,2585],{"class":1267},[1049,9524,9183],{"class":1072},[1049,9526,2631],{"class":1263},[1049,9528,9529],{"class":1051,"line":1310},[1049,9530,1332],{"emptyLinePlaceholder":21},[1049,9532,9533,9535,9538,9540,9542,9544,9546],{"class":1051,"line":1321},[1049,9534,4743],{"class":1550},[1049,9536,9537],{"class":1263}," selectedModel ",[1049,9539,1554],{"class":1267},[1049,9541,7070],{"class":1072},[1049,9543,1264],{"class":1263},[1049,9545,1768],{"class":1267},[1049,9547,9548],{"class":1550}," =>\n",[1049,9550,9551,9554,9556,9559,9561,9564,9566,9569,9571,9574,9576,9578,9580],{"class":1051,"line":1329},[1049,9552,9553],{"class":1263},"  models",[1049,9555,1771],{"class":1267},[1049,9557,9558],{"class":1072},"find",[1049,9560,1264],{"class":1263},[1049,9562,9563],{"class":1905},"m",[1049,9565,1788],{"class":1550},[1049,9567,9568],{"class":1263}," m",[1049,9570,1771],{"class":1267},[1049,9572,9573],{"class":1263},"value ",[1049,9575,7153],{"class":1267},[1049,9577,3114],{"class":1263},[1049,9579,1771],{"class":1267},[1049,9581,9582],{"class":1263},"value)\n",[1049,9584,9585],{"class":1051,"line":1335},[1049,9586,1454],{"class":1263},[1049,9588,9589,9591,9593],{"class":1051,"line":1346},[1049,9590,1598],{"class":1267},[1049,9592,4722],{"class":1273},[1049,9594,1528],{"class":1267},[1049,9596,9597],{"class":1051,"line":1362},[1049,9598,1332],{"emptyLinePlaceholder":21},[1049,9600,9601,9603,9605],{"class":1051,"line":1368},[1049,9602,1522],{"class":1267},[1049,9604,1525],{"class":1273},[1049,9606,1528],{"class":1267},[1049,9608,9609,9611],{"class":1051,"line":1373},[1049,9610,1535],{"class":1267},[1049,9612,9613],{"class":1273},"USelectMenu\n",[1049,9615,9616,9619,9621,9623,9625],{"class":1051,"line":1396},[1049,9617,9618],{"class":1550},"    v-model",[1049,9620,1554],{"class":1267},[1049,9622,1481],{"class":1267},[1049,9624,4248],{"class":1059},[1049,9626,5151],{"class":1267},[1049,9628,9629,9632,9634,9636,9639],{"class":1051,"line":1401},[1049,9630,9631],{"class":1550},"    :items",[1049,9633,1554],{"class":1267},[1049,9635,1481],{"class":1267},[1049,9637,9638],{"class":1059},"models",[1049,9640,5151],{"class":1267},[1049,9642,9643,9646,9648,9650,9653],{"class":1051,"line":1411},[1049,9644,9645],{"class":1550},"    :icon",[1049,9647,1554],{"class":1267},[1049,9649,1481],{"class":1267},[1049,9651,9652],{"class":1059},"selectedModel?.icon",[1049,9654,5151],{"class":1267},[1049,9656,9657,9660,9662,9664,9666],{"class":1051,"line":1421},[1049,9658,9659],{"class":1550},"    variant",[1049,9661,1554],{"class":1267},[1049,9663,1481],{"class":1267},[1049,9665,7358],{"class":1059},[1049,9667,5151],{"class":1267},[1049,9669,9670,9673,9675,9677,9679],{"class":1051,"line":1437},[1049,9671,9672],{"class":1550},"    value-key",[1049,9674,1554],{"class":1267},[1049,9676,1481],{"class":1267},[1049,9678,4810],{"class":1059},[1049,9680,5151],{"class":1267},[1049,9682,9683],{"class":1051,"line":1443},[1049,9684,9685],{"class":1267},"  />\n",[1049,9687,9688,9690,9692],{"class":1051,"line":1448},[1049,9689,1598],{"class":1267},[1049,9691,1525],{"class":1273},[1049,9693,1528],{"class":1267},[1077,9695,9697],{"id":9696},"integrating-with-the-chat","Integrating with the chat",[949,9699,9700],{},"Update the chat page to include the model selector and pass the selected model to the server:",[1240,9702,9703],{},[1658,9704,9705],{},[1039,9706,9709],{"className":1512,"code":9707,"filename":5345,"highlights":9708,"language":34,"meta":1044,"style":1044},"\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",[1335,2286,2291,2323,4192,6555,6564],[1046,9710,9711,9731,9749,9767,9771,9783,9795,9811,9816,9858,9862,9878,9918,9922,9926,9942,9946,9962,9980,9998,10012,10038,10046,10062,10067,10076,10088,10112,10126,10130,10134,10146,10158,10172,10186,10198,10204,10208,10214,10218,10236,10246,10266,10292,10304,10308,10312,10316,10328,10356,10366,10370,10376,10384,10388,10396,10414,10426,10434,10442,10454,10472,10478,10490,10502,10506,10518,10522,10546,10612,10660,10696,10704,10712,10720,10724,10730,10742,10754,10766,10778,10790,10794,10807,10827,10836,10841,10848,10860,10872,10884,10896,10900,10908,10917,10926,10935],{"__ignoreMap":1044},[1049,9712,9713,9715,9717,9719,9721,9723,9725,9727,9729],{"class":1051,"line":1052},[1049,9714,1522],{"class":1267},[1049,9716,4722],{"class":1273},[1049,9718,4725],{"class":1550},[1049,9720,4728],{"class":1550},[1049,9722,1554],{"class":1267},[1049,9724,1481],{"class":1267},[1049,9726,1246],{"class":1059},[1049,9728,1481],{"class":1267},[1049,9730,1528],{"class":1267},[1049,9732,9733,9735,9737,9739,9741,9743,9745,9747],{"class":1051,"line":1069},[1049,9734,1670],{"class":1253},[1049,9736,1673],{"class":1267},[1049,9738,5378],{"class":1263},[1049,9740,1695],{"class":1267},[1049,9742,1698],{"class":1253},[1049,9744,1354],{"class":1267},[1049,9746,2496],{"class":1059},[1049,9748,1318],{"class":1267},[1049,9750,9751,9753,9755,9757,9759,9761,9763,9765],{"class":1051,"line":1283},[1049,9752,1670],{"class":1253},[1049,9754,1673],{"class":1267},[1049,9756,5398],{"class":1263},[1049,9758,1695],{"class":1267},[1049,9760,1698],{"class":1253},[1049,9762,1354],{"class":1267},[1049,9764,5407],{"class":1059},[1049,9766,1318],{"class":1267},[1049,9768,9769],{"class":1051,"line":1298},[1049,9770,1332],{"emptyLinePlaceholder":21},[1049,9772,9773,9775,9777,9779,9781],{"class":1051,"line":1310},[1049,9774,4743],{"class":1550},[1049,9776,5421],{"class":1263},[1049,9778,1554],{"class":1267},[1049,9780,5426],{"class":1072},[1049,9782,2631],{"class":1263},[1049,9784,9785,9787,9789,9791,9793],{"class":1051,"line":1321},[1049,9786,4743],{"class":1550},[1049,9788,5435],{"class":1263},[1049,9790,1554],{"class":1267},[1049,9792,5440],{"class":1072},[1049,9794,2631],{"class":1263},[1049,9796,9797,9799,9801,9803,9805,9807,9809],{"class":1051,"line":1329},[1049,9798,4743],{"class":1550},[1049,9800,1673],{"class":1267},[1049,9802,9479],{"class":1263},[1049,9804,1451],{"class":1267},[1049,9806,2585],{"class":1267},[1049,9808,9183],{"class":1072},[1049,9810,2631],{"class":1263},[1049,9812,9814],{"class":9813,"line":1335},[1051,1532],[1049,9815,1332],{"emptyLinePlaceholder":21},[1049,9817,9818,9820,9822,9824,9826,9828,9830,9832,9834,9836,9838,9840,9842,9844,9846,9848,9850,9852,9854,9856],{"class":1051,"line":1346},[1049,9819,4743],{"class":1550},[1049,9821,1673],{"class":1267},[1049,9823,5460],{"class":1273},[1049,9825,1277],{"class":1267},[1049,9827,5465],{"class":1263},[1049,9829,1451],{"class":1267},[1049,9831,2585],{"class":1267},[1049,9833,2588],{"class":1253},[1049,9835,5474],{"class":1072},[1049,9837,1264],{"class":1263},[1049,9839,3465],{"class":1267},[1049,9841,5481],{"class":1059},[1049,9843,4997],{"class":1267},[1049,9845,5486],{"class":1263},[1049,9847,1771],{"class":1267},[1049,9849,5491],{"class":1263},[1049,9851,1771],{"class":1267},[1049,9853,1980],{"class":1263},[1049,9855,5006],{"class":1267},[1049,9857,1454],{"class":1263},[1049,9859,9860],{"class":1051,"line":1362},[1049,9861,1332],{"emptyLinePlaceholder":21},[1049,9863,9864,9866,9868,9870,9872,9874,9876],{"class":1051,"line":1368},[1049,9865,5508],{"class":1253},[1049,9867,1914],{"class":1263},[1049,9869,3321],{"class":1267},[1049,9871,5515],{"class":1263},[1049,9873,1771],{"class":1267},[1049,9875,5520],{"class":1263},[1049,9877,1268],{"class":1267},[1049,9879,9880,9882,9884,9886,9888,9890,9892,9894,9896,9898,9900,9902,9904,9906,9908,9910,9912,9914,9916],{"class":1051,"line":1373},[1049,9881,5527],{"class":1253},[1049,9883,2861],{"class":1072},[1049,9885,1264],{"class":1273},[1049,9887,1828],{"class":1267},[1049,9889,3343],{"class":1273},[1049,9891,1277],{"class":1267},[1049,9893,3349],{"class":3348},[1049,9895,1679],{"class":1267},[1049,9897,3354],{"class":1273},[1049,9899,1277],{"class":1267},[1049,9901,1354],{"class":1267},[1049,9903,3361],{"class":1059},[1049,9905,1292],{"class":1267},[1049,9907,1679],{"class":1267},[1049,9909,5556],{"class":1273},[1049,9911,1277],{"class":1267},[1049,9913,5561],{"class":1429},[1049,9915,1695],{"class":1267},[1049,9917,1454],{"class":1273},[1049,9919,9920],{"class":1051,"line":1396},[1049,9921,5013],{"class":1267},[1049,9923,9924],{"class":1051,"line":1401},[1049,9925,1332],{"emptyLinePlaceholder":21},[1049,9927,9928,9930,9932,9934,9936,9938,9940],{"class":1051,"line":1411},[1049,9929,4743],{"class":1550},[1049,9931,4746],{"class":1263},[1049,9933,1554],{"class":1267},[1049,9935,4751],{"class":1072},[1049,9937,1264],{"class":1263},[1049,9939,4756],{"class":1267},[1049,9941,1454],{"class":1263},[1049,9943,9944],{"class":1051,"line":1421},[1049,9945,1332],{"emptyLinePlaceholder":21},[1049,9947,9948,9950,9952,9954,9956,9958,9960],{"class":1051,"line":1437},[1049,9949,4743],{"class":1550},[1049,9951,5605],{"class":1263},[1049,9953,1554],{"class":1267},[1049,9955,1865],{"class":1267},[1049,9957,5398],{"class":1072},[1049,9959,1264],{"class":1263},[1049,9961,1268],{"class":1267},[1049,9963,9964,9966,9968,9970,9972,9974,9976,9978],{"class":1051,"line":1443},[1049,9965,1761],{"class":1273},[1049,9967,1277],{"class":1267},[1049,9969,5625],{"class":1263},[1049,9971,1771],{"class":1267},[1049,9973,4810],{"class":1263},[1049,9975,1771],{"class":1267},[1049,9977,1980],{"class":1263},[1049,9979,1295],{"class":1267},[1049,9981,9982,9984,9986,9988,9990,9992,9994,9996],{"class":1051,"line":1448},[1049,9983,1921],{"class":1273},[1049,9985,1277],{"class":1267},[1049,9987,5625],{"class":1263},[1049,9989,1771],{"class":1267},[1049,9991,4810],{"class":1263},[1049,9993,1771],{"class":1267},[1049,9995,1959],{"class":1263},[1049,9997,1295],{"class":1267},[1049,9999,10000,10002,10004,10006,10008,10010],{"class":1051,"line":2237},[1049,10001,5660],{"class":1273},[1049,10003,1277],{"class":1267},[1049,10005,1865],{"class":1267},[1049,10007,5378],{"class":1072},[1049,10009,1264],{"class":1263},[1049,10011,1268],{"class":1267},[1049,10013,10014,10016,10018,10020,10022,10024,10026,10028,10030,10032,10034,10036],{"class":1051,"line":2250},[1049,10015,5676],{"class":1273},[1049,10017,1277],{"class":1267},[1049,10019,3459],{"class":1267},[1049,10021,5481],{"class":1059},[1049,10023,4997],{"class":1267},[1049,10025,5515],{"class":1263},[1049,10027,1771],{"class":1267},[1049,10029,4810],{"class":1263},[1049,10031,1771],{"class":1267},[1049,10033,1980],{"class":1263},[1049,10035,5006],{"class":1267},[1049,10037,1295],{"class":1267},[1049,10039,10040,10042,10044],{"class":1051,"line":2280},[1049,10041,4894],{"class":1273},[1049,10043,1277],{"class":1267},[1049,10045,1343],{"class":1267},[1049,10047,10049,10051,10053,10055,10057,10059],{"class":10048,"line":2286},[1051,1532],[1049,10050,3438],{"class":1273},[1049,10052,1277],{"class":1267},[1049,10054,3114],{"class":1263},[1049,10056,1771],{"class":1267},[1049,10058,9573],{"class":1263},[1049,10060,10061],{"class":1433},"// Pass the selected model\n",[1049,10063,10065],{"class":10064,"line":2291},[1051,1532],[1049,10066,1440],{"class":1267},[1049,10068,10070,10072,10074],{"class":10069,"line":2323},[1051,1532],[1049,10071,2376],{"class":1267},[1049,10073,1845],{"class":1263},[1049,10075,1295],{"class":1267},[1049,10077,10078,10080,10082,10084,10086],{"class":1051,"line":2339},[1049,10079,5712],{"class":1273},[1049,10081,1264],{"class":1267},[1049,10083,5717],{"class":1905},[1049,10085,1845],{"class":1267},[1049,10087,1343],{"class":1267},[1049,10089,10090,10092,10094,10096,10098,10100,10102,10104,10106,10108,10110],{"class":1051,"line":2357},[1049,10091,5733],{"class":1253},[1049,10093,1914],{"class":1273},[1049,10095,5717],{"class":1263},[1049,10097,1771],{"class":1267},[1049,10099,5742],{"class":1263},[1049,10101,3638],{"class":1267},[1049,10103,1354],{"class":1267},[1049,10105,3924],{"class":1059},[1049,10107,1292],{"class":1267},[1049,10109,3326],{"class":1273},[1049,10111,1268],{"class":1267},[1049,10113,10114,10116,10118,10120,10122,10124],{"class":1051,"line":2373},[1049,10115,5760],{"class":1072},[1049,10117,1264],{"class":1273},[1049,10119,1292],{"class":1267},[1049,10121,1750],{"class":1059},[1049,10123,1292],{"class":1267},[1049,10125,1454],{"class":1273},[1049,10127,10128],{"class":1051,"line":2381},[1049,10129,1440],{"class":1267},[1049,10131,10132],{"class":1051,"line":3331},[1049,10133,1365],{"class":1267},[1049,10135,10136,10138,10140,10142,10144],{"class":1051,"line":3370},[1049,10137,5786],{"class":1273},[1049,10139,1264],{"class":1267},[1049,10141,5791],{"class":1905},[1049,10143,1845],{"class":1267},[1049,10145,1343],{"class":1267},[1049,10147,10148,10150,10152,10154,10156],{"class":1051,"line":3376},[1049,10149,5801],{"class":1263},[1049,10151,1771],{"class":1267},[1049,10153,5806],{"class":1072},[1049,10155,1264],{"class":1273},[1049,10157,1268],{"class":1267},[1049,10159,10160,10162,10164,10166,10168,10170],{"class":1051,"line":3381},[1049,10161,5816],{"class":1273},[1049,10163,1277],{"class":1267},[1049,10165,1354],{"class":1267},[1049,10167,471],{"class":1059},[1049,10169,1292],{"class":1267},[1049,10171,1295],{"class":1267},[1049,10173,10174,10176,10178,10180,10182,10184],{"class":1051,"line":3387},[1049,10175,5832],{"class":1273},[1049,10177,1277],{"class":1267},[1049,10179,5837],{"class":1263},[1049,10181,1771],{"class":1267},[1049,10183,4077],{"class":1263},[1049,10185,1295],{"class":1267},[1049,10187,10188,10190,10192,10194,10196],{"class":1051,"line":3407},[1049,10189,5849],{"class":1273},[1049,10191,1277],{"class":1267},[1049,10193,1354],{"class":1267},[1049,10195,5791],{"class":1059},[1049,10197,1318],{"class":1267},[1049,10199,10200,10202],{"class":1051,"line":3435},[1049,10201,3501],{"class":1267},[1049,10203,1454],{"class":1273},[1049,10205,10206],{"class":1051,"line":3451},[1049,10207,3373],{"class":1267},[1049,10209,10210,10212],{"class":1051,"line":3470},[1049,10211,1451],{"class":1267},[1049,10213,1454],{"class":1263},[1049,10215,10216],{"class":1051,"line":3498},[1049,10217,1332],{"emptyLinePlaceholder":21},[1049,10219,10220,10222,10224,10226,10228,10230,10232,10234],{"class":1051,"line":3506},[1049,10221,5886],{"class":1550},[1049,10223,5889],{"class":1072},[1049,10225,1264],{"class":1267},[1049,10227,5894],{"class":1905},[1049,10229,1277],{"class":1267},[1049,10231,5899],{"class":1055},[1049,10233,1845],{"class":1267},[1049,10235,1343],{"class":1267},[1049,10237,10238,10240,10242,10244],{"class":1051,"line":3511},[1049,10239,5908],{"class":1263},[1049,10241,1771],{"class":1267},[1049,10243,5913],{"class":1072},[1049,10245,2631],{"class":1273},[1049,10247,10248,10250,10252,10254,10256,10258,10260,10262,10264],{"class":1051,"line":3577},[1049,10249,3316],{"class":1253},[1049,10251,1914],{"class":1273},[1049,10253,4805],{"class":1263},[1049,10255,1771],{"class":1267},[1049,10257,4810],{"class":1263},[1049,10259,1771],{"class":1267},[1049,10261,4815],{"class":1072},[1049,10263,4818],{"class":1273},[1049,10265,1268],{"class":1267},[1049,10267,10268,10270,10272,10274,10276,10278,10280,10282,10284,10286,10288,10290],{"class":1051,"line":3582},[1049,10269,5940],{"class":1263},[1049,10271,1771],{"class":1267},[1049,10273,5945],{"class":1072},[1049,10275,1264],{"class":1273},[1049,10277,1828],{"class":1267},[1049,10279,1682],{"class":1273},[1049,10281,1277],{"class":1267},[1049,10283,4951],{"class":1263},[1049,10285,1771],{"class":1267},[1049,10287,4810],{"class":1263},[1049,10289,1695],{"class":1267},[1049,10291,1454],{"class":1273},[1049,10293,10294,10296,10298,10300,10302],{"class":1051,"line":3587},[1049,10295,5968],{"class":1263},[1049,10297,1771],{"class":1267},[1049,10299,4810],{"class":1263},[1049,10301,2585],{"class":1267},[1049,10303,5977],{"class":1267},[1049,10305,10306],{"class":1051,"line":3593},[1049,10307,3373],{"class":1267},[1049,10309,10310],{"class":1051,"line":3623},[1049,10311,5013],{"class":1267},[1049,10313,10314],{"class":1051,"line":3665},[1049,10315,1332],{"emptyLinePlaceholder":21},[1049,10317,10318,10320,10322,10324,10326],{"class":1051,"line":3694},[1049,10319,5999],{"class":1072},[1049,10321,1264],{"class":1263},[1049,10323,1768],{"class":1267},[1049,10325,1788],{"class":1550},[1049,10327,1343],{"class":1267},[1049,10329,10330,10332,10334,10336,10338,10340,10342,10344,10346,10348,10350,10352,10354],{"class":1051,"line":3706},[1049,10331,3316],{"class":1253},[1049,10333,1914],{"class":1273},[1049,10335,5515],{"class":1263},[1049,10337,1771],{"class":1267},[1049,10339,4810],{"class":1263},[1049,10341,3633],{"class":1267},[1049,10343,1959],{"class":1263},[1049,10345,1771],{"class":1267},[1049,10347,3611],{"class":1263},[1049,10349,3638],{"class":1267},[1049,10351,3617],{"class":3348},[1049,10353,3326],{"class":1273},[1049,10355,1268],{"class":1267},[1049,10357,10358,10360,10362,10364],{"class":1051,"line":3722},[1049,10359,5940],{"class":1263},[1049,10361,1771],{"class":1267},[1049,10363,6044],{"class":1072},[1049,10365,2631],{"class":1273},[1049,10367,10368],{"class":1051,"line":3736},[1049,10369,3373],{"class":1267},[1049,10371,10372,10374],{"class":1051,"line":3743},[1049,10373,1451],{"class":1267},[1049,10375,1454],{"class":1263},[1049,10377,10378,10380,10382],{"class":1051,"line":3748},[1049,10379,1598],{"class":1267},[1049,10381,4722],{"class":1273},[1049,10383,1528],{"class":1267},[1049,10385,10386],{"class":1051,"line":3753},[1049,10387,1332],{"emptyLinePlaceholder":21},[1049,10389,10390,10392,10394],{"class":1051,"line":3759},[1049,10391,1522],{"class":1267},[1049,10393,1525],{"class":1273},[1049,10395,1528],{"class":1267},[1049,10397,10398,10400,10402,10404,10406,10408,10410,10412],{"class":1051,"line":3776},[1049,10399,1535],{"class":1267},[1049,10401,5040],{"class":1273},[1049,10403,5043],{"class":1550},[1049,10405,1554],{"class":1267},[1049,10407,1481],{"class":1267},[1049,10409,5050],{"class":1059},[1049,10411,1481],{"class":1267},[1049,10413,1528],{"class":1267},[1049,10415,10416,10418,10420,10422,10424],{"class":1051,"line":3798},[1049,10417,1544],{"class":1267},[1049,10419,1525],{"class":1273},[1049,10421,5063],{"class":1267},[1049,10423,7751],{"class":1550},[1049,10425,1528],{"class":1267},[1049,10427,10428,10430,10432],{"class":1051,"line":3816},[1049,10429,1568],{"class":1267},[1049,10431,7761],{"class":1273},[1049,10433,1574],{"class":1267},[1049,10435,10436,10438,10440],{"class":1051,"line":3824},[1049,10437,1579],{"class":1267},[1049,10439,1525],{"class":1273},[1049,10441,1528],{"class":1267},[1049,10443,10444,10446,10448,10450,10452],{"class":1051,"line":3841},[1049,10445,1544],{"class":1267},[1049,10447,1525],{"class":1273},[1049,10449,5063],{"class":1267},[1049,10451,5066],{"class":1550},[1049,10453,1528],{"class":1267},[1049,10455,10456,10458,10460,10462,10464,10466,10468,10470],{"class":1051,"line":3860},[1049,10457,1568],{"class":1267},[1049,10459,5075],{"class":1273},[1049,10461,5078],{"class":1550},[1049,10463,1554],{"class":1267},[1049,10465,1481],{"class":1267},[1049,10467,6121],{"class":1059},[1049,10469,1481],{"class":1267},[1049,10471,1528],{"class":1267},[1049,10473,10474,10476],{"class":1051,"line":3868},[1049,10475,5094],{"class":1267},[1049,10477,6132],{"class":1273},[1049,10479,10480,10482,10484,10486,10488],{"class":1051,"line":3873},[1049,10481,6137],{"class":1550},[1049,10483,1554],{"class":1267},[1049,10485,1481],{"class":1267},[1049,10487,6144],{"class":1059},[1049,10489,5151],{"class":1267},[1049,10491,10492,10494,10496,10498,10500],{"class":1051,"line":3879},[1049,10493,5157],{"class":1550},[1049,10495,1554],{"class":1267},[1049,10497,1481],{"class":1267},[1049,10499,6157],{"class":1059},[1049,10501,5151],{"class":1267},[1049,10503,10504],{"class":1051,"line":3899},[1049,10505,6164],{"class":1550},[1049,10507,10508,10510,10512,10514,10516],{"class":1051,"line":3914},[1049,10509,6169],{"class":1550},[1049,10511,1554],{"class":1267},[1049,10513,1481],{"class":1267},[1049,10515,6176],{"class":1059},[1049,10517,5151],{"class":1267},[1049,10519,10520],{"class":1051,"line":3931},[1049,10521,5217],{"class":1267},[1049,10523,10524,10526,10528,10530,10532,10534,10536,10538,10540,10542,10544],{"class":1051,"line":3955},[1049,10525,5223],{"class":1267},[1049,10527,1525],{"class":1273},[1049,10529,5063],{"class":1267},[1049,10531,344],{"class":1550},[1049,10533,1554],{"class":1267},[1049,10535,1481],{"class":1267},[1049,10537,1828],{"class":1267},[1049,10539,6201],{"class":1263},[1049,10541,1451],{"class":1267},[1049,10543,1481],{"class":1267},[1049,10545,1528],{"class":1267},[1049,10547,10548,10550,10552,10554,10556,10558,10560,10562,10564,10566,10568,10570,10572,10574,10576,10578,10580,10582,10584,10586,10588,10590,10592,10594,10596,10598,10600,10602,10604,10606,10608,10610],{"class":1051,"line":3966},[1049,10549,6212],{"class":1267},[1049,10551,1525],{"class":1273},[1049,10553,6217],{"class":1253},[1049,10555,1554],{"class":1267},[1049,10557,1481],{"class":1267},[1049,10559,6224],{"class":1263},[1049,10561,1679],{"class":1267},[1049,10563,6229],{"class":1263},[1049,10565,6232],{"class":1267},[1049,10567,2580],{"class":1263},[1049,10569,1771],{"class":1267},[1049,10571,2161],{"class":1263},[1049,10573,1481],{"class":1267},[1049,10575,6243],{"class":1267},[1049,10577,6246],{"class":1550},[1049,10579,1554],{"class":1267},[1049,10581,6251],{"class":1267},[1049,10583,4077],{"class":1263},[1049,10585,1771],{"class":1267},[1049,10587,1980],{"class":1263},[1049,10589,1451],{"class":1267},[1049,10591,6262],{"class":1059},[1049,10593,4997],{"class":1267},[1049,10595,6267],{"class":1263},[1049,10597,1771],{"class":1267},[1049,10599,5742],{"class":1263},[1049,10601,1451],{"class":1267},[1049,10603,6262],{"class":1059},[1049,10605,4997],{"class":1267},[1049,10607,6280],{"class":1263},[1049,10609,6283],{"class":1267},[1049,10611,1528],{"class":1267},[1049,10613,10614,10616,10618,10620,10622,10624,10626,10628,10630,10632,10634,10636,10638,10640,10642,10644,10646,10648,10650,10652,10654,10656,10658],{"class":1051,"line":3974},[1049,10615,6290],{"class":1267},[1049,10617,6293],{"class":1273},[1049,10619,6296],{"class":1550},[1049,10621,1554],{"class":1267},[1049,10623,1481],{"class":1267},[1049,10625,6303],{"class":1059},[1049,10627,1481],{"class":1267},[1049,10629,6308],{"class":1550},[1049,10631,1554],{"class":1267},[1049,10633,1481],{"class":1267},[1049,10635,6315],{"class":1059},[1049,10637,1481],{"class":1267},[1049,10639,6320],{"class":1550},[1049,10641,1554],{"class":1267},[1049,10643,1481],{"class":1267},[1049,10645,6327],{"class":1059},[1049,10647,1481],{"class":1267},[1049,10649,5078],{"class":1550},[1049,10651,1554],{"class":1267},[1049,10653,1481],{"class":1267},[1049,10655,6338],{"class":1059},[1049,10657,1481],{"class":1267},[1049,10659,1574],{"class":1267},[1049,10661,10662,10664,10666,10668,10670,10672,10674,10676,10678,10680,10682,10684,10686,10688,10690,10692,10694],{"class":1051,"line":3980},[1049,10663,6290],{"class":1267},[1049,10665,949],{"class":1273},[1049,10667,6351],{"class":1550},[1049,10669,1554],{"class":1267},[1049,10671,1481],{"class":1267},[1049,10673,6358],{"class":1059},[1049,10675,1481],{"class":1267},[1049,10677,5078],{"class":1550},[1049,10679,1554],{"class":1267},[1049,10681,1481],{"class":1267},[1049,10683,6369],{"class":1059},[1049,10685,1481],{"class":1267},[1049,10687,2628],{"class":1267},[1049,10689,6376],{"class":1263},[1049,10691,1598],{"class":1267},[1049,10693,949],{"class":1273},[1049,10695,1528],{"class":1267},[1049,10697,10698,10700,10702],{"class":1051,"line":3985},[1049,10699,6387],{"class":1267},[1049,10701,1525],{"class":1273},[1049,10703,1528],{"class":1267},[1049,10705,10706,10708,10710],{"class":1051,"line":4008},[1049,10707,6396],{"class":1267},[1049,10709,1525],{"class":1273},[1049,10711,1528],{"class":1267},[1049,10713,10714,10716,10718],{"class":1051,"line":4014},[1049,10715,5120],{"class":1267},[1049,10717,4693],{"class":1273},[1049,10719,1528],{"class":1267},[1049,10721,10722],{"class":1051,"line":4034},[1049,10723,1332],{"emptyLinePlaceholder":21},[1049,10725,10726,10728],{"class":1051,"line":4040},[1049,10727,5094],{"class":1267},[1049,10729,5136],{"class":1273},[1049,10731,10732,10734,10736,10738,10740],{"class":1051,"line":4086},[1049,10733,5142],{"class":1550},[1049,10735,1554],{"class":1267},[1049,10737,1481],{"class":1267},[1049,10739,4805],{"class":1059},[1049,10741,5151],{"class":1267},[1049,10743,10744,10746,10748,10750,10752],{"class":1051,"line":4102},[1049,10745,6435],{"class":1550},[1049,10747,1554],{"class":1267},[1049,10749,1481],{"class":1267},[1049,10751,6442],{"class":1059},[1049,10753,5151],{"class":1267},[1049,10755,10756,10758,10760,10762,10764],{"class":1051,"line":4135},[1049,10757,5172],{"class":1550},[1049,10759,1554],{"class":1267},[1049,10761,1481],{"class":1267},[1049,10763,5179],{"class":1059},[1049,10765,5151],{"class":1267},[1049,10767,10768,10770,10772,10774,10776],{"class":1051,"line":4149},[1049,10769,6169],{"class":1550},[1049,10771,1554],{"class":1267},[1049,10773,1481],{"class":1267},[1049,10775,6467],{"class":1059},[1049,10777,5151],{"class":1267},[1049,10779,10780,10782,10784,10786,10788],{"class":1051,"line":4157},[1049,10781,5202],{"class":1550},[1049,10783,1554],{"class":1267},[1049,10785,1481],{"class":1267},[1049,10787,6480],{"class":1059},[1049,10789,5151],{"class":1267},[1049,10791,10792],{"class":1051,"line":4162},[1049,10793,5217],{"class":1267},[1049,10795,10796,10798,10800,10802,10805],{"class":1051,"line":4169},[1049,10797,5223],{"class":1267},[1049,10799,1525],{"class":1273},[1049,10801,5063],{"class":1267},[1049,10803,10804],{"class":1550},"footer",[1049,10806,1528],{"class":1267},[1049,10808,10809,10811,10814,10817,10819,10821,10823,10825],{"class":1051,"line":4174},[1049,10810,6212],{"class":1267},[1049,10812,10813],{"class":1273},"ModelSelect",[1049,10815,10816],{"class":1550}," v-model",[1049,10818,1554],{"class":1267},[1049,10820,1481],{"class":1267},[1049,10822,4248],{"class":1059},[1049,10824,1481],{"class":1267},[1049,10826,1574],{"class":1267},[1049,10828,10830,10832,10834],{"class":10829,"line":4192},[1051,1532],[1049,10831,6396],{"class":1267},[1049,10833,1525],{"class":1273},[1049,10835,1528],{"class":1267},[1049,10837,10839],{"class":10838,"line":6555},[1051,1532],[1049,10840,1332],{"emptyLinePlaceholder":21},[1049,10842,10844,10846],{"class":10843,"line":6564},[1051,1532],[1049,10845,5223],{"class":1267},[1049,10847,6493],{"class":1273},[1049,10849,10850,10852,10854,10856,10858],{"class":1051,"line":6573},[1049,10851,6498],{"class":1550},[1049,10853,1554],{"class":1267},[1049,10855,1481],{"class":1267},[1049,10857,6157],{"class":1059},[1049,10859,5151],{"class":1267},[1049,10861,10862,10864,10866,10868,10870],{"class":1051,"line":6582},[1049,10863,6511],{"class":1550},[1049,10865,1554],{"class":1267},[1049,10867,1481],{"class":1267},[1049,10869,5236],{"class":1059},[1049,10871,5151],{"class":1267},[1049,10873,10874,10876,10878,10880,10882],{"class":1051,"line":6591},[1049,10875,6524],{"class":1550},[1049,10877,1554],{"class":1267},[1049,10879,1481],{"class":1267},[1049,10881,6531],{"class":1059},[1049,10883,5151],{"class":1267},[1049,10885,10886,10888,10890,10892,10894],{"class":1051,"line":9108},[1049,10887,6538],{"class":1550},[1049,10889,1554],{"class":1267},[1049,10891,1481],{"class":1267},[1049,10893,6545],{"class":1059},[1049,10895,5151],{"class":1267},[1049,10897,10898],{"class":1051,"line":9117},[1049,10899,6552],{"class":1267},[1049,10901,10902,10904,10906],{"class":1051,"line":9126},[1049,10903,5120],{"class":1267},[1049,10905,4687],{"class":1273},[1049,10907,1528],{"class":1267},[1049,10909,10911,10913,10915],{"class":1051,"line":10910},94,[1049,10912,5254],{"class":1267},[1049,10914,5075],{"class":1273},[1049,10916,1528],{"class":1267},[1049,10918,10920,10922,10924],{"class":1051,"line":10919},95,[1049,10921,1579],{"class":1267},[1049,10923,1525],{"class":1273},[1049,10925,1528],{"class":1267},[1049,10927,10929,10931,10933],{"class":1051,"line":10928},96,[1049,10930,1589],{"class":1267},[1049,10932,5040],{"class":1273},[1049,10934,1528],{"class":1267},[1049,10936,10938,10940,10942],{"class":1051,"line":10937},97,[1049,10939,1598],{"class":1267},[1049,10941,1525],{"class":1273},[1049,10943,1528],{"class":1267},[953,10945,10947],{"id":10946},"going-further","Going further",[949,10949,10950],{},"You now have a working AI chatbot with database persistence! To take it further, consider adding:",[949,10952,10953],{},[967,10954,10955],{},"User Authentication",[949,10957,10958,10959,10964],{},"Add authentication with ",[1024,10960,10963],{"href":10961,"rel":10962},"https://github.com/atinux/nuxt-auth-utils",[1028],"nuxt-auth-utils"," to let users access their chat history across devices and keep conversations private.",[949,10966,10967],{},[967,10968,141],{},[949,10970,10971,10972,10977],{},"Extend your chatbot with ",[1024,10973,10976],{"href":10974,"rel":10975},"https://ai-sdk.dev/docs/ai-sdk-core/tools-and-tool-calling",[1028],"AI SDK tools"," that can fetch real-time data, generate charts, or interact with external APIs:",[1039,10979,10981],{"className":1244,"code":10980,"language":1246,"meta":1044,"style":1044},"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",[1046,10982,10983,11002,11020,11024,11039,11055,11072,11103,11111,11131,11136,11171,11175],{"__ignoreMap":1044},[1049,10984,10985,10987,10989,10992,10994,10996,10998,11000],{"class":1051,"line":1052},[1049,10986,1670],{"class":1253},[1049,10988,1673],{"class":1267},[1049,10990,10991],{"class":1263}," tool",[1049,10993,1695],{"class":1267},[1049,10995,1698],{"class":1253},[1049,10997,1354],{"class":1267},[1049,10999,2496],{"class":1059},[1049,11001,1318],{"class":1267},[1049,11003,11004,11006,11008,11010,11012,11014,11016,11018],{"class":1051,"line":1069},[1049,11005,1670],{"class":1253},[1049,11007,1673],{"class":1267},[1049,11009,2531],{"class":1263},[1049,11011,1695],{"class":1267},[1049,11013,1698],{"class":1253},[1049,11015,1354],{"class":1267},[1049,11017,2540],{"class":1059},[1049,11019,1318],{"class":1267},[1049,11021,11022],{"class":1051,"line":1283},[1049,11023,1332],{"emptyLinePlaceholder":21},[1049,11025,11026,11028,11031,11033,11035,11037],{"class":1051,"line":1298},[1049,11027,4743],{"class":1550},[1049,11029,11030],{"class":1263}," weatherTool ",[1049,11032,1554],{"class":1267},[1049,11034,10991],{"class":1072},[1049,11036,1264],{"class":1263},[1049,11038,1268],{"class":1267},[1049,11040,11041,11044,11046,11048,11051,11053],{"class":1051,"line":1310},[1049,11042,11043],{"class":1273},"  description",[1049,11045,1277],{"class":1267},[1049,11047,1354],{"class":1267},[1049,11049,11050],{"class":1059},"Get the current weather for a location",[1049,11052,1292],{"class":1267},[1049,11054,1295],{"class":1267},[1049,11056,11057,11060,11062,11064,11066,11068,11070],{"class":1051,"line":1321},[1049,11058,11059],{"class":1273},"  parameters",[1049,11061,1277],{"class":1267},[1049,11063,2531],{"class":1263},[1049,11065,1771],{"class":1267},[1049,11067,2603],{"class":1072},[1049,11069,1264],{"class":1263},[1049,11071,1268],{"class":1267},[1049,11073,11074,11077,11079,11081,11083,11085,11087,11089,11092,11094,11096,11099,11101],{"class":1051,"line":1329},[1049,11075,11076],{"class":1273},"    location",[1049,11078,1277],{"class":1267},[1049,11080,2531],{"class":1263},[1049,11082,1771],{"class":1267},[1049,11084,3087],{"class":1072},[1049,11086,1768],{"class":1263},[1049,11088,1771],{"class":1267},[1049,11090,11091],{"class":1072},"describe",[1049,11093,1264],{"class":1263},[1049,11095,1292],{"class":1267},[1049,11097,11098],{"class":1059},"The city name",[1049,11100,1292],{"class":1267},[1049,11102,1454],{"class":1263},[1049,11104,11105,11107,11109],{"class":1051,"line":1335},[1049,11106,2376],{"class":1267},[1049,11108,1845],{"class":1263},[1049,11110,1295],{"class":1267},[1049,11112,11113,11116,11118,11120,11122,11125,11127,11129],{"class":1051,"line":1346},[1049,11114,11115],{"class":1072},"  execute",[1049,11117,1277],{"class":1267},[1049,11119,3784],{"class":1550},[1049,11121,1902],{"class":1267},[1049,11123,11124],{"class":1905}," location",[1049,11126,1909],{"class":1267},[1049,11128,1788],{"class":1550},[1049,11130,1343],{"class":1267},[1049,11132,11133],{"class":1051,"line":1362},[1049,11134,11135],{"class":1433},"    // Fetch weather data from an API\n",[1049,11137,11138,11141,11143,11145,11147,11150,11152,11155,11157,11160,11162,11164,11167,11169],{"class":1051,"line":1368},[1049,11139,11140],{"class":1253},"    return",[1049,11142,1673],{"class":1267},[1049,11144,11124],{"class":1263},[1049,11146,1679],{"class":1267},[1049,11148,11149],{"class":1273}," temperature",[1049,11151,1277],{"class":1267},[1049,11153,11154],{"class":3348}," 22",[1049,11156,1679],{"class":1267},[1049,11158,11159],{"class":1273}," condition",[1049,11161,1277],{"class":1267},[1049,11163,1354],{"class":1267},[1049,11165,11166],{"class":1059},"Sunny",[1049,11168,1292],{"class":1267},[1049,11170,9340],{"class":1267},[1049,11172,11173],{"class":1051,"line":1373},[1049,11174,3373],{"class":1267},[1049,11176,11177,11179],{"class":1051,"line":1396},[1049,11178,1451],{"class":1267},[1049,11180,1454],{"class":1263},[996,11182,11184],{"icon":11183,"target":999,"to":1000},"i-lucide-rocket",[949,11185,11186,11187,11189,11190,1771],{},"The official ",[967,11188,1006],{}," includes all these features and more. Get started instantly with ",[1046,11191,11192],{},"npx nuxi@latest init -t ui/chat my-chat-app",[953,11194,11196],{"id":11195},"deploying-to-vercel","Deploying to Vercel",[949,11198,11199],{},"Deploy your chatbot to Vercel with zero configuration:",[1039,11201,11203],{"className":1041,"code":11202,"language":1043,"meta":1044,"style":1044},"npx vercel deploy\n",[1046,11204,11205],{"__ignoreMap":1044},[1049,11206,11207,11209,11212],{"class":1051,"line":1052},[1049,11208,1056],{"class":1055},[1049,11210,11211],{"class":1059}," vercel",[1049,11213,11214],{"class":1059}," deploy\n",[949,11216,11217],{},"Then, in the Vercel dashboard:",[961,11219,11220,11226],{},[964,11221,11222,11223,11225],{},"Enable ",[967,11224,4204],{}," and add credits so requests can be processed.",[964,11227,11228,11229,11232],{},"Add a ",[967,11230,11231],{},"Turso"," database from the Vercel Marketplace and connect it to your project (it will provision the database and add the required environment variables automatically).",[11234,11235,11236],"blockquote",{},[949,11237,11238,11239,11244,11245,11247],{},"Note: On Vercel, you ",[967,11240,11241,11242],{},"don’t need to manually add ",[1046,11243,1621],{}," — Vercel handles the gateway configuration for deployments. Keep using ",[1046,11246,1608],{}," locally for development.",[1628,11249,11250],{"to":1026,"target":999},[949,11251,11252,11253,1771],{},"Learn more about setting up AI Gateway in the ",[967,11254,11255],{},"Vercel AI Gateway documentation",[953,11257,11259],{"id":11258},"conclusion","Conclusion",[949,11261,11262],{},"You've built a complete AI chatbot with:",[961,11264,11265,11271,11277,11282,11287],{},[964,11266,11267,11270],{},[967,11268,11269],{},"A complete chat interface"," using Nuxt UI components",[964,11272,11273,11276],{},[967,11274,11275],{},"Real-time streaming responses"," with the AI SDK",[964,11278,11279,11281],{},[967,11280,981],{}," with MDC for rich content display",[964,11283,11284,11286],{},[967,11285,987],{}," via AI Gateway",[964,11288,11289,11292],{},[967,11290,11291],{},"Database persistence"," with SQLite (local) / Turso (production) and Drizzle ORM",[949,11294,11295],{},"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.",[949,11297,11298],{},[967,11299,11300],{},"Resources:",[961,11302,11303,11310,11317,11324,11330],{},[964,11304,11305],{},[1024,11306,11309],{"href":11307,"rel":11308},"https://ui.nuxt.com/components/chat-messages",[1028],"Nuxt UI Chat Components",[964,11311,11312],{},[1024,11313,11316],{"href":11314,"rel":11315},"https://hub.nuxt.com/docs/features/database",[1028],"NuxtHub Database",[964,11318,11319],{},[1024,11320,11323],{"href":11321,"rel":11322},"https://ai-sdk.dev",[1028],"AI SDK Documentation",[964,11325,11326],{},[1024,11327,11329],{"href":1026,"rel":11328},[1028],"AI Gateway Documentation",[964,11331,11332],{},[1024,11333,11335],{"href":1000,"rel":11334},[1028],"AI Chat Template",[949,11337,11338],{},"We're excited to see what you'll build!",[11340,11341,11342],"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}html pre.shiki code .sRy2g, html code.shiki .sRy2g{--shiki-icon-url: url(https://api.iconify.design/lucide:plus-square.svg?color=%23000)}html pre.shiki code .sdATh, html code.shiki .sdATh{--shiki-icon-url: url(https://api.iconify.design/lucide:messages-square.svg?color=%23000)}html pre.shiki code .sh9xi, html code.shiki .sh9xi{--shiki-icon-url: url(https://api.iconify.design/simple-icons:openai.svg?color=%23000)}html pre.shiki code .sNknm, html code.shiki .sNknm{--shiki-icon-url: url(https://api.iconify.design/simple-icons:anthropic.svg?color=%23000)}html pre.shiki code .scZL3, html code.shiki .scZL3{--shiki-icon-url: url(https://api.iconify.design/simple-icons:google.svg?color=%23000)}",{"title":1044,"searchDepth":1069,"depth":1069,"links":11344},[11345,11346,11347,11353,11358,11361,11362,11366,11367,11368,11373,11374,11375],{"id":955,"depth":1069,"text":956},{"id":1010,"depth":1069,"text":1011},{"id":1033,"depth":1069,"text":1034,"children":11348},[11349,11350,11351,11352],{"id":1079,"depth":1283,"text":1080},{"id":1230,"depth":1283,"text":1231},{"id":1499,"depth":1283,"text":1500},{"id":1639,"depth":1283,"text":1640},{"id":2419,"depth":1069,"text":2420,"children":11354},[11355,11356,11357],{"id":2431,"depth":1283,"text":2432},{"id":2814,"depth":1283,"text":2815},{"id":4296,"depth":1283,"text":4297},{"id":4678,"depth":1069,"text":4679,"children":11359},[11360],{"id":4697,"depth":1283,"text":4698},{"id":5317,"depth":1069,"text":5318},{"id":6752,"depth":1069,"text":6753,"children":11363},[11364,11365],{"id":6759,"depth":1283,"text":6760},{"id":6919,"depth":1283,"text":6920},{"id":7424,"depth":1069,"text":7425},{"id":7967,"depth":1069,"text":7968},{"id":9144,"depth":1069,"text":9145,"children":11369},[11370,11371,11372],{"id":9155,"depth":1283,"text":9156},{"id":9435,"depth":1283,"text":9436},{"id":9696,"depth":1283,"text":9697},{"id":10946,"depth":1069,"text":10947},{"id":11195,"depth":1069,"text":11196},{"id":11258,"depth":1069,"text":11259},"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":11381},"Tutorial","/blog/how-to-build-an-ai-chat",{"title":933,"description":11377},"blog/how-to-build-an-ai-chat","IPLkZO8LL_2FoVmhWkSkC7V0qDJOTOwI5l4BHDYBM_E",{"data":11387,"body":11388},{},{"type":11389,"children":11390},"root",[11391],{"type":172,"tag":949,"props":11392,"children":11393},{},[11394,11396,11403],{"type":4940,"value":11395},"Nuxt ",{"type":172,"tag":1049,"props":11397,"children":11400},{"className":11398},[11399],"text-primary",[11401],{"type":4940,"value":11402},"UI",{"type":4940,"value":11404}," Blog",{"data":11406,"body":11407},{},{"type":11389,"children":11408},[11409],{"type":172,"tag":949,"props":11410,"children":11411},{},[11412],{"type":4940,"value":921},1768492393018]