[{"data":1,"prerenderedAt":11373},["ShallowReactive",2],{"navigation":3,"-blog-how-to-build-an-ai-chat":918},[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,"authors":921,"body":932,"date":11363,"description":11364,"extension":11365,"image":11366,"meta":11367,"navigation":36,"path":11369,"seo":11370,"stem":11371,"__hash__":11372},"posts/blog/how-to-build-an-ai-chat.md","Build an AI Chatbot with Nuxt, Nuxt UI, and AI SDK",[922,927],{"name":923,"avatar":924,"to":926},"Hugo Richard",{"src":925},"https://github.com/hugorcd.png","https://x.com/hugorcd",{"name":928,"avatar":929,"to":931},"Benjamin Canac",{"src":930},"https://github.com/benjamincanac.png","https://x.com/benjamincanac",{"type":933,"value":934,"toc":11330},"minimark",[935,939,944,947,982,995,999,1002,1018,1022,1025,1063,1068,1071,1215,1219,1226,1442,1445,1484,1488,1495,1590,1597,1614,1624,1628,1642,2373,2376,2394,2404,2408,2416,2420,2431,2799,2803,2830,4184,4187,4192,4199,4204,4215,4220,4229,4247,4252,4268,4281,4285,4288,4663,4667,4682,4686,4694,5270,5277,5302,5306,5325,6585,6588,6593,6604,6642,6657,6662,6669,6683,6688,6709,6714,6719,6726,6737,6741,6744,6748,6751,6904,6908,6933,7409,7413,7952,7956,9120,9129,9133,9140,9144,9154,9420,9424,9432,9681,9685,9688,10931,10935,10938,10943,10952,10956,10965,11168,11180,11184,11187,11202,11205,11220,11235,11243,11247,11250,11280,11283,11288,11323,11326],[936,937,938],"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.",[940,941,943],"h2",{"id":942},"what-were-building","What we're building",[936,945,946],{},"By the end of this tutorial, you'll have a fully functional AI chatbot with:",[948,949,950,958,964,970,976],"ul",{},[951,952,953,957],"li",{},[954,955,956],"strong",{},"Streaming responses"," that appear in real-time as the AI generates them",[951,959,960,963],{},[954,961,962],{},"A beautiful chat interface"," built with Nuxt UI's purpose-built chat components",[951,965,966,969],{},[954,967,968],{},"Markdown rendering"," for rich AI responses with code highlighting",[951,971,972,975],{},[954,973,974],{},"Multi-model support"," allowing users to switch between OpenAI, Anthropic, and Google models",[951,977,978,981],{},[954,979,980],{},"Server-side AI integration"," using Nitro API routes and the AI SDK",[983,984,988],"callout",{"icon":985,"target":986,"to":987},"i-simple-icons-github","_blank","https://github.com/nuxt-ui-templates/chat",[936,989,990,991,994],{},"Check out the complete ",[954,992,993],{},"AI Chat template"," on GitHub for a production-ready implementation with authentication, database persistence, and more.",[940,996,998],{"id":997},"prerequisites","Prerequisites",[936,1000,1001],{},"Before we start, make sure you have:",[948,1003,1004,1007],{},[951,1005,1006],{},"Node.js 20+ installed",[951,1008,1009,1010,1017],{},"A ",[1011,1012,1016],"a",{"href":1013,"rel":1014},"https://vercel.com/docs/ai-gateway",[1015],"nofollow","Vercel AI Gateway"," API key (provides access to multiple AI providers through a single endpoint)",[940,1019,1021],{"id":1020},"project-setup","Project setup",[936,1023,1024],{},"Start by creating a new Nuxt project:",[1026,1027,1032],"pre",{"className":1028,"code":1029,"language":1030,"meta":1031,"style":1031},"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","",[1033,1034,1035,1054],"code",{"__ignoreMap":1031},[1036,1037,1040,1044,1048,1051],"span",{"class":1038,"line":1039},"line",1,[1036,1041,1043],{"class":1042},"sBMFI","npx",[1036,1045,1047],{"class":1046},"sfazB"," nuxi@latest",[1036,1049,1050],{"class":1046}," init",[1036,1052,1053],{"class":1046}," nuxt-ai-chat\n",[1036,1055,1057,1061],{"class":1038,"line":1056},2,[1036,1058,1060],{"class":1059},"s2Zo4","cd",[1036,1062,1053],{"class":1046},[1064,1065,1067],"h3",{"id":1066},"installing-dependencies","Installing dependencies",[936,1069,1070],{},"Install Nuxt UI and the AI-specific dependencies:",[1072,1073,1075,1118,1150,1183],"code-group",{"sync":1074},"pm",[1026,1076,1079],{"className":1028,"code":1077,"filename":1078,"language":1030,"meta":1031,"style":1031},"pnpm add @nuxt/ui tailwindcss @nuxtjs/mdc @nuxthub/core drizzle-orm drizzle-kit @libsql/client ai @ai-sdk/vue zod\n","pnpm",[1033,1080,1081],{"__ignoreMap":1031},[1036,1082,1083,1085,1088,1091,1094,1097,1100,1103,1106,1109,1112,1115],{"class":1038,"line":1039},[1036,1084,1078],{"class":1042},[1036,1086,1087],{"class":1046}," add",[1036,1089,1090],{"class":1046}," @nuxt/ui",[1036,1092,1093],{"class":1046}," tailwindcss",[1036,1095,1096],{"class":1046}," @nuxtjs/mdc",[1036,1098,1099],{"class":1046}," @nuxthub/core",[1036,1101,1102],{"class":1046}," drizzle-orm",[1036,1104,1105],{"class":1046}," drizzle-kit",[1036,1107,1108],{"class":1046}," @libsql/client",[1036,1110,1111],{"class":1046}," ai",[1036,1113,1114],{"class":1046}," @ai-sdk/vue",[1036,1116,1117],{"class":1046}," zod\n",[1026,1119,1122],{"className":1028,"code":1120,"filename":1121,"language":1030,"meta":1031,"style":1031},"yarn add @nuxt/ui tailwindcss @nuxtjs/mdc @nuxthub/core drizzle-orm drizzle-kit @libsql/client ai @ai-sdk/vue zod\n","yarn",[1033,1123,1124],{"__ignoreMap":1031},[1036,1125,1126,1128,1130,1132,1134,1136,1138,1140,1142,1144,1146,1148],{"class":1038,"line":1039},[1036,1127,1121],{"class":1042},[1036,1129,1087],{"class":1046},[1036,1131,1090],{"class":1046},[1036,1133,1093],{"class":1046},[1036,1135,1096],{"class":1046},[1036,1137,1099],{"class":1046},[1036,1139,1102],{"class":1046},[1036,1141,1105],{"class":1046},[1036,1143,1108],{"class":1046},[1036,1145,1111],{"class":1046},[1036,1147,1114],{"class":1046},[1036,1149,1117],{"class":1046},[1026,1151,1154],{"className":1028,"code":1152,"filename":1153,"language":1030,"meta":1031,"style":1031},"npm install @nuxt/ui tailwindcss @nuxtjs/mdc @nuxthub/core drizzle-orm drizzle-kit @libsql/client ai @ai-sdk/vue zod\n","npm",[1033,1155,1156],{"__ignoreMap":1031},[1036,1157,1158,1160,1163,1165,1167,1169,1171,1173,1175,1177,1179,1181],{"class":1038,"line":1039},[1036,1159,1153],{"class":1042},[1036,1161,1162],{"class":1046}," install",[1036,1164,1090],{"class":1046},[1036,1166,1093],{"class":1046},[1036,1168,1096],{"class":1046},[1036,1170,1099],{"class":1046},[1036,1172,1102],{"class":1046},[1036,1174,1105],{"class":1046},[1036,1176,1108],{"class":1046},[1036,1178,1111],{"class":1046},[1036,1180,1114],{"class":1046},[1036,1182,1117],{"class":1046},[1026,1184,1187],{"className":1028,"code":1185,"filename":1186,"language":1030,"meta":1031,"style":1031},"bun add @nuxt/ui tailwindcss @nuxtjs/mdc @nuxthub/core drizzle-orm drizzle-kit @libsql/client ai @ai-sdk/vue zod\n","bun",[1033,1188,1189],{"__ignoreMap":1031},[1036,1190,1191,1193,1195,1197,1199,1201,1203,1205,1207,1209,1211,1213],{"class":1038,"line":1039},[1036,1192,1186],{"class":1042},[1036,1194,1087],{"class":1046},[1036,1196,1090],{"class":1046},[1036,1198,1093],{"class":1046},[1036,1200,1096],{"class":1046},[1036,1202,1099],{"class":1046},[1036,1204,1102],{"class":1046},[1036,1206,1105],{"class":1046},[1036,1208,1108],{"class":1046},[1036,1210,1111],{"class":1046},[1036,1212,1114],{"class":1046},[1036,1214,1117],{"class":1046},[1064,1216,1218],{"id":1217},"configuration","Configuration",[936,1220,1221,1222,1225],{},"Update your ",[1033,1223,1224],{},"nuxt.config.ts"," to register the modules:",[1227,1228,1229],"code-tree-intersection",{},[1026,1230,1234],{"className":1231,"code":1232,"filename":1224,"language":1233,"meta":1031,"style":1031},"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",[1033,1235,1236,1256,1268,1283,1295,1306,1314,1320,1331,1347,1353,1358,1381,1386,1396,1406,1422,1428,1433],{"__ignoreMap":1031},[1036,1237,1238,1242,1245,1248,1252],{"class":1038,"line":1039},[1036,1239,1241],{"class":1240},"s7zQu","export",[1036,1243,1244],{"class":1240}," default",[1036,1246,1247],{"class":1059}," defineNuxtConfig",[1036,1249,1251],{"class":1250},"sTEyZ","(",[1036,1253,1255],{"class":1254},"sMK4o","{\n",[1036,1257,1258,1262,1265],{"class":1038,"line":1056},[1036,1259,1261],{"class":1260},"swJcz","  modules",[1036,1263,1264],{"class":1254},":",[1036,1266,1267],{"class":1250}," [\n",[1036,1269,1271,1274,1277,1280],{"class":1038,"line":1270},3,[1036,1272,1273],{"class":1254},"    '",[1036,1275,1276],{"class":1046},"@nuxt/ui",[1036,1278,1279],{"class":1254},"'",[1036,1281,1282],{"class":1254},",\n",[1036,1284,1286,1288,1291,1293],{"class":1038,"line":1285},4,[1036,1287,1273],{"class":1254},[1036,1289,1290],{"class":1046},"@nuxtjs/mdc",[1036,1292,1279],{"class":1254},[1036,1294,1282],{"class":1254},[1036,1296,1298,1300,1303],{"class":1038,"line":1297},5,[1036,1299,1273],{"class":1254},[1036,1301,1302],{"class":1046},"@nuxthub/core",[1036,1304,1305],{"class":1254},"'\n",[1036,1307,1309,1312],{"class":1038,"line":1308},6,[1036,1310,1311],{"class":1250},"  ]",[1036,1313,1282],{"class":1254},[1036,1315,1317],{"class":1038,"line":1316},7,[1036,1318,1319],{"emptyLinePlaceholder":21},"\n",[1036,1321,1323,1326,1328],{"class":1038,"line":1322},8,[1036,1324,1325],{"class":1260},"  hub",[1036,1327,1264],{"class":1254},[1036,1329,1330],{"class":1254}," {\n",[1036,1332,1334,1337,1339,1342,1345],{"class":1038,"line":1333},9,[1036,1335,1336],{"class":1260},"    db",[1036,1338,1264],{"class":1254},[1036,1340,1341],{"class":1254}," '",[1036,1343,1344],{"class":1046},"sqlite",[1036,1346,1305],{"class":1254},[1036,1348,1350],{"class":1038,"line":1349},10,[1036,1351,1352],{"class":1254},"  },\n",[1036,1354,1356],{"class":1038,"line":1355},11,[1036,1357,1319],{"emptyLinePlaceholder":21},[1036,1359,1361,1364,1366,1369,1371,1374,1376,1379],{"class":1038,"line":1360},12,[1036,1362,1363],{"class":1260},"  css",[1036,1365,1264],{"class":1254},[1036,1367,1368],{"class":1250}," [",[1036,1370,1279],{"class":1254},[1036,1372,1373],{"class":1046},"~/assets/css/main.css",[1036,1375,1279],{"class":1254},[1036,1377,1378],{"class":1250},"]",[1036,1380,1282],{"class":1254},[1036,1382,1384],{"class":1038,"line":1383},13,[1036,1385,1319],{"emptyLinePlaceholder":21},[1036,1387,1389,1392,1394],{"class":1038,"line":1388},14,[1036,1390,1391],{"class":1260},"  mdc",[1036,1393,1264],{"class":1254},[1036,1395,1330],{"class":1254},[1036,1397,1399,1402,1404],{"class":1038,"line":1398},15,[1036,1400,1401],{"class":1260},"    headings",[1036,1403,1264],{"class":1254},[1036,1405,1330],{"class":1254},[1036,1407,1409,1412,1414,1418],{"class":1038,"line":1408},16,[1036,1410,1411],{"class":1260},"      anchorLinks",[1036,1413,1264],{"class":1254},[1036,1415,1417],{"class":1416},"sfNiH"," false",[1036,1419,1421],{"class":1420},"sHwdD"," // Disable anchor links in AI responses\n",[1036,1423,1425],{"class":1038,"line":1424},17,[1036,1426,1427],{"class":1254},"    }\n",[1036,1429,1431],{"class":1038,"line":1430},18,[1036,1432,1352],{"class":1254},[1036,1434,1436,1439],{"class":1038,"line":1435},19,[1036,1437,1438],{"class":1254},"}",[1036,1440,1441],{"class":1250},")\n",[936,1443,1444],{},"Create the main CSS file to import Tailwind CSS and Nuxt UI:",[1227,1446,1447],{},[1026,1448,1453],{"className":1449,"code":1450,"filename":1451,"language":1452,"meta":1031,"style":1031},"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",[1033,1454,1455,1472],{"__ignoreMap":1031},[1036,1456,1457,1460,1463,1466,1469],{"class":1038,"line":1039},[1036,1458,1459],{"class":1240},"@import",[1036,1461,1462],{"class":1254}," \"",[1036,1464,1465],{"class":1046},"tailwindcss",[1036,1467,1468],{"class":1254},"\"",[1036,1470,1471],{"class":1254},";\n",[1036,1473,1474,1476,1478,1480,1482],{"class":1038,"line":1056},[1036,1475,1459],{"class":1240},[1036,1477,1462],{"class":1254},[1036,1479,1276],{"class":1046},[1036,1481,1468],{"class":1254},[1036,1483,1471],{"class":1254},[1064,1485,1487],{"id":1486},"setting-up-the-app","Setting up the app",[936,1489,1490,1491,1494],{},"Nuxt UI requires wrapping your app with ",[1033,1492,1493],{},"UApp"," for modals, toasts, and overlays to work properly:",[1227,1496,1497],{},[1026,1498,1503],{"className":1499,"code":1500,"filename":1501,"highlights":1502,"language":34,"meta":1031,"style":1031},"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",[1056,1308],[1033,1504,1505,1516,1527,1551,1562,1571,1581],{"__ignoreMap":1031},[1036,1506,1507,1510,1513],{"class":1038,"line":1039},[1036,1508,1509],{"class":1254},"\u003C",[1036,1511,1512],{"class":1260},"template",[1036,1514,1515],{"class":1254},">\n",[1036,1517,1520,1523,1525],{"class":1518,"line":1056},[1038,1519],"highlight",[1036,1521,1522],{"class":1254},"  \u003C",[1036,1524,1493],{"class":1260},[1036,1526,1515],{"class":1254},[1036,1528,1529,1532,1535,1539,1542,1544,1547,1549],{"class":1038,"line":1270},[1036,1530,1531],{"class":1254},"    \u003C",[1036,1533,1534],{"class":1260},"UDashboardGroup",[1036,1536,1538],{"class":1537},"spNyl"," unit",[1036,1540,1541],{"class":1254},"=",[1036,1543,1468],{"class":1254},[1036,1545,1546],{"class":1046},"rem",[1036,1548,1468],{"class":1254},[1036,1550,1515],{"class":1254},[1036,1552,1553,1556,1559],{"class":1038,"line":1285},[1036,1554,1555],{"class":1254},"      \u003C",[1036,1557,1558],{"class":1260},"NuxtPage",[1036,1560,1561],{"class":1254}," />\n",[1036,1563,1564,1567,1569],{"class":1038,"line":1297},[1036,1565,1566],{"class":1254},"    \u003C/",[1036,1568,1534],{"class":1260},[1036,1570,1515],{"class":1254},[1036,1572,1574,1577,1579],{"class":1573,"line":1308},[1038,1519],[1036,1575,1576],{"class":1254},"  \u003C/",[1036,1578,1493],{"class":1260},[1036,1580,1515],{"class":1254},[1036,1582,1583,1586,1588],{"class":1038,"line":1316},[1036,1584,1585],{"class":1254},"\u003C/",[1036,1587,1512],{"class":1260},[1036,1589,1515],{"class":1254},[936,1591,1592,1593,1596],{},"Create a ",[1033,1594,1595],{},".env"," file with your AI Gateway API key:",[1227,1598,1599],{},[1026,1600,1602],{"className":1028,"code":1601,"filename":1595,"language":1030,"meta":1031,"style":1031},"AI_GATEWAY_API_KEY=your-api-key-here\n",[1033,1603,1604],{"__ignoreMap":1031},[1036,1605,1606,1609,1611],{"class":1038,"line":1039},[1036,1607,1608],{"class":1250},"AI_GATEWAY_API_KEY",[1036,1610,1541],{"class":1254},[1036,1612,1613],{"class":1046},"your-api-key-here\n",[1615,1616,1617],"note",{},[936,1618,1619,1620,1623],{},"With ",[1011,1621,1016],{"href":1013,"rel":1622},[1015],", 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.",[1064,1625,1627],{"id":1626},"setting-up-the-database","Setting up the database",[936,1629,1630,1635,1636,1641],{},[1011,1631,1634],{"href":1632,"rel":1633},"https://hub.nuxt.com",[1015],"NuxtHub"," provides a zero-config database powered by ",[1011,1637,1640],{"href":1638,"rel":1639},"https://orm.drizzle.team",[1015],"Drizzle ORM",". Here is the schema for the chat application:",[1227,1643,1644],{},[1645,1646,1647],"code-collapse",{},[1026,1648,1651],{"className":1231,"code":1649,"filename":1650,"language":1233,"meta":1031,"style":1031},"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",[1033,1652,1653,1693,1713,1717,1744,1789,1802,1859,1865,1869,1904,1916,1923,1927,1953,1998,2064,2133,2172,2222,2235,2265,2271,2276,2308,2324,2342,2358,2366],{"__ignoreMap":1031},[1036,1654,1655,1658,1661,1664,1667,1670,1672,1675,1677,1680,1683,1686,1688,1691],{"class":1038,"line":1039},[1036,1656,1657],{"class":1240},"import",[1036,1659,1660],{"class":1254}," {",[1036,1662,1663],{"class":1250}," sqliteTable",[1036,1665,1666],{"class":1254},",",[1036,1668,1669],{"class":1250}," text",[1036,1671,1666],{"class":1254},[1036,1673,1674],{"class":1250}," integer",[1036,1676,1666],{"class":1254},[1036,1678,1679],{"class":1250}," index",[1036,1681,1682],{"class":1254}," }",[1036,1684,1685],{"class":1240}," from",[1036,1687,1341],{"class":1254},[1036,1689,1690],{"class":1046},"drizzle-orm/sqlite-core",[1036,1692,1305],{"class":1254},[1036,1694,1695,1697,1699,1702,1704,1706,1708,1711],{"class":1038,"line":1056},[1036,1696,1657],{"class":1240},[1036,1698,1660],{"class":1254},[1036,1700,1701],{"class":1250}," relations",[1036,1703,1682],{"class":1254},[1036,1705,1685],{"class":1240},[1036,1707,1341],{"class":1254},[1036,1709,1710],{"class":1046},"drizzle-orm",[1036,1712,1305],{"class":1254},[1036,1714,1715],{"class":1038,"line":1270},[1036,1716,1319],{"emptyLinePlaceholder":21},[1036,1718,1719,1721,1724,1727,1729,1731,1733,1735,1738,1740,1742],{"class":1038,"line":1285},[1036,1720,1241],{"class":1240},[1036,1722,1723],{"class":1537}," const",[1036,1725,1726],{"class":1250}," chats ",[1036,1728,1541],{"class":1254},[1036,1730,1663],{"class":1059},[1036,1732,1251],{"class":1250},[1036,1734,1279],{"class":1254},[1036,1736,1737],{"class":1046},"chats",[1036,1739,1279],{"class":1254},[1036,1741,1666],{"class":1254},[1036,1743,1330],{"class":1254},[1036,1745,1746,1749,1751,1753,1756,1759,1762,1764,1766,1769,1771,1773,1776,1779,1781,1784,1787],{"class":1038,"line":1297},[1036,1747,1748],{"class":1260},"  id",[1036,1750,1264],{"class":1254},[1036,1752,1669],{"class":1059},[1036,1754,1755],{"class":1250},"()",[1036,1757,1758],{"class":1254},".",[1036,1760,1761],{"class":1059},"primaryKey",[1036,1763,1755],{"class":1250},[1036,1765,1758],{"class":1254},[1036,1767,1768],{"class":1059},"$defaultFn",[1036,1770,1251],{"class":1250},[1036,1772,1755],{"class":1254},[1036,1774,1775],{"class":1537}," =>",[1036,1777,1778],{"class":1250}," crypto",[1036,1780,1758],{"class":1254},[1036,1782,1783],{"class":1059},"randomUUID",[1036,1785,1786],{"class":1250},"())",[1036,1788,1282],{"class":1254},[1036,1790,1791,1794,1796,1798,1800],{"class":1038,"line":1308},[1036,1792,1793],{"class":1260},"  title",[1036,1795,1264],{"class":1254},[1036,1797,1669],{"class":1059},[1036,1799,1755],{"class":1250},[1036,1801,1282],{"class":1254},[1036,1803,1804,1807,1809,1811,1813,1816,1819,1821,1823,1826,1828,1830,1833,1835,1838,1840,1842,1844,1846,1848,1850,1853,1856],{"class":1038,"line":1316},[1036,1805,1806],{"class":1260},"  createdAt",[1036,1808,1264],{"class":1254},[1036,1810,1674],{"class":1059},[1036,1812,1251],{"class":1250},[1036,1814,1815],{"class":1254},"{",[1036,1817,1818],{"class":1260}," mode",[1036,1820,1264],{"class":1254},[1036,1822,1341],{"class":1254},[1036,1824,1825],{"class":1046},"timestamp",[1036,1827,1279],{"class":1254},[1036,1829,1682],{"class":1254},[1036,1831,1832],{"class":1250},")",[1036,1834,1758],{"class":1254},[1036,1836,1837],{"class":1059},"notNull",[1036,1839,1755],{"class":1250},[1036,1841,1758],{"class":1254},[1036,1843,1768],{"class":1059},[1036,1845,1251],{"class":1250},[1036,1847,1755],{"class":1254},[1036,1849,1775],{"class":1537},[1036,1851,1852],{"class":1254}," new",[1036,1854,1855],{"class":1059}," Date",[1036,1857,1858],{"class":1250},"())\n",[1036,1860,1861,1863],{"class":1038,"line":1322},[1036,1862,1438],{"class":1254},[1036,1864,1441],{"class":1250},[1036,1866,1867],{"class":1038,"line":1333},[1036,1868,1319],{"emptyLinePlaceholder":21},[1036,1870,1871,1873,1875,1878,1880,1882,1885,1887,1890,1894,1897,1899,1902],{"class":1038,"line":1349},[1036,1872,1241],{"class":1240},[1036,1874,1723],{"class":1537},[1036,1876,1877],{"class":1250}," chatsRelations ",[1036,1879,1541],{"class":1254},[1036,1881,1701],{"class":1059},[1036,1883,1884],{"class":1250},"(chats",[1036,1886,1666],{"class":1254},[1036,1888,1889],{"class":1254}," ({",[1036,1891,1893],{"class":1892},"sHdIc"," many",[1036,1895,1896],{"class":1254}," })",[1036,1898,1775],{"class":1537},[1036,1900,1901],{"class":1250}," (",[1036,1903,1255],{"class":1254},[1036,1905,1906,1909,1911,1913],{"class":1038,"line":1355},[1036,1907,1908],{"class":1260},"  messages",[1036,1910,1264],{"class":1254},[1036,1912,1893],{"class":1059},[1036,1914,1915],{"class":1250},"(messages)\n",[1036,1917,1918,1920],{"class":1038,"line":1360},[1036,1919,1438],{"class":1254},[1036,1921,1922],{"class":1250},"))\n",[1036,1924,1925],{"class":1038,"line":1383},[1036,1926,1319],{"emptyLinePlaceholder":21},[1036,1928,1929,1931,1933,1936,1938,1940,1942,1944,1947,1949,1951],{"class":1038,"line":1388},[1036,1930,1241],{"class":1240},[1036,1932,1723],{"class":1537},[1036,1934,1935],{"class":1250}," messages ",[1036,1937,1541],{"class":1254},[1036,1939,1663],{"class":1059},[1036,1941,1251],{"class":1250},[1036,1943,1279],{"class":1254},[1036,1945,1946],{"class":1046},"messages",[1036,1948,1279],{"class":1254},[1036,1950,1666],{"class":1254},[1036,1952,1330],{"class":1254},[1036,1954,1955,1957,1959,1961,1963,1965,1968,1970,1972,1974,1976,1978,1980,1982,1984,1986,1988,1990,1992,1994,1996],{"class":1038,"line":1398},[1036,1956,1748],{"class":1260},[1036,1958,1264],{"class":1254},[1036,1960,1669],{"class":1059},[1036,1962,1251],{"class":1250},[1036,1964,1279],{"class":1254},[1036,1966,1967],{"class":1046},"id",[1036,1969,1279],{"class":1254},[1036,1971,1832],{"class":1250},[1036,1973,1758],{"class":1254},[1036,1975,1761],{"class":1059},[1036,1977,1755],{"class":1250},[1036,1979,1758],{"class":1254},[1036,1981,1768],{"class":1059},[1036,1983,1251],{"class":1250},[1036,1985,1755],{"class":1254},[1036,1987,1775],{"class":1537},[1036,1989,1778],{"class":1250},[1036,1991,1758],{"class":1254},[1036,1993,1783],{"class":1059},[1036,1995,1786],{"class":1250},[1036,1997,1282],{"class":1254},[1036,1999,2000,2003,2005,2007,2009,2011,2014,2016,2018,2020,2022,2024,2026,2029,2031,2033,2035,2038,2040,2042,2044,2046,2049,2051,2053,2056,2058,2060,2062],{"class":1038,"line":1408},[1036,2001,2002],{"class":1260},"  chatId",[1036,2004,1264],{"class":1254},[1036,2006,1669],{"class":1059},[1036,2008,1251],{"class":1250},[1036,2010,1279],{"class":1254},[1036,2012,2013],{"class":1046},"chat_id",[1036,2015,1279],{"class":1254},[1036,2017,1832],{"class":1250},[1036,2019,1758],{"class":1254},[1036,2021,1837],{"class":1059},[1036,2023,1755],{"class":1250},[1036,2025,1758],{"class":1254},[1036,2027,2028],{"class":1059},"references",[1036,2030,1251],{"class":1250},[1036,2032,1755],{"class":1254},[1036,2034,1775],{"class":1537},[1036,2036,2037],{"class":1250}," chats",[1036,2039,1758],{"class":1254},[1036,2041,1967],{"class":1250},[1036,2043,1666],{"class":1254},[1036,2045,1660],{"class":1254},[1036,2047,2048],{"class":1260}," onDelete",[1036,2050,1264],{"class":1254},[1036,2052,1341],{"class":1254},[1036,2054,2055],{"class":1046},"cascade",[1036,2057,1279],{"class":1254},[1036,2059,1682],{"class":1254},[1036,2061,1832],{"class":1250},[1036,2063,1282],{"class":1254},[1036,2065,2066,2069,2071,2073,2075,2077,2080,2082,2084,2086,2089,2091,2093,2095,2098,2100,2102,2104,2107,2109,2111,2113,2116,2118,2121,2123,2125,2127,2129,2131],{"class":1038,"line":1424},[1036,2067,2068],{"class":1260},"  role",[1036,2070,1264],{"class":1254},[1036,2072,1669],{"class":1059},[1036,2074,1251],{"class":1250},[1036,2076,1279],{"class":1254},[1036,2078,2079],{"class":1046},"role",[1036,2081,1279],{"class":1254},[1036,2083,1666],{"class":1254},[1036,2085,1660],{"class":1254},[1036,2087,2088],{"class":1260}," enum",[1036,2090,1264],{"class":1254},[1036,2092,1368],{"class":1250},[1036,2094,1279],{"class":1254},[1036,2096,2097],{"class":1046},"user",[1036,2099,1279],{"class":1254},[1036,2101,1666],{"class":1254},[1036,2103,1341],{"class":1254},[1036,2105,2106],{"class":1046},"assistant",[1036,2108,1279],{"class":1254},[1036,2110,1666],{"class":1254},[1036,2112,1341],{"class":1254},[1036,2114,2115],{"class":1046},"system",[1036,2117,1279],{"class":1254},[1036,2119,2120],{"class":1250},"] ",[1036,2122,1438],{"class":1254},[1036,2124,1832],{"class":1250},[1036,2126,1758],{"class":1254},[1036,2128,1837],{"class":1059},[1036,2130,1755],{"class":1250},[1036,2132,1282],{"class":1254},[1036,2134,2135,2138,2140,2142,2144,2146,2149,2151,2153,2155,2157,2159,2161,2164,2166,2168,2170],{"class":1038,"line":1430},[1036,2136,2137],{"class":1260},"  parts",[1036,2139,1264],{"class":1254},[1036,2141,1669],{"class":1059},[1036,2143,1251],{"class":1250},[1036,2145,1279],{"class":1254},[1036,2147,2148],{"class":1046},"parts",[1036,2150,1279],{"class":1254},[1036,2152,1666],{"class":1254},[1036,2154,1660],{"class":1254},[1036,2156,1818],{"class":1260},[1036,2158,1264],{"class":1254},[1036,2160,1341],{"class":1254},[1036,2162,2163],{"class":1046},"json",[1036,2165,1279],{"class":1254},[1036,2167,1682],{"class":1254},[1036,2169,1832],{"class":1250},[1036,2171,1282],{"class":1254},[1036,2173,2174,2176,2178,2180,2182,2184,2186,2188,2190,2192,2194,2196,2198,2200,2202,2204,2206,2208,2210,2212,2214,2216,2218,2220],{"class":1038,"line":1435},[1036,2175,1806],{"class":1260},[1036,2177,1264],{"class":1254},[1036,2179,1674],{"class":1059},[1036,2181,1251],{"class":1250},[1036,2183,1815],{"class":1254},[1036,2185,1818],{"class":1260},[1036,2187,1264],{"class":1254},[1036,2189,1341],{"class":1254},[1036,2191,1825],{"class":1046},[1036,2193,1279],{"class":1254},[1036,2195,1682],{"class":1254},[1036,2197,1832],{"class":1250},[1036,2199,1758],{"class":1254},[1036,2201,1837],{"class":1059},[1036,2203,1755],{"class":1250},[1036,2205,1758],{"class":1254},[1036,2207,1768],{"class":1059},[1036,2209,1251],{"class":1250},[1036,2211,1755],{"class":1254},[1036,2213,1775],{"class":1537},[1036,2215,1852],{"class":1254},[1036,2217,1855],{"class":1059},[1036,2219,1786],{"class":1250},[1036,2221,1282],{"class":1254},[1036,2223,2225,2228,2231,2233],{"class":1038,"line":2224},20,[1036,2226,2227],{"class":1254},"},",[1036,2229,2230],{"class":1892}," table",[1036,2232,1775],{"class":1537},[1036,2234,1267],{"class":1250},[1036,2236,2238,2241,2243,2245,2248,2250,2252,2254,2257,2260,2262],{"class":1038,"line":2237},21,[1036,2239,2240],{"class":1059},"  index",[1036,2242,1251],{"class":1250},[1036,2244,1279],{"class":1254},[1036,2246,2247],{"class":1046},"messages_chat_id_idx",[1036,2249,1279],{"class":1254},[1036,2251,1832],{"class":1250},[1036,2253,1758],{"class":1254},[1036,2255,2256],{"class":1059},"on",[1036,2258,2259],{"class":1250},"(table",[1036,2261,1758],{"class":1254},[1036,2263,2264],{"class":1250},"chatId)\n",[1036,2266,2268],{"class":1038,"line":2267},22,[1036,2269,2270],{"class":1250},"])\n",[1036,2272,2274],{"class":1038,"line":2273},23,[1036,2275,1319],{"emptyLinePlaceholder":21},[1036,2277,2279,2281,2283,2286,2288,2290,2293,2295,2297,2300,2302,2304,2306],{"class":1038,"line":2278},24,[1036,2280,1241],{"class":1240},[1036,2282,1723],{"class":1537},[1036,2284,2285],{"class":1250}," messagesRelations ",[1036,2287,1541],{"class":1254},[1036,2289,1701],{"class":1059},[1036,2291,2292],{"class":1250},"(messages",[1036,2294,1666],{"class":1254},[1036,2296,1889],{"class":1254},[1036,2298,2299],{"class":1892}," one",[1036,2301,1896],{"class":1254},[1036,2303,1775],{"class":1537},[1036,2305,1901],{"class":1250},[1036,2307,1255],{"class":1254},[1036,2309,2311,2314,2316,2318,2320,2322],{"class":1038,"line":2310},25,[1036,2312,2313],{"class":1260},"  chat",[1036,2315,1264],{"class":1254},[1036,2317,2299],{"class":1059},[1036,2319,1884],{"class":1250},[1036,2321,1666],{"class":1254},[1036,2323,1330],{"class":1254},[1036,2325,2327,2330,2332,2335,2337,2340],{"class":1038,"line":2326},26,[1036,2328,2329],{"class":1260},"    fields",[1036,2331,1264],{"class":1254},[1036,2333,2334],{"class":1250}," [messages",[1036,2336,1758],{"class":1254},[1036,2338,2339],{"class":1250},"chatId]",[1036,2341,1282],{"class":1254},[1036,2343,2345,2348,2350,2353,2355],{"class":1038,"line":2344},27,[1036,2346,2347],{"class":1260},"    references",[1036,2349,1264],{"class":1254},[1036,2351,2352],{"class":1250}," [chats",[1036,2354,1758],{"class":1254},[1036,2356,2357],{"class":1250},"id]\n",[1036,2359,2361,2364],{"class":1038,"line":2360},28,[1036,2362,2363],{"class":1254},"  }",[1036,2365,1441],{"class":1250},[1036,2367,2369,2371],{"class":1038,"line":2368},29,[1036,2370,1438],{"class":1254},[1036,2372,1922],{"class":1250},[936,2374,2375],{},"Generate the database migrations from your schema:",[1026,2377,2379],{"className":1028,"code":2378,"language":1030,"meta":1031,"style":1031},"npx nuxt db generate\n",[1033,2380,2381],{"__ignoreMap":1031},[1036,2382,2383,2385,2388,2391],{"class":1038,"line":1039},[1036,2384,1043],{"class":1042},[1036,2386,2387],{"class":1046}," nuxt",[1036,2389,2390],{"class":1046}," db",[1036,2392,2393],{"class":1046}," generate\n",[2395,2396,2397],"tip",{},[936,2398,2399,2400,2403],{},"Migrations are automatically applied when you start the development server with ",[1033,2401,2402],{},"npx nuxt dev",". NuxtHub uses SQLite locally, so no external database is required during development.",[940,2405,2407],{"id":2406},"building-the-backend","Building the backend",[936,2409,2410,2411,1758],{},"This section covers integrating AI on the server. The following API endpoints handle chat creation, AI streaming, and data persistence using ",[1011,2412,2415],{"href":2413,"rel":2414},"https://nitro.build",[1015],"Nitro",[1064,2417,2419],{"id":2418},"creating-a-chat","Creating a chat",[936,2421,2422,2423,2430],{},"First, create the endpoint that initializes a new chat and saves the first message to the database. This uses the ",[1011,2424,2427],{"href":2425,"rel":2426},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/ui-message",[1015],[1033,2428,2429],{},"UIMessage"," type from the AI SDK:",[1227,2432,2433],{},[1026,2434,2437],{"className":1231,"code":2435,"filename":2436,"language":1233,"meta":1031,"style":1031},"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",[1033,2438,2439,2463,2486,2510,2530,2534,2558,2595,2619,2632,2636,2641,2692,2696,2701,2730,2746,2761,2775,2781,2785,2793],{"__ignoreMap":1031},[1036,2440,2441,2443,2445,2448,2450,2453,2455,2457,2459,2461],{"class":1038,"line":1039},[1036,2442,1657],{"class":1240},[1036,2444,1660],{"class":1254},[1036,2446,2447],{"class":1250}," defineEventHandler",[1036,2449,1666],{"class":1254},[1036,2451,2452],{"class":1250}," readValidatedBody",[1036,2454,1682],{"class":1254},[1036,2456,1685],{"class":1240},[1036,2458,1341],{"class":1254},[1036,2460,1064],{"class":1046},[1036,2462,1305],{"class":1254},[1036,2464,2465,2467,2470,2472,2475,2477,2479,2481,2484],{"class":1038,"line":1056},[1036,2466,1657],{"class":1240},[1036,2468,2469],{"class":1240}," type",[1036,2471,1660],{"class":1254},[1036,2473,2474],{"class":1250}," UIMessage",[1036,2476,1682],{"class":1254},[1036,2478,1685],{"class":1240},[1036,2480,1341],{"class":1254},[1036,2482,2483],{"class":1046},"ai",[1036,2485,1305],{"class":1254},[1036,2487,2488,2490,2492,2494,2496,2499,2501,2503,2505,2508],{"class":1038,"line":1270},[1036,2489,1657],{"class":1240},[1036,2491,1660],{"class":1254},[1036,2493,2390],{"class":1250},[1036,2495,1666],{"class":1254},[1036,2497,2498],{"class":1250}," schema",[1036,2500,1682],{"class":1254},[1036,2502,1685],{"class":1240},[1036,2504,1341],{"class":1254},[1036,2506,2507],{"class":1046},"hub:db",[1036,2509,1305],{"class":1254},[1036,2511,2512,2514,2516,2519,2521,2523,2525,2528],{"class":1038,"line":1285},[1036,2513,1657],{"class":1240},[1036,2515,1660],{"class":1254},[1036,2517,2518],{"class":1250}," z",[1036,2520,1682],{"class":1254},[1036,2522,1685],{"class":1240},[1036,2524,1341],{"class":1254},[1036,2526,2527],{"class":1046},"zod",[1036,2529,1305],{"class":1254},[1036,2531,2532],{"class":1038,"line":1297},[1036,2533,1319],{"emptyLinePlaceholder":21},[1036,2535,2536,2538,2540,2542,2544,2547,2549,2552,2554,2556],{"class":1038,"line":1308},[1036,2537,1241],{"class":1240},[1036,2539,1244],{"class":1240},[1036,2541,2447],{"class":1059},[1036,2543,1251],{"class":1250},[1036,2545,2546],{"class":1537},"async",[1036,2548,1901],{"class":1254},[1036,2550,2551],{"class":1892},"event",[1036,2553,1832],{"class":1254},[1036,2555,1775],{"class":1537},[1036,2557,1330],{"class":1254},[1036,2559,2560,2563,2565,2568,2570,2573,2576,2578,2580,2582,2584,2586,2588,2591,2593],{"class":1038,"line":1316},[1036,2561,2562],{"class":1537},"  const",[1036,2564,1660],{"class":1254},[1036,2566,2567],{"class":1250}," message",[1036,2569,1682],{"class":1254},[1036,2571,2572],{"class":1254}," =",[1036,2574,2575],{"class":1240}," await",[1036,2577,2452],{"class":1059},[1036,2579,1251],{"class":1260},[1036,2581,2551],{"class":1250},[1036,2583,1666],{"class":1254},[1036,2585,2518],{"class":1250},[1036,2587,1758],{"class":1254},[1036,2589,2590],{"class":1059},"object",[1036,2592,1251],{"class":1260},[1036,2594,1255],{"class":1254},[1036,2596,2597,2600,2602,2604,2606,2609,2611,2613,2616],{"class":1038,"line":1322},[1036,2598,2599],{"class":1260},"    message",[1036,2601,1264],{"class":1254},[1036,2603,2518],{"class":1250},[1036,2605,1758],{"class":1254},[1036,2607,2608],{"class":1059},"custom",[1036,2610,1509],{"class":1254},[1036,2612,2429],{"class":1042},[1036,2614,2615],{"class":1254},">",[1036,2617,2618],{"class":1260},"()\n",[1036,2620,2621,2623,2625,2627,2630],{"class":1038,"line":1333},[1036,2622,2363],{"class":1254},[1036,2624,1832],{"class":1260},[1036,2626,1758],{"class":1254},[1036,2628,2629],{"class":1250},"parse",[1036,2631,1441],{"class":1260},[1036,2633,2634],{"class":1038,"line":1349},[1036,2635,1319],{"emptyLinePlaceholder":21},[1036,2637,2638],{"class":1038,"line":1355},[1036,2639,2640],{"class":1420},"  // Create a new chat\n",[1036,2642,2643,2645,2647,2649,2651,2653,2655,2657,2659,2662,2664,2667,2669,2671,2673,2675,2678,2680,2683,2685,2687,2690],{"class":1038,"line":1360},[1036,2644,2562],{"class":1537},[1036,2646,1368],{"class":1254},[1036,2648,256],{"class":1250},[1036,2650,1378],{"class":1254},[1036,2652,2572],{"class":1254},[1036,2654,2575],{"class":1240},[1036,2656,2390],{"class":1250},[1036,2658,1758],{"class":1254},[1036,2660,2661],{"class":1059},"insert",[1036,2663,1251],{"class":1260},[1036,2665,2666],{"class":1250},"schema",[1036,2668,1758],{"class":1254},[1036,2670,1737],{"class":1250},[1036,2672,1832],{"class":1260},[1036,2674,1758],{"class":1254},[1036,2676,2677],{"class":1059},"values",[1036,2679,1251],{"class":1260},[1036,2681,2682],{"class":1254},"{}",[1036,2684,1832],{"class":1260},[1036,2686,1758],{"class":1254},[1036,2688,2689],{"class":1059},"returning",[1036,2691,2618],{"class":1260},[1036,2693,2694],{"class":1038,"line":1383},[1036,2695,1319],{"emptyLinePlaceholder":21},[1036,2697,2698],{"class":1038,"line":1388},[1036,2699,2700],{"class":1420},"  // Save the first user message\n",[1036,2702,2703,2706,2708,2710,2712,2714,2716,2718,2720,2722,2724,2726,2728],{"class":1038,"line":1398},[1036,2704,2705],{"class":1240},"  await",[1036,2707,2390],{"class":1250},[1036,2709,1758],{"class":1254},[1036,2711,2661],{"class":1059},[1036,2713,1251],{"class":1260},[1036,2715,2666],{"class":1250},[1036,2717,1758],{"class":1254},[1036,2719,1946],{"class":1250},[1036,2721,1832],{"class":1260},[1036,2723,1758],{"class":1254},[1036,2725,2677],{"class":1059},[1036,2727,1251],{"class":1260},[1036,2729,1255],{"class":1254},[1036,2731,2732,2735,2737,2740,2742,2744],{"class":1038,"line":1408},[1036,2733,2734],{"class":1260},"    chatId",[1036,2736,1264],{"class":1254},[1036,2738,2739],{"class":1250}," chat",[1036,2741,1758],{"class":1254},[1036,2743,1967],{"class":1250},[1036,2745,1282],{"class":1254},[1036,2747,2748,2751,2753,2755,2757,2759],{"class":1038,"line":1424},[1036,2749,2750],{"class":1260},"    role",[1036,2752,1264],{"class":1254},[1036,2754,1341],{"class":1254},[1036,2756,2097],{"class":1046},[1036,2758,1279],{"class":1254},[1036,2760,1282],{"class":1254},[1036,2762,2763,2766,2768,2770,2772],{"class":1038,"line":1430},[1036,2764,2765],{"class":1260},"    parts",[1036,2767,1264],{"class":1254},[1036,2769,2567],{"class":1250},[1036,2771,1758],{"class":1254},[1036,2773,2774],{"class":1250},"parts\n",[1036,2776,2777,2779],{"class":1038,"line":1435},[1036,2778,2363],{"class":1254},[1036,2780,1441],{"class":1260},[1036,2782,2783],{"class":1038,"line":2224},[1036,2784,1319],{"emptyLinePlaceholder":21},[1036,2786,2787,2790],{"class":1038,"line":2237},[1036,2788,2789],{"class":1240},"  return",[1036,2791,2792],{"class":1250}," chat\n",[1036,2794,2795,2797],{"class":1038,"line":2267},[1036,2796,1438],{"class":1254},[1036,2798,1441],{"class":1250},[1064,2800,2802],{"id":2801},"streaming-ai-responses","Streaming AI responses",[936,2804,2805,2806,2813,2814,2821,2822,2829],{},"Next, create the endpoint that handles the AI conversation. This endpoint uses ",[1011,2807,2810],{"href":2808,"rel":2809},"https://ai-sdk.dev/docs/reference/ai-sdk-core/stream-text",[1015],[1033,2811,2812],{},"streamText",", ",[1011,2815,2818],{"href":2816,"rel":2817},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/create-ui-message-stream",[1015],[1033,2819,2820],{},"createUIMessageStream",", and ",[1011,2823,2826],{"href":2824,"rel":2825},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/create-ui-message-stream-response",[1015],[1033,2827,2828],{},"createUIMessageStreamResponse"," from the AI SDK:",[1227,2831,2832],{},[1645,2833,2834],{},[1026,2835,2838],{"className":1231,"code":2836,"filename":2837,"language":1233,"meta":1031,"style":1031},"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",[1033,2839,2840,2872,2891,2913,2931,2937,2944,2951,2958,2965,2970,2982,3002,3006,3028,3061,3077,3089,3093,3131,3164,3195,3207,3211,3216,3246,3289,3295,3299,3316,3355,3361,3366,3372,3392,3420,3436,3455,3483,3491,3496,3562,3567,3572,3578,3608,3650,3679,3691,3707,3721,3728,3733,3738,3744,3761,3783,3801,3809,3826,3845,3853,3858,3864,3884,3899,3916,3940,3951,3959,3965,3970,3993,3999,4019,4025,4071,4087,4120,4134,4142,4147,4154,4159,4177],{"__ignoreMap":1031},[1036,2841,2842,2844,2846,2849,2851,2853,2855,2858,2860,2862,2864,2866,2868,2870],{"class":1038,"line":1039},[1036,2843,1657],{"class":1240},[1036,2845,1660],{"class":1254},[1036,2847,2848],{"class":1250}," createError",[1036,2850,1666],{"class":1254},[1036,2852,2447],{"class":1250},[1036,2854,1666],{"class":1254},[1036,2856,2857],{"class":1250}," getValidatedRouterParams",[1036,2859,1666],{"class":1254},[1036,2861,2452],{"class":1250},[1036,2863,1682],{"class":1254},[1036,2865,1685],{"class":1240},[1036,2867,1341],{"class":1254},[1036,2869,1064],{"class":1046},[1036,2871,1305],{"class":1254},[1036,2873,2874,2876,2878,2881,2883,2885,2887,2889],{"class":1038,"line":1056},[1036,2875,1657],{"class":1240},[1036,2877,1660],{"class":1254},[1036,2879,2880],{"class":1250}," eq",[1036,2882,1682],{"class":1254},[1036,2884,1685],{"class":1240},[1036,2886,1341],{"class":1254},[1036,2888,1710],{"class":1046},[1036,2890,1305],{"class":1254},[1036,2892,2893,2895,2897,2899,2901,2903,2905,2907,2909,2911],{"class":1038,"line":1270},[1036,2894,1657],{"class":1240},[1036,2896,1660],{"class":1254},[1036,2898,2390],{"class":1250},[1036,2900,1666],{"class":1254},[1036,2902,2498],{"class":1250},[1036,2904,1682],{"class":1254},[1036,2906,1685],{"class":1240},[1036,2908,1341],{"class":1254},[1036,2910,2507],{"class":1046},[1036,2912,1305],{"class":1254},[1036,2914,2915,2917,2919,2921,2923,2925,2927,2929],{"class":1038,"line":1285},[1036,2916,1657],{"class":1240},[1036,2918,1660],{"class":1254},[1036,2920,2518],{"class":1250},[1036,2922,1682],{"class":1254},[1036,2924,1685],{"class":1240},[1036,2926,1341],{"class":1254},[1036,2928,2527],{"class":1046},[1036,2930,1305],{"class":1254},[1036,2932,2933,2935],{"class":1038,"line":1297},[1036,2934,1657],{"class":1240},[1036,2936,1330],{"class":1254},[1036,2938,2939,2942],{"class":1038,"line":1308},[1036,2940,2941],{"class":1250},"  convertToModelMessages",[1036,2943,1282],{"class":1254},[1036,2945,2946,2949],{"class":1038,"line":1316},[1036,2947,2948],{"class":1250},"  createUIMessageStream",[1036,2950,1282],{"class":1254},[1036,2952,2953,2956],{"class":1038,"line":1322},[1036,2954,2955],{"class":1250},"  createUIMessageStreamResponse",[1036,2957,1282],{"class":1254},[1036,2959,2960,2963],{"class":1038,"line":1333},[1036,2961,2962],{"class":1250},"  generateText",[1036,2964,1282],{"class":1254},[1036,2966,2967],{"class":1038,"line":1349},[1036,2968,2969],{"class":1250},"  streamText\n",[1036,2971,2972,2974,2976,2978,2980],{"class":1038,"line":1355},[1036,2973,1438],{"class":1254},[1036,2975,1685],{"class":1240},[1036,2977,1341],{"class":1254},[1036,2979,2483],{"class":1046},[1036,2981,1305],{"class":1254},[1036,2983,2984,2986,2988,2990,2992,2994,2996,2998,3000],{"class":1038,"line":1360},[1036,2985,1657],{"class":1240},[1036,2987,2469],{"class":1240},[1036,2989,1660],{"class":1254},[1036,2991,2474],{"class":1250},[1036,2993,1682],{"class":1254},[1036,2995,1685],{"class":1240},[1036,2997,1341],{"class":1254},[1036,2999,2483],{"class":1046},[1036,3001,1305],{"class":1254},[1036,3003,3004],{"class":1038,"line":1383},[1036,3005,1319],{"emptyLinePlaceholder":21},[1036,3007,3008,3010,3012,3014,3016,3018,3020,3022,3024,3026],{"class":1038,"line":1388},[1036,3009,1241],{"class":1240},[1036,3011,1244],{"class":1240},[1036,3013,2447],{"class":1059},[1036,3015,1251],{"class":1250},[1036,3017,2546],{"class":1537},[1036,3019,1901],{"class":1254},[1036,3021,2551],{"class":1892},[1036,3023,1832],{"class":1254},[1036,3025,1775],{"class":1537},[1036,3027,1330],{"class":1254},[1036,3029,3030,3032,3034,3037,3039,3041,3043,3045,3047,3049,3051,3053,3055,3057,3059],{"class":1038,"line":1398},[1036,3031,2562],{"class":1537},[1036,3033,1660],{"class":1254},[1036,3035,3036],{"class":1250}," id",[1036,3038,1682],{"class":1254},[1036,3040,2572],{"class":1254},[1036,3042,2575],{"class":1240},[1036,3044,2857],{"class":1059},[1036,3046,1251],{"class":1260},[1036,3048,2551],{"class":1250},[1036,3050,1666],{"class":1254},[1036,3052,2518],{"class":1250},[1036,3054,1758],{"class":1254},[1036,3056,2590],{"class":1059},[1036,3058,1251],{"class":1260},[1036,3060,1255],{"class":1254},[1036,3062,3063,3066,3068,3070,3072,3075],{"class":1038,"line":1408},[1036,3064,3065],{"class":1260},"    id",[1036,3067,1264],{"class":1254},[1036,3069,2518],{"class":1250},[1036,3071,1758],{"class":1254},[1036,3073,3074],{"class":1059},"string",[1036,3076,2618],{"class":1260},[1036,3078,3079,3081,3083,3085,3087],{"class":1038,"line":1424},[1036,3080,2363],{"class":1254},[1036,3082,1832],{"class":1260},[1036,3084,1758],{"class":1254},[1036,3086,2629],{"class":1250},[1036,3088,1441],{"class":1260},[1036,3090,3091],{"class":1038,"line":1430},[1036,3092,1319],{"emptyLinePlaceholder":21},[1036,3094,3095,3097,3099,3102,3104,3107,3109,3111,3113,3115,3117,3119,3121,3123,3125,3127,3129],{"class":1038,"line":1435},[1036,3096,2562],{"class":1537},[1036,3098,1660],{"class":1254},[1036,3100,3101],{"class":1250}," model",[1036,3103,1666],{"class":1254},[1036,3105,3106],{"class":1250}," messages",[1036,3108,1682],{"class":1254},[1036,3110,2572],{"class":1254},[1036,3112,2575],{"class":1240},[1036,3114,2452],{"class":1059},[1036,3116,1251],{"class":1260},[1036,3118,2551],{"class":1250},[1036,3120,1666],{"class":1254},[1036,3122,2518],{"class":1250},[1036,3124,1758],{"class":1254},[1036,3126,2590],{"class":1059},[1036,3128,1251],{"class":1260},[1036,3130,1255],{"class":1254},[1036,3132,3133,3136,3138,3140,3142,3144,3146,3148,3151,3153,3155,3158,3160,3162],{"class":1038,"line":2224},[1036,3134,3135],{"class":1260},"    model",[1036,3137,1264],{"class":1254},[1036,3139,2518],{"class":1250},[1036,3141,1758],{"class":1254},[1036,3143,3074],{"class":1059},[1036,3145,1755],{"class":1260},[1036,3147,1758],{"class":1254},[1036,3149,3150],{"class":1059},"default",[1036,3152,1251],{"class":1260},[1036,3154,1279],{"class":1254},[1036,3156,3157],{"class":1046},"openai/gpt-4o-mini",[1036,3159,1279],{"class":1254},[1036,3161,1832],{"class":1260},[1036,3163,1282],{"class":1254},[1036,3165,3166,3169,3171,3173,3175,3178,3180,3183,3185,3187,3189,3191,3193],{"class":1038,"line":2237},[1036,3167,3168],{"class":1260},"    messages",[1036,3170,1264],{"class":1254},[1036,3172,2518],{"class":1250},[1036,3174,1758],{"class":1254},[1036,3176,3177],{"class":1059},"array",[1036,3179,1251],{"class":1260},[1036,3181,3182],{"class":1250},"z",[1036,3184,1758],{"class":1254},[1036,3186,2608],{"class":1059},[1036,3188,1509],{"class":1254},[1036,3190,2429],{"class":1042},[1036,3192,2615],{"class":1254},[1036,3194,1858],{"class":1260},[1036,3196,3197,3199,3201,3203,3205],{"class":1038,"line":2267},[1036,3198,2363],{"class":1254},[1036,3200,1832],{"class":1260},[1036,3202,1758],{"class":1254},[1036,3204,2629],{"class":1250},[1036,3206,1441],{"class":1260},[1036,3208,3209],{"class":1038,"line":2273},[1036,3210,1319],{"emptyLinePlaceholder":21},[1036,3212,3213],{"class":1038,"line":2278},[1036,3214,3215],{"class":1420},"  // Fetch the chat from the database\n",[1036,3217,3218,3220,3222,3224,3226,3228,3230,3233,3235,3237,3239,3242,3244],{"class":1038,"line":2310},[1036,3219,2562],{"class":1537},[1036,3221,2739],{"class":1250},[1036,3223,2572],{"class":1254},[1036,3225,2575],{"class":1240},[1036,3227,2390],{"class":1250},[1036,3229,1758],{"class":1254},[1036,3231,3232],{"class":1250},"query",[1036,3234,1758],{"class":1254},[1036,3236,1737],{"class":1250},[1036,3238,1758],{"class":1254},[1036,3240,3241],{"class":1059},"findFirst",[1036,3243,1251],{"class":1260},[1036,3245,1255],{"class":1254},[1036,3247,3248,3251,3253,3255,3257,3259,3261,3263,3265,3267,3269,3271,3273,3275,3277,3279,3281,3284,3287],{"class":1038,"line":2326},[1036,3249,3250],{"class":1059},"    where",[1036,3252,1264],{"class":1254},[1036,3254,1901],{"class":1254},[1036,3256,256],{"class":1892},[1036,3258,1666],{"class":1254},[1036,3260,1660],{"class":1254},[1036,3262,2880],{"class":1892},[1036,3264,1896],{"class":1254},[1036,3266,1775],{"class":1537},[1036,3268,2880],{"class":1059},[1036,3270,1251],{"class":1260},[1036,3272,256],{"class":1250},[1036,3274,1758],{"class":1254},[1036,3276,1967],{"class":1250},[1036,3278,1666],{"class":1254},[1036,3280,3036],{"class":1250},[1036,3282,3283],{"class":1240}," as",[1036,3285,3286],{"class":1042}," string",[1036,3288,1441],{"class":1260},[1036,3290,3291,3293],{"class":1038,"line":2344},[1036,3292,2363],{"class":1254},[1036,3294,1441],{"class":1260},[1036,3296,3297],{"class":1038,"line":2360},[1036,3298,1319],{"emptyLinePlaceholder":21},[1036,3300,3301,3304,3306,3309,3311,3314],{"class":1038,"line":2368},[1036,3302,3303],{"class":1240},"  if",[1036,3305,1901],{"class":1260},[1036,3307,3308],{"class":1254},"!",[1036,3310,256],{"class":1250},[1036,3312,3313],{"class":1260},") ",[1036,3315,1255],{"class":1254},[1036,3317,3319,3322,3324,3326,3328,3331,3333,3337,3339,3342,3344,3346,3349,3351,3353],{"class":1038,"line":3318},30,[1036,3320,3321],{"class":1240},"    throw",[1036,3323,2848],{"class":1059},[1036,3325,1251],{"class":1260},[1036,3327,1815],{"class":1254},[1036,3329,3330],{"class":1260}," statusCode",[1036,3332,1264],{"class":1254},[1036,3334,3336],{"class":3335},"sbssI"," 404",[1036,3338,1666],{"class":1254},[1036,3340,3341],{"class":1260}," statusMessage",[1036,3343,1264],{"class":1254},[1036,3345,1341],{"class":1254},[1036,3347,3348],{"class":1046},"Chat not found",[1036,3350,1279],{"class":1254},[1036,3352,1682],{"class":1254},[1036,3354,1441],{"class":1260},[1036,3356,3358],{"class":1038,"line":3357},31,[1036,3359,3360],{"class":1254},"  }\n",[1036,3362,3364],{"class":1038,"line":3363},32,[1036,3365,1319],{"emptyLinePlaceholder":21},[1036,3367,3369],{"class":1038,"line":3368},33,[1036,3370,3371],{"class":1420},"  // Generate a title for the chat if it doesn't have one\n",[1036,3373,3375,3377,3379,3381,3383,3385,3388,3390],{"class":1038,"line":3374},34,[1036,3376,3303],{"class":1240},[1036,3378,1901],{"class":1260},[1036,3380,3308],{"class":1254},[1036,3382,256],{"class":1250},[1036,3384,1758],{"class":1254},[1036,3386,3387],{"class":1250},"title",[1036,3389,3313],{"class":1260},[1036,3391,1255],{"class":1254},[1036,3393,3395,3398,3400,3402,3404,3407,3409,3411,3413,3416,3418],{"class":1038,"line":3394},35,[1036,3396,3397],{"class":1537},"    const",[1036,3399,1660],{"class":1254},[1036,3401,1669],{"class":1260},[1036,3403,1264],{"class":1254},[1036,3405,3406],{"class":1250}," title",[1036,3408,1682],{"class":1254},[1036,3410,2572],{"class":1254},[1036,3412,2575],{"class":1240},[1036,3414,3415],{"class":1059}," generateText",[1036,3417,1251],{"class":1260},[1036,3419,1255],{"class":1254},[1036,3421,3423,3426,3428,3430,3432,3434],{"class":1038,"line":3422},36,[1036,3424,3425],{"class":1260},"      model",[1036,3427,1264],{"class":1254},[1036,3429,1341],{"class":1254},[1036,3431,3157],{"class":1046},[1036,3433,1279],{"class":1254},[1036,3435,1282],{"class":1254},[1036,3437,3439,3442,3444,3447,3450,3453],{"class":1038,"line":3438},37,[1036,3440,3441],{"class":1260},"      system",[1036,3443,1264],{"class":1254},[1036,3445,3446],{"class":1254}," `",[1036,3448,3449],{"class":1046},"Generate a short title (max 30 characters) based on the user's message. No quotes or punctuation.",[1036,3451,3452],{"class":1254},"`",[1036,3454,1282],{"class":1254},[1036,3456,3458,3461,3463,3466,3468,3471,3473,3475,3478,3481],{"class":1038,"line":3457},38,[1036,3459,3460],{"class":1260},"      prompt",[1036,3462,1264],{"class":1254},[1036,3464,3465],{"class":1250}," JSON",[1036,3467,1758],{"class":1254},[1036,3469,3470],{"class":1059},"stringify",[1036,3472,1251],{"class":1260},[1036,3474,1946],{"class":1250},[1036,3476,3477],{"class":1260},"[",[1036,3479,3480],{"class":3335},"0",[1036,3482,2270],{"class":1260},[1036,3484,3486,3489],{"class":1038,"line":3485},39,[1036,3487,3488],{"class":1254},"    }",[1036,3490,1441],{"class":1260},[1036,3492,3494],{"class":1038,"line":3493},40,[1036,3495,1319],{"emptyLinePlaceholder":21},[1036,3497,3499,3502,3504,3506,3509,3511,3513,3515,3517,3519,3521,3524,3526,3528,3530,3532,3534,3536,3539,3541,3544,3546,3548,3550,3552,3554,3556,3558,3560],{"class":1038,"line":3498},41,[1036,3500,3501],{"class":1240},"    await",[1036,3503,2390],{"class":1250},[1036,3505,1758],{"class":1254},[1036,3507,3508],{"class":1059},"update",[1036,3510,1251],{"class":1260},[1036,3512,2666],{"class":1250},[1036,3514,1758],{"class":1254},[1036,3516,1737],{"class":1250},[1036,3518,1832],{"class":1260},[1036,3520,1758],{"class":1254},[1036,3522,3523],{"class":1059},"set",[1036,3525,1251],{"class":1260},[1036,3527,1815],{"class":1254},[1036,3529,3406],{"class":1250},[1036,3531,1682],{"class":1254},[1036,3533,1832],{"class":1260},[1036,3535,1758],{"class":1254},[1036,3537,3538],{"class":1059},"where",[1036,3540,1251],{"class":1260},[1036,3542,3543],{"class":1059},"eq",[1036,3545,1251],{"class":1260},[1036,3547,2666],{"class":1250},[1036,3549,1758],{"class":1254},[1036,3551,1737],{"class":1250},[1036,3553,1758],{"class":1254},[1036,3555,1967],{"class":1250},[1036,3557,1666],{"class":1254},[1036,3559,3036],{"class":1250},[1036,3561,1922],{"class":1260},[1036,3563,3565],{"class":1038,"line":3564},42,[1036,3566,3360],{"class":1254},[1036,3568,3570],{"class":1038,"line":3569},43,[1036,3571,1319],{"emptyLinePlaceholder":21},[1036,3573,3575],{"class":1038,"line":3574},44,[1036,3576,3577],{"class":1420},"  // Save the user message if it's a follow-up\n",[1036,3579,3581,3583,3586,3588,3590,3592,3594,3596,3599,3602,3605],{"class":1038,"line":3580},45,[1036,3582,2562],{"class":1537},[1036,3584,3585],{"class":1250}," lastMessage",[1036,3587,2572],{"class":1254},[1036,3589,3106],{"class":1250},[1036,3591,3477],{"class":1260},[1036,3593,1946],{"class":1250},[1036,3595,1758],{"class":1254},[1036,3597,3598],{"class":1250},"length",[1036,3600,3601],{"class":1254}," -",[1036,3603,3604],{"class":3335}," 1",[1036,3606,3607],{"class":1260},"]\n",[1036,3609,3611,3613,3615,3618,3621,3623,3626,3628,3630,3632,3635,3637,3639,3641,3644,3646,3648],{"class":1038,"line":3610},46,[1036,3612,3303],{"class":1240},[1036,3614,1901],{"class":1260},[1036,3616,3617],{"class":1250},"lastMessage",[1036,3619,3620],{"class":1254},"?.",[1036,3622,2079],{"class":1250},[1036,3624,3625],{"class":1254}," ===",[1036,3627,1341],{"class":1254},[1036,3629,2097],{"class":1046},[1036,3631,1279],{"class":1254},[1036,3633,3634],{"class":1254}," &&",[1036,3636,3106],{"class":1250},[1036,3638,1758],{"class":1254},[1036,3640,3598],{"class":1250},[1036,3642,3643],{"class":1254}," >",[1036,3645,3604],{"class":3335},[1036,3647,3313],{"class":1260},[1036,3649,1255],{"class":1254},[1036,3651,3653,3655,3657,3659,3661,3663,3665,3667,3669,3671,3673,3675,3677],{"class":1038,"line":3652},47,[1036,3654,3501],{"class":1240},[1036,3656,2390],{"class":1250},[1036,3658,1758],{"class":1254},[1036,3660,2661],{"class":1059},[1036,3662,1251],{"class":1260},[1036,3664,2666],{"class":1250},[1036,3666,1758],{"class":1254},[1036,3668,1946],{"class":1250},[1036,3670,1832],{"class":1260},[1036,3672,1758],{"class":1254},[1036,3674,2677],{"class":1059},[1036,3676,1251],{"class":1260},[1036,3678,1255],{"class":1254},[1036,3680,3682,3685,3687,3689],{"class":1038,"line":3681},48,[1036,3683,3684],{"class":1260},"      chatId",[1036,3686,1264],{"class":1254},[1036,3688,3036],{"class":1250},[1036,3690,1282],{"class":1254},[1036,3692,3694,3697,3699,3701,3703,3705],{"class":1038,"line":3693},49,[1036,3695,3696],{"class":1260},"      role",[1036,3698,1264],{"class":1254},[1036,3700,1341],{"class":1254},[1036,3702,2097],{"class":1046},[1036,3704,1279],{"class":1254},[1036,3706,1282],{"class":1254},[1036,3708,3710,3713,3715,3717,3719],{"class":1038,"line":3709},50,[1036,3711,3712],{"class":1260},"      parts",[1036,3714,1264],{"class":1254},[1036,3716,3585],{"class":1250},[1036,3718,1758],{"class":1254},[1036,3720,2774],{"class":1250},[1036,3722,3724,3726],{"class":1038,"line":3723},51,[1036,3725,3488],{"class":1254},[1036,3727,1441],{"class":1260},[1036,3729,3731],{"class":1038,"line":3730},52,[1036,3732,3360],{"class":1254},[1036,3734,3736],{"class":1038,"line":3735},53,[1036,3737,1319],{"emptyLinePlaceholder":21},[1036,3739,3741],{"class":1038,"line":3740},54,[1036,3742,3743],{"class":1420},"  // Create the streaming response\n",[1036,3745,3747,3749,3752,3754,3757,3759],{"class":1038,"line":3746},55,[1036,3748,2562],{"class":1537},[1036,3750,3751],{"class":1250}," stream",[1036,3753,2572],{"class":1254},[1036,3755,3756],{"class":1059}," createUIMessageStream",[1036,3758,1251],{"class":1260},[1036,3760,1255],{"class":1254},[1036,3762,3764,3767,3769,3772,3774,3777,3779,3781],{"class":1038,"line":3763},56,[1036,3765,3766],{"class":1059},"    execute",[1036,3768,1264],{"class":1254},[1036,3770,3771],{"class":1537}," async",[1036,3773,1889],{"class":1254},[1036,3775,3776],{"class":1892}," writer",[1036,3778,1896],{"class":1254},[1036,3780,1775],{"class":1537},[1036,3782,1330],{"class":1254},[1036,3784,3786,3789,3792,3794,3797,3799],{"class":1038,"line":3785},57,[1036,3787,3788],{"class":1537},"      const",[1036,3790,3791],{"class":1250}," result",[1036,3793,2572],{"class":1254},[1036,3795,3796],{"class":1059}," streamText",[1036,3798,1251],{"class":1260},[1036,3800,1255],{"class":1254},[1036,3802,3804,3807],{"class":1038,"line":3803},58,[1036,3805,3806],{"class":1250},"        model",[1036,3808,1282],{"class":1254},[1036,3810,3812,3815,3817,3819,3822,3824],{"class":1038,"line":3811},59,[1036,3813,3814],{"class":1260},"        system",[1036,3816,1264],{"class":1254},[1036,3818,3446],{"class":1254},[1036,3820,3821],{"class":1046},"You are a helpful AI assistant. Be concise and friendly.",[1036,3823,3452],{"class":1254},[1036,3825,1282],{"class":1254},[1036,3827,3829,3832,3834,3836,3839,3841,3843],{"class":1038,"line":3828},60,[1036,3830,3831],{"class":1260},"        messages",[1036,3833,1264],{"class":1254},[1036,3835,2575],{"class":1240},[1036,3837,3838],{"class":1059}," convertToModelMessages",[1036,3840,1251],{"class":1260},[1036,3842,1946],{"class":1250},[1036,3844,1441],{"class":1260},[1036,3846,3848,3851],{"class":1038,"line":3847},61,[1036,3849,3850],{"class":1254},"      }",[1036,3852,1441],{"class":1260},[1036,3854,3856],{"class":1038,"line":3855},62,[1036,3857,1319],{"emptyLinePlaceholder":21},[1036,3859,3861],{"class":1038,"line":3860},63,[1036,3862,3863],{"class":1420},"      // Notify the client that a title was generated\n",[1036,3865,3867,3870,3872,3874,3876,3878,3880,3882],{"class":1038,"line":3866},64,[1036,3868,3869],{"class":1240},"      if",[1036,3871,1901],{"class":1260},[1036,3873,3308],{"class":1254},[1036,3875,256],{"class":1250},[1036,3877,1758],{"class":1254},[1036,3879,3387],{"class":1250},[1036,3881,3313],{"class":1260},[1036,3883,1255],{"class":1254},[1036,3885,3887,3890,3892,3895,3897],{"class":1038,"line":3886},65,[1036,3888,3889],{"class":1250},"        writer",[1036,3891,1758],{"class":1254},[1036,3893,3894],{"class":1059},"write",[1036,3896,1251],{"class":1260},[1036,3898,1255],{"class":1254},[1036,3900,3902,3905,3907,3909,3912,3914],{"class":1038,"line":3901},66,[1036,3903,3904],{"class":1260},"          type",[1036,3906,1264],{"class":1254},[1036,3908,1341],{"class":1254},[1036,3910,3911],{"class":1046},"data-chat-title",[1036,3913,1279],{"class":1254},[1036,3915,1282],{"class":1254},[1036,3917,3919,3922,3924,3926,3928,3930,3932,3935,3937],{"class":1038,"line":3918},67,[1036,3920,3921],{"class":1260},"          data",[1036,3923,1264],{"class":1254},[1036,3925,1660],{"class":1254},[1036,3927,2567],{"class":1260},[1036,3929,1264],{"class":1254},[1036,3931,1341],{"class":1254},[1036,3933,3934],{"class":1046},"Title generated",[1036,3936,1279],{"class":1254},[1036,3938,3939],{"class":1254}," },\n",[1036,3941,3943,3946,3948],{"class":1038,"line":3942},68,[1036,3944,3945],{"class":1260},"          transient",[1036,3947,1264],{"class":1254},[1036,3949,3950],{"class":1416}," true\n",[1036,3952,3954,3957],{"class":1038,"line":3953},69,[1036,3955,3956],{"class":1254},"        }",[1036,3958,1441],{"class":1260},[1036,3960,3962],{"class":1038,"line":3961},70,[1036,3963,3964],{"class":1254},"      }\n",[1036,3966,3968],{"class":1038,"line":3967},71,[1036,3969,1319],{"emptyLinePlaceholder":21},[1036,3971,3973,3976,3978,3981,3983,3986,3988,3991],{"class":1038,"line":3972},72,[1036,3974,3975],{"class":1250},"      writer",[1036,3977,1758],{"class":1254},[1036,3979,3980],{"class":1059},"merge",[1036,3982,1251],{"class":1260},[1036,3984,3985],{"class":1250},"result",[1036,3987,1758],{"class":1254},[1036,3989,3990],{"class":1059},"toUIMessageStream",[1036,3992,1858],{"class":1260},[1036,3994,3996],{"class":1038,"line":3995},73,[1036,3997,3998],{"class":1254},"    },\n",[1036,4000,4002,4005,4007,4009,4011,4013,4015,4017],{"class":1038,"line":4001},74,[1036,4003,4004],{"class":1059},"    onFinish",[1036,4006,1264],{"class":1254},[1036,4008,3771],{"class":1537},[1036,4010,1889],{"class":1254},[1036,4012,3106],{"class":1892},[1036,4014,1896],{"class":1254},[1036,4016,1775],{"class":1537},[1036,4018,1330],{"class":1254},[1036,4020,4022],{"class":1038,"line":4021},75,[1036,4023,4024],{"class":1420},"      // Save the assistant's response to the database\n",[1036,4026,4028,4031,4033,4035,4037,4039,4041,4043,4045,4047,4049,4051,4053,4055,4057,4060,4062,4065,4067,4069],{"class":1038,"line":4027},76,[1036,4029,4030],{"class":1240},"      await",[1036,4032,2390],{"class":1250},[1036,4034,1758],{"class":1254},[1036,4036,2661],{"class":1059},[1036,4038,1251],{"class":1260},[1036,4040,2666],{"class":1250},[1036,4042,1758],{"class":1254},[1036,4044,1946],{"class":1250},[1036,4046,1832],{"class":1260},[1036,4048,1758],{"class":1254},[1036,4050,2677],{"class":1059},[1036,4052,1251],{"class":1260},[1036,4054,1946],{"class":1250},[1036,4056,1758],{"class":1254},[1036,4058,4059],{"class":1059},"map",[1036,4061,1251],{"class":1260},[1036,4063,4064],{"class":1892},"message",[1036,4066,1775],{"class":1537},[1036,4068,1901],{"class":1260},[1036,4070,1255],{"class":1254},[1036,4072,4074,4077,4079,4081,4083,4085],{"class":1038,"line":4073},77,[1036,4075,4076],{"class":1260},"        chatId",[1036,4078,1264],{"class":1254},[1036,4080,2739],{"class":1250},[1036,4082,1758],{"class":1254},[1036,4084,1967],{"class":1250},[1036,4086,1282],{"class":1254},[1036,4088,4090,4093,4095,4097,4099,4101,4103,4105,4107,4109,4112,4114,4116,4118],{"class":1038,"line":4089},78,[1036,4091,4092],{"class":1260},"        role",[1036,4094,1264],{"class":1254},[1036,4096,2567],{"class":1250},[1036,4098,1758],{"class":1254},[1036,4100,2079],{"class":1250},[1036,4102,3283],{"class":1240},[1036,4104,1341],{"class":1254},[1036,4106,2097],{"class":1046},[1036,4108,1279],{"class":1254},[1036,4110,4111],{"class":1254}," |",[1036,4113,1341],{"class":1254},[1036,4115,2106],{"class":1046},[1036,4117,1279],{"class":1254},[1036,4119,1282],{"class":1254},[1036,4121,4123,4126,4128,4130,4132],{"class":1038,"line":4122},79,[1036,4124,4125],{"class":1260},"        parts",[1036,4127,1264],{"class":1254},[1036,4129,2567],{"class":1250},[1036,4131,1758],{"class":1254},[1036,4133,2774],{"class":1250},[1036,4135,4137,4139],{"class":1038,"line":4136},80,[1036,4138,3850],{"class":1254},[1036,4140,4141],{"class":1260},")))\n",[1036,4143,4145],{"class":1038,"line":4144},81,[1036,4146,1427],{"class":1254},[1036,4148,4150,4152],{"class":1038,"line":4149},82,[1036,4151,2363],{"class":1254},[1036,4153,1441],{"class":1260},[1036,4155,4157],{"class":1038,"line":4156},83,[1036,4158,1319],{"emptyLinePlaceholder":21},[1036,4160,4162,4164,4167,4169,4171,4173,4175],{"class":1038,"line":4161},84,[1036,4163,2789],{"class":1240},[1036,4165,4166],{"class":1059}," createUIMessageStreamResponse",[1036,4168,1251],{"class":1260},[1036,4170,1815],{"class":1254},[1036,4172,3751],{"class":1250},[1036,4174,1682],{"class":1254},[1036,4176,1441],{"class":1260},[1036,4178,4180,4182],{"class":1038,"line":4179},85,[1036,4181,1438],{"class":1254},[1036,4183,1441],{"class":1250},[936,4185,4186],{},"Here's what each part does:",[936,4188,4189],{},[954,4190,4191],{},"AI Gateway",[936,4193,4194,4195,4198],{},"Thanks to ",[1011,4196,1016],{"href":1013,"rel":4197},[1015],", we can use any AI model supported by the gateway just by specifying the model name.",[936,4200,4201],{},[954,4202,4203],{},"Automatic Title Generation",[936,4205,4206,4207,4214],{},"When a chat doesn't have a title yet, we use ",[1011,4208,4211],{"href":4209,"rel":4210},"https://ai-sdk.dev/docs/reference/ai-sdk-core/generate-text#generatetext",[1015],[1033,4212,4213],{},"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\".",[936,4216,4217],{},[954,4218,4219],{},"Streaming with streamText",[936,4221,4222,4223,4228],{},"The ",[1011,4224,4226],{"href":2808,"rel":4225},[1015],[1033,4227,2812],{}," function generates a streaming response from the AI model. Key options include:",[948,4230,4231,4237,4242],{},[951,4232,4233,4236],{},[1033,4234,4235],{},"model",": The AI model to use",[951,4238,4239,4241],{},[1033,4240,2115],{},": Instructions that guide the AI's behavior",[951,4243,4244,4246],{},[1033,4245,1946],{},": The conversation history",[936,4248,4249],{},[954,4250,4251],{},"UIMessageStream",[936,4253,4222,4254,4260,4261,4267],{},[1011,4255,4258],{"href":4256,"rel":4257},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/create-ui-message-stream#createuimessagestream",[1015],[1033,4259,2820],{}," and ",[1011,4262,4265],{"href":4263,"rel":4264},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/create-ui-message-stream-response#createuimessagestreamresponse",[1015],[1033,4266,2828],{}," 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.",[936,4269,4222,4270,4273,4274,4276,4277,4280],{},[1033,4271,4272],{},"writer.write()"," method allows sending custom data events to the client (like ",[1033,4275,3911],{},"), while ",[1033,4278,4279],{},"onFinish"," is called when streaming completes, perfect for persisting the assistant's response.",[1064,4282,4284],{"id":4283},"fetching-a-chat","Fetching a chat",[936,4286,4287],{},"Add an endpoint to fetch existing chat data from your database:",[1227,4289,4290],{},[1026,4291,4294],{"className":1231,"code":4292,"filename":4293,"language":1233,"meta":1031,"style":1031},"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",[1033,4295,4296,4322,4345,4367,4385,4389,4411,4443,4457,4469,4473,4501,4532,4541,4550,4579,4583,4587,4593,4597,4611,4643,4647,4651,4657],{"__ignoreMap":1031},[1036,4297,4298,4300,4302,4304,4306,4308,4310,4312,4314,4316,4318,4320],{"class":1038,"line":1039},[1036,4299,1657],{"class":1240},[1036,4301,1660],{"class":1254},[1036,4303,2848],{"class":1250},[1036,4305,1666],{"class":1254},[1036,4307,2447],{"class":1250},[1036,4309,1666],{"class":1254},[1036,4311,2857],{"class":1250},[1036,4313,1682],{"class":1254},[1036,4315,1685],{"class":1240},[1036,4317,1341],{"class":1254},[1036,4319,1064],{"class":1046},[1036,4321,1305],{"class":1254},[1036,4323,4324,4326,4328,4331,4333,4335,4337,4339,4341,4343],{"class":1038,"line":1056},[1036,4325,1657],{"class":1240},[1036,4327,1660],{"class":1254},[1036,4329,4330],{"class":1250}," asc",[1036,4332,1666],{"class":1254},[1036,4334,2880],{"class":1250},[1036,4336,1682],{"class":1254},[1036,4338,1685],{"class":1240},[1036,4340,1341],{"class":1254},[1036,4342,1710],{"class":1046},[1036,4344,1305],{"class":1254},[1036,4346,4347,4349,4351,4353,4355,4357,4359,4361,4363,4365],{"class":1038,"line":1270},[1036,4348,1657],{"class":1240},[1036,4350,1660],{"class":1254},[1036,4352,2390],{"class":1250},[1036,4354,1666],{"class":1254},[1036,4356,2498],{"class":1250},[1036,4358,1682],{"class":1254},[1036,4360,1685],{"class":1240},[1036,4362,1341],{"class":1254},[1036,4364,2507],{"class":1046},[1036,4366,1305],{"class":1254},[1036,4368,4369,4371,4373,4375,4377,4379,4381,4383],{"class":1038,"line":1285},[1036,4370,1657],{"class":1240},[1036,4372,1660],{"class":1254},[1036,4374,2518],{"class":1250},[1036,4376,1682],{"class":1254},[1036,4378,1685],{"class":1240},[1036,4380,1341],{"class":1254},[1036,4382,2527],{"class":1046},[1036,4384,1305],{"class":1254},[1036,4386,4387],{"class":1038,"line":1297},[1036,4388,1319],{"emptyLinePlaceholder":21},[1036,4390,4391,4393,4395,4397,4399,4401,4403,4405,4407,4409],{"class":1038,"line":1308},[1036,4392,1241],{"class":1240},[1036,4394,1244],{"class":1240},[1036,4396,2447],{"class":1059},[1036,4398,1251],{"class":1250},[1036,4400,2546],{"class":1537},[1036,4402,1901],{"class":1254},[1036,4404,2551],{"class":1892},[1036,4406,1832],{"class":1254},[1036,4408,1775],{"class":1537},[1036,4410,1330],{"class":1254},[1036,4412,4413,4415,4417,4419,4421,4423,4425,4427,4429,4431,4433,4435,4437,4439,4441],{"class":1038,"line":1316},[1036,4414,2562],{"class":1537},[1036,4416,1660],{"class":1254},[1036,4418,3036],{"class":1250},[1036,4420,1682],{"class":1254},[1036,4422,2572],{"class":1254},[1036,4424,2575],{"class":1240},[1036,4426,2857],{"class":1059},[1036,4428,1251],{"class":1260},[1036,4430,2551],{"class":1250},[1036,4432,1666],{"class":1254},[1036,4434,2518],{"class":1250},[1036,4436,1758],{"class":1254},[1036,4438,2590],{"class":1059},[1036,4440,1251],{"class":1260},[1036,4442,1255],{"class":1254},[1036,4444,4445,4447,4449,4451,4453,4455],{"class":1038,"line":1322},[1036,4446,3065],{"class":1260},[1036,4448,1264],{"class":1254},[1036,4450,2518],{"class":1250},[1036,4452,1758],{"class":1254},[1036,4454,3074],{"class":1059},[1036,4456,2618],{"class":1260},[1036,4458,4459,4461,4463,4465,4467],{"class":1038,"line":1333},[1036,4460,2363],{"class":1254},[1036,4462,1832],{"class":1260},[1036,4464,1758],{"class":1254},[1036,4466,2629],{"class":1250},[1036,4468,1441],{"class":1260},[1036,4470,4471],{"class":1038,"line":1349},[1036,4472,1319],{"emptyLinePlaceholder":21},[1036,4474,4475,4477,4479,4481,4483,4485,4487,4489,4491,4493,4495,4497,4499],{"class":1038,"line":1355},[1036,4476,2562],{"class":1537},[1036,4478,2739],{"class":1250},[1036,4480,2572],{"class":1254},[1036,4482,2575],{"class":1240},[1036,4484,2390],{"class":1250},[1036,4486,1758],{"class":1254},[1036,4488,3232],{"class":1250},[1036,4490,1758],{"class":1254},[1036,4492,1737],{"class":1250},[1036,4494,1758],{"class":1254},[1036,4496,3241],{"class":1059},[1036,4498,1251],{"class":1260},[1036,4500,1255],{"class":1254},[1036,4502,4503,4505,4507,4509,4511,4513,4515,4517,4519,4521,4523,4525,4527,4530],{"class":1038,"line":1360},[1036,4504,3250],{"class":1260},[1036,4506,1264],{"class":1254},[1036,4508,1901],{"class":1260},[1036,4510,3543],{"class":1059},[1036,4512,1251],{"class":1260},[1036,4514,2666],{"class":1250},[1036,4516,1758],{"class":1254},[1036,4518,1737],{"class":1250},[1036,4520,1758],{"class":1254},[1036,4522,1967],{"class":1250},[1036,4524,1666],{"class":1254},[1036,4526,3036],{"class":1250},[1036,4528,4529],{"class":1260},"))",[1036,4531,1282],{"class":1254},[1036,4533,4534,4537,4539],{"class":1038,"line":1383},[1036,4535,4536],{"class":1260},"    with",[1036,4538,1264],{"class":1254},[1036,4540,1330],{"class":1254},[1036,4542,4543,4546,4548],{"class":1038,"line":1388},[1036,4544,4545],{"class":1260},"      messages",[1036,4547,1264],{"class":1254},[1036,4549,1330],{"class":1254},[1036,4551,4552,4555,4557,4560,4562,4564,4566,4568,4570,4572,4574,4577],{"class":1038,"line":1398},[1036,4553,4554],{"class":1059},"        orderBy",[1036,4556,1264],{"class":1254},[1036,4558,4559],{"class":1254}," ()",[1036,4561,1775],{"class":1537},[1036,4563,4330],{"class":1059},[1036,4565,1251],{"class":1260},[1036,4567,2666],{"class":1250},[1036,4569,1758],{"class":1254},[1036,4571,1946],{"class":1250},[1036,4573,1758],{"class":1254},[1036,4575,4576],{"class":1250},"createdAt",[1036,4578,1441],{"class":1260},[1036,4580,4581],{"class":1038,"line":1408},[1036,4582,3964],{"class":1254},[1036,4584,4585],{"class":1038,"line":1424},[1036,4586,1427],{"class":1254},[1036,4588,4589,4591],{"class":1038,"line":1430},[1036,4590,2363],{"class":1254},[1036,4592,1441],{"class":1260},[1036,4594,4595],{"class":1038,"line":1435},[1036,4596,1319],{"emptyLinePlaceholder":21},[1036,4598,4599,4601,4603,4605,4607,4609],{"class":1038,"line":2224},[1036,4600,3303],{"class":1240},[1036,4602,1901],{"class":1260},[1036,4604,3308],{"class":1254},[1036,4606,256],{"class":1250},[1036,4608,3313],{"class":1260},[1036,4610,1255],{"class":1254},[1036,4612,4613,4615,4617,4619,4621,4623,4625,4627,4629,4631,4633,4635,4637,4639,4641],{"class":1038,"line":2237},[1036,4614,3321],{"class":1240},[1036,4616,2848],{"class":1059},[1036,4618,1251],{"class":1260},[1036,4620,1815],{"class":1254},[1036,4622,3330],{"class":1260},[1036,4624,1264],{"class":1254},[1036,4626,3336],{"class":3335},[1036,4628,1666],{"class":1254},[1036,4630,3341],{"class":1260},[1036,4632,1264],{"class":1254},[1036,4634,1341],{"class":1254},[1036,4636,3348],{"class":1046},[1036,4638,1279],{"class":1254},[1036,4640,1682],{"class":1254},[1036,4642,1441],{"class":1260},[1036,4644,4645],{"class":1038,"line":2267},[1036,4646,3360],{"class":1254},[1036,4648,4649],{"class":1038,"line":2273},[1036,4650,1319],{"emptyLinePlaceholder":21},[1036,4652,4653,4655],{"class":1038,"line":2278},[1036,4654,2789],{"class":1240},[1036,4656,2792],{"class":1250},[1036,4658,4659,4661],{"class":1038,"line":2310},[1036,4660,1438],{"class":1254},[1036,4662,1441],{"class":1250},[940,4664,4666],{"id":4665},"wire-up-the-ui","Wire up the UI",[936,4668,4669,4670,4675,4676,4681],{},"Nuxt UI provides purpose-built components for AI chat interfaces: ",[1011,4671,4672],{"href":270},[1033,4673,4674],{},"UChatPrompt"," for the input area and ",[1011,4677,4678],{"href":260},[1033,4679,4680],{},"UChatMessages"," for displaying the conversation.",[1064,4683,4685],{"id":4684},"creating-the-home-page","Creating the home page",[936,4687,4688,4689,4693],{},"The home page is where users start a new conversation. The ",[1011,4690,4691],{"href":270},[1033,4692,4674],{}," component provides a textarea with auto-resize, keyboard shortcuts, and a submit button:",[1227,4695,4696],{},[1026,4697,4701],{"className":1499,"code":4698,"filename":4699,"highlights":4700,"language":34,"meta":1031,"style":1031},"\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",[3374,3394,3422,3438,3457,3485,3493,3498,3564],[1033,4702,4703,4726,4746,4764,4768,4782,4809,4813,4826,4830,4835,4861,4877,4886,4895,4909,4947,4951,4955,4961,4965,4970,4996,5001,5009,5013,5021,5042,5056,5077,5098,5103,5112,5116,5124,5139,5154,5169,5184,5199,5205,5228,5237,5246,5254,5262],{"__ignoreMap":1031},[1036,4704,4705,4707,4710,4713,4716,4718,4720,4722,4724],{"class":1038,"line":1039},[1036,4706,1509],{"class":1254},[1036,4708,4709],{"class":1260},"script",[1036,4711,4712],{"class":1537}," setup",[1036,4714,4715],{"class":1537}," lang",[1036,4717,1541],{"class":1254},[1036,4719,1468],{"class":1254},[1036,4721,1233],{"class":1046},[1036,4723,1468],{"class":1254},[1036,4725,1515],{"class":1254},[1036,4727,4728,4731,4734,4736,4739,4741,4744],{"class":1038,"line":1056},[1036,4729,4730],{"class":1537},"const",[1036,4732,4733],{"class":1250}," input ",[1036,4735,1541],{"class":1254},[1036,4737,4738],{"class":1059}," ref",[1036,4740,1251],{"class":1250},[1036,4742,4743],{"class":1254},"''",[1036,4745,1441],{"class":1250},[1036,4747,4748,4750,4753,4755,4757,4759,4762],{"class":1038,"line":1270},[1036,4749,4730],{"class":1537},[1036,4751,4752],{"class":1250}," loading ",[1036,4754,1541],{"class":1254},[1036,4756,4738],{"class":1059},[1036,4758,1251],{"class":1250},[1036,4760,4761],{"class":1416},"false",[1036,4763,1441],{"class":1250},[1036,4765,4766],{"class":1038,"line":1285},[1036,4767,1319],{"emptyLinePlaceholder":21},[1036,4769,4770,4772,4775,4778,4780],{"class":1038,"line":1297},[1036,4771,2546],{"class":1537},[1036,4773,4774],{"class":1537}," function",[1036,4776,4777],{"class":1059}," createChat",[1036,4779,1755],{"class":1254},[1036,4781,1330],{"class":1254},[1036,4783,4784,4786,4788,4790,4793,4795,4798,4800,4803,4806],{"class":1038,"line":1308},[1036,4785,3303],{"class":1240},[1036,4787,1901],{"class":1260},[1036,4789,3308],{"class":1254},[1036,4791,4792],{"class":1250},"input",[1036,4794,1758],{"class":1254},[1036,4796,4797],{"class":1250},"value",[1036,4799,1758],{"class":1254},[1036,4801,4802],{"class":1059},"trim",[1036,4804,4805],{"class":1260},"()) ",[1036,4807,4808],{"class":1240},"return\n",[1036,4810,4811],{"class":1038,"line":1316},[1036,4812,1319],{"emptyLinePlaceholder":21},[1036,4814,4815,4818,4820,4822,4824],{"class":1038,"line":1322},[1036,4816,4817],{"class":1250},"  loading",[1036,4819,1758],{"class":1254},[1036,4821,4797],{"class":1250},[1036,4823,2572],{"class":1254},[1036,4825,3950],{"class":1416},[1036,4827,4828],{"class":1038,"line":1333},[1036,4829,1319],{"emptyLinePlaceholder":21},[1036,4831,4832],{"class":1038,"line":1349},[1036,4833,4834],{"class":1420},"  // Create a new chat on the server\n",[1036,4836,4837,4839,4841,4843,4845,4848,4850,4852,4855,4857,4859],{"class":1038,"line":1355},[1036,4838,2562],{"class":1537},[1036,4840,2739],{"class":1250},[1036,4842,2572],{"class":1254},[1036,4844,2575],{"class":1240},[1036,4846,4847],{"class":1059}," $fetch",[1036,4849,1251],{"class":1260},[1036,4851,1279],{"class":1254},[1036,4853,4854],{"class":1046},"/api/chats",[1036,4856,1279],{"class":1254},[1036,4858,1666],{"class":1254},[1036,4860,1330],{"class":1254},[1036,4862,4863,4866,4868,4870,4873,4875],{"class":1038,"line":1360},[1036,4864,4865],{"class":1260},"    method",[1036,4867,1264],{"class":1254},[1036,4869,1341],{"class":1254},[1036,4871,4872],{"class":1046},"POST",[1036,4874,1279],{"class":1254},[1036,4876,1282],{"class":1254},[1036,4878,4879,4882,4884],{"class":1038,"line":1383},[1036,4880,4881],{"class":1260},"    body",[1036,4883,1264],{"class":1254},[1036,4885,1330],{"class":1254},[1036,4887,4888,4891,4893],{"class":1038,"line":1388},[1036,4889,4890],{"class":1260},"      message",[1036,4892,1264],{"class":1254},[1036,4894,1330],{"class":1254},[1036,4896,4897,4899,4901,4903,4905,4907],{"class":1038,"line":1398},[1036,4898,4092],{"class":1260},[1036,4900,1264],{"class":1254},[1036,4902,1341],{"class":1254},[1036,4904,2097],{"class":1046},[1036,4906,1279],{"class":1254},[1036,4908,1282],{"class":1254},[1036,4910,4911,4913,4915,4917,4919,4921,4923,4925,4928,4930,4932,4934,4936,4939,4941,4943,4945],{"class":1038,"line":1408},[1036,4912,4125],{"class":1260},[1036,4914,1264],{"class":1254},[1036,4916,1368],{"class":1260},[1036,4918,1815],{"class":1254},[1036,4920,2469],{"class":1260},[1036,4922,1264],{"class":1254},[1036,4924,1341],{"class":1254},[1036,4926,4927],{"class":1046},"text",[1036,4929,1279],{"class":1254},[1036,4931,1666],{"class":1254},[1036,4933,1669],{"class":1260},[1036,4935,1264],{"class":1254},[1036,4937,4938],{"class":1250}," input",[1036,4940,1758],{"class":1254},[1036,4942,4797],{"class":1250},[1036,4944,1682],{"class":1254},[1036,4946,3607],{"class":1260},[1036,4948,4949],{"class":1038,"line":1424},[1036,4950,3964],{"class":1254},[1036,4952,4953],{"class":1038,"line":1430},[1036,4954,1427],{"class":1254},[1036,4956,4957,4959],{"class":1038,"line":1435},[1036,4958,2363],{"class":1254},[1036,4960,1441],{"class":1260},[1036,4962,4963],{"class":1038,"line":2224},[1036,4964,1319],{"emptyLinePlaceholder":21},[1036,4966,4967],{"class":1038,"line":2237},[1036,4968,4969],{"class":1420},"  // Navigate to the chat page\n",[1036,4971,4972,4975,4977,4979,4982,4985,4987,4989,4991,4994],{"class":1038,"line":2267},[1036,4973,4974],{"class":1059},"  navigateTo",[1036,4976,1251],{"class":1260},[1036,4978,3452],{"class":1254},[1036,4980,4981],{"class":1046},"/chat/",[1036,4983,4984],{"class":1254},"${",[1036,4986,256],{"class":1250},[1036,4988,1758],{"class":1254},[1036,4990,1967],{"class":1250},[1036,4992,4993],{"class":1254},"}`",[1036,4995,1441],{"class":1260},[1036,4997,4998],{"class":1038,"line":2273},[1036,4999,5000],{"class":1254},"}\n",[1036,5002,5003,5005,5007],{"class":1038,"line":2278},[1036,5004,1585],{"class":1254},[1036,5006,4709],{"class":1260},[1036,5008,1515],{"class":1254},[1036,5010,5011],{"class":1038,"line":2310},[1036,5012,1319],{"emptyLinePlaceholder":21},[1036,5014,5015,5017,5019],{"class":1038,"line":2326},[1036,5016,1509],{"class":1254},[1036,5018,1512],{"class":1260},[1036,5020,1515],{"class":1254},[1036,5022,5023,5025,5028,5031,5033,5035,5038,5040],{"class":1038,"line":2344},[1036,5024,1522],{"class":1254},[1036,5026,5027],{"class":1260},"UDashboardPanel",[1036,5029,5030],{"class":1537}," :ui",[1036,5032,1541],{"class":1254},[1036,5034,1468],{"class":1254},[1036,5036,5037],{"class":1046},"{ body: 'p-0 sm:p-0' }",[1036,5039,1468],{"class":1254},[1036,5041,1515],{"class":1254},[1036,5043,5044,5046,5048,5051,5054],{"class":1038,"line":2360},[1036,5045,1531],{"class":1254},[1036,5047,1512],{"class":1260},[1036,5049,5050],{"class":1254}," #",[1036,5052,5053],{"class":1537},"body",[1036,5055,1515],{"class":1254},[1036,5057,5058,5060,5063,5066,5068,5070,5073,5075],{"class":1038,"line":2368},[1036,5059,1555],{"class":1254},[1036,5061,5062],{"class":1260},"UContainer",[1036,5064,5065],{"class":1537}," class",[1036,5067,1541],{"class":1254},[1036,5069,1468],{"class":1254},[1036,5071,5072],{"class":1046},"min-h-dvh flex flex-col justify-center gap-6 py-8",[1036,5074,1468],{"class":1254},[1036,5076,1515],{"class":1254},[1036,5078,5079,5082,5085,5087,5089,5091,5094,5096],{"class":1038,"line":3318},[1036,5080,5081],{"class":1254},"        \u003C",[1036,5083,5084],{"class":1260},"h1",[1036,5086,5065],{"class":1537},[1036,5088,1541],{"class":1254},[1036,5090,1468],{"class":1254},[1036,5092,5093],{"class":1046},"text-3xl sm:text-4xl text-highlighted font-bold",[1036,5095,1468],{"class":1254},[1036,5097,1515],{"class":1254},[1036,5099,5100],{"class":1038,"line":3357},[1036,5101,5102],{"class":1250},"          How can I help you today?\n",[1036,5104,5105,5108,5110],{"class":1038,"line":3363},[1036,5106,5107],{"class":1254},"        \u003C/",[1036,5109,5084],{"class":1260},[1036,5111,1515],{"class":1254},[1036,5113,5114],{"class":1038,"line":3368},[1036,5115,1319],{"emptyLinePlaceholder":21},[1036,5117,5119,5121],{"class":5118,"line":3374},[1038,1519],[1036,5120,5081],{"class":1254},[1036,5122,5123],{"class":1260},"UChatPrompt\n",[1036,5125,5127,5130,5132,5134,5136],{"class":5126,"line":3394},[1038,1519],[1036,5128,5129],{"class":1537},"          v-model",[1036,5131,1541],{"class":1254},[1036,5133,1468],{"class":1254},[1036,5135,4792],{"class":1046},[1036,5137,5138],{"class":1254},"\"\n",[1036,5140,5142,5145,5147,5149,5152],{"class":5141,"line":3422},[1038,1519],[1036,5143,5144],{"class":1537},"          :status",[1036,5146,1541],{"class":1254},[1036,5148,1468],{"class":1254},[1036,5150,5151],{"class":1046},"loading ? 'streaming' : 'ready'",[1036,5153,5138],{"class":1254},[1036,5155,5157,5160,5162,5164,5167],{"class":5156,"line":3438},[1038,1519],[1036,5158,5159],{"class":1537},"          variant",[1036,5161,1541],{"class":1254},[1036,5163,1468],{"class":1254},[1036,5165,5166],{"class":1046},"subtle",[1036,5168,5138],{"class":1254},[1036,5170,5172,5175,5177,5179,5182],{"class":5171,"line":3457},[1038,1519],[1036,5173,5174],{"class":1537},"          placeholder",[1036,5176,1541],{"class":1254},[1036,5178,1468],{"class":1254},[1036,5180,5181],{"class":1046},"Ask me anything...",[1036,5183,5138],{"class":1254},[1036,5185,5187,5190,5192,5194,5197],{"class":5186,"line":3485},[1038,1519],[1036,5188,5189],{"class":1537},"          @submit",[1036,5191,1541],{"class":1254},[1036,5193,1468],{"class":1254},[1036,5195,5196],{"class":1046},"createChat",[1036,5198,5138],{"class":1254},[1036,5200,5202],{"class":5201,"line":3493},[1038,1519],[1036,5203,5204],{"class":1254},"        >\n",[1036,5206,5208,5211,5214,5217,5219,5221,5224,5226],{"class":5207,"line":3498},[1038,1519],[1036,5209,5210],{"class":1254},"          \u003C",[1036,5212,5213],{"class":1260},"UChatPromptSubmit",[1036,5215,5216],{"class":1537}," color",[1036,5218,1541],{"class":1254},[1036,5220,1468],{"class":1254},[1036,5222,5223],{"class":1046},"neutral",[1036,5225,1468],{"class":1254},[1036,5227,1561],{"class":1254},[1036,5229,5231,5233,5235],{"class":5230,"line":3564},[1038,1519],[1036,5232,5107],{"class":1254},[1036,5234,4674],{"class":1260},[1036,5236,1515],{"class":1254},[1036,5238,5239,5242,5244],{"class":1038,"line":3569},[1036,5240,5241],{"class":1254},"      \u003C/",[1036,5243,5062],{"class":1260},[1036,5245,1515],{"class":1254},[1036,5247,5248,5250,5252],{"class":1038,"line":3574},[1036,5249,1566],{"class":1254},[1036,5251,1512],{"class":1260},[1036,5253,1515],{"class":1254},[1036,5255,5256,5258,5260],{"class":1038,"line":3580},[1036,5257,1576],{"class":1254},[1036,5259,5027],{"class":1260},[1036,5261,1515],{"class":1254},[1036,5263,5264,5266,5268],{"class":1038,"line":3610},[1036,5265,1585],{"class":1254},[1036,5267,1512],{"class":1260},[1036,5269,1515],{"class":1254},[936,5271,4222,5272,5276],{},[1011,5273,5274],{"href":270},[1033,5275,4674],{}," component automatically handles:",[948,5278,5279,5286,5289,5299],{},[951,5280,5281,5282],{},"Form submission when pressing ",[5283,5284],"kbd",{"value":5285},"enter",[951,5287,5288],{},"Auto-resizing as you type",[951,5290,5291,5292,5295,5296],{},"A loading state when ",[1033,5293,5294],{},"status"," is set to ",[1033,5297,5298],{},"streaming",[951,5300,5301],{},"Focus management and keyboard shortcuts",[940,5303,5305],{"id":5304},"creating-the-chat-page","Creating the chat page",[936,5307,5308,5309,5316,5317,5324],{},"The chat page is where the actual conversation happens. It integrates the AI SDK's ",[1011,5310,5313],{"href":5311,"rel":5312},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/chat",[1015],[1033,5314,5315],{},"Chat"," class and ",[1011,5318,5321],{"href":5319,"rel":5320},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/default-chat-transport",[1015],[1033,5322,5323],{},"DefaultChatTransport"," for real-time streaming.",[1227,5326,5327],{},[1645,5328,5329],{},[1026,5330,5334],{"className":1499,"code":5331,"filename":5332,"highlights":5333,"language":34,"meta":1031,"style":1031},"\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",[1056,1270,1285,1435,2224,2237,2267,2273,2278,2310,2326,2344,2360,2368,3318,3357,3363,3368,3374,3394,3422,3438,3457],[1033,5335,5336,5356,5376,5397,5402,5416,5430,5434,5439,5487,5491,5510,5553,5557,5561,5577,5581,5586,5603,5623,5642,5658,5685,5694,5709,5715,5742,5758,5763,5768,5783,5798,5814,5831,5845,5852,5857,5864,5869,5891,5903,5923,5951,5965,5969,5973,5977,5982,5995,6023,6034,6038,6044,6052,6056,6064,6082,6094,6113,6120,6134,6147,6152,6166,6170,6195,6273,6330,6370,6379,6388,6396,6400,6406,6418,6432,6444,6457,6470,6474,6481,6494,6507,6521,6535,6540,6549,6558,6567,6576],{"__ignoreMap":1031},[1036,5337,5338,5340,5342,5344,5346,5348,5350,5352,5354],{"class":1038,"line":1039},[1036,5339,1509],{"class":1254},[1036,5341,4709],{"class":1260},[1036,5343,4712],{"class":1537},[1036,5345,4715],{"class":1537},[1036,5347,1541],{"class":1254},[1036,5349,1468],{"class":1254},[1036,5351,1233],{"class":1046},[1036,5353,1468],{"class":1254},[1036,5355,1515],{"class":1254},[1036,5357,5359,5361,5363,5366,5368,5370,5372,5374],{"class":5358,"line":1056},[1038,1519],[1036,5360,1657],{"class":1240},[1036,5362,1660],{"class":1254},[1036,5364,5365],{"class":1250}," DefaultChatTransport",[1036,5367,1682],{"class":1254},[1036,5369,1685],{"class":1240},[1036,5371,1341],{"class":1254},[1036,5373,2483],{"class":1046},[1036,5375,1305],{"class":1254},[1036,5377,5379,5381,5383,5386,5388,5390,5392,5395],{"class":5378,"line":1270},[1038,1519],[1036,5380,1657],{"class":1240},[1036,5382,1660],{"class":1254},[1036,5384,5385],{"class":1250}," Chat",[1036,5387,1682],{"class":1254},[1036,5389,1685],{"class":1240},[1036,5391,1341],{"class":1254},[1036,5393,5394],{"class":1046},"@ai-sdk/vue",[1036,5396,1305],{"class":1254},[1036,5398,5400],{"class":5399,"line":1285},[1038,1519],[1036,5401,1319],{"emptyLinePlaceholder":21},[1036,5403,5404,5406,5409,5411,5414],{"class":1038,"line":1297},[1036,5405,4730],{"class":1537},[1036,5407,5408],{"class":1250}," route ",[1036,5410,1541],{"class":1254},[1036,5412,5413],{"class":1059}," useRoute",[1036,5415,2618],{"class":1250},[1036,5417,5418,5420,5423,5425,5428],{"class":1038,"line":1308},[1036,5419,4730],{"class":1537},[1036,5421,5422],{"class":1250}," toast ",[1036,5424,1541],{"class":1254},[1036,5426,5427],{"class":1059}," useToast",[1036,5429,2618],{"class":1250},[1036,5431,5432],{"class":1038,"line":1316},[1036,5433,1319],{"emptyLinePlaceholder":21},[1036,5435,5436],{"class":1038,"line":1322},[1036,5437,5438],{"class":1420},"// Fetch existing chat data\n",[1036,5440,5441,5443,5445,5448,5450,5453,5455,5457,5459,5462,5464,5466,5469,5471,5474,5476,5479,5481,5483,5485],{"class":1038,"line":1333},[1036,5442,4730],{"class":1537},[1036,5444,1660],{"class":1254},[1036,5446,5447],{"class":1260}," data",[1036,5449,1264],{"class":1254},[1036,5451,5452],{"class":1250}," chatData ",[1036,5454,1438],{"class":1254},[1036,5456,2572],{"class":1254},[1036,5458,2575],{"class":1240},[1036,5460,5461],{"class":1059}," useFetch",[1036,5463,1251],{"class":1250},[1036,5465,3452],{"class":1254},[1036,5467,5468],{"class":1046},"/api/chats/",[1036,5470,4984],{"class":1254},[1036,5472,5473],{"class":1250},"route",[1036,5475,1758],{"class":1254},[1036,5477,5478],{"class":1250},"params",[1036,5480,1758],{"class":1254},[1036,5482,1967],{"class":1250},[1036,5484,4993],{"class":1254},[1036,5486,1441],{"class":1250},[1036,5488,5489],{"class":1038,"line":1349},[1036,5490,1319],{"emptyLinePlaceholder":21},[1036,5492,5493,5496,5498,5500,5503,5505,5508],{"class":1038,"line":1355},[1036,5494,5495],{"class":1240},"if",[1036,5497,1901],{"class":1250},[1036,5499,3308],{"class":1254},[1036,5501,5502],{"class":1250},"chatData",[1036,5504,1758],{"class":1254},[1036,5506,5507],{"class":1250},"value) ",[1036,5509,1255],{"class":1254},[1036,5511,5512,5515,5517,5519,5521,5523,5525,5527,5529,5531,5533,5535,5537,5539,5541,5544,5546,5549,5551],{"class":1038,"line":1360},[1036,5513,5514],{"class":1240},"  throw",[1036,5516,2848],{"class":1059},[1036,5518,1251],{"class":1260},[1036,5520,1815],{"class":1254},[1036,5522,3330],{"class":1260},[1036,5524,1264],{"class":1254},[1036,5526,3336],{"class":3335},[1036,5528,1666],{"class":1254},[1036,5530,3341],{"class":1260},[1036,5532,1264],{"class":1254},[1036,5534,1341],{"class":1254},[1036,5536,3348],{"class":1046},[1036,5538,1279],{"class":1254},[1036,5540,1666],{"class":1254},[1036,5542,5543],{"class":1260}," fatal",[1036,5545,1264],{"class":1254},[1036,5547,5548],{"class":1416}," true",[1036,5550,1682],{"class":1254},[1036,5552,1441],{"class":1260},[1036,5554,5555],{"class":1038,"line":1383},[1036,5556,5000],{"class":1254},[1036,5558,5559],{"class":1038,"line":1388},[1036,5560,1319],{"emptyLinePlaceholder":21},[1036,5562,5563,5565,5567,5569,5571,5573,5575],{"class":1038,"line":1398},[1036,5564,4730],{"class":1537},[1036,5566,4733],{"class":1250},[1036,5568,1541],{"class":1254},[1036,5570,4738],{"class":1059},[1036,5572,1251],{"class":1250},[1036,5574,4743],{"class":1254},[1036,5576,1441],{"class":1250},[1036,5578,5579],{"class":1038,"line":1408},[1036,5580,1319],{"emptyLinePlaceholder":21},[1036,5582,5583],{"class":1038,"line":1424},[1036,5584,5585],{"class":1420},"// Initialize the Chat class from AI SDK\n",[1036,5587,5588,5590,5593,5595,5597,5599,5601],{"class":1038,"line":1430},[1036,5589,4730],{"class":1537},[1036,5591,5592],{"class":1250}," chat ",[1036,5594,1541],{"class":1254},[1036,5596,1852],{"class":1254},[1036,5598,5385],{"class":1059},[1036,5600,1251],{"class":1250},[1036,5602,1255],{"class":1254},[1036,5604,5606,5608,5610,5613,5615,5617,5619,5621],{"class":5605,"line":1435},[1038,1519],[1036,5607,1748],{"class":1260},[1036,5609,1264],{"class":1254},[1036,5611,5612],{"class":1250}," chatData",[1036,5614,1758],{"class":1254},[1036,5616,4797],{"class":1250},[1036,5618,1758],{"class":1254},[1036,5620,1967],{"class":1250},[1036,5622,1282],{"class":1254},[1036,5624,5626,5628,5630,5632,5634,5636,5638,5640],{"class":5625,"line":2224},[1038,1519],[1036,5627,1908],{"class":1260},[1036,5629,1264],{"class":1254},[1036,5631,5612],{"class":1250},[1036,5633,1758],{"class":1254},[1036,5635,4797],{"class":1250},[1036,5637,1758],{"class":1254},[1036,5639,1946],{"class":1250},[1036,5641,1282],{"class":1254},[1036,5643,5645,5648,5650,5652,5654,5656],{"class":5644,"line":2237},[1038,1519],[1036,5646,5647],{"class":1260},"  transport",[1036,5649,1264],{"class":1254},[1036,5651,1852],{"class":1254},[1036,5653,5365],{"class":1059},[1036,5655,1251],{"class":1250},[1036,5657,1255],{"class":1254},[1036,5659,5661,5664,5666,5668,5670,5672,5674,5676,5678,5680,5682],{"class":5660,"line":2267},[1038,1519],[1036,5662,5663],{"class":1260},"    api",[1036,5665,1264],{"class":1254},[1036,5667,3446],{"class":1254},[1036,5669,5468],{"class":1046},[1036,5671,4984],{"class":1254},[1036,5673,5502],{"class":1250},[1036,5675,1758],{"class":1254},[1036,5677,4797],{"class":1250},[1036,5679,1758],{"class":1254},[1036,5681,1967],{"class":1250},[1036,5683,5684],{"class":1254},"}`\n",[1036,5686,5688,5690,5692],{"class":5687,"line":2273},[1038,1519],[1036,5689,2363],{"class":1254},[1036,5691,1832],{"class":1250},[1036,5693,1282],{"class":1254},[1036,5695,5697,5700,5702,5705,5707],{"class":5696,"line":2278},[1038,1519],[1036,5698,5699],{"class":1260},"  onData",[1036,5701,1251],{"class":1254},[1036,5703,5704],{"class":1892},"dataPart",[1036,5706,1832],{"class":1254},[1036,5708,1330],{"class":1254},[1036,5710,5712],{"class":5711,"line":2310},[1038,1519],[1036,5713,5714],{"class":1420},"    // Refresh the chat list when a title is generated\n",[1036,5716,5718,5721,5723,5725,5727,5730,5732,5734,5736,5738,5740],{"class":5717,"line":2326},[1038,1519],[1036,5719,5720],{"class":1240},"    if",[1036,5722,1901],{"class":1260},[1036,5724,5704],{"class":1250},[1036,5726,1758],{"class":1254},[1036,5728,5729],{"class":1250},"type",[1036,5731,3625],{"class":1254},[1036,5733,1341],{"class":1254},[1036,5735,3911],{"class":1046},[1036,5737,1279],{"class":1254},[1036,5739,3313],{"class":1260},[1036,5741,1255],{"class":1254},[1036,5743,5745,5748,5750,5752,5754,5756],{"class":5744,"line":2344},[1038,1519],[1036,5746,5747],{"class":1059},"      refreshNuxtData",[1036,5749,1251],{"class":1260},[1036,5751,1279],{"class":1254},[1036,5753,1737],{"class":1046},[1036,5755,1279],{"class":1254},[1036,5757,1441],{"class":1260},[1036,5759,5761],{"class":5760,"line":2360},[1038,1519],[1036,5762,1427],{"class":1254},[1036,5764,5766],{"class":5765,"line":2368},[1038,1519],[1036,5767,1352],{"class":1254},[1036,5769,5771,5774,5776,5779,5781],{"class":5770,"line":3318},[1038,1519],[1036,5772,5773],{"class":1260},"  onError",[1036,5775,1251],{"class":1254},[1036,5777,5778],{"class":1892},"error",[1036,5780,1832],{"class":1254},[1036,5782,1330],{"class":1254},[1036,5784,5786,5789,5791,5794,5796],{"class":5785,"line":3357},[1038,1519],[1036,5787,5788],{"class":1250},"    toast",[1036,5790,1758],{"class":1254},[1036,5792,5793],{"class":1059},"add",[1036,5795,1251],{"class":1260},[1036,5797,1255],{"class":1254},[1036,5799,5801,5804,5806,5808,5810,5812],{"class":5800,"line":3363},[1038,1519],[1036,5802,5803],{"class":1260},"      title",[1036,5805,1264],{"class":1254},[1036,5807,1341],{"class":1254},[1036,5809,471],{"class":1046},[1036,5811,1279],{"class":1254},[1036,5813,1282],{"class":1254},[1036,5815,5817,5820,5822,5825,5827,5829],{"class":5816,"line":3368},[1038,1519],[1036,5818,5819],{"class":1260},"      description",[1036,5821,1264],{"class":1254},[1036,5823,5824],{"class":1250}," error",[1036,5826,1758],{"class":1254},[1036,5828,4064],{"class":1250},[1036,5830,1282],{"class":1254},[1036,5832,5834,5837,5839,5841,5843],{"class":5833,"line":3374},[1038,1519],[1036,5835,5836],{"class":1260},"      color",[1036,5838,1264],{"class":1254},[1036,5840,1341],{"class":1254},[1036,5842,5778],{"class":1046},[1036,5844,1305],{"class":1254},[1036,5846,5848,5850],{"class":5847,"line":3394},[1038,1519],[1036,5849,3488],{"class":1254},[1036,5851,1441],{"class":1260},[1036,5853,5855],{"class":5854,"line":3422},[1038,1519],[1036,5856,3360],{"class":1254},[1036,5858,5860,5862],{"class":5859,"line":3438},[1038,1519],[1036,5861,1438],{"class":1254},[1036,5863,1441],{"class":1250},[1036,5865,5867],{"class":5866,"line":3457},[1038,1519],[1036,5868,1319],{"emptyLinePlaceholder":21},[1036,5870,5871,5874,5877,5879,5882,5884,5887,5889],{"class":1038,"line":3485},[1036,5872,5873],{"class":1537},"function",[1036,5875,5876],{"class":1059}," handleSubmit",[1036,5878,1251],{"class":1254},[1036,5880,5881],{"class":1892},"e",[1036,5883,1264],{"class":1254},[1036,5885,5886],{"class":1042}," Event",[1036,5888,1832],{"class":1254},[1036,5890,1330],{"class":1254},[1036,5892,5893,5896,5898,5901],{"class":1038,"line":3493},[1036,5894,5895],{"class":1250},"  e",[1036,5897,1758],{"class":1254},[1036,5899,5900],{"class":1059},"preventDefault",[1036,5902,2618],{"class":1260},[1036,5904,5905,5907,5909,5911,5913,5915,5917,5919,5921],{"class":1038,"line":3498},[1036,5906,3303],{"class":1240},[1036,5908,1901],{"class":1260},[1036,5910,4792],{"class":1250},[1036,5912,1758],{"class":1254},[1036,5914,4797],{"class":1250},[1036,5916,1758],{"class":1254},[1036,5918,4802],{"class":1059},[1036,5920,4805],{"class":1260},[1036,5922,1255],{"class":1254},[1036,5924,5925,5928,5930,5933,5935,5937,5939,5941,5943,5945,5947,5949],{"class":1038,"line":3564},[1036,5926,5927],{"class":1250},"    chat",[1036,5929,1758],{"class":1254},[1036,5931,5932],{"class":1059},"sendMessage",[1036,5934,1251],{"class":1260},[1036,5936,1815],{"class":1254},[1036,5938,1669],{"class":1260},[1036,5940,1264],{"class":1254},[1036,5942,4938],{"class":1250},[1036,5944,1758],{"class":1254},[1036,5946,4797],{"class":1250},[1036,5948,1682],{"class":1254},[1036,5950,1441],{"class":1260},[1036,5952,5953,5956,5958,5960,5962],{"class":1038,"line":3569},[1036,5954,5955],{"class":1250},"    input",[1036,5957,1758],{"class":1254},[1036,5959,4797],{"class":1250},[1036,5961,2572],{"class":1254},[1036,5963,5964],{"class":1254}," ''\n",[1036,5966,5967],{"class":1038,"line":3574},[1036,5968,3360],{"class":1254},[1036,5970,5971],{"class":1038,"line":3580},[1036,5972,5000],{"class":1254},[1036,5974,5975],{"class":1038,"line":3610},[1036,5976,1319],{"emptyLinePlaceholder":21},[1036,5978,5979],{"class":1038,"line":3652},[1036,5980,5981],{"class":1420},"// Auto-generate response for first message\n",[1036,5983,5984,5987,5989,5991,5993],{"class":1038,"line":3681},[1036,5985,5986],{"class":1059},"onMounted",[1036,5988,1251],{"class":1250},[1036,5990,1755],{"class":1254},[1036,5992,1775],{"class":1537},[1036,5994,1330],{"class":1254},[1036,5996,5997,5999,6001,6003,6005,6007,6009,6011,6013,6015,6017,6019,6021],{"class":1038,"line":3693},[1036,5998,3303],{"class":1240},[1036,6000,1901],{"class":1260},[1036,6002,5502],{"class":1250},[1036,6004,1758],{"class":1254},[1036,6006,4797],{"class":1250},[1036,6008,3620],{"class":1254},[1036,6010,1946],{"class":1250},[1036,6012,1758],{"class":1254},[1036,6014,3598],{"class":1250},[1036,6016,3625],{"class":1254},[1036,6018,3604],{"class":3335},[1036,6020,3313],{"class":1260},[1036,6022,1255],{"class":1254},[1036,6024,6025,6027,6029,6032],{"class":1038,"line":3709},[1036,6026,5927],{"class":1250},[1036,6028,1758],{"class":1254},[1036,6030,6031],{"class":1059},"regenerate",[1036,6033,2618],{"class":1260},[1036,6035,6036],{"class":1038,"line":3723},[1036,6037,3360],{"class":1254},[1036,6039,6040,6042],{"class":1038,"line":3730},[1036,6041,1438],{"class":1254},[1036,6043,1441],{"class":1250},[1036,6045,6046,6048,6050],{"class":1038,"line":3735},[1036,6047,1585],{"class":1254},[1036,6049,4709],{"class":1260},[1036,6051,1515],{"class":1254},[1036,6053,6054],{"class":1038,"line":3740},[1036,6055,1319],{"emptyLinePlaceholder":21},[1036,6057,6058,6060,6062],{"class":1038,"line":3746},[1036,6059,1509],{"class":1254},[1036,6061,1512],{"class":1260},[1036,6063,1515],{"class":1254},[1036,6065,6066,6068,6070,6072,6074,6076,6078,6080],{"class":1038,"line":3763},[1036,6067,1522],{"class":1254},[1036,6069,5027],{"class":1260},[1036,6071,5030],{"class":1537},[1036,6073,1541],{"class":1254},[1036,6075,1468],{"class":1254},[1036,6077,5037],{"class":1046},[1036,6079,1468],{"class":1254},[1036,6081,1515],{"class":1254},[1036,6083,6084,6086,6088,6090,6092],{"class":1038,"line":3785},[1036,6085,1531],{"class":1254},[1036,6087,1512],{"class":1260},[1036,6089,5050],{"class":1254},[1036,6091,5053],{"class":1537},[1036,6093,1515],{"class":1254},[1036,6095,6096,6098,6100,6102,6104,6106,6109,6111],{"class":1038,"line":3803},[1036,6097,1555],{"class":1254},[1036,6099,5062],{"class":1260},[1036,6101,5065],{"class":1537},[1036,6103,1541],{"class":1254},[1036,6105,1468],{"class":1254},[1036,6107,6108],{"class":1046},"min-h-dvh flex flex-col py-4 sm:py-6",[1036,6110,1468],{"class":1254},[1036,6112,1515],{"class":1254},[1036,6114,6115,6117],{"class":1038,"line":3811},[1036,6116,5081],{"class":1254},[1036,6118,6119],{"class":1260},"UChatMessages\n",[1036,6121,6122,6125,6127,6129,6132],{"class":1038,"line":3828},[1036,6123,6124],{"class":1537},"          :messages",[1036,6126,1541],{"class":1254},[1036,6128,1468],{"class":1254},[1036,6130,6131],{"class":1046},"chat.messages",[1036,6133,5138],{"class":1254},[1036,6135,6136,6138,6140,6142,6145],{"class":1038,"line":3847},[1036,6137,5144],{"class":1537},[1036,6139,1541],{"class":1254},[1036,6141,1468],{"class":1254},[1036,6143,6144],{"class":1046},"chat.status",[1036,6146,5138],{"class":1254},[1036,6148,6149],{"class":1038,"line":3855},[1036,6150,6151],{"class":1537},"          should-auto-scroll\n",[1036,6153,6154,6157,6159,6161,6164],{"class":1038,"line":3860},[1036,6155,6156],{"class":1537},"          class",[1036,6158,1541],{"class":1254},[1036,6160,1468],{"class":1254},[1036,6162,6163],{"class":1046},"flex-1",[1036,6165,5138],{"class":1254},[1036,6167,6168],{"class":1038,"line":3866},[1036,6169,5204],{"class":1254},[1036,6171,6172,6174,6176,6178,6180,6182,6184,6186,6189,6191,6193],{"class":1038,"line":3886},[1036,6173,5210],{"class":1254},[1036,6175,1512],{"class":1260},[1036,6177,5050],{"class":1254},[1036,6179,344],{"class":1537},[1036,6181,1541],{"class":1254},[1036,6183,1468],{"class":1254},[1036,6185,1815],{"class":1254},[1036,6187,6188],{"class":1250}," message ",[1036,6190,1438],{"class":1254},[1036,6192,1468],{"class":1254},[1036,6194,1515],{"class":1254},[1036,6196,6197,6200,6202,6205,6207,6209,6212,6214,6217,6220,6222,6224,6226,6228,6231,6234,6236,6239,6241,6243,6245,6247,6250,6252,6255,6257,6259,6261,6263,6265,6268,6271],{"class":1038,"line":3901},[1036,6198,6199],{"class":1254},"            \u003C",[1036,6201,1512],{"class":1260},[1036,6203,6204],{"class":1240}," v-for",[1036,6206,1541],{"class":1254},[1036,6208,1468],{"class":1254},[1036,6210,6211],{"class":1250},"(part",[1036,6213,1666],{"class":1254},[1036,6215,6216],{"class":1250}," index) ",[1036,6218,6219],{"class":1254},"in",[1036,6221,2567],{"class":1250},[1036,6223,1758],{"class":1254},[1036,6225,2148],{"class":1250},[1036,6227,1468],{"class":1254},[1036,6229,6230],{"class":1254}," :",[1036,6232,6233],{"class":1537},"key",[1036,6235,1541],{"class":1254},[1036,6237,6238],{"class":1254},"\"`${",[1036,6240,4064],{"class":1250},[1036,6242,1758],{"class":1254},[1036,6244,1967],{"class":1250},[1036,6246,1438],{"class":1254},[1036,6248,6249],{"class":1046},"-",[1036,6251,4984],{"class":1254},[1036,6253,6254],{"class":1250},"part",[1036,6256,1758],{"class":1254},[1036,6258,5729],{"class":1250},[1036,6260,1438],{"class":1254},[1036,6262,6249],{"class":1046},[1036,6264,4984],{"class":1254},[1036,6266,6267],{"class":1250},"index",[1036,6269,6270],{"class":1254},"}`\"",[1036,6272,1515],{"class":1254},[1036,6274,6275,6278,6281,6284,6286,6288,6291,6293,6296,6298,6300,6303,6305,6308,6310,6312,6315,6317,6319,6321,6323,6326,6328],{"class":1038,"line":3918},[1036,6276,6277],{"class":1254},"              \u003C",[1036,6279,6280],{"class":1260},"MDC",[1036,6282,6283],{"class":1537}," v-if",[1036,6285,1541],{"class":1254},[1036,6287,1468],{"class":1254},[1036,6289,6290],{"class":1046},"part.type === 'text' && message.role === 'assistant'",[1036,6292,1468],{"class":1254},[1036,6294,6295],{"class":1537}," :value",[1036,6297,1541],{"class":1254},[1036,6299,1468],{"class":1254},[1036,6301,6302],{"class":1046},"part.text",[1036,6304,1468],{"class":1254},[1036,6306,6307],{"class":1537}," :cache-key",[1036,6309,1541],{"class":1254},[1036,6311,1468],{"class":1254},[1036,6313,6314],{"class":1046},"`${message.id}-${index}`",[1036,6316,1468],{"class":1254},[1036,6318,5065],{"class":1537},[1036,6320,1541],{"class":1254},[1036,6322,1468],{"class":1254},[1036,6324,6325],{"class":1046},"*:first:mt-0 *:last:mb-0",[1036,6327,1468],{"class":1254},[1036,6329,1561],{"class":1254},[1036,6331,6332,6334,6336,6339,6341,6343,6346,6348,6350,6352,6354,6357,6359,6361,6364,6366,6368],{"class":1038,"line":3942},[1036,6333,6277],{"class":1254},[1036,6335,936],{"class":1260},[1036,6337,6338],{"class":1537}," v-else-if",[1036,6340,1541],{"class":1254},[1036,6342,1468],{"class":1254},[1036,6344,6345],{"class":1046},"part.type === 'text' && message.role === 'user'",[1036,6347,1468],{"class":1254},[1036,6349,5065],{"class":1537},[1036,6351,1541],{"class":1254},[1036,6353,1468],{"class":1254},[1036,6355,6356],{"class":1046},"whitespace-pre-wrap",[1036,6358,1468],{"class":1254},[1036,6360,2615],{"class":1254},[1036,6362,6363],{"class":1250},"{{ part.text }}",[1036,6365,1585],{"class":1254},[1036,6367,936],{"class":1260},[1036,6369,1515],{"class":1254},[1036,6371,6372,6375,6377],{"class":1038,"line":3953},[1036,6373,6374],{"class":1254},"            \u003C/",[1036,6376,1512],{"class":1260},[1036,6378,1515],{"class":1254},[1036,6380,6381,6384,6386],{"class":1038,"line":3961},[1036,6382,6383],{"class":1254},"          \u003C/",[1036,6385,1512],{"class":1260},[1036,6387,1515],{"class":1254},[1036,6389,6390,6392,6394],{"class":1038,"line":3967},[1036,6391,5107],{"class":1254},[1036,6393,4680],{"class":1260},[1036,6395,1515],{"class":1254},[1036,6397,6398],{"class":1038,"line":3972},[1036,6399,1319],{"emptyLinePlaceholder":21},[1036,6401,6402,6404],{"class":1038,"line":3995},[1036,6403,5081],{"class":1254},[1036,6405,5123],{"class":1260},[1036,6407,6408,6410,6412,6414,6416],{"class":1038,"line":4001},[1036,6409,5129],{"class":1537},[1036,6411,1541],{"class":1254},[1036,6413,1468],{"class":1254},[1036,6415,4792],{"class":1046},[1036,6417,5138],{"class":1254},[1036,6419,6420,6423,6425,6427,6430],{"class":1038,"line":4021},[1036,6421,6422],{"class":1537},"          :error",[1036,6424,1541],{"class":1254},[1036,6426,1468],{"class":1254},[1036,6428,6429],{"class":1046},"chat.error",[1036,6431,5138],{"class":1254},[1036,6433,6434,6436,6438,6440,6442],{"class":1038,"line":4027},[1036,6435,5159],{"class":1537},[1036,6437,1541],{"class":1254},[1036,6439,1468],{"class":1254},[1036,6441,5166],{"class":1046},[1036,6443,5138],{"class":1254},[1036,6445,6446,6448,6450,6452,6455],{"class":1038,"line":4073},[1036,6447,6156],{"class":1537},[1036,6449,1541],{"class":1254},[1036,6451,1468],{"class":1254},[1036,6453,6454],{"class":1046},"sticky bottom-0",[1036,6456,5138],{"class":1254},[1036,6458,6459,6461,6463,6465,6468],{"class":1038,"line":4089},[1036,6460,5189],{"class":1537},[1036,6462,1541],{"class":1254},[1036,6464,1468],{"class":1254},[1036,6466,6467],{"class":1046},"handleSubmit",[1036,6469,5138],{"class":1254},[1036,6471,6472],{"class":1038,"line":4122},[1036,6473,5204],{"class":1254},[1036,6475,6476,6478],{"class":1038,"line":4136},[1036,6477,5210],{"class":1254},[1036,6479,6480],{"class":1260},"UChatPromptSubmit\n",[1036,6482,6483,6486,6488,6490,6492],{"class":1038,"line":4144},[1036,6484,6485],{"class":1537},"            :status",[1036,6487,1541],{"class":1254},[1036,6489,1468],{"class":1254},[1036,6491,6144],{"class":1046},[1036,6493,5138],{"class":1254},[1036,6495,6496,6499,6501,6503,6505],{"class":1038,"line":4149},[1036,6497,6498],{"class":1537},"            color",[1036,6500,1541],{"class":1254},[1036,6502,1468],{"class":1254},[1036,6504,5223],{"class":1046},[1036,6506,5138],{"class":1254},[1036,6508,6509,6512,6514,6516,6519],{"class":1038,"line":4156},[1036,6510,6511],{"class":1537},"            @stop",[1036,6513,1541],{"class":1254},[1036,6515,1468],{"class":1254},[1036,6517,6518],{"class":1046},"chat.stop()",[1036,6520,5138],{"class":1254},[1036,6522,6523,6526,6528,6530,6533],{"class":1038,"line":4161},[1036,6524,6525],{"class":1537},"            @reload",[1036,6527,1541],{"class":1254},[1036,6529,1468],{"class":1254},[1036,6531,6532],{"class":1046},"chat.regenerate()",[1036,6534,5138],{"class":1254},[1036,6536,6537],{"class":1038,"line":4179},[1036,6538,6539],{"class":1254},"          />\n",[1036,6541,6543,6545,6547],{"class":1038,"line":6542},86,[1036,6544,5107],{"class":1254},[1036,6546,4674],{"class":1260},[1036,6548,1515],{"class":1254},[1036,6550,6552,6554,6556],{"class":1038,"line":6551},87,[1036,6553,5241],{"class":1254},[1036,6555,5062],{"class":1260},[1036,6557,1515],{"class":1254},[1036,6559,6561,6563,6565],{"class":1038,"line":6560},88,[1036,6562,1566],{"class":1254},[1036,6564,1512],{"class":1260},[1036,6566,1515],{"class":1254},[1036,6568,6570,6572,6574],{"class":1038,"line":6569},89,[1036,6571,1576],{"class":1254},[1036,6573,5027],{"class":1260},[1036,6575,1515],{"class":1254},[1036,6577,6579,6581,6583],{"class":1038,"line":6578},90,[1036,6580,1585],{"class":1254},[1036,6582,1512],{"class":1260},[1036,6584,1515],{"class":1254},[936,6586,6587],{},"Here's a breakdown of the key parts:",[936,6589,6590],{},[954,6591,6592],{},"The Chat Class",[936,6594,4222,6595,6600,6601,6603],{},[1011,6596,6598],{"href":5311,"rel":6597},[1015],[1033,6599,5315],{}," class from ",[1033,6602,5394],{}," manages the entire conversation state. It handles:",[948,6605,6606,6611,6626,6632,6637],{},[951,6607,6608,6609],{},"Message history with ",[1033,6610,6131],{},[951,6612,6613,6614,1901,6616,2813,6619,2813,6622,2813,6624,1832],{},"Connection status with ",[1033,6615,6144],{},[1033,6617,6618],{},"ready",[1033,6620,6621],{},"submitted",[1033,6623,5298],{},[1033,6625,5778],{},[951,6627,6628,6629],{},"Sending messages with ",[1033,6630,6631],{},"chat.sendMessage()",[951,6633,6634,6635],{},"Stopping generation with ",[1033,6636,6518],{},[951,6638,6639,6640],{},"Regenerating responses with ",[1033,6641,6532],{},[936,6643,4222,6644,6647,6648,6653,6654,6656],{},[1033,6645,6646],{},"onData"," callback receives ",[1011,6649,6652],{"href":6650,"rel":6651},"https://ai-sdk.dev/docs/ai-sdk-ui/streaming-data",[1015],"custom data events"," from the server (like ",[1033,6655,3911],{},"), allowing you to react to server-side events during streaming.",[936,6658,6659],{},[954,6660,6661],{},"UChatMessages Component",[936,6663,4222,6664,6668],{},[1011,6665,6666],{"href":260},[1033,6667,4680],{}," component is purpose-built for AI chatbots with:",[948,6670,6671,6674,6677,6680],{},[951,6672,6673],{},"Auto-scroll to bottom on load",[951,6675,6676],{},"Continuous scrolling as messages stream in",[951,6678,6679],{},"A loading indicator while the assistant processes",[951,6681,6682],{},"An \"Auto scroll\" button when scrolled up",[936,6684,6685],{},[954,6686,6687],{},"Rendering Markdown with MDC",[936,6689,6690,6691,6697,6698,6704,6705,6708],{},"AI models often respond with markdown formatting (code blocks, lists, bold text, etc.). We use the ",[1011,6692,6695],{"href":6693,"rel":6694},"https://github.com/nuxt-content/mdc#mdc",[1015],[1033,6696,6280],{}," component from ",[1011,6699,6702],{"href":6700,"rel":6701},"https://github.com/nuxt-content/mdc",[1015],[1033,6703,1290],{}," to render this content beautifully. The ",[1033,6706,6707],{},"getTextFromMessage"," utility extracts the text content from AI SDK v5 message parts.",[1615,6710,6711],{"to":819},[936,6712,6713],{},"Nuxt UI provides pre-styled prose components, so your markdown content will be automatically styled to match your theme.",[936,6715,6716],{},[954,6717,6718],{},"UChatPromptSubmit Component",[936,6720,4222,6721,6725],{},[1011,6722,6723],{"href":275},[1033,6724,5213],{}," component adapts based on the chat status:",[948,6727,6728,6731,6734],{},[951,6729,6730],{},"Shows a send button when ready",[951,6732,6733],{},"Shows a stop button while streaming",[951,6735,6736],{},"Shows a reload button after an error",[940,6738,6740],{"id":6739},"adding-chat-history","Adding chat history",[936,6742,6743],{},"This section adds a dropdown menu to list previous chats and navigate between them.",[1064,6745,6747],{"id":6746},"listing-chats-api","Listing chats API",[936,6749,6750],{},"First, create an endpoint to fetch all chats:",[1227,6752,6753],{},[1026,6754,6757],{"className":1231,"code":6755,"filename":6756,"language":1233,"meta":1031,"style":1031},"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",[1033,6758,6759,6777,6799,6818,6822,6840,6865,6892,6898],{"__ignoreMap":1031},[1036,6760,6761,6763,6765,6767,6769,6771,6773,6775],{"class":1038,"line":1039},[1036,6762,1657],{"class":1240},[1036,6764,1660],{"class":1254},[1036,6766,2447],{"class":1250},[1036,6768,1682],{"class":1254},[1036,6770,1685],{"class":1240},[1036,6772,1341],{"class":1254},[1036,6774,1064],{"class":1046},[1036,6776,1305],{"class":1254},[1036,6778,6779,6781,6783,6785,6787,6789,6791,6793,6795,6797],{"class":1038,"line":1056},[1036,6780,1657],{"class":1240},[1036,6782,1660],{"class":1254},[1036,6784,2390],{"class":1250},[1036,6786,1666],{"class":1254},[1036,6788,2498],{"class":1250},[1036,6790,1682],{"class":1254},[1036,6792,1685],{"class":1240},[1036,6794,1341],{"class":1254},[1036,6796,2507],{"class":1046},[1036,6798,1305],{"class":1254},[1036,6800,6801,6803,6805,6808,6810,6812,6814,6816],{"class":1038,"line":1270},[1036,6802,1657],{"class":1240},[1036,6804,1660],{"class":1254},[1036,6806,6807],{"class":1250}," desc",[1036,6809,1682],{"class":1254},[1036,6811,1685],{"class":1240},[1036,6813,1341],{"class":1254},[1036,6815,1710],{"class":1046},[1036,6817,1305],{"class":1254},[1036,6819,6820],{"class":1038,"line":1285},[1036,6821,1319],{"emptyLinePlaceholder":21},[1036,6823,6824,6826,6828,6830,6832,6834,6836,6838],{"class":1038,"line":1297},[1036,6825,1241],{"class":1240},[1036,6827,1244],{"class":1240},[1036,6829,2447],{"class":1059},[1036,6831,1251],{"class":1250},[1036,6833,2546],{"class":1537},[1036,6835,4559],{"class":1254},[1036,6837,1775],{"class":1537},[1036,6839,1330],{"class":1254},[1036,6841,6842,6844,6846,6848,6850,6852,6854,6856,6858,6861,6863],{"class":1038,"line":1308},[1036,6843,2789],{"class":1240},[1036,6845,2575],{"class":1240},[1036,6847,2390],{"class":1250},[1036,6849,1758],{"class":1254},[1036,6851,3232],{"class":1250},[1036,6853,1758],{"class":1254},[1036,6855,1737],{"class":1250},[1036,6857,1758],{"class":1254},[1036,6859,6860],{"class":1059},"findMany",[1036,6862,1251],{"class":1260},[1036,6864,1255],{"class":1254},[1036,6866,6867,6870,6872,6874,6876,6878,6880,6882,6884,6886,6888,6890],{"class":1038,"line":1316},[1036,6868,6869],{"class":1059},"    orderBy",[1036,6871,1264],{"class":1254},[1036,6873,4559],{"class":1254},[1036,6875,1775],{"class":1537},[1036,6877,6807],{"class":1059},[1036,6879,1251],{"class":1260},[1036,6881,2666],{"class":1250},[1036,6883,1758],{"class":1254},[1036,6885,1737],{"class":1250},[1036,6887,1758],{"class":1254},[1036,6889,4576],{"class":1250},[1036,6891,1441],{"class":1260},[1036,6893,6894,6896],{"class":1038,"line":1322},[1036,6895,2363],{"class":1254},[1036,6897,1441],{"class":1260},[1036,6899,6900,6902],{"class":1038,"line":1333},[1036,6901,1438],{"class":1254},[1036,6903,1441],{"class":1250},[1064,6905,6907],{"id":6906},"building-the-chats-history-dropdown","Building the chats history dropdown",[936,6909,6910,6911,6916,6917,6922,6923,6916,6930,6932],{},"The component uses ",[1011,6912,6913],{"href":430},[1033,6914,6915],{},"UDropdownMenu"," with a ",[1011,6918,6919],{"href":224},[1033,6920,6921],{},"UButton"," as trigger. Use ",[1011,6924,6927],{"href":6925,"rel":6926},"https://nuxt.com/docs/api/composables/use-fetch",[1015],[1033,6928,6929],{},"useFetch",[1033,6931,6233],{}," to fetch and cache the chat list:",[1227,6934,6935],{},[1026,6936,6939],{"className":1499,"code":6937,"filename":6938,"language":34,"meta":1031,"style":1031},"\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",[1033,6940,6941,6961,6973,6977,7007,7022,7036,7042,7046,7066,7071,7087,7103,7123,7147,7151,7176,7201,7223,7249,7255,7259,7267,7271,7279,7310,7317,7334,7348,7362,7374,7388,7393,7401],{"__ignoreMap":1031},[1036,6942,6943,6945,6947,6949,6951,6953,6955,6957,6959],{"class":1038,"line":1039},[1036,6944,1509],{"class":1254},[1036,6946,4709],{"class":1260},[1036,6948,4712],{"class":1537},[1036,6950,4715],{"class":1537},[1036,6952,1541],{"class":1254},[1036,6954,1468],{"class":1254},[1036,6956,1233],{"class":1046},[1036,6958,1468],{"class":1254},[1036,6960,1515],{"class":1254},[1036,6962,6963,6965,6967,6969,6971],{"class":1038,"line":1056},[1036,6964,4730],{"class":1537},[1036,6966,5408],{"class":1250},[1036,6968,1541],{"class":1254},[1036,6970,5413],{"class":1059},[1036,6972,2618],{"class":1250},[1036,6974,6975],{"class":1038,"line":1270},[1036,6976,1319],{"emptyLinePlaceholder":21},[1036,6978,6979,6981,6983,6985,6987,6989,6991,6993,6995,6997,6999,7001,7003,7005],{"class":1038,"line":1285},[1036,6980,4730],{"class":1537},[1036,6982,1660],{"class":1254},[1036,6984,5447],{"class":1260},[1036,6986,1264],{"class":1254},[1036,6988,1726],{"class":1250},[1036,6990,1438],{"class":1254},[1036,6992,2572],{"class":1254},[1036,6994,5461],{"class":1059},[1036,6996,1251],{"class":1250},[1036,6998,1279],{"class":1254},[1036,7000,4854],{"class":1046},[1036,7002,1279],{"class":1254},[1036,7004,1666],{"class":1254},[1036,7006,1330],{"class":1254},[1036,7008,7009,7012,7014,7016,7018,7020],{"class":1038,"line":1297},[1036,7010,7011],{"class":1260},"  key",[1036,7013,1264],{"class":1254},[1036,7015,1341],{"class":1254},[1036,7017,1737],{"class":1046},[1036,7019,1279],{"class":1254},[1036,7021,1282],{"class":1254},[1036,7023,7024,7027,7029,7031,7033],{"class":1038,"line":1308},[1036,7025,7026],{"class":1059},"  default",[1036,7028,1264],{"class":1254},[1036,7030,4559],{"class":1254},[1036,7032,1775],{"class":1537},[1036,7034,7035],{"class":1250}," []\n",[1036,7037,7038,7040],{"class":1038,"line":1316},[1036,7039,1438],{"class":1254},[1036,7041,1441],{"class":1250},[1036,7043,7044],{"class":1038,"line":1322},[1036,7045,1319],{"emptyLinePlaceholder":21},[1036,7047,7048,7050,7053,7055,7058,7060,7062,7064],{"class":1038,"line":1333},[1036,7049,4730],{"class":1537},[1036,7051,7052],{"class":1250}," items ",[1036,7054,1541],{"class":1254},[1036,7056,7057],{"class":1059}," computed",[1036,7059,1251],{"class":1250},[1036,7061,1755],{"class":1254},[1036,7063,1775],{"class":1537},[1036,7065,1267],{"class":1250},[1036,7067,7068],{"class":1038,"line":1349},[1036,7069,7070],{"class":1254},"  {\n",[1036,7072,7073,7076,7078,7080,7083,7085],{"class":1038,"line":1355},[1036,7074,7075],{"class":1260},"    label",[1036,7077,1264],{"class":1254},[1036,7079,1341],{"class":1254},[1036,7081,7082],{"class":1046},"New chat",[1036,7084,1279],{"class":1254},[1036,7086,1282],{"class":1254},[1036,7088,7089,7092,7094,7096,7099,7101],{"class":1038,"line":1360},[1036,7090,7091],{"class":1260},"    to",[1036,7093,1264],{"class":1254},[1036,7095,1341],{"class":1254},[1036,7097,7098],{"class":1046},"/",[1036,7100,1279],{"class":1254},[1036,7102,1282],{"class":1254},[1036,7104,7105,7108,7110,7112,7119,7121],{"class":1038,"line":1383},[1036,7106,7107],{"class":1260},"    icon",[1036,7109,1264],{"class":1254},[1036,7111,1341],{"class":1254},[1036,7113,7114,7118],{"class":1046},[7115,7116],"i",{"class":7117},"shiki-icon-highlight sRy2g","i-lucide-plus-square",[1036,7120,1279],{"class":1254},[1036,7122,1282],{"class":1254},[1036,7124,7125,7128,7130,7133,7135,7138,7141,7143,7145],{"class":1038,"line":1388},[1036,7126,7127],{"class":1260},"    active",[1036,7129,1264],{"class":1254},[1036,7131,7132],{"class":1250}," route",[1036,7134,1758],{"class":1254},[1036,7136,7137],{"class":1250},"name ",[1036,7139,7140],{"class":1254},"===",[1036,7142,1341],{"class":1254},[1036,7144,6267],{"class":1046},[1036,7146,1305],{"class":1254},[1036,7148,7149],{"class":1038,"line":1398},[1036,7150,1352],{"class":1254},[1036,7152,7153,7156,7158,7160,7162,7164,7166,7168,7170,7172,7174],{"class":1038,"line":1408},[1036,7154,7155],{"class":1254},"  ...",[1036,7157,1737],{"class":1250},[1036,7159,1758],{"class":1254},[1036,7161,4797],{"class":1250},[1036,7163,1758],{"class":1254},[1036,7165,4059],{"class":1059},[1036,7167,1251],{"class":1250},[1036,7169,256],{"class":1892},[1036,7171,1775],{"class":1537},[1036,7173,1901],{"class":1250},[1036,7175,1255],{"class":1254},[1036,7177,7178,7180,7182,7184,7186,7189,7192,7194,7197,7199],{"class":1038,"line":1424},[1036,7179,7075],{"class":1260},[1036,7181,1264],{"class":1254},[1036,7183,2739],{"class":1250},[1036,7185,1758],{"class":1254},[1036,7187,7188],{"class":1250},"title ",[1036,7190,7191],{"class":1254},"||",[1036,7193,1341],{"class":1254},[1036,7195,7196],{"class":1046},"Untitled",[1036,7198,1279],{"class":1254},[1036,7200,1282],{"class":1254},[1036,7202,7203,7205,7207,7209,7211,7213,7215,7217,7219,7221],{"class":1038,"line":1430},[1036,7204,7091],{"class":1260},[1036,7206,1264],{"class":1254},[1036,7208,3446],{"class":1254},[1036,7210,4981],{"class":1046},[1036,7212,4984],{"class":1254},[1036,7214,256],{"class":1250},[1036,7216,1758],{"class":1254},[1036,7218,1967],{"class":1250},[1036,7220,4993],{"class":1254},[1036,7222,1282],{"class":1254},[1036,7224,7225,7227,7229,7231,7233,7235,7237,7240,7242,7244,7246],{"class":1038,"line":1435},[1036,7226,7127],{"class":1260},[1036,7228,1264],{"class":1254},[1036,7230,7132],{"class":1250},[1036,7232,1758],{"class":1254},[1036,7234,5478],{"class":1250},[1036,7236,1758],{"class":1254},[1036,7238,7239],{"class":1250},"id ",[1036,7241,7140],{"class":1254},[1036,7243,2739],{"class":1250},[1036,7245,1758],{"class":1254},[1036,7247,7248],{"class":1250},"id\n",[1036,7250,7251,7253],{"class":1038,"line":2224},[1036,7252,2363],{"class":1254},[1036,7254,1922],{"class":1250},[1036,7256,7257],{"class":1038,"line":2237},[1036,7258,2270],{"class":1250},[1036,7260,7261,7263,7265],{"class":1038,"line":2267},[1036,7262,1585],{"class":1254},[1036,7264,4709],{"class":1260},[1036,7266,1515],{"class":1254},[1036,7268,7269],{"class":1038,"line":2273},[1036,7270,1319],{"emptyLinePlaceholder":21},[1036,7272,7273,7275,7277],{"class":1038,"line":2278},[1036,7274,1509],{"class":1254},[1036,7276,1512],{"class":1260},[1036,7278,1515],{"class":1254},[1036,7280,7281,7283,7285,7288,7290,7292,7295,7297,7299,7301,7303,7306,7308],{"class":1038,"line":2310},[1036,7282,1522],{"class":1254},[1036,7284,6915],{"class":1260},[1036,7286,7287],{"class":1537}," :items",[1036,7289,1541],{"class":1254},[1036,7291,1468],{"class":1254},[1036,7293,7294],{"class":1046},"items",[1036,7296,1468],{"class":1254},[1036,7298,5065],{"class":1537},[1036,7300,1541],{"class":1254},[1036,7302,1468],{"class":1254},[1036,7304,7305],{"class":1046},"m-2",[1036,7307,1468],{"class":1254},[1036,7309,1515],{"class":1254},[1036,7311,7312,7314],{"class":1038,"line":2326},[1036,7313,1531],{"class":1254},[1036,7315,7316],{"class":1260},"UButton\n",[1036,7318,7319,7322,7324,7326,7332],{"class":1038,"line":2344},[1036,7320,7321],{"class":1537},"      icon",[1036,7323,1541],{"class":1254},[1036,7325,1468],{"class":1254},[1036,7327,7328,7331],{"class":1046},[7115,7329],{"class":7330},"shiki-icon-highlight sdATh","i-lucide-messages-square",[1036,7333,5138],{"class":1254},[1036,7335,7336,7339,7341,7343,7346],{"class":1038,"line":2360},[1036,7337,7338],{"class":1537},"      variant",[1036,7340,1541],{"class":1254},[1036,7342,1468],{"class":1254},[1036,7344,7345],{"class":1046},"ghost",[1036,7347,5138],{"class":1254},[1036,7349,7350,7353,7355,7357,7360],{"class":1038,"line":2368},[1036,7351,7352],{"class":1537},"      label",[1036,7354,1541],{"class":1254},[1036,7356,1468],{"class":1254},[1036,7358,7359],{"class":1046},"Chats History",[1036,7361,5138],{"class":1254},[1036,7363,7364,7366,7368,7370,7372],{"class":1038,"line":3318},[1036,7365,5836],{"class":1537},[1036,7367,1541],{"class":1254},[1036,7369,1468],{"class":1254},[1036,7371,5223],{"class":1046},[1036,7373,5138],{"class":1254},[1036,7375,7376,7379,7381,7383,7386],{"class":1038,"line":3357},[1036,7377,7378],{"class":1537},"      class",[1036,7380,1541],{"class":1254},[1036,7382,1468],{"class":1254},[1036,7384,7385],{"class":1046},"w-fit",[1036,7387,5138],{"class":1254},[1036,7389,7390],{"class":1038,"line":3363},[1036,7391,7392],{"class":1254},"    />\n",[1036,7394,7395,7397,7399],{"class":1038,"line":3368},[1036,7396,1576],{"class":1254},[1036,7398,6915],{"class":1260},[1036,7400,1515],{"class":1254},[1036,7402,7403,7405,7407],{"class":1038,"line":3374},[1036,7404,1585],{"class":1254},[1036,7406,1512],{"class":1260},[1036,7408,1515],{"class":1254},[940,7410,7412],{"id":7411},"integrating-history-in-the-home-page","Integrating history in the home page",[1227,7414,7415],{},[1645,7416,7417],{},[1026,7418,7421],{"className":1499,"code":7419,"filename":4699,"highlights":7420,"language":34,"meta":1031,"style":1031},"\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",[2360,2368,3318],[1033,7422,7423,7443,7459,7475,7479,7491,7513,7517,7529,7533,7537,7561,7575,7583,7591,7605,7641,7645,7649,7655,7659,7663,7685,7689,7697,7701,7709,7727,7741,7751,7760,7772,7790,7808,7812,7820,7824,7830,7842,7854,7866,7878,7890,7894,7912,7920,7928,7936,7944],{"__ignoreMap":1031},[1036,7424,7425,7427,7429,7431,7433,7435,7437,7439,7441],{"class":1038,"line":1039},[1036,7426,1509],{"class":1254},[1036,7428,4709],{"class":1260},[1036,7430,4712],{"class":1537},[1036,7432,4715],{"class":1537},[1036,7434,1541],{"class":1254},[1036,7436,1468],{"class":1254},[1036,7438,1233],{"class":1046},[1036,7440,1468],{"class":1254},[1036,7442,1515],{"class":1254},[1036,7444,7445,7447,7449,7451,7453,7455,7457],{"class":1038,"line":1056},[1036,7446,4730],{"class":1537},[1036,7448,4733],{"class":1250},[1036,7450,1541],{"class":1254},[1036,7452,4738],{"class":1059},[1036,7454,1251],{"class":1250},[1036,7456,4743],{"class":1254},[1036,7458,1441],{"class":1250},[1036,7460,7461,7463,7465,7467,7469,7471,7473],{"class":1038,"line":1270},[1036,7462,4730],{"class":1537},[1036,7464,4752],{"class":1250},[1036,7466,1541],{"class":1254},[1036,7468,4738],{"class":1059},[1036,7470,1251],{"class":1250},[1036,7472,4761],{"class":1416},[1036,7474,1441],{"class":1250},[1036,7476,7477],{"class":1038,"line":1285},[1036,7478,1319],{"emptyLinePlaceholder":21},[1036,7480,7481,7483,7485,7487,7489],{"class":1038,"line":1297},[1036,7482,2546],{"class":1537},[1036,7484,4774],{"class":1537},[1036,7486,4777],{"class":1059},[1036,7488,1755],{"class":1254},[1036,7490,1330],{"class":1254},[1036,7492,7493,7495,7497,7499,7501,7503,7505,7507,7509,7511],{"class":1038,"line":1308},[1036,7494,3303],{"class":1240},[1036,7496,1901],{"class":1260},[1036,7498,3308],{"class":1254},[1036,7500,4792],{"class":1250},[1036,7502,1758],{"class":1254},[1036,7504,4797],{"class":1250},[1036,7506,1758],{"class":1254},[1036,7508,4802],{"class":1059},[1036,7510,4805],{"class":1260},[1036,7512,4808],{"class":1240},[1036,7514,7515],{"class":1038,"line":1316},[1036,7516,1319],{"emptyLinePlaceholder":21},[1036,7518,7519,7521,7523,7525,7527],{"class":1038,"line":1322},[1036,7520,4817],{"class":1250},[1036,7522,1758],{"class":1254},[1036,7524,4797],{"class":1250},[1036,7526,2572],{"class":1254},[1036,7528,3950],{"class":1416},[1036,7530,7531],{"class":1038,"line":1333},[1036,7532,1319],{"emptyLinePlaceholder":21},[1036,7534,7535],{"class":1038,"line":1349},[1036,7536,4834],{"class":1420},[1036,7538,7539,7541,7543,7545,7547,7549,7551,7553,7555,7557,7559],{"class":1038,"line":1355},[1036,7540,2562],{"class":1537},[1036,7542,2739],{"class":1250},[1036,7544,2572],{"class":1254},[1036,7546,2575],{"class":1240},[1036,7548,4847],{"class":1059},[1036,7550,1251],{"class":1260},[1036,7552,1279],{"class":1254},[1036,7554,4854],{"class":1046},[1036,7556,1279],{"class":1254},[1036,7558,1666],{"class":1254},[1036,7560,1330],{"class":1254},[1036,7562,7563,7565,7567,7569,7571,7573],{"class":1038,"line":1360},[1036,7564,4865],{"class":1260},[1036,7566,1264],{"class":1254},[1036,7568,1341],{"class":1254},[1036,7570,4872],{"class":1046},[1036,7572,1279],{"class":1254},[1036,7574,1282],{"class":1254},[1036,7576,7577,7579,7581],{"class":1038,"line":1383},[1036,7578,4881],{"class":1260},[1036,7580,1264],{"class":1254},[1036,7582,1330],{"class":1254},[1036,7584,7585,7587,7589],{"class":1038,"line":1388},[1036,7586,4890],{"class":1260},[1036,7588,1264],{"class":1254},[1036,7590,1330],{"class":1254},[1036,7592,7593,7595,7597,7599,7601,7603],{"class":1038,"line":1398},[1036,7594,4092],{"class":1260},[1036,7596,1264],{"class":1254},[1036,7598,1341],{"class":1254},[1036,7600,2097],{"class":1046},[1036,7602,1279],{"class":1254},[1036,7604,1282],{"class":1254},[1036,7606,7607,7609,7611,7613,7615,7617,7619,7621,7623,7625,7627,7629,7631,7633,7635,7637,7639],{"class":1038,"line":1408},[1036,7608,4125],{"class":1260},[1036,7610,1264],{"class":1254},[1036,7612,1368],{"class":1260},[1036,7614,1815],{"class":1254},[1036,7616,2469],{"class":1260},[1036,7618,1264],{"class":1254},[1036,7620,1341],{"class":1254},[1036,7622,4927],{"class":1046},[1036,7624,1279],{"class":1254},[1036,7626,1666],{"class":1254},[1036,7628,1669],{"class":1260},[1036,7630,1264],{"class":1254},[1036,7632,4938],{"class":1250},[1036,7634,1758],{"class":1254},[1036,7636,4797],{"class":1250},[1036,7638,1682],{"class":1254},[1036,7640,3607],{"class":1260},[1036,7642,7643],{"class":1038,"line":1424},[1036,7644,3964],{"class":1254},[1036,7646,7647],{"class":1038,"line":1430},[1036,7648,1427],{"class":1254},[1036,7650,7651,7653],{"class":1038,"line":1435},[1036,7652,2363],{"class":1254},[1036,7654,1441],{"class":1260},[1036,7656,7657],{"class":1038,"line":2224},[1036,7658,1319],{"emptyLinePlaceholder":21},[1036,7660,7661],{"class":1038,"line":2237},[1036,7662,4969],{"class":1420},[1036,7664,7665,7667,7669,7671,7673,7675,7677,7679,7681,7683],{"class":1038,"line":2267},[1036,7666,4974],{"class":1059},[1036,7668,1251],{"class":1260},[1036,7670,3452],{"class":1254},[1036,7672,4981],{"class":1046},[1036,7674,4984],{"class":1254},[1036,7676,256],{"class":1250},[1036,7678,1758],{"class":1254},[1036,7680,1967],{"class":1250},[1036,7682,4993],{"class":1254},[1036,7684,1441],{"class":1260},[1036,7686,7687],{"class":1038,"line":2273},[1036,7688,5000],{"class":1254},[1036,7690,7691,7693,7695],{"class":1038,"line":2278},[1036,7692,1585],{"class":1254},[1036,7694,4709],{"class":1260},[1036,7696,1515],{"class":1254},[1036,7698,7699],{"class":1038,"line":2310},[1036,7700,1319],{"emptyLinePlaceholder":21},[1036,7702,7703,7705,7707],{"class":1038,"line":2326},[1036,7704,1509],{"class":1254},[1036,7706,1512],{"class":1260},[1036,7708,1515],{"class":1254},[1036,7710,7711,7713,7715,7717,7719,7721,7723,7725],{"class":1038,"line":2344},[1036,7712,1522],{"class":1254},[1036,7714,5027],{"class":1260},[1036,7716,5030],{"class":1537},[1036,7718,1541],{"class":1254},[1036,7720,1468],{"class":1254},[1036,7722,5037],{"class":1046},[1036,7724,1468],{"class":1254},[1036,7726,1515],{"class":1254},[1036,7728,7730,7732,7734,7736,7739],{"class":7729,"line":2360},[1038,1519],[1036,7731,1531],{"class":1254},[1036,7733,1512],{"class":1260},[1036,7735,5050],{"class":1254},[1036,7737,7738],{"class":1537},"header",[1036,7740,1515],{"class":1254},[1036,7742,7744,7746,7749],{"class":7743,"line":2368},[1038,1519],[1036,7745,1555],{"class":1254},[1036,7747,7748],{"class":1260},"ChatsHistory",[1036,7750,1561],{"class":1254},[1036,7752,7754,7756,7758],{"class":7753,"line":3318},[1038,1519],[1036,7755,1566],{"class":1254},[1036,7757,1512],{"class":1260},[1036,7759,1515],{"class":1254},[1036,7761,7762,7764,7766,7768,7770],{"class":1038,"line":3357},[1036,7763,1531],{"class":1254},[1036,7765,1512],{"class":1260},[1036,7767,5050],{"class":1254},[1036,7769,5053],{"class":1537},[1036,7771,1515],{"class":1254},[1036,7773,7774,7776,7778,7780,7782,7784,7786,7788],{"class":1038,"line":3363},[1036,7775,1555],{"class":1254},[1036,7777,5062],{"class":1260},[1036,7779,5065],{"class":1537},[1036,7781,1541],{"class":1254},[1036,7783,1468],{"class":1254},[1036,7785,5072],{"class":1046},[1036,7787,1468],{"class":1254},[1036,7789,1515],{"class":1254},[1036,7791,7792,7794,7796,7798,7800,7802,7804,7806],{"class":1038,"line":3368},[1036,7793,5081],{"class":1254},[1036,7795,5084],{"class":1260},[1036,7797,5065],{"class":1537},[1036,7799,1541],{"class":1254},[1036,7801,1468],{"class":1254},[1036,7803,5093],{"class":1046},[1036,7805,1468],{"class":1254},[1036,7807,1515],{"class":1254},[1036,7809,7810],{"class":1038,"line":3374},[1036,7811,5102],{"class":1250},[1036,7813,7814,7816,7818],{"class":1038,"line":3394},[1036,7815,5107],{"class":1254},[1036,7817,5084],{"class":1260},[1036,7819,1515],{"class":1254},[1036,7821,7822],{"class":1038,"line":3422},[1036,7823,1319],{"emptyLinePlaceholder":21},[1036,7825,7826,7828],{"class":1038,"line":3438},[1036,7827,5081],{"class":1254},[1036,7829,5123],{"class":1260},[1036,7831,7832,7834,7836,7838,7840],{"class":1038,"line":3457},[1036,7833,5129],{"class":1537},[1036,7835,1541],{"class":1254},[1036,7837,1468],{"class":1254},[1036,7839,4792],{"class":1046},[1036,7841,5138],{"class":1254},[1036,7843,7844,7846,7848,7850,7852],{"class":1038,"line":3485},[1036,7845,5144],{"class":1537},[1036,7847,1541],{"class":1254},[1036,7849,1468],{"class":1254},[1036,7851,5151],{"class":1046},[1036,7853,5138],{"class":1254},[1036,7855,7856,7858,7860,7862,7864],{"class":1038,"line":3493},[1036,7857,5159],{"class":1537},[1036,7859,1541],{"class":1254},[1036,7861,1468],{"class":1254},[1036,7863,5166],{"class":1046},[1036,7865,5138],{"class":1254},[1036,7867,7868,7870,7872,7874,7876],{"class":1038,"line":3498},[1036,7869,5174],{"class":1537},[1036,7871,1541],{"class":1254},[1036,7873,1468],{"class":1254},[1036,7875,5181],{"class":1046},[1036,7877,5138],{"class":1254},[1036,7879,7880,7882,7884,7886,7888],{"class":1038,"line":3564},[1036,7881,5189],{"class":1537},[1036,7883,1541],{"class":1254},[1036,7885,1468],{"class":1254},[1036,7887,5196],{"class":1046},[1036,7889,5138],{"class":1254},[1036,7891,7892],{"class":1038,"line":3569},[1036,7893,5204],{"class":1254},[1036,7895,7896,7898,7900,7902,7904,7906,7908,7910],{"class":1038,"line":3574},[1036,7897,5210],{"class":1254},[1036,7899,5213],{"class":1260},[1036,7901,5216],{"class":1537},[1036,7903,1541],{"class":1254},[1036,7905,1468],{"class":1254},[1036,7907,5223],{"class":1046},[1036,7909,1468],{"class":1254},[1036,7911,1561],{"class":1254},[1036,7913,7914,7916,7918],{"class":1038,"line":3580},[1036,7915,5107],{"class":1254},[1036,7917,4674],{"class":1260},[1036,7919,1515],{"class":1254},[1036,7921,7922,7924,7926],{"class":1038,"line":3610},[1036,7923,5241],{"class":1254},[1036,7925,5062],{"class":1260},[1036,7927,1515],{"class":1254},[1036,7929,7930,7932,7934],{"class":1038,"line":3652},[1036,7931,1566],{"class":1254},[1036,7933,1512],{"class":1260},[1036,7935,1515],{"class":1254},[1036,7937,7938,7940,7942],{"class":1038,"line":3681},[1036,7939,1576],{"class":1254},[1036,7941,5027],{"class":1260},[1036,7943,1515],{"class":1254},[1036,7945,7946,7948,7950],{"class":1038,"line":3693},[1036,7947,1585],{"class":1254},[1036,7949,1512],{"class":1260},[1036,7951,1515],{"class":1254},[940,7953,7955],{"id":7954},"integrating-history-in-the-chat-page","Integrating history in the chat page",[1227,7957,7958],{},[1645,7959,7960],{},[1026,7961,7964],{"className":1499,"code":7962,"filename":5332,"highlights":7963,"language":34,"meta":1031,"style":1031},"\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",[3803,3811,3828],[1033,7965,7966,7986,8004,8022,8026,8038,8050,8054,8058,8100,8104,8120,8160,8164,8168,8184,8188,8192,8208,8226,8244,8258,8282,8290,8302,8306,8330,8344,8348,8352,8364,8376,8390,8404,8416,8422,8426,8432,8436,8454,8464,8484,8510,8522,8526,8530,8534,8538,8550,8578,8588,8592,8598,8606,8610,8618,8636,8648,8657,8666,8679,8697,8703,8715,8727,8731,8743,8747,8771,8837,8885,8921,8929,8937,8945,8949,8955,8967,8979,8991,9003,9015,9019,9025,9037,9049,9061,9073,9077,9085,9093,9102,9111],{"__ignoreMap":1031},[1036,7967,7968,7970,7972,7974,7976,7978,7980,7982,7984],{"class":1038,"line":1039},[1036,7969,1509],{"class":1254},[1036,7971,4709],{"class":1260},[1036,7973,4712],{"class":1537},[1036,7975,4715],{"class":1537},[1036,7977,1541],{"class":1254},[1036,7979,1468],{"class":1254},[1036,7981,1233],{"class":1046},[1036,7983,1468],{"class":1254},[1036,7985,1515],{"class":1254},[1036,7987,7988,7990,7992,7994,7996,7998,8000,8002],{"class":1038,"line":1056},[1036,7989,1657],{"class":1240},[1036,7991,1660],{"class":1254},[1036,7993,5365],{"class":1250},[1036,7995,1682],{"class":1254},[1036,7997,1685],{"class":1240},[1036,7999,1341],{"class":1254},[1036,8001,2483],{"class":1046},[1036,8003,1305],{"class":1254},[1036,8005,8006,8008,8010,8012,8014,8016,8018,8020],{"class":1038,"line":1270},[1036,8007,1657],{"class":1240},[1036,8009,1660],{"class":1254},[1036,8011,5385],{"class":1250},[1036,8013,1682],{"class":1254},[1036,8015,1685],{"class":1240},[1036,8017,1341],{"class":1254},[1036,8019,5394],{"class":1046},[1036,8021,1305],{"class":1254},[1036,8023,8024],{"class":1038,"line":1285},[1036,8025,1319],{"emptyLinePlaceholder":21},[1036,8027,8028,8030,8032,8034,8036],{"class":1038,"line":1297},[1036,8029,4730],{"class":1537},[1036,8031,5408],{"class":1250},[1036,8033,1541],{"class":1254},[1036,8035,5413],{"class":1059},[1036,8037,2618],{"class":1250},[1036,8039,8040,8042,8044,8046,8048],{"class":1038,"line":1308},[1036,8041,4730],{"class":1537},[1036,8043,5422],{"class":1250},[1036,8045,1541],{"class":1254},[1036,8047,5427],{"class":1059},[1036,8049,2618],{"class":1250},[1036,8051,8052],{"class":1038,"line":1316},[1036,8053,1319],{"emptyLinePlaceholder":21},[1036,8055,8056],{"class":1038,"line":1322},[1036,8057,5438],{"class":1420},[1036,8059,8060,8062,8064,8066,8068,8070,8072,8074,8076,8078,8080,8082,8084,8086,8088,8090,8092,8094,8096,8098],{"class":1038,"line":1333},[1036,8061,4730],{"class":1537},[1036,8063,1660],{"class":1254},[1036,8065,5447],{"class":1260},[1036,8067,1264],{"class":1254},[1036,8069,5452],{"class":1250},[1036,8071,1438],{"class":1254},[1036,8073,2572],{"class":1254},[1036,8075,2575],{"class":1240},[1036,8077,5461],{"class":1059},[1036,8079,1251],{"class":1250},[1036,8081,3452],{"class":1254},[1036,8083,5468],{"class":1046},[1036,8085,4984],{"class":1254},[1036,8087,5473],{"class":1250},[1036,8089,1758],{"class":1254},[1036,8091,5478],{"class":1250},[1036,8093,1758],{"class":1254},[1036,8095,1967],{"class":1250},[1036,8097,4993],{"class":1254},[1036,8099,1441],{"class":1250},[1036,8101,8102],{"class":1038,"line":1349},[1036,8103,1319],{"emptyLinePlaceholder":21},[1036,8105,8106,8108,8110,8112,8114,8116,8118],{"class":1038,"line":1355},[1036,8107,5495],{"class":1240},[1036,8109,1901],{"class":1250},[1036,8111,3308],{"class":1254},[1036,8113,5502],{"class":1250},[1036,8115,1758],{"class":1254},[1036,8117,5507],{"class":1250},[1036,8119,1255],{"class":1254},[1036,8121,8122,8124,8126,8128,8130,8132,8134,8136,8138,8140,8142,8144,8146,8148,8150,8152,8154,8156,8158],{"class":1038,"line":1360},[1036,8123,5514],{"class":1240},[1036,8125,2848],{"class":1059},[1036,8127,1251],{"class":1260},[1036,8129,1815],{"class":1254},[1036,8131,3330],{"class":1260},[1036,8133,1264],{"class":1254},[1036,8135,3336],{"class":3335},[1036,8137,1666],{"class":1254},[1036,8139,3341],{"class":1260},[1036,8141,1264],{"class":1254},[1036,8143,1341],{"class":1254},[1036,8145,3348],{"class":1046},[1036,8147,1279],{"class":1254},[1036,8149,1666],{"class":1254},[1036,8151,5543],{"class":1260},[1036,8153,1264],{"class":1254},[1036,8155,5548],{"class":1416},[1036,8157,1682],{"class":1254},[1036,8159,1441],{"class":1260},[1036,8161,8162],{"class":1038,"line":1383},[1036,8163,5000],{"class":1254},[1036,8165,8166],{"class":1038,"line":1388},[1036,8167,1319],{"emptyLinePlaceholder":21},[1036,8169,8170,8172,8174,8176,8178,8180,8182],{"class":1038,"line":1398},[1036,8171,4730],{"class":1537},[1036,8173,4733],{"class":1250},[1036,8175,1541],{"class":1254},[1036,8177,4738],{"class":1059},[1036,8179,1251],{"class":1250},[1036,8181,4743],{"class":1254},[1036,8183,1441],{"class":1250},[1036,8185,8186],{"class":1038,"line":1408},[1036,8187,1319],{"emptyLinePlaceholder":21},[1036,8189,8190],{"class":1038,"line":1424},[1036,8191,5585],{"class":1420},[1036,8193,8194,8196,8198,8200,8202,8204,8206],{"class":1038,"line":1430},[1036,8195,4730],{"class":1537},[1036,8197,5592],{"class":1250},[1036,8199,1541],{"class":1254},[1036,8201,1852],{"class":1254},[1036,8203,5385],{"class":1059},[1036,8205,1251],{"class":1250},[1036,8207,1255],{"class":1254},[1036,8209,8210,8212,8214,8216,8218,8220,8222,8224],{"class":1038,"line":1435},[1036,8211,1748],{"class":1260},[1036,8213,1264],{"class":1254},[1036,8215,5612],{"class":1250},[1036,8217,1758],{"class":1254},[1036,8219,4797],{"class":1250},[1036,8221,1758],{"class":1254},[1036,8223,1967],{"class":1250},[1036,8225,1282],{"class":1254},[1036,8227,8228,8230,8232,8234,8236,8238,8240,8242],{"class":1038,"line":2224},[1036,8229,1908],{"class":1260},[1036,8231,1264],{"class":1254},[1036,8233,5612],{"class":1250},[1036,8235,1758],{"class":1254},[1036,8237,4797],{"class":1250},[1036,8239,1758],{"class":1254},[1036,8241,1946],{"class":1250},[1036,8243,1282],{"class":1254},[1036,8245,8246,8248,8250,8252,8254,8256],{"class":1038,"line":2237},[1036,8247,5647],{"class":1260},[1036,8249,1264],{"class":1254},[1036,8251,1852],{"class":1254},[1036,8253,5365],{"class":1059},[1036,8255,1251],{"class":1250},[1036,8257,1255],{"class":1254},[1036,8259,8260,8262,8264,8266,8268,8270,8272,8274,8276,8278,8280],{"class":1038,"line":2267},[1036,8261,5663],{"class":1260},[1036,8263,1264],{"class":1254},[1036,8265,3446],{"class":1254},[1036,8267,5468],{"class":1046},[1036,8269,4984],{"class":1254},[1036,8271,5502],{"class":1250},[1036,8273,1758],{"class":1254},[1036,8275,4797],{"class":1250},[1036,8277,1758],{"class":1254},[1036,8279,1967],{"class":1250},[1036,8281,5684],{"class":1254},[1036,8283,8284,8286,8288],{"class":1038,"line":2273},[1036,8285,2363],{"class":1254},[1036,8287,1832],{"class":1250},[1036,8289,1282],{"class":1254},[1036,8291,8292,8294,8296,8298,8300],{"class":1038,"line":2278},[1036,8293,5699],{"class":1260},[1036,8295,1251],{"class":1254},[1036,8297,5704],{"class":1892},[1036,8299,1832],{"class":1254},[1036,8301,1330],{"class":1254},[1036,8303,8304],{"class":1038,"line":2310},[1036,8305,5714],{"class":1420},[1036,8307,8308,8310,8312,8314,8316,8318,8320,8322,8324,8326,8328],{"class":1038,"line":2326},[1036,8309,5720],{"class":1240},[1036,8311,1901],{"class":1260},[1036,8313,5704],{"class":1250},[1036,8315,1758],{"class":1254},[1036,8317,5729],{"class":1250},[1036,8319,3625],{"class":1254},[1036,8321,1341],{"class":1254},[1036,8323,3911],{"class":1046},[1036,8325,1279],{"class":1254},[1036,8327,3313],{"class":1260},[1036,8329,1255],{"class":1254},[1036,8331,8332,8334,8336,8338,8340,8342],{"class":1038,"line":2344},[1036,8333,5747],{"class":1059},[1036,8335,1251],{"class":1260},[1036,8337,1279],{"class":1254},[1036,8339,1737],{"class":1046},[1036,8341,1279],{"class":1254},[1036,8343,1441],{"class":1260},[1036,8345,8346],{"class":1038,"line":2360},[1036,8347,1427],{"class":1254},[1036,8349,8350],{"class":1038,"line":2368},[1036,8351,1352],{"class":1254},[1036,8353,8354,8356,8358,8360,8362],{"class":1038,"line":3318},[1036,8355,5773],{"class":1260},[1036,8357,1251],{"class":1254},[1036,8359,5778],{"class":1892},[1036,8361,1832],{"class":1254},[1036,8363,1330],{"class":1254},[1036,8365,8366,8368,8370,8372,8374],{"class":1038,"line":3357},[1036,8367,5788],{"class":1250},[1036,8369,1758],{"class":1254},[1036,8371,5793],{"class":1059},[1036,8373,1251],{"class":1260},[1036,8375,1255],{"class":1254},[1036,8377,8378,8380,8382,8384,8386,8388],{"class":1038,"line":3363},[1036,8379,5803],{"class":1260},[1036,8381,1264],{"class":1254},[1036,8383,1341],{"class":1254},[1036,8385,471],{"class":1046},[1036,8387,1279],{"class":1254},[1036,8389,1282],{"class":1254},[1036,8391,8392,8394,8396,8398,8400,8402],{"class":1038,"line":3368},[1036,8393,5819],{"class":1260},[1036,8395,1264],{"class":1254},[1036,8397,5824],{"class":1250},[1036,8399,1758],{"class":1254},[1036,8401,4064],{"class":1250},[1036,8403,1282],{"class":1254},[1036,8405,8406,8408,8410,8412,8414],{"class":1038,"line":3374},[1036,8407,5836],{"class":1260},[1036,8409,1264],{"class":1254},[1036,8411,1341],{"class":1254},[1036,8413,5778],{"class":1046},[1036,8415,1305],{"class":1254},[1036,8417,8418,8420],{"class":1038,"line":3394},[1036,8419,3488],{"class":1254},[1036,8421,1441],{"class":1260},[1036,8423,8424],{"class":1038,"line":3422},[1036,8425,3360],{"class":1254},[1036,8427,8428,8430],{"class":1038,"line":3438},[1036,8429,1438],{"class":1254},[1036,8431,1441],{"class":1250},[1036,8433,8434],{"class":1038,"line":3457},[1036,8435,1319],{"emptyLinePlaceholder":21},[1036,8437,8438,8440,8442,8444,8446,8448,8450,8452],{"class":1038,"line":3485},[1036,8439,5873],{"class":1537},[1036,8441,5876],{"class":1059},[1036,8443,1251],{"class":1254},[1036,8445,5881],{"class":1892},[1036,8447,1264],{"class":1254},[1036,8449,5886],{"class":1042},[1036,8451,1832],{"class":1254},[1036,8453,1330],{"class":1254},[1036,8455,8456,8458,8460,8462],{"class":1038,"line":3493},[1036,8457,5895],{"class":1250},[1036,8459,1758],{"class":1254},[1036,8461,5900],{"class":1059},[1036,8463,2618],{"class":1260},[1036,8465,8466,8468,8470,8472,8474,8476,8478,8480,8482],{"class":1038,"line":3498},[1036,8467,3303],{"class":1240},[1036,8469,1901],{"class":1260},[1036,8471,4792],{"class":1250},[1036,8473,1758],{"class":1254},[1036,8475,4797],{"class":1250},[1036,8477,1758],{"class":1254},[1036,8479,4802],{"class":1059},[1036,8481,4805],{"class":1260},[1036,8483,1255],{"class":1254},[1036,8485,8486,8488,8490,8492,8494,8496,8498,8500,8502,8504,8506,8508],{"class":1038,"line":3564},[1036,8487,5927],{"class":1250},[1036,8489,1758],{"class":1254},[1036,8491,5932],{"class":1059},[1036,8493,1251],{"class":1260},[1036,8495,1815],{"class":1254},[1036,8497,1669],{"class":1260},[1036,8499,1264],{"class":1254},[1036,8501,4938],{"class":1250},[1036,8503,1758],{"class":1254},[1036,8505,4797],{"class":1250},[1036,8507,1682],{"class":1254},[1036,8509,1441],{"class":1260},[1036,8511,8512,8514,8516,8518,8520],{"class":1038,"line":3569},[1036,8513,5955],{"class":1250},[1036,8515,1758],{"class":1254},[1036,8517,4797],{"class":1250},[1036,8519,2572],{"class":1254},[1036,8521,5964],{"class":1254},[1036,8523,8524],{"class":1038,"line":3574},[1036,8525,3360],{"class":1254},[1036,8527,8528],{"class":1038,"line":3580},[1036,8529,5000],{"class":1254},[1036,8531,8532],{"class":1038,"line":3610},[1036,8533,1319],{"emptyLinePlaceholder":21},[1036,8535,8536],{"class":1038,"line":3652},[1036,8537,5981],{"class":1420},[1036,8539,8540,8542,8544,8546,8548],{"class":1038,"line":3681},[1036,8541,5986],{"class":1059},[1036,8543,1251],{"class":1250},[1036,8545,1755],{"class":1254},[1036,8547,1775],{"class":1537},[1036,8549,1330],{"class":1254},[1036,8551,8552,8554,8556,8558,8560,8562,8564,8566,8568,8570,8572,8574,8576],{"class":1038,"line":3693},[1036,8553,3303],{"class":1240},[1036,8555,1901],{"class":1260},[1036,8557,5502],{"class":1250},[1036,8559,1758],{"class":1254},[1036,8561,4797],{"class":1250},[1036,8563,3620],{"class":1254},[1036,8565,1946],{"class":1250},[1036,8567,1758],{"class":1254},[1036,8569,3598],{"class":1250},[1036,8571,3625],{"class":1254},[1036,8573,3604],{"class":3335},[1036,8575,3313],{"class":1260},[1036,8577,1255],{"class":1254},[1036,8579,8580,8582,8584,8586],{"class":1038,"line":3709},[1036,8581,5927],{"class":1250},[1036,8583,1758],{"class":1254},[1036,8585,6031],{"class":1059},[1036,8587,2618],{"class":1260},[1036,8589,8590],{"class":1038,"line":3723},[1036,8591,3360],{"class":1254},[1036,8593,8594,8596],{"class":1038,"line":3730},[1036,8595,1438],{"class":1254},[1036,8597,1441],{"class":1250},[1036,8599,8600,8602,8604],{"class":1038,"line":3735},[1036,8601,1585],{"class":1254},[1036,8603,4709],{"class":1260},[1036,8605,1515],{"class":1254},[1036,8607,8608],{"class":1038,"line":3740},[1036,8609,1319],{"emptyLinePlaceholder":21},[1036,8611,8612,8614,8616],{"class":1038,"line":3746},[1036,8613,1509],{"class":1254},[1036,8615,1512],{"class":1260},[1036,8617,1515],{"class":1254},[1036,8619,8620,8622,8624,8626,8628,8630,8632,8634],{"class":1038,"line":3763},[1036,8621,1522],{"class":1254},[1036,8623,5027],{"class":1260},[1036,8625,5030],{"class":1537},[1036,8627,1541],{"class":1254},[1036,8629,1468],{"class":1254},[1036,8631,5037],{"class":1046},[1036,8633,1468],{"class":1254},[1036,8635,1515],{"class":1254},[1036,8637,8638,8640,8642,8644,8646],{"class":1038,"line":3785},[1036,8639,1531],{"class":1254},[1036,8641,1512],{"class":1260},[1036,8643,5050],{"class":1254},[1036,8645,7738],{"class":1537},[1036,8647,1515],{"class":1254},[1036,8649,8651,8653,8655],{"class":8650,"line":3803},[1038,1519],[1036,8652,1555],{"class":1254},[1036,8654,7748],{"class":1260},[1036,8656,1561],{"class":1254},[1036,8658,8660,8662,8664],{"class":8659,"line":3811},[1038,1519],[1036,8661,1566],{"class":1254},[1036,8663,1512],{"class":1260},[1036,8665,1515],{"class":1254},[1036,8667,8669,8671,8673,8675,8677],{"class":8668,"line":3828},[1038,1519],[1036,8670,1531],{"class":1254},[1036,8672,1512],{"class":1260},[1036,8674,5050],{"class":1254},[1036,8676,5053],{"class":1537},[1036,8678,1515],{"class":1254},[1036,8680,8681,8683,8685,8687,8689,8691,8693,8695],{"class":1038,"line":3847},[1036,8682,1555],{"class":1254},[1036,8684,5062],{"class":1260},[1036,8686,5065],{"class":1537},[1036,8688,1541],{"class":1254},[1036,8690,1468],{"class":1254},[1036,8692,6108],{"class":1046},[1036,8694,1468],{"class":1254},[1036,8696,1515],{"class":1254},[1036,8698,8699,8701],{"class":1038,"line":3855},[1036,8700,5081],{"class":1254},[1036,8702,6119],{"class":1260},[1036,8704,8705,8707,8709,8711,8713],{"class":1038,"line":3860},[1036,8706,6124],{"class":1537},[1036,8708,1541],{"class":1254},[1036,8710,1468],{"class":1254},[1036,8712,6131],{"class":1046},[1036,8714,5138],{"class":1254},[1036,8716,8717,8719,8721,8723,8725],{"class":1038,"line":3866},[1036,8718,5144],{"class":1537},[1036,8720,1541],{"class":1254},[1036,8722,1468],{"class":1254},[1036,8724,6144],{"class":1046},[1036,8726,5138],{"class":1254},[1036,8728,8729],{"class":1038,"line":3886},[1036,8730,6151],{"class":1537},[1036,8732,8733,8735,8737,8739,8741],{"class":1038,"line":3901},[1036,8734,6156],{"class":1537},[1036,8736,1541],{"class":1254},[1036,8738,1468],{"class":1254},[1036,8740,6163],{"class":1046},[1036,8742,5138],{"class":1254},[1036,8744,8745],{"class":1038,"line":3918},[1036,8746,5204],{"class":1254},[1036,8748,8749,8751,8753,8755,8757,8759,8761,8763,8765,8767,8769],{"class":1038,"line":3942},[1036,8750,5210],{"class":1254},[1036,8752,1512],{"class":1260},[1036,8754,5050],{"class":1254},[1036,8756,344],{"class":1537},[1036,8758,1541],{"class":1254},[1036,8760,1468],{"class":1254},[1036,8762,1815],{"class":1254},[1036,8764,6188],{"class":1250},[1036,8766,1438],{"class":1254},[1036,8768,1468],{"class":1254},[1036,8770,1515],{"class":1254},[1036,8772,8773,8775,8777,8779,8781,8783,8785,8787,8789,8791,8793,8795,8797,8799,8801,8803,8805,8807,8809,8811,8813,8815,8817,8819,8821,8823,8825,8827,8829,8831,8833,8835],{"class":1038,"line":3953},[1036,8774,6199],{"class":1254},[1036,8776,1512],{"class":1260},[1036,8778,6204],{"class":1240},[1036,8780,1541],{"class":1254},[1036,8782,1468],{"class":1254},[1036,8784,6211],{"class":1250},[1036,8786,1666],{"class":1254},[1036,8788,6216],{"class":1250},[1036,8790,6219],{"class":1254},[1036,8792,2567],{"class":1250},[1036,8794,1758],{"class":1254},[1036,8796,2148],{"class":1250},[1036,8798,1468],{"class":1254},[1036,8800,6230],{"class":1254},[1036,8802,6233],{"class":1537},[1036,8804,1541],{"class":1254},[1036,8806,6238],{"class":1254},[1036,8808,4064],{"class":1250},[1036,8810,1758],{"class":1254},[1036,8812,1967],{"class":1250},[1036,8814,1438],{"class":1254},[1036,8816,6249],{"class":1046},[1036,8818,4984],{"class":1254},[1036,8820,6254],{"class":1250},[1036,8822,1758],{"class":1254},[1036,8824,5729],{"class":1250},[1036,8826,1438],{"class":1254},[1036,8828,6249],{"class":1046},[1036,8830,4984],{"class":1254},[1036,8832,6267],{"class":1250},[1036,8834,6270],{"class":1254},[1036,8836,1515],{"class":1254},[1036,8838,8839,8841,8843,8845,8847,8849,8851,8853,8855,8857,8859,8861,8863,8865,8867,8869,8871,8873,8875,8877,8879,8881,8883],{"class":1038,"line":3961},[1036,8840,6277],{"class":1254},[1036,8842,6280],{"class":1260},[1036,8844,6283],{"class":1537},[1036,8846,1541],{"class":1254},[1036,8848,1468],{"class":1254},[1036,8850,6290],{"class":1046},[1036,8852,1468],{"class":1254},[1036,8854,6295],{"class":1537},[1036,8856,1541],{"class":1254},[1036,8858,1468],{"class":1254},[1036,8860,6302],{"class":1046},[1036,8862,1468],{"class":1254},[1036,8864,6307],{"class":1537},[1036,8866,1541],{"class":1254},[1036,8868,1468],{"class":1254},[1036,8870,6314],{"class":1046},[1036,8872,1468],{"class":1254},[1036,8874,5065],{"class":1537},[1036,8876,1541],{"class":1254},[1036,8878,1468],{"class":1254},[1036,8880,6325],{"class":1046},[1036,8882,1468],{"class":1254},[1036,8884,1561],{"class":1254},[1036,8886,8887,8889,8891,8893,8895,8897,8899,8901,8903,8905,8907,8909,8911,8913,8915,8917,8919],{"class":1038,"line":3967},[1036,8888,6277],{"class":1254},[1036,8890,936],{"class":1260},[1036,8892,6338],{"class":1537},[1036,8894,1541],{"class":1254},[1036,8896,1468],{"class":1254},[1036,8898,6345],{"class":1046},[1036,8900,1468],{"class":1254},[1036,8902,5065],{"class":1537},[1036,8904,1541],{"class":1254},[1036,8906,1468],{"class":1254},[1036,8908,6356],{"class":1046},[1036,8910,1468],{"class":1254},[1036,8912,2615],{"class":1254},[1036,8914,6363],{"class":1250},[1036,8916,1585],{"class":1254},[1036,8918,936],{"class":1260},[1036,8920,1515],{"class":1254},[1036,8922,8923,8925,8927],{"class":1038,"line":3972},[1036,8924,6374],{"class":1254},[1036,8926,1512],{"class":1260},[1036,8928,1515],{"class":1254},[1036,8930,8931,8933,8935],{"class":1038,"line":3995},[1036,8932,6383],{"class":1254},[1036,8934,1512],{"class":1260},[1036,8936,1515],{"class":1254},[1036,8938,8939,8941,8943],{"class":1038,"line":4001},[1036,8940,5107],{"class":1254},[1036,8942,4680],{"class":1260},[1036,8944,1515],{"class":1254},[1036,8946,8947],{"class":1038,"line":4021},[1036,8948,1319],{"emptyLinePlaceholder":21},[1036,8950,8951,8953],{"class":1038,"line":4027},[1036,8952,5081],{"class":1254},[1036,8954,5123],{"class":1260},[1036,8956,8957,8959,8961,8963,8965],{"class":1038,"line":4073},[1036,8958,5129],{"class":1537},[1036,8960,1541],{"class":1254},[1036,8962,1468],{"class":1254},[1036,8964,4792],{"class":1046},[1036,8966,5138],{"class":1254},[1036,8968,8969,8971,8973,8975,8977],{"class":1038,"line":4089},[1036,8970,6422],{"class":1537},[1036,8972,1541],{"class":1254},[1036,8974,1468],{"class":1254},[1036,8976,6429],{"class":1046},[1036,8978,5138],{"class":1254},[1036,8980,8981,8983,8985,8987,8989],{"class":1038,"line":4122},[1036,8982,5159],{"class":1537},[1036,8984,1541],{"class":1254},[1036,8986,1468],{"class":1254},[1036,8988,5166],{"class":1046},[1036,8990,5138],{"class":1254},[1036,8992,8993,8995,8997,8999,9001],{"class":1038,"line":4136},[1036,8994,6156],{"class":1537},[1036,8996,1541],{"class":1254},[1036,8998,1468],{"class":1254},[1036,9000,6454],{"class":1046},[1036,9002,5138],{"class":1254},[1036,9004,9005,9007,9009,9011,9013],{"class":1038,"line":4144},[1036,9006,5189],{"class":1537},[1036,9008,1541],{"class":1254},[1036,9010,1468],{"class":1254},[1036,9012,6467],{"class":1046},[1036,9014,5138],{"class":1254},[1036,9016,9017],{"class":1038,"line":4149},[1036,9018,5204],{"class":1254},[1036,9020,9021,9023],{"class":1038,"line":4156},[1036,9022,5210],{"class":1254},[1036,9024,6480],{"class":1260},[1036,9026,9027,9029,9031,9033,9035],{"class":1038,"line":4161},[1036,9028,6485],{"class":1537},[1036,9030,1541],{"class":1254},[1036,9032,1468],{"class":1254},[1036,9034,6144],{"class":1046},[1036,9036,5138],{"class":1254},[1036,9038,9039,9041,9043,9045,9047],{"class":1038,"line":4179},[1036,9040,6498],{"class":1537},[1036,9042,1541],{"class":1254},[1036,9044,1468],{"class":1254},[1036,9046,5223],{"class":1046},[1036,9048,5138],{"class":1254},[1036,9050,9051,9053,9055,9057,9059],{"class":1038,"line":6542},[1036,9052,6511],{"class":1537},[1036,9054,1541],{"class":1254},[1036,9056,1468],{"class":1254},[1036,9058,6518],{"class":1046},[1036,9060,5138],{"class":1254},[1036,9062,9063,9065,9067,9069,9071],{"class":1038,"line":6551},[1036,9064,6525],{"class":1537},[1036,9066,1541],{"class":1254},[1036,9068,1468],{"class":1254},[1036,9070,6532],{"class":1046},[1036,9072,5138],{"class":1254},[1036,9074,9075],{"class":1038,"line":6560},[1036,9076,6539],{"class":1254},[1036,9078,9079,9081,9083],{"class":1038,"line":6569},[1036,9080,5107],{"class":1254},[1036,9082,4674],{"class":1260},[1036,9084,1515],{"class":1254},[1036,9086,9087,9089,9091],{"class":1038,"line":6578},[1036,9088,5241],{"class":1254},[1036,9090,5062],{"class":1260},[1036,9092,1515],{"class":1254},[1036,9094,9096,9098,9100],{"class":1038,"line":9095},91,[1036,9097,1566],{"class":1254},[1036,9099,1512],{"class":1260},[1036,9101,1515],{"class":1254},[1036,9103,9105,9107,9109],{"class":1038,"line":9104},92,[1036,9106,1576],{"class":1254},[1036,9108,5027],{"class":1260},[1036,9110,1515],{"class":1254},[1036,9112,9114,9116,9118],{"class":1038,"line":9113},93,[1036,9115,1585],{"class":1254},[1036,9117,1512],{"class":1260},[1036,9119,1515],{"class":1254},[936,9121,4222,9122,9125,9126,9128],{},[1033,9123,9124],{},"refreshNuxtData('chats')"," call in the chat page's ",[1033,9127,6646],{}," callback (as shown earlier) ensures the chat list updates automatically when a new title is generated.",[940,9130,9132],{"id":9131},"adding-multi-model-support","Adding multi-model support",[936,9134,9135,9136,9139],{},"One of the benefits of using ",[1011,9137,4191],{"href":1013,"rel":9138},[1015]," is the ability to switch between models seamlessly. This section adds a model selector to the chat.",[1064,9141,9143],{"id":9142},"creating-a-models-composable","Creating a models composable",[936,9145,9146,9147,1264],{},"Define the available models and persist the user's selection using ",[1011,9148,9151],{"href":9149,"rel":9150},"https://nuxt.com/docs/api/composables/use-cookie",[1015],[1033,9152,9153],{},"useCookie",[1227,9155,9156],{},[1026,9157,9160],{"className":1231,"code":9158,"filename":9159,"language":1233,"meta":1031,"style":1031},"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",[1033,9161,9162,9175,9186,9235,9281,9328,9333,9337,9367,9384,9390,9394,9400,9407,9412,9416],{"__ignoreMap":1031},[1036,9163,9164,9166,9168,9171,9173],{"class":1038,"line":1039},[1036,9165,1241],{"class":1240},[1036,9167,4774],{"class":1537},[1036,9169,9170],{"class":1059}," useModels",[1036,9172,1755],{"class":1254},[1036,9174,1330],{"class":1254},[1036,9176,9177,9179,9182,9184],{"class":1038,"line":1056},[1036,9178,2562],{"class":1537},[1036,9180,9181],{"class":1250}," models",[1036,9183,2572],{"class":1254},[1036,9185,1267],{"class":1260},[1036,9187,9188,9191,9194,9196,9198,9200,9202,9204,9207,9209,9211,9214,9216,9218,9221,9223,9225,9231,9233],{"class":1038,"line":1270},[1036,9189,9190],{"class":1254},"    {",[1036,9192,9193],{"class":1260}," value",[1036,9195,1264],{"class":1254},[1036,9197,1341],{"class":1254},[1036,9199,3157],{"class":1046},[1036,9201,1279],{"class":1254},[1036,9203,1666],{"class":1254},[1036,9205,9206],{"class":1260}," label",[1036,9208,1264],{"class":1254},[1036,9210,1341],{"class":1254},[1036,9212,9213],{"class":1046},"GPT-4o Mini",[1036,9215,1279],{"class":1254},[1036,9217,1666],{"class":1254},[1036,9219,9220],{"class":1260}," icon",[1036,9222,1264],{"class":1254},[1036,9224,1341],{"class":1254},[1036,9226,9227,9230],{"class":1046},[7115,9228],{"class":9229},"shiki-icon-highlight sh9xi","i-simple-icons-openai",[1036,9232,1279],{"class":1254},[1036,9234,3939],{"class":1254},[1036,9236,9237,9239,9241,9243,9245,9248,9250,9252,9254,9256,9258,9261,9263,9265,9267,9269,9271,9277,9279],{"class":1038,"line":1285},[1036,9238,9190],{"class":1254},[1036,9240,9193],{"class":1260},[1036,9242,1264],{"class":1254},[1036,9244,1341],{"class":1254},[1036,9246,9247],{"class":1046},"anthropic/claude-3-5-haiku-latest",[1036,9249,1279],{"class":1254},[1036,9251,1666],{"class":1254},[1036,9253,9206],{"class":1260},[1036,9255,1264],{"class":1254},[1036,9257,1341],{"class":1254},[1036,9259,9260],{"class":1046},"Claude 3.5 Haiku",[1036,9262,1279],{"class":1254},[1036,9264,1666],{"class":1254},[1036,9266,9220],{"class":1260},[1036,9268,1264],{"class":1254},[1036,9270,1341],{"class":1254},[1036,9272,9273,9276],{"class":1046},[7115,9274],{"class":9275},"shiki-icon-highlight sNknm","i-simple-icons-anthropic",[1036,9278,1279],{"class":1254},[1036,9280,3939],{"class":1254},[1036,9282,9283,9285,9287,9289,9291,9294,9296,9298,9300,9302,9304,9307,9309,9311,9313,9315,9317,9323,9325],{"class":1038,"line":1297},[1036,9284,9190],{"class":1254},[1036,9286,9193],{"class":1260},[1036,9288,1264],{"class":1254},[1036,9290,1341],{"class":1254},[1036,9292,9293],{"class":1046},"google/gemini-2.0-flash",[1036,9295,1279],{"class":1254},[1036,9297,1666],{"class":1254},[1036,9299,9206],{"class":1260},[1036,9301,1264],{"class":1254},[1036,9303,1341],{"class":1254},[1036,9305,9306],{"class":1046},"Gemini 2.0 Flash",[1036,9308,1279],{"class":1254},[1036,9310,1666],{"class":1254},[1036,9312,9220],{"class":1260},[1036,9314,1264],{"class":1254},[1036,9316,1341],{"class":1254},[1036,9318,9319,9322],{"class":1046},[7115,9320],{"class":9321},"shiki-icon-highlight scZL3","i-simple-icons-google",[1036,9324,1279],{"class":1254},[1036,9326,9327],{"class":1254}," }\n",[1036,9329,9330],{"class":1038,"line":1308},[1036,9331,9332],{"class":1260},"  ]\n",[1036,9334,9335],{"class":1038,"line":1316},[1036,9336,1319],{"emptyLinePlaceholder":21},[1036,9338,9339,9341,9343,9345,9348,9350,9352,9354,9356,9358,9361,9363,9365],{"class":1038,"line":1322},[1036,9340,2562],{"class":1537},[1036,9342,3101],{"class":1250},[1036,9344,2572],{"class":1254},[1036,9346,9347],{"class":1059}," useCookie",[1036,9349,1509],{"class":1254},[1036,9351,3074],{"class":1042},[1036,9353,2615],{"class":1254},[1036,9355,1251],{"class":1260},[1036,9357,1279],{"class":1254},[1036,9359,9360],{"class":1046},"ai-model",[1036,9362,1279],{"class":1254},[1036,9364,1666],{"class":1254},[1036,9366,1330],{"class":1254},[1036,9368,9369,9372,9374,9376,9378,9380,9382],{"class":1038,"line":1333},[1036,9370,9371],{"class":1059},"    default",[1036,9373,1264],{"class":1254},[1036,9375,4559],{"class":1254},[1036,9377,1775],{"class":1537},[1036,9379,1341],{"class":1254},[1036,9381,3157],{"class":1046},[1036,9383,1305],{"class":1254},[1036,9385,9386,9388],{"class":1038,"line":1349},[1036,9387,2363],{"class":1254},[1036,9389,1441],{"class":1260},[1036,9391,9392],{"class":1038,"line":1355},[1036,9393,1319],{"emptyLinePlaceholder":21},[1036,9395,9396,9398],{"class":1038,"line":1360},[1036,9397,2789],{"class":1240},[1036,9399,1330],{"class":1254},[1036,9401,9402,9405],{"class":1038,"line":1383},[1036,9403,9404],{"class":1250},"    models",[1036,9406,1282],{"class":1254},[1036,9408,9409],{"class":1038,"line":1388},[1036,9410,9411],{"class":1250},"    model\n",[1036,9413,9414],{"class":1038,"line":1398},[1036,9415,3360],{"class":1254},[1036,9417,9418],{"class":1038,"line":1408},[1036,9419,5000],{"class":1254},[1064,9421,9423],{"id":9422},"building-the-model-selector","Building the model selector",[936,9425,1592,9426,9431],{},[1011,9427,9428],{"href":708},[1033,9429,9430],{},"USelectMenu"," component that displays the available models:",[1227,9433,9434],{},[1026,9435,9438],{"className":1499,"code":9436,"filename":9437,"language":34,"meta":1031,"style":1031},"\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",[1033,9439,9440,9460,9493,9497,9514,9518,9536,9570,9574,9582,9586,9594,9601,9614,9628,9642,9655,9668,9673],{"__ignoreMap":1031},[1036,9441,9442,9444,9446,9448,9450,9452,9454,9456,9458],{"class":1038,"line":1039},[1036,9443,1509],{"class":1254},[1036,9445,4709],{"class":1260},[1036,9447,4712],{"class":1537},[1036,9449,4715],{"class":1537},[1036,9451,1541],{"class":1254},[1036,9453,1468],{"class":1254},[1036,9455,1233],{"class":1046},[1036,9457,1468],{"class":1254},[1036,9459,1515],{"class":1254},[1036,9461,9462,9464,9467,9469,9472,9474,9476,9478,9480,9482,9485,9487,9489,9491],{"class":1038,"line":1056},[1036,9463,4730],{"class":1537},[1036,9465,9466],{"class":1250}," model ",[1036,9468,1541],{"class":1254},[1036,9470,9471],{"class":1059}," defineModel",[1036,9473,1509],{"class":1254},[1036,9475,3074],{"class":1042},[1036,9477,2615],{"class":1254},[1036,9479,1251],{"class":1250},[1036,9481,1815],{"class":1254},[1036,9483,9484],{"class":1260}," required",[1036,9486,1264],{"class":1254},[1036,9488,5548],{"class":1416},[1036,9490,1682],{"class":1254},[1036,9492,1441],{"class":1250},[1036,9494,9495],{"class":1038,"line":1270},[1036,9496,1319],{"emptyLinePlaceholder":21},[1036,9498,9499,9501,9503,9506,9508,9510,9512],{"class":1038,"line":1285},[1036,9500,4730],{"class":1537},[1036,9502,1660],{"class":1254},[1036,9504,9505],{"class":1250}," models ",[1036,9507,1438],{"class":1254},[1036,9509,2572],{"class":1254},[1036,9511,9170],{"class":1059},[1036,9513,2618],{"class":1250},[1036,9515,9516],{"class":1038,"line":1297},[1036,9517,1319],{"emptyLinePlaceholder":21},[1036,9519,9520,9522,9525,9527,9529,9531,9533],{"class":1038,"line":1308},[1036,9521,4730],{"class":1537},[1036,9523,9524],{"class":1250}," selectedModel ",[1036,9526,1541],{"class":1254},[1036,9528,7057],{"class":1059},[1036,9530,1251],{"class":1250},[1036,9532,1755],{"class":1254},[1036,9534,9535],{"class":1537}," =>\n",[1036,9537,9538,9541,9543,9546,9548,9551,9553,9556,9558,9561,9563,9565,9567],{"class":1038,"line":1316},[1036,9539,9540],{"class":1250},"  models",[1036,9542,1758],{"class":1254},[1036,9544,9545],{"class":1059},"find",[1036,9547,1251],{"class":1250},[1036,9549,9550],{"class":1892},"m",[1036,9552,1775],{"class":1537},[1036,9554,9555],{"class":1250}," m",[1036,9557,1758],{"class":1254},[1036,9559,9560],{"class":1250},"value ",[1036,9562,7140],{"class":1254},[1036,9564,3101],{"class":1250},[1036,9566,1758],{"class":1254},[1036,9568,9569],{"class":1250},"value)\n",[1036,9571,9572],{"class":1038,"line":1322},[1036,9573,1441],{"class":1250},[1036,9575,9576,9578,9580],{"class":1038,"line":1333},[1036,9577,1585],{"class":1254},[1036,9579,4709],{"class":1260},[1036,9581,1515],{"class":1254},[1036,9583,9584],{"class":1038,"line":1349},[1036,9585,1319],{"emptyLinePlaceholder":21},[1036,9587,9588,9590,9592],{"class":1038,"line":1355},[1036,9589,1509],{"class":1254},[1036,9591,1512],{"class":1260},[1036,9593,1515],{"class":1254},[1036,9595,9596,9598],{"class":1038,"line":1360},[1036,9597,1522],{"class":1254},[1036,9599,9600],{"class":1260},"USelectMenu\n",[1036,9602,9603,9606,9608,9610,9612],{"class":1038,"line":1383},[1036,9604,9605],{"class":1537},"    v-model",[1036,9607,1541],{"class":1254},[1036,9609,1468],{"class":1254},[1036,9611,4235],{"class":1046},[1036,9613,5138],{"class":1254},[1036,9615,9616,9619,9621,9623,9626],{"class":1038,"line":1388},[1036,9617,9618],{"class":1537},"    :items",[1036,9620,1541],{"class":1254},[1036,9622,1468],{"class":1254},[1036,9624,9625],{"class":1046},"models",[1036,9627,5138],{"class":1254},[1036,9629,9630,9633,9635,9637,9640],{"class":1038,"line":1398},[1036,9631,9632],{"class":1537},"    :icon",[1036,9634,1541],{"class":1254},[1036,9636,1468],{"class":1254},[1036,9638,9639],{"class":1046},"selectedModel?.icon",[1036,9641,5138],{"class":1254},[1036,9643,9644,9647,9649,9651,9653],{"class":1038,"line":1408},[1036,9645,9646],{"class":1537},"    variant",[1036,9648,1541],{"class":1254},[1036,9650,1468],{"class":1254},[1036,9652,7345],{"class":1046},[1036,9654,5138],{"class":1254},[1036,9656,9657,9660,9662,9664,9666],{"class":1038,"line":1424},[1036,9658,9659],{"class":1537},"    value-key",[1036,9661,1541],{"class":1254},[1036,9663,1468],{"class":1254},[1036,9665,4797],{"class":1046},[1036,9667,5138],{"class":1254},[1036,9669,9670],{"class":1038,"line":1430},[1036,9671,9672],{"class":1254},"  />\n",[1036,9674,9675,9677,9679],{"class":1038,"line":1435},[1036,9676,1585],{"class":1254},[1036,9678,1512],{"class":1260},[1036,9680,1515],{"class":1254},[1064,9682,9684],{"id":9683},"integrating-with-the-chat","Integrating with the chat",[936,9686,9687],{},"Update the chat page to include the model selector and pass the selected model to the server:",[1227,9689,9690],{},[1645,9691,9692],{},[1026,9693,9696],{"className":1499,"code":9694,"filename":5332,"highlights":9695,"language":34,"meta":1031,"style":1031},"\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",[1322,2273,2278,2310,4179,6542,6551],[1033,9697,9698,9718,9736,9754,9758,9770,9782,9798,9803,9845,9849,9865,9905,9909,9913,9929,9933,9949,9967,9985,9999,10025,10033,10049,10054,10063,10075,10099,10113,10117,10121,10133,10145,10159,10173,10185,10191,10195,10201,10205,10223,10233,10253,10279,10291,10295,10299,10303,10315,10343,10353,10357,10363,10371,10375,10383,10401,10413,10421,10429,10441,10459,10465,10477,10489,10493,10505,10509,10533,10599,10647,10683,10691,10699,10707,10711,10717,10729,10741,10753,10765,10777,10781,10794,10814,10823,10828,10835,10847,10859,10871,10883,10887,10895,10904,10913,10922],{"__ignoreMap":1031},[1036,9699,9700,9702,9704,9706,9708,9710,9712,9714,9716],{"class":1038,"line":1039},[1036,9701,1509],{"class":1254},[1036,9703,4709],{"class":1260},[1036,9705,4712],{"class":1537},[1036,9707,4715],{"class":1537},[1036,9709,1541],{"class":1254},[1036,9711,1468],{"class":1254},[1036,9713,1233],{"class":1046},[1036,9715,1468],{"class":1254},[1036,9717,1515],{"class":1254},[1036,9719,9720,9722,9724,9726,9728,9730,9732,9734],{"class":1038,"line":1056},[1036,9721,1657],{"class":1240},[1036,9723,1660],{"class":1254},[1036,9725,5365],{"class":1250},[1036,9727,1682],{"class":1254},[1036,9729,1685],{"class":1240},[1036,9731,1341],{"class":1254},[1036,9733,2483],{"class":1046},[1036,9735,1305],{"class":1254},[1036,9737,9738,9740,9742,9744,9746,9748,9750,9752],{"class":1038,"line":1270},[1036,9739,1657],{"class":1240},[1036,9741,1660],{"class":1254},[1036,9743,5385],{"class":1250},[1036,9745,1682],{"class":1254},[1036,9747,1685],{"class":1240},[1036,9749,1341],{"class":1254},[1036,9751,5394],{"class":1046},[1036,9753,1305],{"class":1254},[1036,9755,9756],{"class":1038,"line":1285},[1036,9757,1319],{"emptyLinePlaceholder":21},[1036,9759,9760,9762,9764,9766,9768],{"class":1038,"line":1297},[1036,9761,4730],{"class":1537},[1036,9763,5408],{"class":1250},[1036,9765,1541],{"class":1254},[1036,9767,5413],{"class":1059},[1036,9769,2618],{"class":1250},[1036,9771,9772,9774,9776,9778,9780],{"class":1038,"line":1308},[1036,9773,4730],{"class":1537},[1036,9775,5422],{"class":1250},[1036,9777,1541],{"class":1254},[1036,9779,5427],{"class":1059},[1036,9781,2618],{"class":1250},[1036,9783,9784,9786,9788,9790,9792,9794,9796],{"class":1038,"line":1316},[1036,9785,4730],{"class":1537},[1036,9787,1660],{"class":1254},[1036,9789,9466],{"class":1250},[1036,9791,1438],{"class":1254},[1036,9793,2572],{"class":1254},[1036,9795,9170],{"class":1059},[1036,9797,2618],{"class":1250},[1036,9799,9801],{"class":9800,"line":1322},[1038,1519],[1036,9802,1319],{"emptyLinePlaceholder":21},[1036,9804,9805,9807,9809,9811,9813,9815,9817,9819,9821,9823,9825,9827,9829,9831,9833,9835,9837,9839,9841,9843],{"class":1038,"line":1333},[1036,9806,4730],{"class":1537},[1036,9808,1660],{"class":1254},[1036,9810,5447],{"class":1260},[1036,9812,1264],{"class":1254},[1036,9814,5452],{"class":1250},[1036,9816,1438],{"class":1254},[1036,9818,2572],{"class":1254},[1036,9820,2575],{"class":1240},[1036,9822,5461],{"class":1059},[1036,9824,1251],{"class":1250},[1036,9826,3452],{"class":1254},[1036,9828,5468],{"class":1046},[1036,9830,4984],{"class":1254},[1036,9832,5473],{"class":1250},[1036,9834,1758],{"class":1254},[1036,9836,5478],{"class":1250},[1036,9838,1758],{"class":1254},[1036,9840,1967],{"class":1250},[1036,9842,4993],{"class":1254},[1036,9844,1441],{"class":1250},[1036,9846,9847],{"class":1038,"line":1349},[1036,9848,1319],{"emptyLinePlaceholder":21},[1036,9850,9851,9853,9855,9857,9859,9861,9863],{"class":1038,"line":1355},[1036,9852,5495],{"class":1240},[1036,9854,1901],{"class":1250},[1036,9856,3308],{"class":1254},[1036,9858,5502],{"class":1250},[1036,9860,1758],{"class":1254},[1036,9862,5507],{"class":1250},[1036,9864,1255],{"class":1254},[1036,9866,9867,9869,9871,9873,9875,9877,9879,9881,9883,9885,9887,9889,9891,9893,9895,9897,9899,9901,9903],{"class":1038,"line":1360},[1036,9868,5514],{"class":1240},[1036,9870,2848],{"class":1059},[1036,9872,1251],{"class":1260},[1036,9874,1815],{"class":1254},[1036,9876,3330],{"class":1260},[1036,9878,1264],{"class":1254},[1036,9880,3336],{"class":3335},[1036,9882,1666],{"class":1254},[1036,9884,3341],{"class":1260},[1036,9886,1264],{"class":1254},[1036,9888,1341],{"class":1254},[1036,9890,3348],{"class":1046},[1036,9892,1279],{"class":1254},[1036,9894,1666],{"class":1254},[1036,9896,5543],{"class":1260},[1036,9898,1264],{"class":1254},[1036,9900,5548],{"class":1416},[1036,9902,1682],{"class":1254},[1036,9904,1441],{"class":1260},[1036,9906,9907],{"class":1038,"line":1383},[1036,9908,5000],{"class":1254},[1036,9910,9911],{"class":1038,"line":1388},[1036,9912,1319],{"emptyLinePlaceholder":21},[1036,9914,9915,9917,9919,9921,9923,9925,9927],{"class":1038,"line":1398},[1036,9916,4730],{"class":1537},[1036,9918,4733],{"class":1250},[1036,9920,1541],{"class":1254},[1036,9922,4738],{"class":1059},[1036,9924,1251],{"class":1250},[1036,9926,4743],{"class":1254},[1036,9928,1441],{"class":1250},[1036,9930,9931],{"class":1038,"line":1408},[1036,9932,1319],{"emptyLinePlaceholder":21},[1036,9934,9935,9937,9939,9941,9943,9945,9947],{"class":1038,"line":1424},[1036,9936,4730],{"class":1537},[1036,9938,5592],{"class":1250},[1036,9940,1541],{"class":1254},[1036,9942,1852],{"class":1254},[1036,9944,5385],{"class":1059},[1036,9946,1251],{"class":1250},[1036,9948,1255],{"class":1254},[1036,9950,9951,9953,9955,9957,9959,9961,9963,9965],{"class":1038,"line":1430},[1036,9952,1748],{"class":1260},[1036,9954,1264],{"class":1254},[1036,9956,5612],{"class":1250},[1036,9958,1758],{"class":1254},[1036,9960,4797],{"class":1250},[1036,9962,1758],{"class":1254},[1036,9964,1967],{"class":1250},[1036,9966,1282],{"class":1254},[1036,9968,9969,9971,9973,9975,9977,9979,9981,9983],{"class":1038,"line":1435},[1036,9970,1908],{"class":1260},[1036,9972,1264],{"class":1254},[1036,9974,5612],{"class":1250},[1036,9976,1758],{"class":1254},[1036,9978,4797],{"class":1250},[1036,9980,1758],{"class":1254},[1036,9982,1946],{"class":1250},[1036,9984,1282],{"class":1254},[1036,9986,9987,9989,9991,9993,9995,9997],{"class":1038,"line":2224},[1036,9988,5647],{"class":1260},[1036,9990,1264],{"class":1254},[1036,9992,1852],{"class":1254},[1036,9994,5365],{"class":1059},[1036,9996,1251],{"class":1250},[1036,9998,1255],{"class":1254},[1036,10000,10001,10003,10005,10007,10009,10011,10013,10015,10017,10019,10021,10023],{"class":1038,"line":2237},[1036,10002,5663],{"class":1260},[1036,10004,1264],{"class":1254},[1036,10006,3446],{"class":1254},[1036,10008,5468],{"class":1046},[1036,10010,4984],{"class":1254},[1036,10012,5502],{"class":1250},[1036,10014,1758],{"class":1254},[1036,10016,4797],{"class":1250},[1036,10018,1758],{"class":1254},[1036,10020,1967],{"class":1250},[1036,10022,4993],{"class":1254},[1036,10024,1282],{"class":1254},[1036,10026,10027,10029,10031],{"class":1038,"line":2267},[1036,10028,4881],{"class":1260},[1036,10030,1264],{"class":1254},[1036,10032,1330],{"class":1254},[1036,10034,10036,10038,10040,10042,10044,10046],{"class":10035,"line":2273},[1038,1519],[1036,10037,3425],{"class":1260},[1036,10039,1264],{"class":1254},[1036,10041,3101],{"class":1250},[1036,10043,1758],{"class":1254},[1036,10045,9560],{"class":1250},[1036,10047,10048],{"class":1420},"// Pass the selected model\n",[1036,10050,10052],{"class":10051,"line":2278},[1038,1519],[1036,10053,1427],{"class":1254},[1036,10055,10057,10059,10061],{"class":10056,"line":2310},[1038,1519],[1036,10058,2363],{"class":1254},[1036,10060,1832],{"class":1250},[1036,10062,1282],{"class":1254},[1036,10064,10065,10067,10069,10071,10073],{"class":1038,"line":2326},[1036,10066,5699],{"class":1260},[1036,10068,1251],{"class":1254},[1036,10070,5704],{"class":1892},[1036,10072,1832],{"class":1254},[1036,10074,1330],{"class":1254},[1036,10076,10077,10079,10081,10083,10085,10087,10089,10091,10093,10095,10097],{"class":1038,"line":2344},[1036,10078,5720],{"class":1240},[1036,10080,1901],{"class":1260},[1036,10082,5704],{"class":1250},[1036,10084,1758],{"class":1254},[1036,10086,5729],{"class":1250},[1036,10088,3625],{"class":1254},[1036,10090,1341],{"class":1254},[1036,10092,3911],{"class":1046},[1036,10094,1279],{"class":1254},[1036,10096,3313],{"class":1260},[1036,10098,1255],{"class":1254},[1036,10100,10101,10103,10105,10107,10109,10111],{"class":1038,"line":2360},[1036,10102,5747],{"class":1059},[1036,10104,1251],{"class":1260},[1036,10106,1279],{"class":1254},[1036,10108,1737],{"class":1046},[1036,10110,1279],{"class":1254},[1036,10112,1441],{"class":1260},[1036,10114,10115],{"class":1038,"line":2368},[1036,10116,1427],{"class":1254},[1036,10118,10119],{"class":1038,"line":3318},[1036,10120,1352],{"class":1254},[1036,10122,10123,10125,10127,10129,10131],{"class":1038,"line":3357},[1036,10124,5773],{"class":1260},[1036,10126,1251],{"class":1254},[1036,10128,5778],{"class":1892},[1036,10130,1832],{"class":1254},[1036,10132,1330],{"class":1254},[1036,10134,10135,10137,10139,10141,10143],{"class":1038,"line":3363},[1036,10136,5788],{"class":1250},[1036,10138,1758],{"class":1254},[1036,10140,5793],{"class":1059},[1036,10142,1251],{"class":1260},[1036,10144,1255],{"class":1254},[1036,10146,10147,10149,10151,10153,10155,10157],{"class":1038,"line":3368},[1036,10148,5803],{"class":1260},[1036,10150,1264],{"class":1254},[1036,10152,1341],{"class":1254},[1036,10154,471],{"class":1046},[1036,10156,1279],{"class":1254},[1036,10158,1282],{"class":1254},[1036,10160,10161,10163,10165,10167,10169,10171],{"class":1038,"line":3374},[1036,10162,5819],{"class":1260},[1036,10164,1264],{"class":1254},[1036,10166,5824],{"class":1250},[1036,10168,1758],{"class":1254},[1036,10170,4064],{"class":1250},[1036,10172,1282],{"class":1254},[1036,10174,10175,10177,10179,10181,10183],{"class":1038,"line":3394},[1036,10176,5836],{"class":1260},[1036,10178,1264],{"class":1254},[1036,10180,1341],{"class":1254},[1036,10182,5778],{"class":1046},[1036,10184,1305],{"class":1254},[1036,10186,10187,10189],{"class":1038,"line":3422},[1036,10188,3488],{"class":1254},[1036,10190,1441],{"class":1260},[1036,10192,10193],{"class":1038,"line":3438},[1036,10194,3360],{"class":1254},[1036,10196,10197,10199],{"class":1038,"line":3457},[1036,10198,1438],{"class":1254},[1036,10200,1441],{"class":1250},[1036,10202,10203],{"class":1038,"line":3485},[1036,10204,1319],{"emptyLinePlaceholder":21},[1036,10206,10207,10209,10211,10213,10215,10217,10219,10221],{"class":1038,"line":3493},[1036,10208,5873],{"class":1537},[1036,10210,5876],{"class":1059},[1036,10212,1251],{"class":1254},[1036,10214,5881],{"class":1892},[1036,10216,1264],{"class":1254},[1036,10218,5886],{"class":1042},[1036,10220,1832],{"class":1254},[1036,10222,1330],{"class":1254},[1036,10224,10225,10227,10229,10231],{"class":1038,"line":3498},[1036,10226,5895],{"class":1250},[1036,10228,1758],{"class":1254},[1036,10230,5900],{"class":1059},[1036,10232,2618],{"class":1260},[1036,10234,10235,10237,10239,10241,10243,10245,10247,10249,10251],{"class":1038,"line":3564},[1036,10236,3303],{"class":1240},[1036,10238,1901],{"class":1260},[1036,10240,4792],{"class":1250},[1036,10242,1758],{"class":1254},[1036,10244,4797],{"class":1250},[1036,10246,1758],{"class":1254},[1036,10248,4802],{"class":1059},[1036,10250,4805],{"class":1260},[1036,10252,1255],{"class":1254},[1036,10254,10255,10257,10259,10261,10263,10265,10267,10269,10271,10273,10275,10277],{"class":1038,"line":3569},[1036,10256,5927],{"class":1250},[1036,10258,1758],{"class":1254},[1036,10260,5932],{"class":1059},[1036,10262,1251],{"class":1260},[1036,10264,1815],{"class":1254},[1036,10266,1669],{"class":1260},[1036,10268,1264],{"class":1254},[1036,10270,4938],{"class":1250},[1036,10272,1758],{"class":1254},[1036,10274,4797],{"class":1250},[1036,10276,1682],{"class":1254},[1036,10278,1441],{"class":1260},[1036,10280,10281,10283,10285,10287,10289],{"class":1038,"line":3574},[1036,10282,5955],{"class":1250},[1036,10284,1758],{"class":1254},[1036,10286,4797],{"class":1250},[1036,10288,2572],{"class":1254},[1036,10290,5964],{"class":1254},[1036,10292,10293],{"class":1038,"line":3580},[1036,10294,3360],{"class":1254},[1036,10296,10297],{"class":1038,"line":3610},[1036,10298,5000],{"class":1254},[1036,10300,10301],{"class":1038,"line":3652},[1036,10302,1319],{"emptyLinePlaceholder":21},[1036,10304,10305,10307,10309,10311,10313],{"class":1038,"line":3681},[1036,10306,5986],{"class":1059},[1036,10308,1251],{"class":1250},[1036,10310,1755],{"class":1254},[1036,10312,1775],{"class":1537},[1036,10314,1330],{"class":1254},[1036,10316,10317,10319,10321,10323,10325,10327,10329,10331,10333,10335,10337,10339,10341],{"class":1038,"line":3693},[1036,10318,3303],{"class":1240},[1036,10320,1901],{"class":1260},[1036,10322,5502],{"class":1250},[1036,10324,1758],{"class":1254},[1036,10326,4797],{"class":1250},[1036,10328,3620],{"class":1254},[1036,10330,1946],{"class":1250},[1036,10332,1758],{"class":1254},[1036,10334,3598],{"class":1250},[1036,10336,3625],{"class":1254},[1036,10338,3604],{"class":3335},[1036,10340,3313],{"class":1260},[1036,10342,1255],{"class":1254},[1036,10344,10345,10347,10349,10351],{"class":1038,"line":3709},[1036,10346,5927],{"class":1250},[1036,10348,1758],{"class":1254},[1036,10350,6031],{"class":1059},[1036,10352,2618],{"class":1260},[1036,10354,10355],{"class":1038,"line":3723},[1036,10356,3360],{"class":1254},[1036,10358,10359,10361],{"class":1038,"line":3730},[1036,10360,1438],{"class":1254},[1036,10362,1441],{"class":1250},[1036,10364,10365,10367,10369],{"class":1038,"line":3735},[1036,10366,1585],{"class":1254},[1036,10368,4709],{"class":1260},[1036,10370,1515],{"class":1254},[1036,10372,10373],{"class":1038,"line":3740},[1036,10374,1319],{"emptyLinePlaceholder":21},[1036,10376,10377,10379,10381],{"class":1038,"line":3746},[1036,10378,1509],{"class":1254},[1036,10380,1512],{"class":1260},[1036,10382,1515],{"class":1254},[1036,10384,10385,10387,10389,10391,10393,10395,10397,10399],{"class":1038,"line":3763},[1036,10386,1522],{"class":1254},[1036,10388,5027],{"class":1260},[1036,10390,5030],{"class":1537},[1036,10392,1541],{"class":1254},[1036,10394,1468],{"class":1254},[1036,10396,5037],{"class":1046},[1036,10398,1468],{"class":1254},[1036,10400,1515],{"class":1254},[1036,10402,10403,10405,10407,10409,10411],{"class":1038,"line":3785},[1036,10404,1531],{"class":1254},[1036,10406,1512],{"class":1260},[1036,10408,5050],{"class":1254},[1036,10410,7738],{"class":1537},[1036,10412,1515],{"class":1254},[1036,10414,10415,10417,10419],{"class":1038,"line":3803},[1036,10416,1555],{"class":1254},[1036,10418,7748],{"class":1260},[1036,10420,1561],{"class":1254},[1036,10422,10423,10425,10427],{"class":1038,"line":3811},[1036,10424,1566],{"class":1254},[1036,10426,1512],{"class":1260},[1036,10428,1515],{"class":1254},[1036,10430,10431,10433,10435,10437,10439],{"class":1038,"line":3828},[1036,10432,1531],{"class":1254},[1036,10434,1512],{"class":1260},[1036,10436,5050],{"class":1254},[1036,10438,5053],{"class":1537},[1036,10440,1515],{"class":1254},[1036,10442,10443,10445,10447,10449,10451,10453,10455,10457],{"class":1038,"line":3847},[1036,10444,1555],{"class":1254},[1036,10446,5062],{"class":1260},[1036,10448,5065],{"class":1537},[1036,10450,1541],{"class":1254},[1036,10452,1468],{"class":1254},[1036,10454,6108],{"class":1046},[1036,10456,1468],{"class":1254},[1036,10458,1515],{"class":1254},[1036,10460,10461,10463],{"class":1038,"line":3855},[1036,10462,5081],{"class":1254},[1036,10464,6119],{"class":1260},[1036,10466,10467,10469,10471,10473,10475],{"class":1038,"line":3860},[1036,10468,6124],{"class":1537},[1036,10470,1541],{"class":1254},[1036,10472,1468],{"class":1254},[1036,10474,6131],{"class":1046},[1036,10476,5138],{"class":1254},[1036,10478,10479,10481,10483,10485,10487],{"class":1038,"line":3866},[1036,10480,5144],{"class":1537},[1036,10482,1541],{"class":1254},[1036,10484,1468],{"class":1254},[1036,10486,6144],{"class":1046},[1036,10488,5138],{"class":1254},[1036,10490,10491],{"class":1038,"line":3886},[1036,10492,6151],{"class":1537},[1036,10494,10495,10497,10499,10501,10503],{"class":1038,"line":3901},[1036,10496,6156],{"class":1537},[1036,10498,1541],{"class":1254},[1036,10500,1468],{"class":1254},[1036,10502,6163],{"class":1046},[1036,10504,5138],{"class":1254},[1036,10506,10507],{"class":1038,"line":3918},[1036,10508,5204],{"class":1254},[1036,10510,10511,10513,10515,10517,10519,10521,10523,10525,10527,10529,10531],{"class":1038,"line":3942},[1036,10512,5210],{"class":1254},[1036,10514,1512],{"class":1260},[1036,10516,5050],{"class":1254},[1036,10518,344],{"class":1537},[1036,10520,1541],{"class":1254},[1036,10522,1468],{"class":1254},[1036,10524,1815],{"class":1254},[1036,10526,6188],{"class":1250},[1036,10528,1438],{"class":1254},[1036,10530,1468],{"class":1254},[1036,10532,1515],{"class":1254},[1036,10534,10535,10537,10539,10541,10543,10545,10547,10549,10551,10553,10555,10557,10559,10561,10563,10565,10567,10569,10571,10573,10575,10577,10579,10581,10583,10585,10587,10589,10591,10593,10595,10597],{"class":1038,"line":3953},[1036,10536,6199],{"class":1254},[1036,10538,1512],{"class":1260},[1036,10540,6204],{"class":1240},[1036,10542,1541],{"class":1254},[1036,10544,1468],{"class":1254},[1036,10546,6211],{"class":1250},[1036,10548,1666],{"class":1254},[1036,10550,6216],{"class":1250},[1036,10552,6219],{"class":1254},[1036,10554,2567],{"class":1250},[1036,10556,1758],{"class":1254},[1036,10558,2148],{"class":1250},[1036,10560,1468],{"class":1254},[1036,10562,6230],{"class":1254},[1036,10564,6233],{"class":1537},[1036,10566,1541],{"class":1254},[1036,10568,6238],{"class":1254},[1036,10570,4064],{"class":1250},[1036,10572,1758],{"class":1254},[1036,10574,1967],{"class":1250},[1036,10576,1438],{"class":1254},[1036,10578,6249],{"class":1046},[1036,10580,4984],{"class":1254},[1036,10582,6254],{"class":1250},[1036,10584,1758],{"class":1254},[1036,10586,5729],{"class":1250},[1036,10588,1438],{"class":1254},[1036,10590,6249],{"class":1046},[1036,10592,4984],{"class":1254},[1036,10594,6267],{"class":1250},[1036,10596,6270],{"class":1254},[1036,10598,1515],{"class":1254},[1036,10600,10601,10603,10605,10607,10609,10611,10613,10615,10617,10619,10621,10623,10625,10627,10629,10631,10633,10635,10637,10639,10641,10643,10645],{"class":1038,"line":3961},[1036,10602,6277],{"class":1254},[1036,10604,6280],{"class":1260},[1036,10606,6283],{"class":1537},[1036,10608,1541],{"class":1254},[1036,10610,1468],{"class":1254},[1036,10612,6290],{"class":1046},[1036,10614,1468],{"class":1254},[1036,10616,6295],{"class":1537},[1036,10618,1541],{"class":1254},[1036,10620,1468],{"class":1254},[1036,10622,6302],{"class":1046},[1036,10624,1468],{"class":1254},[1036,10626,6307],{"class":1537},[1036,10628,1541],{"class":1254},[1036,10630,1468],{"class":1254},[1036,10632,6314],{"class":1046},[1036,10634,1468],{"class":1254},[1036,10636,5065],{"class":1537},[1036,10638,1541],{"class":1254},[1036,10640,1468],{"class":1254},[1036,10642,6325],{"class":1046},[1036,10644,1468],{"class":1254},[1036,10646,1561],{"class":1254},[1036,10648,10649,10651,10653,10655,10657,10659,10661,10663,10665,10667,10669,10671,10673,10675,10677,10679,10681],{"class":1038,"line":3967},[1036,10650,6277],{"class":1254},[1036,10652,936],{"class":1260},[1036,10654,6338],{"class":1537},[1036,10656,1541],{"class":1254},[1036,10658,1468],{"class":1254},[1036,10660,6345],{"class":1046},[1036,10662,1468],{"class":1254},[1036,10664,5065],{"class":1537},[1036,10666,1541],{"class":1254},[1036,10668,1468],{"class":1254},[1036,10670,6356],{"class":1046},[1036,10672,1468],{"class":1254},[1036,10674,2615],{"class":1254},[1036,10676,6363],{"class":1250},[1036,10678,1585],{"class":1254},[1036,10680,936],{"class":1260},[1036,10682,1515],{"class":1254},[1036,10684,10685,10687,10689],{"class":1038,"line":3972},[1036,10686,6374],{"class":1254},[1036,10688,1512],{"class":1260},[1036,10690,1515],{"class":1254},[1036,10692,10693,10695,10697],{"class":1038,"line":3995},[1036,10694,6383],{"class":1254},[1036,10696,1512],{"class":1260},[1036,10698,1515],{"class":1254},[1036,10700,10701,10703,10705],{"class":1038,"line":4001},[1036,10702,5107],{"class":1254},[1036,10704,4680],{"class":1260},[1036,10706,1515],{"class":1254},[1036,10708,10709],{"class":1038,"line":4021},[1036,10710,1319],{"emptyLinePlaceholder":21},[1036,10712,10713,10715],{"class":1038,"line":4027},[1036,10714,5081],{"class":1254},[1036,10716,5123],{"class":1260},[1036,10718,10719,10721,10723,10725,10727],{"class":1038,"line":4073},[1036,10720,5129],{"class":1537},[1036,10722,1541],{"class":1254},[1036,10724,1468],{"class":1254},[1036,10726,4792],{"class":1046},[1036,10728,5138],{"class":1254},[1036,10730,10731,10733,10735,10737,10739],{"class":1038,"line":4089},[1036,10732,6422],{"class":1537},[1036,10734,1541],{"class":1254},[1036,10736,1468],{"class":1254},[1036,10738,6429],{"class":1046},[1036,10740,5138],{"class":1254},[1036,10742,10743,10745,10747,10749,10751],{"class":1038,"line":4122},[1036,10744,5159],{"class":1537},[1036,10746,1541],{"class":1254},[1036,10748,1468],{"class":1254},[1036,10750,5166],{"class":1046},[1036,10752,5138],{"class":1254},[1036,10754,10755,10757,10759,10761,10763],{"class":1038,"line":4136},[1036,10756,6156],{"class":1537},[1036,10758,1541],{"class":1254},[1036,10760,1468],{"class":1254},[1036,10762,6454],{"class":1046},[1036,10764,5138],{"class":1254},[1036,10766,10767,10769,10771,10773,10775],{"class":1038,"line":4144},[1036,10768,5189],{"class":1537},[1036,10770,1541],{"class":1254},[1036,10772,1468],{"class":1254},[1036,10774,6467],{"class":1046},[1036,10776,5138],{"class":1254},[1036,10778,10779],{"class":1038,"line":4149},[1036,10780,5204],{"class":1254},[1036,10782,10783,10785,10787,10789,10792],{"class":1038,"line":4156},[1036,10784,5210],{"class":1254},[1036,10786,1512],{"class":1260},[1036,10788,5050],{"class":1254},[1036,10790,10791],{"class":1537},"footer",[1036,10793,1515],{"class":1254},[1036,10795,10796,10798,10801,10804,10806,10808,10810,10812],{"class":1038,"line":4161},[1036,10797,6199],{"class":1254},[1036,10799,10800],{"class":1260},"ModelSelect",[1036,10802,10803],{"class":1537}," v-model",[1036,10805,1541],{"class":1254},[1036,10807,1468],{"class":1254},[1036,10809,4235],{"class":1046},[1036,10811,1468],{"class":1254},[1036,10813,1561],{"class":1254},[1036,10815,10817,10819,10821],{"class":10816,"line":4179},[1038,1519],[1036,10818,6383],{"class":1254},[1036,10820,1512],{"class":1260},[1036,10822,1515],{"class":1254},[1036,10824,10826],{"class":10825,"line":6542},[1038,1519],[1036,10827,1319],{"emptyLinePlaceholder":21},[1036,10829,10831,10833],{"class":10830,"line":6551},[1038,1519],[1036,10832,5210],{"class":1254},[1036,10834,6480],{"class":1260},[1036,10836,10837,10839,10841,10843,10845],{"class":1038,"line":6560},[1036,10838,6485],{"class":1537},[1036,10840,1541],{"class":1254},[1036,10842,1468],{"class":1254},[1036,10844,6144],{"class":1046},[1036,10846,5138],{"class":1254},[1036,10848,10849,10851,10853,10855,10857],{"class":1038,"line":6569},[1036,10850,6498],{"class":1537},[1036,10852,1541],{"class":1254},[1036,10854,1468],{"class":1254},[1036,10856,5223],{"class":1046},[1036,10858,5138],{"class":1254},[1036,10860,10861,10863,10865,10867,10869],{"class":1038,"line":6578},[1036,10862,6511],{"class":1537},[1036,10864,1541],{"class":1254},[1036,10866,1468],{"class":1254},[1036,10868,6518],{"class":1046},[1036,10870,5138],{"class":1254},[1036,10872,10873,10875,10877,10879,10881],{"class":1038,"line":9095},[1036,10874,6525],{"class":1537},[1036,10876,1541],{"class":1254},[1036,10878,1468],{"class":1254},[1036,10880,6532],{"class":1046},[1036,10882,5138],{"class":1254},[1036,10884,10885],{"class":1038,"line":9104},[1036,10886,6539],{"class":1254},[1036,10888,10889,10891,10893],{"class":1038,"line":9113},[1036,10890,5107],{"class":1254},[1036,10892,4674],{"class":1260},[1036,10894,1515],{"class":1254},[1036,10896,10898,10900,10902],{"class":1038,"line":10897},94,[1036,10899,5241],{"class":1254},[1036,10901,5062],{"class":1260},[1036,10903,1515],{"class":1254},[1036,10905,10907,10909,10911],{"class":1038,"line":10906},95,[1036,10908,1566],{"class":1254},[1036,10910,1512],{"class":1260},[1036,10912,1515],{"class":1254},[1036,10914,10916,10918,10920],{"class":1038,"line":10915},96,[1036,10917,1576],{"class":1254},[1036,10919,5027],{"class":1260},[1036,10921,1515],{"class":1254},[1036,10923,10925,10927,10929],{"class":1038,"line":10924},97,[1036,10926,1585],{"class":1254},[1036,10928,1512],{"class":1260},[1036,10930,1515],{"class":1254},[940,10932,10934],{"id":10933},"going-further","Going further",[936,10936,10937],{},"You now have a working AI chatbot with database persistence! To take it further, consider adding:",[936,10939,10940],{},[954,10941,10942],{},"User Authentication",[936,10944,10945,10946,10951],{},"Add authentication with ",[1011,10947,10950],{"href":10948,"rel":10949},"https://github.com/atinux/nuxt-auth-utils",[1015],"nuxt-auth-utils"," to let users access their chat history across devices and keep conversations private.",[936,10953,10954],{},[954,10955,141],{},[936,10957,10958,10959,10964],{},"Extend your chatbot with ",[1011,10960,10963],{"href":10961,"rel":10962},"https://ai-sdk.dev/docs/ai-sdk-core/tools-and-tool-calling",[1015],"AI SDK tools"," that can fetch real-time data, generate charts, or interact with external APIs:",[1026,10966,10968],{"className":1231,"code":10967,"language":1233,"meta":1031,"style":1031},"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",[1033,10969,10970,10989,11007,11011,11026,11042,11059,11090,11098,11118,11123,11158,11162],{"__ignoreMap":1031},[1036,10971,10972,10974,10976,10979,10981,10983,10985,10987],{"class":1038,"line":1039},[1036,10973,1657],{"class":1240},[1036,10975,1660],{"class":1254},[1036,10977,10978],{"class":1250}," tool",[1036,10980,1682],{"class":1254},[1036,10982,1685],{"class":1240},[1036,10984,1341],{"class":1254},[1036,10986,2483],{"class":1046},[1036,10988,1305],{"class":1254},[1036,10990,10991,10993,10995,10997,10999,11001,11003,11005],{"class":1038,"line":1056},[1036,10992,1657],{"class":1240},[1036,10994,1660],{"class":1254},[1036,10996,2518],{"class":1250},[1036,10998,1682],{"class":1254},[1036,11000,1685],{"class":1240},[1036,11002,1341],{"class":1254},[1036,11004,2527],{"class":1046},[1036,11006,1305],{"class":1254},[1036,11008,11009],{"class":1038,"line":1270},[1036,11010,1319],{"emptyLinePlaceholder":21},[1036,11012,11013,11015,11018,11020,11022,11024],{"class":1038,"line":1285},[1036,11014,4730],{"class":1537},[1036,11016,11017],{"class":1250}," weatherTool ",[1036,11019,1541],{"class":1254},[1036,11021,10978],{"class":1059},[1036,11023,1251],{"class":1250},[1036,11025,1255],{"class":1254},[1036,11027,11028,11031,11033,11035,11038,11040],{"class":1038,"line":1297},[1036,11029,11030],{"class":1260},"  description",[1036,11032,1264],{"class":1254},[1036,11034,1341],{"class":1254},[1036,11036,11037],{"class":1046},"Get the current weather for a location",[1036,11039,1279],{"class":1254},[1036,11041,1282],{"class":1254},[1036,11043,11044,11047,11049,11051,11053,11055,11057],{"class":1038,"line":1308},[1036,11045,11046],{"class":1260},"  parameters",[1036,11048,1264],{"class":1254},[1036,11050,2518],{"class":1250},[1036,11052,1758],{"class":1254},[1036,11054,2590],{"class":1059},[1036,11056,1251],{"class":1250},[1036,11058,1255],{"class":1254},[1036,11060,11061,11064,11066,11068,11070,11072,11074,11076,11079,11081,11083,11086,11088],{"class":1038,"line":1316},[1036,11062,11063],{"class":1260},"    location",[1036,11065,1264],{"class":1254},[1036,11067,2518],{"class":1250},[1036,11069,1758],{"class":1254},[1036,11071,3074],{"class":1059},[1036,11073,1755],{"class":1250},[1036,11075,1758],{"class":1254},[1036,11077,11078],{"class":1059},"describe",[1036,11080,1251],{"class":1250},[1036,11082,1279],{"class":1254},[1036,11084,11085],{"class":1046},"The city name",[1036,11087,1279],{"class":1254},[1036,11089,1441],{"class":1250},[1036,11091,11092,11094,11096],{"class":1038,"line":1322},[1036,11093,2363],{"class":1254},[1036,11095,1832],{"class":1250},[1036,11097,1282],{"class":1254},[1036,11099,11100,11103,11105,11107,11109,11112,11114,11116],{"class":1038,"line":1333},[1036,11101,11102],{"class":1059},"  execute",[1036,11104,1264],{"class":1254},[1036,11106,3771],{"class":1537},[1036,11108,1889],{"class":1254},[1036,11110,11111],{"class":1892}," location",[1036,11113,1896],{"class":1254},[1036,11115,1775],{"class":1537},[1036,11117,1330],{"class":1254},[1036,11119,11120],{"class":1038,"line":1349},[1036,11121,11122],{"class":1420},"    // Fetch weather data from an API\n",[1036,11124,11125,11128,11130,11132,11134,11137,11139,11142,11144,11147,11149,11151,11154,11156],{"class":1038,"line":1355},[1036,11126,11127],{"class":1240},"    return",[1036,11129,1660],{"class":1254},[1036,11131,11111],{"class":1250},[1036,11133,1666],{"class":1254},[1036,11135,11136],{"class":1260}," temperature",[1036,11138,1264],{"class":1254},[1036,11140,11141],{"class":3335}," 22",[1036,11143,1666],{"class":1254},[1036,11145,11146],{"class":1260}," condition",[1036,11148,1264],{"class":1254},[1036,11150,1341],{"class":1254},[1036,11152,11153],{"class":1046},"Sunny",[1036,11155,1279],{"class":1254},[1036,11157,9327],{"class":1254},[1036,11159,11160],{"class":1038,"line":1360},[1036,11161,3360],{"class":1254},[1036,11163,11164,11166],{"class":1038,"line":1383},[1036,11165,1438],{"class":1254},[1036,11167,1441],{"class":1250},[983,11169,11171],{"icon":11170,"target":986,"to":987},"i-lucide-rocket",[936,11172,11173,11174,11176,11177,1758],{},"The official ",[954,11175,993],{}," includes all these features and more. Get started instantly with ",[1033,11178,11179],{},"npx nuxi@latest init -t ui/chat my-chat-app",[940,11181,11183],{"id":11182},"deploying-to-vercel","Deploying to Vercel",[936,11185,11186],{},"Deploy your chatbot to Vercel with zero configuration:",[1026,11188,11190],{"className":1028,"code":11189,"language":1030,"meta":1031,"style":1031},"npx vercel deploy\n",[1033,11191,11192],{"__ignoreMap":1031},[1036,11193,11194,11196,11199],{"class":1038,"line":1039},[1036,11195,1043],{"class":1042},[1036,11197,11198],{"class":1046}," vercel",[1036,11200,11201],{"class":1046}," deploy\n",[936,11203,11204],{},"Then, in the Vercel dashboard:",[948,11206,11207,11213],{},[951,11208,11209,11210,11212],{},"Enable ",[954,11211,4191],{}," and add credits so requests can be processed.",[951,11214,11215,11216,11219],{},"Add a ",[954,11217,11218],{},"Turso"," database from the Vercel Marketplace and connect it to your project (it will provision the database and add the required environment variables automatically).",[11221,11222,11223],"blockquote",{},[936,11224,11225,11226,11231,11232,11234],{},"Note: On Vercel, you ",[954,11227,11228,11229],{},"don’t need to manually add ",[1033,11230,1608],{}," — Vercel handles the gateway configuration for deployments. Keep using ",[1033,11233,1595],{}," locally for development.",[1615,11236,11237],{"to":1013,"target":986},[936,11238,11239,11240,1758],{},"Learn more about setting up AI Gateway in the ",[954,11241,11242],{},"Vercel AI Gateway documentation",[940,11244,11246],{"id":11245},"conclusion","Conclusion",[936,11248,11249],{},"You've built a complete AI chatbot with:",[948,11251,11252,11258,11264,11269,11274],{},[951,11253,11254,11257],{},[954,11255,11256],{},"A complete chat interface"," using Nuxt UI components",[951,11259,11260,11263],{},[954,11261,11262],{},"Real-time streaming responses"," with the AI SDK",[951,11265,11266,11268],{},[954,11267,968],{}," with MDC for rich content display",[951,11270,11271,11273],{},[954,11272,974],{}," via AI Gateway",[951,11275,11276,11279],{},[954,11277,11278],{},"Database persistence"," with SQLite (local) / Turso (production) and Drizzle ORM",[936,11281,11282],{},"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.",[936,11284,11285],{},[954,11286,11287],{},"Resources:",[948,11289,11290,11297,11304,11311,11317],{},[951,11291,11292],{},[1011,11293,11296],{"href":11294,"rel":11295},"https://ui.nuxt.com/components/chat-messages",[1015],"Nuxt UI Chat Components",[951,11298,11299],{},[1011,11300,11303],{"href":11301,"rel":11302},"https://hub.nuxt.com/docs/features/database",[1015],"NuxtHub Database",[951,11305,11306],{},[1011,11307,11310],{"href":11308,"rel":11309},"https://ai-sdk.dev",[1015],"AI SDK Documentation",[951,11312,11313],{},[1011,11314,11316],{"href":1013,"rel":11315},[1015],"AI Gateway Documentation",[951,11318,11319],{},[1011,11320,11322],{"href":987,"rel":11321},[1015],"AI Chat Template",[936,11324,11325],{},"We're excited to see what you'll build!",[11327,11328,11329],"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":1031,"searchDepth":1056,"depth":1056,"links":11331},[11332,11333,11334,11340,11345,11348,11349,11353,11354,11355,11360,11361,11362],{"id":942,"depth":1056,"text":943},{"id":997,"depth":1056,"text":998},{"id":1020,"depth":1056,"text":1021,"children":11335},[11336,11337,11338,11339],{"id":1066,"depth":1270,"text":1067},{"id":1217,"depth":1270,"text":1218},{"id":1486,"depth":1270,"text":1487},{"id":1626,"depth":1270,"text":1627},{"id":2406,"depth":1056,"text":2407,"children":11341},[11342,11343,11344],{"id":2418,"depth":1270,"text":2419},{"id":2801,"depth":1270,"text":2802},{"id":4283,"depth":1270,"text":4284},{"id":4665,"depth":1056,"text":4666,"children":11346},[11347],{"id":4684,"depth":1270,"text":4685},{"id":5304,"depth":1056,"text":5305},{"id":6739,"depth":1056,"text":6740,"children":11350},[11351,11352],{"id":6746,"depth":1270,"text":6747},{"id":6906,"depth":1270,"text":6907},{"id":7411,"depth":1056,"text":7412},{"id":7954,"depth":1056,"text":7955},{"id":9131,"depth":1056,"text":9132,"children":11356},[11357,11358,11359],{"id":9142,"depth":1270,"text":9143},{"id":9422,"depth":1270,"text":9423},{"id":9683,"depth":1270,"text":9684},{"id":10933,"depth":1056,"text":10934},{"id":11182,"depth":1056,"text":11183},{"id":11245,"depth":1056,"text":11246},"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":11368},"Tutorial","/blog/how-to-build-an-ai-chat",{"title":920,"description":11364},"blog/how-to-build-an-ai-chat","IPLkZO8LL_2FoVmhWkSkC7V0qDJOTOwI5l4BHDYBM_E",1768562391668]