[{"data":1,"prerenderedAt":11357},["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":11347,"description":11348,"extension":11349,"image":11350,"meta":11351,"navigation":36,"path":11353,"seo":11354,"stem":11355,"__hash__":11356},"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":11314},"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,7402,7406,7945,7949,9113,9122,9126,9133,9137,9147,9404,9408,9416,9665,9669,9672,10915,10919,10922,10927,10936,10940,10949,11152,11164,11168,11171,11186,11189,11204,11219,11227,11231,11234,11264,11267,11272,11307,11310],[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,7119,7143,7147,7172,7197,7219,7245,7251,7255,7263,7267,7275,7306,7313,7327,7341,7355,7367,7381,7386,7394],{"__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,7115,7117],{"class":1038,"line":1383},[1036,7106,7107],{"class":1260},"    icon",[1036,7109,1264],{"class":1254},[1036,7111,1341],{"class":1254},[1036,7113,7114],{"class":1046},"i-lucide-plus-square",[1036,7116,1279],{"class":1254},[1036,7118,1282],{"class":1254},[1036,7120,7121,7124,7126,7129,7131,7134,7137,7139,7141],{"class":1038,"line":1388},[1036,7122,7123],{"class":1260},"    active",[1036,7125,1264],{"class":1254},[1036,7127,7128],{"class":1250}," route",[1036,7130,1758],{"class":1254},[1036,7132,7133],{"class":1250},"name ",[1036,7135,7136],{"class":1254},"===",[1036,7138,1341],{"class":1254},[1036,7140,6267],{"class":1046},[1036,7142,1305],{"class":1254},[1036,7144,7145],{"class":1038,"line":1398},[1036,7146,1352],{"class":1254},[1036,7148,7149,7152,7154,7156,7158,7160,7162,7164,7166,7168,7170],{"class":1038,"line":1408},[1036,7150,7151],{"class":1254},"  ...",[1036,7153,1737],{"class":1250},[1036,7155,1758],{"class":1254},[1036,7157,4797],{"class":1250},[1036,7159,1758],{"class":1254},[1036,7161,4059],{"class":1059},[1036,7163,1251],{"class":1250},[1036,7165,256],{"class":1892},[1036,7167,1775],{"class":1537},[1036,7169,1901],{"class":1250},[1036,7171,1255],{"class":1254},[1036,7173,7174,7176,7178,7180,7182,7185,7188,7190,7193,7195],{"class":1038,"line":1424},[1036,7175,7075],{"class":1260},[1036,7177,1264],{"class":1254},[1036,7179,2739],{"class":1250},[1036,7181,1758],{"class":1254},[1036,7183,7184],{"class":1250},"title ",[1036,7186,7187],{"class":1254},"||",[1036,7189,1341],{"class":1254},[1036,7191,7192],{"class":1046},"Untitled",[1036,7194,1279],{"class":1254},[1036,7196,1282],{"class":1254},[1036,7198,7199,7201,7203,7205,7207,7209,7211,7213,7215,7217],{"class":1038,"line":1430},[1036,7200,7091],{"class":1260},[1036,7202,1264],{"class":1254},[1036,7204,3446],{"class":1254},[1036,7206,4981],{"class":1046},[1036,7208,4984],{"class":1254},[1036,7210,256],{"class":1250},[1036,7212,1758],{"class":1254},[1036,7214,1967],{"class":1250},[1036,7216,4993],{"class":1254},[1036,7218,1282],{"class":1254},[1036,7220,7221,7223,7225,7227,7229,7231,7233,7236,7238,7240,7242],{"class":1038,"line":1435},[1036,7222,7123],{"class":1260},[1036,7224,1264],{"class":1254},[1036,7226,7128],{"class":1250},[1036,7228,1758],{"class":1254},[1036,7230,5478],{"class":1250},[1036,7232,1758],{"class":1254},[1036,7234,7235],{"class":1250},"id ",[1036,7237,7136],{"class":1254},[1036,7239,2739],{"class":1250},[1036,7241,1758],{"class":1254},[1036,7243,7244],{"class":1250},"id\n",[1036,7246,7247,7249],{"class":1038,"line":2224},[1036,7248,2363],{"class":1254},[1036,7250,1922],{"class":1250},[1036,7252,7253],{"class":1038,"line":2237},[1036,7254,2270],{"class":1250},[1036,7256,7257,7259,7261],{"class":1038,"line":2267},[1036,7258,1585],{"class":1254},[1036,7260,4709],{"class":1260},[1036,7262,1515],{"class":1254},[1036,7264,7265],{"class":1038,"line":2273},[1036,7266,1319],{"emptyLinePlaceholder":21},[1036,7268,7269,7271,7273],{"class":1038,"line":2278},[1036,7270,1509],{"class":1254},[1036,7272,1512],{"class":1260},[1036,7274,1515],{"class":1254},[1036,7276,7277,7279,7281,7284,7286,7288,7291,7293,7295,7297,7299,7302,7304],{"class":1038,"line":2310},[1036,7278,1522],{"class":1254},[1036,7280,6915],{"class":1260},[1036,7282,7283],{"class":1537}," :items",[1036,7285,1541],{"class":1254},[1036,7287,1468],{"class":1254},[1036,7289,7290],{"class":1046},"items",[1036,7292,1468],{"class":1254},[1036,7294,5065],{"class":1537},[1036,7296,1541],{"class":1254},[1036,7298,1468],{"class":1254},[1036,7300,7301],{"class":1046},"m-2",[1036,7303,1468],{"class":1254},[1036,7305,1515],{"class":1254},[1036,7307,7308,7310],{"class":1038,"line":2326},[1036,7309,1531],{"class":1254},[1036,7311,7312],{"class":1260},"UButton\n",[1036,7314,7315,7318,7320,7322,7325],{"class":1038,"line":2344},[1036,7316,7317],{"class":1537},"      icon",[1036,7319,1541],{"class":1254},[1036,7321,1468],{"class":1254},[1036,7323,7324],{"class":1046},"i-lucide-messages-square",[1036,7326,5138],{"class":1254},[1036,7328,7329,7332,7334,7336,7339],{"class":1038,"line":2360},[1036,7330,7331],{"class":1537},"      variant",[1036,7333,1541],{"class":1254},[1036,7335,1468],{"class":1254},[1036,7337,7338],{"class":1046},"ghost",[1036,7340,5138],{"class":1254},[1036,7342,7343,7346,7348,7350,7353],{"class":1038,"line":2368},[1036,7344,7345],{"class":1537},"      label",[1036,7347,1541],{"class":1254},[1036,7349,1468],{"class":1254},[1036,7351,7352],{"class":1046},"Chats History",[1036,7354,5138],{"class":1254},[1036,7356,7357,7359,7361,7363,7365],{"class":1038,"line":3318},[1036,7358,5836],{"class":1537},[1036,7360,1541],{"class":1254},[1036,7362,1468],{"class":1254},[1036,7364,5223],{"class":1046},[1036,7366,5138],{"class":1254},[1036,7368,7369,7372,7374,7376,7379],{"class":1038,"line":3357},[1036,7370,7371],{"class":1537},"      class",[1036,7373,1541],{"class":1254},[1036,7375,1468],{"class":1254},[1036,7377,7378],{"class":1046},"w-fit",[1036,7380,5138],{"class":1254},[1036,7382,7383],{"class":1038,"line":3363},[1036,7384,7385],{"class":1254},"    />\n",[1036,7387,7388,7390,7392],{"class":1038,"line":3368},[1036,7389,1576],{"class":1254},[1036,7391,6915],{"class":1260},[1036,7393,1515],{"class":1254},[1036,7395,7396,7398,7400],{"class":1038,"line":3374},[1036,7397,1585],{"class":1254},[1036,7399,1512],{"class":1260},[1036,7401,1515],{"class":1254},[940,7403,7405],{"id":7404},"integrating-history-in-the-home-page","Integrating history in the home page",[1227,7407,7408],{},[1645,7409,7410],{},[1026,7411,7414],{"className":1499,"code":7412,"filename":4699,"highlights":7413,"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,7415,7416,7436,7452,7468,7472,7484,7506,7510,7522,7526,7530,7554,7568,7576,7584,7598,7634,7638,7642,7648,7652,7656,7678,7682,7690,7694,7702,7720,7734,7744,7753,7765,7783,7801,7805,7813,7817,7823,7835,7847,7859,7871,7883,7887,7905,7913,7921,7929,7937],{"__ignoreMap":1031},[1036,7417,7418,7420,7422,7424,7426,7428,7430,7432,7434],{"class":1038,"line":1039},[1036,7419,1509],{"class":1254},[1036,7421,4709],{"class":1260},[1036,7423,4712],{"class":1537},[1036,7425,4715],{"class":1537},[1036,7427,1541],{"class":1254},[1036,7429,1468],{"class":1254},[1036,7431,1233],{"class":1046},[1036,7433,1468],{"class":1254},[1036,7435,1515],{"class":1254},[1036,7437,7438,7440,7442,7444,7446,7448,7450],{"class":1038,"line":1056},[1036,7439,4730],{"class":1537},[1036,7441,4733],{"class":1250},[1036,7443,1541],{"class":1254},[1036,7445,4738],{"class":1059},[1036,7447,1251],{"class":1250},[1036,7449,4743],{"class":1254},[1036,7451,1441],{"class":1250},[1036,7453,7454,7456,7458,7460,7462,7464,7466],{"class":1038,"line":1270},[1036,7455,4730],{"class":1537},[1036,7457,4752],{"class":1250},[1036,7459,1541],{"class":1254},[1036,7461,4738],{"class":1059},[1036,7463,1251],{"class":1250},[1036,7465,4761],{"class":1416},[1036,7467,1441],{"class":1250},[1036,7469,7470],{"class":1038,"line":1285},[1036,7471,1319],{"emptyLinePlaceholder":21},[1036,7473,7474,7476,7478,7480,7482],{"class":1038,"line":1297},[1036,7475,2546],{"class":1537},[1036,7477,4774],{"class":1537},[1036,7479,4777],{"class":1059},[1036,7481,1755],{"class":1254},[1036,7483,1330],{"class":1254},[1036,7485,7486,7488,7490,7492,7494,7496,7498,7500,7502,7504],{"class":1038,"line":1308},[1036,7487,3303],{"class":1240},[1036,7489,1901],{"class":1260},[1036,7491,3308],{"class":1254},[1036,7493,4792],{"class":1250},[1036,7495,1758],{"class":1254},[1036,7497,4797],{"class":1250},[1036,7499,1758],{"class":1254},[1036,7501,4802],{"class":1059},[1036,7503,4805],{"class":1260},[1036,7505,4808],{"class":1240},[1036,7507,7508],{"class":1038,"line":1316},[1036,7509,1319],{"emptyLinePlaceholder":21},[1036,7511,7512,7514,7516,7518,7520],{"class":1038,"line":1322},[1036,7513,4817],{"class":1250},[1036,7515,1758],{"class":1254},[1036,7517,4797],{"class":1250},[1036,7519,2572],{"class":1254},[1036,7521,3950],{"class":1416},[1036,7523,7524],{"class":1038,"line":1333},[1036,7525,1319],{"emptyLinePlaceholder":21},[1036,7527,7528],{"class":1038,"line":1349},[1036,7529,4834],{"class":1420},[1036,7531,7532,7534,7536,7538,7540,7542,7544,7546,7548,7550,7552],{"class":1038,"line":1355},[1036,7533,2562],{"class":1537},[1036,7535,2739],{"class":1250},[1036,7537,2572],{"class":1254},[1036,7539,2575],{"class":1240},[1036,7541,4847],{"class":1059},[1036,7543,1251],{"class":1260},[1036,7545,1279],{"class":1254},[1036,7547,4854],{"class":1046},[1036,7549,1279],{"class":1254},[1036,7551,1666],{"class":1254},[1036,7553,1330],{"class":1254},[1036,7555,7556,7558,7560,7562,7564,7566],{"class":1038,"line":1360},[1036,7557,4865],{"class":1260},[1036,7559,1264],{"class":1254},[1036,7561,1341],{"class":1254},[1036,7563,4872],{"class":1046},[1036,7565,1279],{"class":1254},[1036,7567,1282],{"class":1254},[1036,7569,7570,7572,7574],{"class":1038,"line":1383},[1036,7571,4881],{"class":1260},[1036,7573,1264],{"class":1254},[1036,7575,1330],{"class":1254},[1036,7577,7578,7580,7582],{"class":1038,"line":1388},[1036,7579,4890],{"class":1260},[1036,7581,1264],{"class":1254},[1036,7583,1330],{"class":1254},[1036,7585,7586,7588,7590,7592,7594,7596],{"class":1038,"line":1398},[1036,7587,4092],{"class":1260},[1036,7589,1264],{"class":1254},[1036,7591,1341],{"class":1254},[1036,7593,2097],{"class":1046},[1036,7595,1279],{"class":1254},[1036,7597,1282],{"class":1254},[1036,7599,7600,7602,7604,7606,7608,7610,7612,7614,7616,7618,7620,7622,7624,7626,7628,7630,7632],{"class":1038,"line":1408},[1036,7601,4125],{"class":1260},[1036,7603,1264],{"class":1254},[1036,7605,1368],{"class":1260},[1036,7607,1815],{"class":1254},[1036,7609,2469],{"class":1260},[1036,7611,1264],{"class":1254},[1036,7613,1341],{"class":1254},[1036,7615,4927],{"class":1046},[1036,7617,1279],{"class":1254},[1036,7619,1666],{"class":1254},[1036,7621,1669],{"class":1260},[1036,7623,1264],{"class":1254},[1036,7625,4938],{"class":1250},[1036,7627,1758],{"class":1254},[1036,7629,4797],{"class":1250},[1036,7631,1682],{"class":1254},[1036,7633,3607],{"class":1260},[1036,7635,7636],{"class":1038,"line":1424},[1036,7637,3964],{"class":1254},[1036,7639,7640],{"class":1038,"line":1430},[1036,7641,1427],{"class":1254},[1036,7643,7644,7646],{"class":1038,"line":1435},[1036,7645,2363],{"class":1254},[1036,7647,1441],{"class":1260},[1036,7649,7650],{"class":1038,"line":2224},[1036,7651,1319],{"emptyLinePlaceholder":21},[1036,7653,7654],{"class":1038,"line":2237},[1036,7655,4969],{"class":1420},[1036,7657,7658,7660,7662,7664,7666,7668,7670,7672,7674,7676],{"class":1038,"line":2267},[1036,7659,4974],{"class":1059},[1036,7661,1251],{"class":1260},[1036,7663,3452],{"class":1254},[1036,7665,4981],{"class":1046},[1036,7667,4984],{"class":1254},[1036,7669,256],{"class":1250},[1036,7671,1758],{"class":1254},[1036,7673,1967],{"class":1250},[1036,7675,4993],{"class":1254},[1036,7677,1441],{"class":1260},[1036,7679,7680],{"class":1038,"line":2273},[1036,7681,5000],{"class":1254},[1036,7683,7684,7686,7688],{"class":1038,"line":2278},[1036,7685,1585],{"class":1254},[1036,7687,4709],{"class":1260},[1036,7689,1515],{"class":1254},[1036,7691,7692],{"class":1038,"line":2310},[1036,7693,1319],{"emptyLinePlaceholder":21},[1036,7695,7696,7698,7700],{"class":1038,"line":2326},[1036,7697,1509],{"class":1254},[1036,7699,1512],{"class":1260},[1036,7701,1515],{"class":1254},[1036,7703,7704,7706,7708,7710,7712,7714,7716,7718],{"class":1038,"line":2344},[1036,7705,1522],{"class":1254},[1036,7707,5027],{"class":1260},[1036,7709,5030],{"class":1537},[1036,7711,1541],{"class":1254},[1036,7713,1468],{"class":1254},[1036,7715,5037],{"class":1046},[1036,7717,1468],{"class":1254},[1036,7719,1515],{"class":1254},[1036,7721,7723,7725,7727,7729,7732],{"class":7722,"line":2360},[1038,1519],[1036,7724,1531],{"class":1254},[1036,7726,1512],{"class":1260},[1036,7728,5050],{"class":1254},[1036,7730,7731],{"class":1537},"header",[1036,7733,1515],{"class":1254},[1036,7735,7737,7739,7742],{"class":7736,"line":2368},[1038,1519],[1036,7738,1555],{"class":1254},[1036,7740,7741],{"class":1260},"ChatsHistory",[1036,7743,1561],{"class":1254},[1036,7745,7747,7749,7751],{"class":7746,"line":3318},[1038,1519],[1036,7748,1566],{"class":1254},[1036,7750,1512],{"class":1260},[1036,7752,1515],{"class":1254},[1036,7754,7755,7757,7759,7761,7763],{"class":1038,"line":3357},[1036,7756,1531],{"class":1254},[1036,7758,1512],{"class":1260},[1036,7760,5050],{"class":1254},[1036,7762,5053],{"class":1537},[1036,7764,1515],{"class":1254},[1036,7766,7767,7769,7771,7773,7775,7777,7779,7781],{"class":1038,"line":3363},[1036,7768,1555],{"class":1254},[1036,7770,5062],{"class":1260},[1036,7772,5065],{"class":1537},[1036,7774,1541],{"class":1254},[1036,7776,1468],{"class":1254},[1036,7778,5072],{"class":1046},[1036,7780,1468],{"class":1254},[1036,7782,1515],{"class":1254},[1036,7784,7785,7787,7789,7791,7793,7795,7797,7799],{"class":1038,"line":3368},[1036,7786,5081],{"class":1254},[1036,7788,5084],{"class":1260},[1036,7790,5065],{"class":1537},[1036,7792,1541],{"class":1254},[1036,7794,1468],{"class":1254},[1036,7796,5093],{"class":1046},[1036,7798,1468],{"class":1254},[1036,7800,1515],{"class":1254},[1036,7802,7803],{"class":1038,"line":3374},[1036,7804,5102],{"class":1250},[1036,7806,7807,7809,7811],{"class":1038,"line":3394},[1036,7808,5107],{"class":1254},[1036,7810,5084],{"class":1260},[1036,7812,1515],{"class":1254},[1036,7814,7815],{"class":1038,"line":3422},[1036,7816,1319],{"emptyLinePlaceholder":21},[1036,7818,7819,7821],{"class":1038,"line":3438},[1036,7820,5081],{"class":1254},[1036,7822,5123],{"class":1260},[1036,7824,7825,7827,7829,7831,7833],{"class":1038,"line":3457},[1036,7826,5129],{"class":1537},[1036,7828,1541],{"class":1254},[1036,7830,1468],{"class":1254},[1036,7832,4792],{"class":1046},[1036,7834,5138],{"class":1254},[1036,7836,7837,7839,7841,7843,7845],{"class":1038,"line":3485},[1036,7838,5144],{"class":1537},[1036,7840,1541],{"class":1254},[1036,7842,1468],{"class":1254},[1036,7844,5151],{"class":1046},[1036,7846,5138],{"class":1254},[1036,7848,7849,7851,7853,7855,7857],{"class":1038,"line":3493},[1036,7850,5159],{"class":1537},[1036,7852,1541],{"class":1254},[1036,7854,1468],{"class":1254},[1036,7856,5166],{"class":1046},[1036,7858,5138],{"class":1254},[1036,7860,7861,7863,7865,7867,7869],{"class":1038,"line":3498},[1036,7862,5174],{"class":1537},[1036,7864,1541],{"class":1254},[1036,7866,1468],{"class":1254},[1036,7868,5181],{"class":1046},[1036,7870,5138],{"class":1254},[1036,7872,7873,7875,7877,7879,7881],{"class":1038,"line":3564},[1036,7874,5189],{"class":1537},[1036,7876,1541],{"class":1254},[1036,7878,1468],{"class":1254},[1036,7880,5196],{"class":1046},[1036,7882,5138],{"class":1254},[1036,7884,7885],{"class":1038,"line":3569},[1036,7886,5204],{"class":1254},[1036,7888,7889,7891,7893,7895,7897,7899,7901,7903],{"class":1038,"line":3574},[1036,7890,5210],{"class":1254},[1036,7892,5213],{"class":1260},[1036,7894,5216],{"class":1537},[1036,7896,1541],{"class":1254},[1036,7898,1468],{"class":1254},[1036,7900,5223],{"class":1046},[1036,7902,1468],{"class":1254},[1036,7904,1561],{"class":1254},[1036,7906,7907,7909,7911],{"class":1038,"line":3580},[1036,7908,5107],{"class":1254},[1036,7910,4674],{"class":1260},[1036,7912,1515],{"class":1254},[1036,7914,7915,7917,7919],{"class":1038,"line":3610},[1036,7916,5241],{"class":1254},[1036,7918,5062],{"class":1260},[1036,7920,1515],{"class":1254},[1036,7922,7923,7925,7927],{"class":1038,"line":3652},[1036,7924,1566],{"class":1254},[1036,7926,1512],{"class":1260},[1036,7928,1515],{"class":1254},[1036,7930,7931,7933,7935],{"class":1038,"line":3681},[1036,7932,1576],{"class":1254},[1036,7934,5027],{"class":1260},[1036,7936,1515],{"class":1254},[1036,7938,7939,7941,7943],{"class":1038,"line":3693},[1036,7940,1585],{"class":1254},[1036,7942,1512],{"class":1260},[1036,7944,1515],{"class":1254},[940,7946,7948],{"id":7947},"integrating-history-in-the-chat-page","Integrating history in the chat page",[1227,7950,7951],{},[1645,7952,7953],{},[1026,7954,7957],{"className":1499,"code":7955,"filename":5332,"highlights":7956,"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,7958,7959,7979,7997,8015,8019,8031,8043,8047,8051,8093,8097,8113,8153,8157,8161,8177,8181,8185,8201,8219,8237,8251,8275,8283,8295,8299,8323,8337,8341,8345,8357,8369,8383,8397,8409,8415,8419,8425,8429,8447,8457,8477,8503,8515,8519,8523,8527,8531,8543,8571,8581,8585,8591,8599,8603,8611,8629,8641,8650,8659,8672,8690,8696,8708,8720,8724,8736,8740,8764,8830,8878,8914,8922,8930,8938,8942,8948,8960,8972,8984,8996,9008,9012,9018,9030,9042,9054,9066,9070,9078,9086,9095,9104],{"__ignoreMap":1031},[1036,7960,7961,7963,7965,7967,7969,7971,7973,7975,7977],{"class":1038,"line":1039},[1036,7962,1509],{"class":1254},[1036,7964,4709],{"class":1260},[1036,7966,4712],{"class":1537},[1036,7968,4715],{"class":1537},[1036,7970,1541],{"class":1254},[1036,7972,1468],{"class":1254},[1036,7974,1233],{"class":1046},[1036,7976,1468],{"class":1254},[1036,7978,1515],{"class":1254},[1036,7980,7981,7983,7985,7987,7989,7991,7993,7995],{"class":1038,"line":1056},[1036,7982,1657],{"class":1240},[1036,7984,1660],{"class":1254},[1036,7986,5365],{"class":1250},[1036,7988,1682],{"class":1254},[1036,7990,1685],{"class":1240},[1036,7992,1341],{"class":1254},[1036,7994,2483],{"class":1046},[1036,7996,1305],{"class":1254},[1036,7998,7999,8001,8003,8005,8007,8009,8011,8013],{"class":1038,"line":1270},[1036,8000,1657],{"class":1240},[1036,8002,1660],{"class":1254},[1036,8004,5385],{"class":1250},[1036,8006,1682],{"class":1254},[1036,8008,1685],{"class":1240},[1036,8010,1341],{"class":1254},[1036,8012,5394],{"class":1046},[1036,8014,1305],{"class":1254},[1036,8016,8017],{"class":1038,"line":1285},[1036,8018,1319],{"emptyLinePlaceholder":21},[1036,8020,8021,8023,8025,8027,8029],{"class":1038,"line":1297},[1036,8022,4730],{"class":1537},[1036,8024,5408],{"class":1250},[1036,8026,1541],{"class":1254},[1036,8028,5413],{"class":1059},[1036,8030,2618],{"class":1250},[1036,8032,8033,8035,8037,8039,8041],{"class":1038,"line":1308},[1036,8034,4730],{"class":1537},[1036,8036,5422],{"class":1250},[1036,8038,1541],{"class":1254},[1036,8040,5427],{"class":1059},[1036,8042,2618],{"class":1250},[1036,8044,8045],{"class":1038,"line":1316},[1036,8046,1319],{"emptyLinePlaceholder":21},[1036,8048,8049],{"class":1038,"line":1322},[1036,8050,5438],{"class":1420},[1036,8052,8053,8055,8057,8059,8061,8063,8065,8067,8069,8071,8073,8075,8077,8079,8081,8083,8085,8087,8089,8091],{"class":1038,"line":1333},[1036,8054,4730],{"class":1537},[1036,8056,1660],{"class":1254},[1036,8058,5447],{"class":1260},[1036,8060,1264],{"class":1254},[1036,8062,5452],{"class":1250},[1036,8064,1438],{"class":1254},[1036,8066,2572],{"class":1254},[1036,8068,2575],{"class":1240},[1036,8070,5461],{"class":1059},[1036,8072,1251],{"class":1250},[1036,8074,3452],{"class":1254},[1036,8076,5468],{"class":1046},[1036,8078,4984],{"class":1254},[1036,8080,5473],{"class":1250},[1036,8082,1758],{"class":1254},[1036,8084,5478],{"class":1250},[1036,8086,1758],{"class":1254},[1036,8088,1967],{"class":1250},[1036,8090,4993],{"class":1254},[1036,8092,1441],{"class":1250},[1036,8094,8095],{"class":1038,"line":1349},[1036,8096,1319],{"emptyLinePlaceholder":21},[1036,8098,8099,8101,8103,8105,8107,8109,8111],{"class":1038,"line":1355},[1036,8100,5495],{"class":1240},[1036,8102,1901],{"class":1250},[1036,8104,3308],{"class":1254},[1036,8106,5502],{"class":1250},[1036,8108,1758],{"class":1254},[1036,8110,5507],{"class":1250},[1036,8112,1255],{"class":1254},[1036,8114,8115,8117,8119,8121,8123,8125,8127,8129,8131,8133,8135,8137,8139,8141,8143,8145,8147,8149,8151],{"class":1038,"line":1360},[1036,8116,5514],{"class":1240},[1036,8118,2848],{"class":1059},[1036,8120,1251],{"class":1260},[1036,8122,1815],{"class":1254},[1036,8124,3330],{"class":1260},[1036,8126,1264],{"class":1254},[1036,8128,3336],{"class":3335},[1036,8130,1666],{"class":1254},[1036,8132,3341],{"class":1260},[1036,8134,1264],{"class":1254},[1036,8136,1341],{"class":1254},[1036,8138,3348],{"class":1046},[1036,8140,1279],{"class":1254},[1036,8142,1666],{"class":1254},[1036,8144,5543],{"class":1260},[1036,8146,1264],{"class":1254},[1036,8148,5548],{"class":1416},[1036,8150,1682],{"class":1254},[1036,8152,1441],{"class":1260},[1036,8154,8155],{"class":1038,"line":1383},[1036,8156,5000],{"class":1254},[1036,8158,8159],{"class":1038,"line":1388},[1036,8160,1319],{"emptyLinePlaceholder":21},[1036,8162,8163,8165,8167,8169,8171,8173,8175],{"class":1038,"line":1398},[1036,8164,4730],{"class":1537},[1036,8166,4733],{"class":1250},[1036,8168,1541],{"class":1254},[1036,8170,4738],{"class":1059},[1036,8172,1251],{"class":1250},[1036,8174,4743],{"class":1254},[1036,8176,1441],{"class":1250},[1036,8178,8179],{"class":1038,"line":1408},[1036,8180,1319],{"emptyLinePlaceholder":21},[1036,8182,8183],{"class":1038,"line":1424},[1036,8184,5585],{"class":1420},[1036,8186,8187,8189,8191,8193,8195,8197,8199],{"class":1038,"line":1430},[1036,8188,4730],{"class":1537},[1036,8190,5592],{"class":1250},[1036,8192,1541],{"class":1254},[1036,8194,1852],{"class":1254},[1036,8196,5385],{"class":1059},[1036,8198,1251],{"class":1250},[1036,8200,1255],{"class":1254},[1036,8202,8203,8205,8207,8209,8211,8213,8215,8217],{"class":1038,"line":1435},[1036,8204,1748],{"class":1260},[1036,8206,1264],{"class":1254},[1036,8208,5612],{"class":1250},[1036,8210,1758],{"class":1254},[1036,8212,4797],{"class":1250},[1036,8214,1758],{"class":1254},[1036,8216,1967],{"class":1250},[1036,8218,1282],{"class":1254},[1036,8220,8221,8223,8225,8227,8229,8231,8233,8235],{"class":1038,"line":2224},[1036,8222,1908],{"class":1260},[1036,8224,1264],{"class":1254},[1036,8226,5612],{"class":1250},[1036,8228,1758],{"class":1254},[1036,8230,4797],{"class":1250},[1036,8232,1758],{"class":1254},[1036,8234,1946],{"class":1250},[1036,8236,1282],{"class":1254},[1036,8238,8239,8241,8243,8245,8247,8249],{"class":1038,"line":2237},[1036,8240,5647],{"class":1260},[1036,8242,1264],{"class":1254},[1036,8244,1852],{"class":1254},[1036,8246,5365],{"class":1059},[1036,8248,1251],{"class":1250},[1036,8250,1255],{"class":1254},[1036,8252,8253,8255,8257,8259,8261,8263,8265,8267,8269,8271,8273],{"class":1038,"line":2267},[1036,8254,5663],{"class":1260},[1036,8256,1264],{"class":1254},[1036,8258,3446],{"class":1254},[1036,8260,5468],{"class":1046},[1036,8262,4984],{"class":1254},[1036,8264,5502],{"class":1250},[1036,8266,1758],{"class":1254},[1036,8268,4797],{"class":1250},[1036,8270,1758],{"class":1254},[1036,8272,1967],{"class":1250},[1036,8274,5684],{"class":1254},[1036,8276,8277,8279,8281],{"class":1038,"line":2273},[1036,8278,2363],{"class":1254},[1036,8280,1832],{"class":1250},[1036,8282,1282],{"class":1254},[1036,8284,8285,8287,8289,8291,8293],{"class":1038,"line":2278},[1036,8286,5699],{"class":1260},[1036,8288,1251],{"class":1254},[1036,8290,5704],{"class":1892},[1036,8292,1832],{"class":1254},[1036,8294,1330],{"class":1254},[1036,8296,8297],{"class":1038,"line":2310},[1036,8298,5714],{"class":1420},[1036,8300,8301,8303,8305,8307,8309,8311,8313,8315,8317,8319,8321],{"class":1038,"line":2326},[1036,8302,5720],{"class":1240},[1036,8304,1901],{"class":1260},[1036,8306,5704],{"class":1250},[1036,8308,1758],{"class":1254},[1036,8310,5729],{"class":1250},[1036,8312,3625],{"class":1254},[1036,8314,1341],{"class":1254},[1036,8316,3911],{"class":1046},[1036,8318,1279],{"class":1254},[1036,8320,3313],{"class":1260},[1036,8322,1255],{"class":1254},[1036,8324,8325,8327,8329,8331,8333,8335],{"class":1038,"line":2344},[1036,8326,5747],{"class":1059},[1036,8328,1251],{"class":1260},[1036,8330,1279],{"class":1254},[1036,8332,1737],{"class":1046},[1036,8334,1279],{"class":1254},[1036,8336,1441],{"class":1260},[1036,8338,8339],{"class":1038,"line":2360},[1036,8340,1427],{"class":1254},[1036,8342,8343],{"class":1038,"line":2368},[1036,8344,1352],{"class":1254},[1036,8346,8347,8349,8351,8353,8355],{"class":1038,"line":3318},[1036,8348,5773],{"class":1260},[1036,8350,1251],{"class":1254},[1036,8352,5778],{"class":1892},[1036,8354,1832],{"class":1254},[1036,8356,1330],{"class":1254},[1036,8358,8359,8361,8363,8365,8367],{"class":1038,"line":3357},[1036,8360,5788],{"class":1250},[1036,8362,1758],{"class":1254},[1036,8364,5793],{"class":1059},[1036,8366,1251],{"class":1260},[1036,8368,1255],{"class":1254},[1036,8370,8371,8373,8375,8377,8379,8381],{"class":1038,"line":3363},[1036,8372,5803],{"class":1260},[1036,8374,1264],{"class":1254},[1036,8376,1341],{"class":1254},[1036,8378,471],{"class":1046},[1036,8380,1279],{"class":1254},[1036,8382,1282],{"class":1254},[1036,8384,8385,8387,8389,8391,8393,8395],{"class":1038,"line":3368},[1036,8386,5819],{"class":1260},[1036,8388,1264],{"class":1254},[1036,8390,5824],{"class":1250},[1036,8392,1758],{"class":1254},[1036,8394,4064],{"class":1250},[1036,8396,1282],{"class":1254},[1036,8398,8399,8401,8403,8405,8407],{"class":1038,"line":3374},[1036,8400,5836],{"class":1260},[1036,8402,1264],{"class":1254},[1036,8404,1341],{"class":1254},[1036,8406,5778],{"class":1046},[1036,8408,1305],{"class":1254},[1036,8410,8411,8413],{"class":1038,"line":3394},[1036,8412,3488],{"class":1254},[1036,8414,1441],{"class":1260},[1036,8416,8417],{"class":1038,"line":3422},[1036,8418,3360],{"class":1254},[1036,8420,8421,8423],{"class":1038,"line":3438},[1036,8422,1438],{"class":1254},[1036,8424,1441],{"class":1250},[1036,8426,8427],{"class":1038,"line":3457},[1036,8428,1319],{"emptyLinePlaceholder":21},[1036,8430,8431,8433,8435,8437,8439,8441,8443,8445],{"class":1038,"line":3485},[1036,8432,5873],{"class":1537},[1036,8434,5876],{"class":1059},[1036,8436,1251],{"class":1254},[1036,8438,5881],{"class":1892},[1036,8440,1264],{"class":1254},[1036,8442,5886],{"class":1042},[1036,8444,1832],{"class":1254},[1036,8446,1330],{"class":1254},[1036,8448,8449,8451,8453,8455],{"class":1038,"line":3493},[1036,8450,5895],{"class":1250},[1036,8452,1758],{"class":1254},[1036,8454,5900],{"class":1059},[1036,8456,2618],{"class":1260},[1036,8458,8459,8461,8463,8465,8467,8469,8471,8473,8475],{"class":1038,"line":3498},[1036,8460,3303],{"class":1240},[1036,8462,1901],{"class":1260},[1036,8464,4792],{"class":1250},[1036,8466,1758],{"class":1254},[1036,8468,4797],{"class":1250},[1036,8470,1758],{"class":1254},[1036,8472,4802],{"class":1059},[1036,8474,4805],{"class":1260},[1036,8476,1255],{"class":1254},[1036,8478,8479,8481,8483,8485,8487,8489,8491,8493,8495,8497,8499,8501],{"class":1038,"line":3564},[1036,8480,5927],{"class":1250},[1036,8482,1758],{"class":1254},[1036,8484,5932],{"class":1059},[1036,8486,1251],{"class":1260},[1036,8488,1815],{"class":1254},[1036,8490,1669],{"class":1260},[1036,8492,1264],{"class":1254},[1036,8494,4938],{"class":1250},[1036,8496,1758],{"class":1254},[1036,8498,4797],{"class":1250},[1036,8500,1682],{"class":1254},[1036,8502,1441],{"class":1260},[1036,8504,8505,8507,8509,8511,8513],{"class":1038,"line":3569},[1036,8506,5955],{"class":1250},[1036,8508,1758],{"class":1254},[1036,8510,4797],{"class":1250},[1036,8512,2572],{"class":1254},[1036,8514,5964],{"class":1254},[1036,8516,8517],{"class":1038,"line":3574},[1036,8518,3360],{"class":1254},[1036,8520,8521],{"class":1038,"line":3580},[1036,8522,5000],{"class":1254},[1036,8524,8525],{"class":1038,"line":3610},[1036,8526,1319],{"emptyLinePlaceholder":21},[1036,8528,8529],{"class":1038,"line":3652},[1036,8530,5981],{"class":1420},[1036,8532,8533,8535,8537,8539,8541],{"class":1038,"line":3681},[1036,8534,5986],{"class":1059},[1036,8536,1251],{"class":1250},[1036,8538,1755],{"class":1254},[1036,8540,1775],{"class":1537},[1036,8542,1330],{"class":1254},[1036,8544,8545,8547,8549,8551,8553,8555,8557,8559,8561,8563,8565,8567,8569],{"class":1038,"line":3693},[1036,8546,3303],{"class":1240},[1036,8548,1901],{"class":1260},[1036,8550,5502],{"class":1250},[1036,8552,1758],{"class":1254},[1036,8554,4797],{"class":1250},[1036,8556,3620],{"class":1254},[1036,8558,1946],{"class":1250},[1036,8560,1758],{"class":1254},[1036,8562,3598],{"class":1250},[1036,8564,3625],{"class":1254},[1036,8566,3604],{"class":3335},[1036,8568,3313],{"class":1260},[1036,8570,1255],{"class":1254},[1036,8572,8573,8575,8577,8579],{"class":1038,"line":3709},[1036,8574,5927],{"class":1250},[1036,8576,1758],{"class":1254},[1036,8578,6031],{"class":1059},[1036,8580,2618],{"class":1260},[1036,8582,8583],{"class":1038,"line":3723},[1036,8584,3360],{"class":1254},[1036,8586,8587,8589],{"class":1038,"line":3730},[1036,8588,1438],{"class":1254},[1036,8590,1441],{"class":1250},[1036,8592,8593,8595,8597],{"class":1038,"line":3735},[1036,8594,1585],{"class":1254},[1036,8596,4709],{"class":1260},[1036,8598,1515],{"class":1254},[1036,8600,8601],{"class":1038,"line":3740},[1036,8602,1319],{"emptyLinePlaceholder":21},[1036,8604,8605,8607,8609],{"class":1038,"line":3746},[1036,8606,1509],{"class":1254},[1036,8608,1512],{"class":1260},[1036,8610,1515],{"class":1254},[1036,8612,8613,8615,8617,8619,8621,8623,8625,8627],{"class":1038,"line":3763},[1036,8614,1522],{"class":1254},[1036,8616,5027],{"class":1260},[1036,8618,5030],{"class":1537},[1036,8620,1541],{"class":1254},[1036,8622,1468],{"class":1254},[1036,8624,5037],{"class":1046},[1036,8626,1468],{"class":1254},[1036,8628,1515],{"class":1254},[1036,8630,8631,8633,8635,8637,8639],{"class":1038,"line":3785},[1036,8632,1531],{"class":1254},[1036,8634,1512],{"class":1260},[1036,8636,5050],{"class":1254},[1036,8638,7731],{"class":1537},[1036,8640,1515],{"class":1254},[1036,8642,8644,8646,8648],{"class":8643,"line":3803},[1038,1519],[1036,8645,1555],{"class":1254},[1036,8647,7741],{"class":1260},[1036,8649,1561],{"class":1254},[1036,8651,8653,8655,8657],{"class":8652,"line":3811},[1038,1519],[1036,8654,1566],{"class":1254},[1036,8656,1512],{"class":1260},[1036,8658,1515],{"class":1254},[1036,8660,8662,8664,8666,8668,8670],{"class":8661,"line":3828},[1038,1519],[1036,8663,1531],{"class":1254},[1036,8665,1512],{"class":1260},[1036,8667,5050],{"class":1254},[1036,8669,5053],{"class":1537},[1036,8671,1515],{"class":1254},[1036,8673,8674,8676,8678,8680,8682,8684,8686,8688],{"class":1038,"line":3847},[1036,8675,1555],{"class":1254},[1036,8677,5062],{"class":1260},[1036,8679,5065],{"class":1537},[1036,8681,1541],{"class":1254},[1036,8683,1468],{"class":1254},[1036,8685,6108],{"class":1046},[1036,8687,1468],{"class":1254},[1036,8689,1515],{"class":1254},[1036,8691,8692,8694],{"class":1038,"line":3855},[1036,8693,5081],{"class":1254},[1036,8695,6119],{"class":1260},[1036,8697,8698,8700,8702,8704,8706],{"class":1038,"line":3860},[1036,8699,6124],{"class":1537},[1036,8701,1541],{"class":1254},[1036,8703,1468],{"class":1254},[1036,8705,6131],{"class":1046},[1036,8707,5138],{"class":1254},[1036,8709,8710,8712,8714,8716,8718],{"class":1038,"line":3866},[1036,8711,5144],{"class":1537},[1036,8713,1541],{"class":1254},[1036,8715,1468],{"class":1254},[1036,8717,6144],{"class":1046},[1036,8719,5138],{"class":1254},[1036,8721,8722],{"class":1038,"line":3886},[1036,8723,6151],{"class":1537},[1036,8725,8726,8728,8730,8732,8734],{"class":1038,"line":3901},[1036,8727,6156],{"class":1537},[1036,8729,1541],{"class":1254},[1036,8731,1468],{"class":1254},[1036,8733,6163],{"class":1046},[1036,8735,5138],{"class":1254},[1036,8737,8738],{"class":1038,"line":3918},[1036,8739,5204],{"class":1254},[1036,8741,8742,8744,8746,8748,8750,8752,8754,8756,8758,8760,8762],{"class":1038,"line":3942},[1036,8743,5210],{"class":1254},[1036,8745,1512],{"class":1260},[1036,8747,5050],{"class":1254},[1036,8749,344],{"class":1537},[1036,8751,1541],{"class":1254},[1036,8753,1468],{"class":1254},[1036,8755,1815],{"class":1254},[1036,8757,6188],{"class":1250},[1036,8759,1438],{"class":1254},[1036,8761,1468],{"class":1254},[1036,8763,1515],{"class":1254},[1036,8765,8766,8768,8770,8772,8774,8776,8778,8780,8782,8784,8786,8788,8790,8792,8794,8796,8798,8800,8802,8804,8806,8808,8810,8812,8814,8816,8818,8820,8822,8824,8826,8828],{"class":1038,"line":3953},[1036,8767,6199],{"class":1254},[1036,8769,1512],{"class":1260},[1036,8771,6204],{"class":1240},[1036,8773,1541],{"class":1254},[1036,8775,1468],{"class":1254},[1036,8777,6211],{"class":1250},[1036,8779,1666],{"class":1254},[1036,8781,6216],{"class":1250},[1036,8783,6219],{"class":1254},[1036,8785,2567],{"class":1250},[1036,8787,1758],{"class":1254},[1036,8789,2148],{"class":1250},[1036,8791,1468],{"class":1254},[1036,8793,6230],{"class":1254},[1036,8795,6233],{"class":1537},[1036,8797,1541],{"class":1254},[1036,8799,6238],{"class":1254},[1036,8801,4064],{"class":1250},[1036,8803,1758],{"class":1254},[1036,8805,1967],{"class":1250},[1036,8807,1438],{"class":1254},[1036,8809,6249],{"class":1046},[1036,8811,4984],{"class":1254},[1036,8813,6254],{"class":1250},[1036,8815,1758],{"class":1254},[1036,8817,5729],{"class":1250},[1036,8819,1438],{"class":1254},[1036,8821,6249],{"class":1046},[1036,8823,4984],{"class":1254},[1036,8825,6267],{"class":1250},[1036,8827,6270],{"class":1254},[1036,8829,1515],{"class":1254},[1036,8831,8832,8834,8836,8838,8840,8842,8844,8846,8848,8850,8852,8854,8856,8858,8860,8862,8864,8866,8868,8870,8872,8874,8876],{"class":1038,"line":3961},[1036,8833,6277],{"class":1254},[1036,8835,6280],{"class":1260},[1036,8837,6283],{"class":1537},[1036,8839,1541],{"class":1254},[1036,8841,1468],{"class":1254},[1036,8843,6290],{"class":1046},[1036,8845,1468],{"class":1254},[1036,8847,6295],{"class":1537},[1036,8849,1541],{"class":1254},[1036,8851,1468],{"class":1254},[1036,8853,6302],{"class":1046},[1036,8855,1468],{"class":1254},[1036,8857,6307],{"class":1537},[1036,8859,1541],{"class":1254},[1036,8861,1468],{"class":1254},[1036,8863,6314],{"class":1046},[1036,8865,1468],{"class":1254},[1036,8867,5065],{"class":1537},[1036,8869,1541],{"class":1254},[1036,8871,1468],{"class":1254},[1036,8873,6325],{"class":1046},[1036,8875,1468],{"class":1254},[1036,8877,1561],{"class":1254},[1036,8879,8880,8882,8884,8886,8888,8890,8892,8894,8896,8898,8900,8902,8904,8906,8908,8910,8912],{"class":1038,"line":3967},[1036,8881,6277],{"class":1254},[1036,8883,936],{"class":1260},[1036,8885,6338],{"class":1537},[1036,8887,1541],{"class":1254},[1036,8889,1468],{"class":1254},[1036,8891,6345],{"class":1046},[1036,8893,1468],{"class":1254},[1036,8895,5065],{"class":1537},[1036,8897,1541],{"class":1254},[1036,8899,1468],{"class":1254},[1036,8901,6356],{"class":1046},[1036,8903,1468],{"class":1254},[1036,8905,2615],{"class":1254},[1036,8907,6363],{"class":1250},[1036,8909,1585],{"class":1254},[1036,8911,936],{"class":1260},[1036,8913,1515],{"class":1254},[1036,8915,8916,8918,8920],{"class":1038,"line":3972},[1036,8917,6374],{"class":1254},[1036,8919,1512],{"class":1260},[1036,8921,1515],{"class":1254},[1036,8923,8924,8926,8928],{"class":1038,"line":3995},[1036,8925,6383],{"class":1254},[1036,8927,1512],{"class":1260},[1036,8929,1515],{"class":1254},[1036,8931,8932,8934,8936],{"class":1038,"line":4001},[1036,8933,5107],{"class":1254},[1036,8935,4680],{"class":1260},[1036,8937,1515],{"class":1254},[1036,8939,8940],{"class":1038,"line":4021},[1036,8941,1319],{"emptyLinePlaceholder":21},[1036,8943,8944,8946],{"class":1038,"line":4027},[1036,8945,5081],{"class":1254},[1036,8947,5123],{"class":1260},[1036,8949,8950,8952,8954,8956,8958],{"class":1038,"line":4073},[1036,8951,5129],{"class":1537},[1036,8953,1541],{"class":1254},[1036,8955,1468],{"class":1254},[1036,8957,4792],{"class":1046},[1036,8959,5138],{"class":1254},[1036,8961,8962,8964,8966,8968,8970],{"class":1038,"line":4089},[1036,8963,6422],{"class":1537},[1036,8965,1541],{"class":1254},[1036,8967,1468],{"class":1254},[1036,8969,6429],{"class":1046},[1036,8971,5138],{"class":1254},[1036,8973,8974,8976,8978,8980,8982],{"class":1038,"line":4122},[1036,8975,5159],{"class":1537},[1036,8977,1541],{"class":1254},[1036,8979,1468],{"class":1254},[1036,8981,5166],{"class":1046},[1036,8983,5138],{"class":1254},[1036,8985,8986,8988,8990,8992,8994],{"class":1038,"line":4136},[1036,8987,6156],{"class":1537},[1036,8989,1541],{"class":1254},[1036,8991,1468],{"class":1254},[1036,8993,6454],{"class":1046},[1036,8995,5138],{"class":1254},[1036,8997,8998,9000,9002,9004,9006],{"class":1038,"line":4144},[1036,8999,5189],{"class":1537},[1036,9001,1541],{"class":1254},[1036,9003,1468],{"class":1254},[1036,9005,6467],{"class":1046},[1036,9007,5138],{"class":1254},[1036,9009,9010],{"class":1038,"line":4149},[1036,9011,5204],{"class":1254},[1036,9013,9014,9016],{"class":1038,"line":4156},[1036,9015,5210],{"class":1254},[1036,9017,6480],{"class":1260},[1036,9019,9020,9022,9024,9026,9028],{"class":1038,"line":4161},[1036,9021,6485],{"class":1537},[1036,9023,1541],{"class":1254},[1036,9025,1468],{"class":1254},[1036,9027,6144],{"class":1046},[1036,9029,5138],{"class":1254},[1036,9031,9032,9034,9036,9038,9040],{"class":1038,"line":4179},[1036,9033,6498],{"class":1537},[1036,9035,1541],{"class":1254},[1036,9037,1468],{"class":1254},[1036,9039,5223],{"class":1046},[1036,9041,5138],{"class":1254},[1036,9043,9044,9046,9048,9050,9052],{"class":1038,"line":6542},[1036,9045,6511],{"class":1537},[1036,9047,1541],{"class":1254},[1036,9049,1468],{"class":1254},[1036,9051,6518],{"class":1046},[1036,9053,5138],{"class":1254},[1036,9055,9056,9058,9060,9062,9064],{"class":1038,"line":6551},[1036,9057,6525],{"class":1537},[1036,9059,1541],{"class":1254},[1036,9061,1468],{"class":1254},[1036,9063,6532],{"class":1046},[1036,9065,5138],{"class":1254},[1036,9067,9068],{"class":1038,"line":6560},[1036,9069,6539],{"class":1254},[1036,9071,9072,9074,9076],{"class":1038,"line":6569},[1036,9073,5107],{"class":1254},[1036,9075,4674],{"class":1260},[1036,9077,1515],{"class":1254},[1036,9079,9080,9082,9084],{"class":1038,"line":6578},[1036,9081,5241],{"class":1254},[1036,9083,5062],{"class":1260},[1036,9085,1515],{"class":1254},[1036,9087,9089,9091,9093],{"class":1038,"line":9088},91,[1036,9090,1566],{"class":1254},[1036,9092,1512],{"class":1260},[1036,9094,1515],{"class":1254},[1036,9096,9098,9100,9102],{"class":1038,"line":9097},92,[1036,9099,1576],{"class":1254},[1036,9101,5027],{"class":1260},[1036,9103,1515],{"class":1254},[1036,9105,9107,9109,9111],{"class":1038,"line":9106},93,[1036,9108,1585],{"class":1254},[1036,9110,1512],{"class":1260},[1036,9112,1515],{"class":1254},[936,9114,4222,9115,9118,9119,9121],{},[1033,9116,9117],{},"refreshNuxtData('chats')"," call in the chat page's ",[1033,9120,6646],{}," callback (as shown earlier) ensures the chat list updates automatically when a new title is generated.",[940,9123,9125],{"id":9124},"adding-multi-model-support","Adding multi-model support",[936,9127,9128,9129,9132],{},"One of the benefits of using ",[1011,9130,4191],{"href":1013,"rel":9131},[1015]," is the ability to switch between models seamlessly. This section adds a model selector to the chat.",[1064,9134,9136],{"id":9135},"creating-a-models-composable","Creating a models composable",[936,9138,9139,9140,1264],{},"Define the available models and persist the user's selection using ",[1011,9141,9144],{"href":9142,"rel":9143},"https://nuxt.com/docs/api/composables/use-cookie",[1015],[1033,9145,9146],{},"useCookie",[1227,9148,9149],{},[1026,9150,9153],{"className":1231,"code":9151,"filename":9152,"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,9154,9155,9168,9179,9225,9268,9312,9317,9321,9351,9368,9374,9378,9384,9391,9396,9400],{"__ignoreMap":1031},[1036,9156,9157,9159,9161,9164,9166],{"class":1038,"line":1039},[1036,9158,1241],{"class":1240},[1036,9160,4774],{"class":1537},[1036,9162,9163],{"class":1059}," useModels",[1036,9165,1755],{"class":1254},[1036,9167,1330],{"class":1254},[1036,9169,9170,9172,9175,9177],{"class":1038,"line":1056},[1036,9171,2562],{"class":1537},[1036,9173,9174],{"class":1250}," models",[1036,9176,2572],{"class":1254},[1036,9178,1267],{"class":1260},[1036,9180,9181,9184,9187,9189,9191,9193,9195,9197,9200,9202,9204,9207,9209,9211,9214,9216,9218,9221,9223],{"class":1038,"line":1270},[1036,9182,9183],{"class":1254},"    {",[1036,9185,9186],{"class":1260}," value",[1036,9188,1264],{"class":1254},[1036,9190,1341],{"class":1254},[1036,9192,3157],{"class":1046},[1036,9194,1279],{"class":1254},[1036,9196,1666],{"class":1254},[1036,9198,9199],{"class":1260}," label",[1036,9201,1264],{"class":1254},[1036,9203,1341],{"class":1254},[1036,9205,9206],{"class":1046},"GPT-4o Mini",[1036,9208,1279],{"class":1254},[1036,9210,1666],{"class":1254},[1036,9212,9213],{"class":1260}," icon",[1036,9215,1264],{"class":1254},[1036,9217,1341],{"class":1254},[1036,9219,9220],{"class":1046},"i-simple-icons-openai",[1036,9222,1279],{"class":1254},[1036,9224,3939],{"class":1254},[1036,9226,9227,9229,9231,9233,9235,9238,9240,9242,9244,9246,9248,9251,9253,9255,9257,9259,9261,9264,9266],{"class":1038,"line":1285},[1036,9228,9183],{"class":1254},[1036,9230,9186],{"class":1260},[1036,9232,1264],{"class":1254},[1036,9234,1341],{"class":1254},[1036,9236,9237],{"class":1046},"anthropic/claude-3-5-haiku-latest",[1036,9239,1279],{"class":1254},[1036,9241,1666],{"class":1254},[1036,9243,9199],{"class":1260},[1036,9245,1264],{"class":1254},[1036,9247,1341],{"class":1254},[1036,9249,9250],{"class":1046},"Claude 3.5 Haiku",[1036,9252,1279],{"class":1254},[1036,9254,1666],{"class":1254},[1036,9256,9213],{"class":1260},[1036,9258,1264],{"class":1254},[1036,9260,1341],{"class":1254},[1036,9262,9263],{"class":1046},"i-simple-icons-anthropic",[1036,9265,1279],{"class":1254},[1036,9267,3939],{"class":1254},[1036,9269,9270,9272,9274,9276,9278,9281,9283,9285,9287,9289,9291,9294,9296,9298,9300,9302,9304,9307,9309],{"class":1038,"line":1297},[1036,9271,9183],{"class":1254},[1036,9273,9186],{"class":1260},[1036,9275,1264],{"class":1254},[1036,9277,1341],{"class":1254},[1036,9279,9280],{"class":1046},"google/gemini-2.0-flash",[1036,9282,1279],{"class":1254},[1036,9284,1666],{"class":1254},[1036,9286,9199],{"class":1260},[1036,9288,1264],{"class":1254},[1036,9290,1341],{"class":1254},[1036,9292,9293],{"class":1046},"Gemini 2.0 Flash",[1036,9295,1279],{"class":1254},[1036,9297,1666],{"class":1254},[1036,9299,9213],{"class":1260},[1036,9301,1264],{"class":1254},[1036,9303,1341],{"class":1254},[1036,9305,9306],{"class":1046},"i-simple-icons-google",[1036,9308,1279],{"class":1254},[1036,9310,9311],{"class":1254}," }\n",[1036,9313,9314],{"class":1038,"line":1308},[1036,9315,9316],{"class":1260},"  ]\n",[1036,9318,9319],{"class":1038,"line":1316},[1036,9320,1319],{"emptyLinePlaceholder":21},[1036,9322,9323,9325,9327,9329,9332,9334,9336,9338,9340,9342,9345,9347,9349],{"class":1038,"line":1322},[1036,9324,2562],{"class":1537},[1036,9326,3101],{"class":1250},[1036,9328,2572],{"class":1254},[1036,9330,9331],{"class":1059}," useCookie",[1036,9333,1509],{"class":1254},[1036,9335,3074],{"class":1042},[1036,9337,2615],{"class":1254},[1036,9339,1251],{"class":1260},[1036,9341,1279],{"class":1254},[1036,9343,9344],{"class":1046},"ai-model",[1036,9346,1279],{"class":1254},[1036,9348,1666],{"class":1254},[1036,9350,1330],{"class":1254},[1036,9352,9353,9356,9358,9360,9362,9364,9366],{"class":1038,"line":1333},[1036,9354,9355],{"class":1059},"    default",[1036,9357,1264],{"class":1254},[1036,9359,4559],{"class":1254},[1036,9361,1775],{"class":1537},[1036,9363,1341],{"class":1254},[1036,9365,3157],{"class":1046},[1036,9367,1305],{"class":1254},[1036,9369,9370,9372],{"class":1038,"line":1349},[1036,9371,2363],{"class":1254},[1036,9373,1441],{"class":1260},[1036,9375,9376],{"class":1038,"line":1355},[1036,9377,1319],{"emptyLinePlaceholder":21},[1036,9379,9380,9382],{"class":1038,"line":1360},[1036,9381,2789],{"class":1240},[1036,9383,1330],{"class":1254},[1036,9385,9386,9389],{"class":1038,"line":1383},[1036,9387,9388],{"class":1250},"    models",[1036,9390,1282],{"class":1254},[1036,9392,9393],{"class":1038,"line":1388},[1036,9394,9395],{"class":1250},"    model\n",[1036,9397,9398],{"class":1038,"line":1398},[1036,9399,3360],{"class":1254},[1036,9401,9402],{"class":1038,"line":1408},[1036,9403,5000],{"class":1254},[1064,9405,9407],{"id":9406},"building-the-model-selector","Building the model selector",[936,9409,1592,9410,9415],{},[1011,9411,9412],{"href":708},[1033,9413,9414],{},"USelectMenu"," component that displays the available models:",[1227,9417,9418],{},[1026,9419,9422],{"className":1499,"code":9420,"filename":9421,"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,9423,9424,9444,9477,9481,9498,9502,9520,9554,9558,9566,9570,9578,9585,9598,9612,9626,9639,9652,9657],{"__ignoreMap":1031},[1036,9425,9426,9428,9430,9432,9434,9436,9438,9440,9442],{"class":1038,"line":1039},[1036,9427,1509],{"class":1254},[1036,9429,4709],{"class":1260},[1036,9431,4712],{"class":1537},[1036,9433,4715],{"class":1537},[1036,9435,1541],{"class":1254},[1036,9437,1468],{"class":1254},[1036,9439,1233],{"class":1046},[1036,9441,1468],{"class":1254},[1036,9443,1515],{"class":1254},[1036,9445,9446,9448,9451,9453,9456,9458,9460,9462,9464,9466,9469,9471,9473,9475],{"class":1038,"line":1056},[1036,9447,4730],{"class":1537},[1036,9449,9450],{"class":1250}," model ",[1036,9452,1541],{"class":1254},[1036,9454,9455],{"class":1059}," defineModel",[1036,9457,1509],{"class":1254},[1036,9459,3074],{"class":1042},[1036,9461,2615],{"class":1254},[1036,9463,1251],{"class":1250},[1036,9465,1815],{"class":1254},[1036,9467,9468],{"class":1260}," required",[1036,9470,1264],{"class":1254},[1036,9472,5548],{"class":1416},[1036,9474,1682],{"class":1254},[1036,9476,1441],{"class":1250},[1036,9478,9479],{"class":1038,"line":1270},[1036,9480,1319],{"emptyLinePlaceholder":21},[1036,9482,9483,9485,9487,9490,9492,9494,9496],{"class":1038,"line":1285},[1036,9484,4730],{"class":1537},[1036,9486,1660],{"class":1254},[1036,9488,9489],{"class":1250}," models ",[1036,9491,1438],{"class":1254},[1036,9493,2572],{"class":1254},[1036,9495,9163],{"class":1059},[1036,9497,2618],{"class":1250},[1036,9499,9500],{"class":1038,"line":1297},[1036,9501,1319],{"emptyLinePlaceholder":21},[1036,9503,9504,9506,9509,9511,9513,9515,9517],{"class":1038,"line":1308},[1036,9505,4730],{"class":1537},[1036,9507,9508],{"class":1250}," selectedModel ",[1036,9510,1541],{"class":1254},[1036,9512,7057],{"class":1059},[1036,9514,1251],{"class":1250},[1036,9516,1755],{"class":1254},[1036,9518,9519],{"class":1537}," =>\n",[1036,9521,9522,9525,9527,9530,9532,9535,9537,9540,9542,9545,9547,9549,9551],{"class":1038,"line":1316},[1036,9523,9524],{"class":1250},"  models",[1036,9526,1758],{"class":1254},[1036,9528,9529],{"class":1059},"find",[1036,9531,1251],{"class":1250},[1036,9533,9534],{"class":1892},"m",[1036,9536,1775],{"class":1537},[1036,9538,9539],{"class":1250}," m",[1036,9541,1758],{"class":1254},[1036,9543,9544],{"class":1250},"value ",[1036,9546,7136],{"class":1254},[1036,9548,3101],{"class":1250},[1036,9550,1758],{"class":1254},[1036,9552,9553],{"class":1250},"value)\n",[1036,9555,9556],{"class":1038,"line":1322},[1036,9557,1441],{"class":1250},[1036,9559,9560,9562,9564],{"class":1038,"line":1333},[1036,9561,1585],{"class":1254},[1036,9563,4709],{"class":1260},[1036,9565,1515],{"class":1254},[1036,9567,9568],{"class":1038,"line":1349},[1036,9569,1319],{"emptyLinePlaceholder":21},[1036,9571,9572,9574,9576],{"class":1038,"line":1355},[1036,9573,1509],{"class":1254},[1036,9575,1512],{"class":1260},[1036,9577,1515],{"class":1254},[1036,9579,9580,9582],{"class":1038,"line":1360},[1036,9581,1522],{"class":1254},[1036,9583,9584],{"class":1260},"USelectMenu\n",[1036,9586,9587,9590,9592,9594,9596],{"class":1038,"line":1383},[1036,9588,9589],{"class":1537},"    v-model",[1036,9591,1541],{"class":1254},[1036,9593,1468],{"class":1254},[1036,9595,4235],{"class":1046},[1036,9597,5138],{"class":1254},[1036,9599,9600,9603,9605,9607,9610],{"class":1038,"line":1388},[1036,9601,9602],{"class":1537},"    :items",[1036,9604,1541],{"class":1254},[1036,9606,1468],{"class":1254},[1036,9608,9609],{"class":1046},"models",[1036,9611,5138],{"class":1254},[1036,9613,9614,9617,9619,9621,9624],{"class":1038,"line":1398},[1036,9615,9616],{"class":1537},"    :icon",[1036,9618,1541],{"class":1254},[1036,9620,1468],{"class":1254},[1036,9622,9623],{"class":1046},"selectedModel?.icon",[1036,9625,5138],{"class":1254},[1036,9627,9628,9631,9633,9635,9637],{"class":1038,"line":1408},[1036,9629,9630],{"class":1537},"    variant",[1036,9632,1541],{"class":1254},[1036,9634,1468],{"class":1254},[1036,9636,7338],{"class":1046},[1036,9638,5138],{"class":1254},[1036,9640,9641,9644,9646,9648,9650],{"class":1038,"line":1424},[1036,9642,9643],{"class":1537},"    value-key",[1036,9645,1541],{"class":1254},[1036,9647,1468],{"class":1254},[1036,9649,4797],{"class":1046},[1036,9651,5138],{"class":1254},[1036,9653,9654],{"class":1038,"line":1430},[1036,9655,9656],{"class":1254},"  />\n",[1036,9658,9659,9661,9663],{"class":1038,"line":1435},[1036,9660,1585],{"class":1254},[1036,9662,1512],{"class":1260},[1036,9664,1515],{"class":1254},[1064,9666,9668],{"id":9667},"integrating-with-the-chat","Integrating with the chat",[936,9670,9671],{},"Update the chat page to include the model selector and pass the selected model to the server:",[1227,9673,9674],{},[1645,9675,9676],{},[1026,9677,9680],{"className":1499,"code":9678,"filename":5332,"highlights":9679,"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,9681,9682,9702,9720,9738,9742,9754,9766,9782,9787,9829,9833,9849,9889,9893,9897,9913,9917,9933,9951,9969,9983,10009,10017,10033,10038,10047,10059,10083,10097,10101,10105,10117,10129,10143,10157,10169,10175,10179,10185,10189,10207,10217,10237,10263,10275,10279,10283,10287,10299,10327,10337,10341,10347,10355,10359,10367,10385,10397,10405,10413,10425,10443,10449,10461,10473,10477,10489,10493,10517,10583,10631,10667,10675,10683,10691,10695,10701,10713,10725,10737,10749,10761,10765,10778,10798,10807,10812,10819,10831,10843,10855,10867,10871,10879,10888,10897,10906],{"__ignoreMap":1031},[1036,9683,9684,9686,9688,9690,9692,9694,9696,9698,9700],{"class":1038,"line":1039},[1036,9685,1509],{"class":1254},[1036,9687,4709],{"class":1260},[1036,9689,4712],{"class":1537},[1036,9691,4715],{"class":1537},[1036,9693,1541],{"class":1254},[1036,9695,1468],{"class":1254},[1036,9697,1233],{"class":1046},[1036,9699,1468],{"class":1254},[1036,9701,1515],{"class":1254},[1036,9703,9704,9706,9708,9710,9712,9714,9716,9718],{"class":1038,"line":1056},[1036,9705,1657],{"class":1240},[1036,9707,1660],{"class":1254},[1036,9709,5365],{"class":1250},[1036,9711,1682],{"class":1254},[1036,9713,1685],{"class":1240},[1036,9715,1341],{"class":1254},[1036,9717,2483],{"class":1046},[1036,9719,1305],{"class":1254},[1036,9721,9722,9724,9726,9728,9730,9732,9734,9736],{"class":1038,"line":1270},[1036,9723,1657],{"class":1240},[1036,9725,1660],{"class":1254},[1036,9727,5385],{"class":1250},[1036,9729,1682],{"class":1254},[1036,9731,1685],{"class":1240},[1036,9733,1341],{"class":1254},[1036,9735,5394],{"class":1046},[1036,9737,1305],{"class":1254},[1036,9739,9740],{"class":1038,"line":1285},[1036,9741,1319],{"emptyLinePlaceholder":21},[1036,9743,9744,9746,9748,9750,9752],{"class":1038,"line":1297},[1036,9745,4730],{"class":1537},[1036,9747,5408],{"class":1250},[1036,9749,1541],{"class":1254},[1036,9751,5413],{"class":1059},[1036,9753,2618],{"class":1250},[1036,9755,9756,9758,9760,9762,9764],{"class":1038,"line":1308},[1036,9757,4730],{"class":1537},[1036,9759,5422],{"class":1250},[1036,9761,1541],{"class":1254},[1036,9763,5427],{"class":1059},[1036,9765,2618],{"class":1250},[1036,9767,9768,9770,9772,9774,9776,9778,9780],{"class":1038,"line":1316},[1036,9769,4730],{"class":1537},[1036,9771,1660],{"class":1254},[1036,9773,9450],{"class":1250},[1036,9775,1438],{"class":1254},[1036,9777,2572],{"class":1254},[1036,9779,9163],{"class":1059},[1036,9781,2618],{"class":1250},[1036,9783,9785],{"class":9784,"line":1322},[1038,1519],[1036,9786,1319],{"emptyLinePlaceholder":21},[1036,9788,9789,9791,9793,9795,9797,9799,9801,9803,9805,9807,9809,9811,9813,9815,9817,9819,9821,9823,9825,9827],{"class":1038,"line":1333},[1036,9790,4730],{"class":1537},[1036,9792,1660],{"class":1254},[1036,9794,5447],{"class":1260},[1036,9796,1264],{"class":1254},[1036,9798,5452],{"class":1250},[1036,9800,1438],{"class":1254},[1036,9802,2572],{"class":1254},[1036,9804,2575],{"class":1240},[1036,9806,5461],{"class":1059},[1036,9808,1251],{"class":1250},[1036,9810,3452],{"class":1254},[1036,9812,5468],{"class":1046},[1036,9814,4984],{"class":1254},[1036,9816,5473],{"class":1250},[1036,9818,1758],{"class":1254},[1036,9820,5478],{"class":1250},[1036,9822,1758],{"class":1254},[1036,9824,1967],{"class":1250},[1036,9826,4993],{"class":1254},[1036,9828,1441],{"class":1250},[1036,9830,9831],{"class":1038,"line":1349},[1036,9832,1319],{"emptyLinePlaceholder":21},[1036,9834,9835,9837,9839,9841,9843,9845,9847],{"class":1038,"line":1355},[1036,9836,5495],{"class":1240},[1036,9838,1901],{"class":1250},[1036,9840,3308],{"class":1254},[1036,9842,5502],{"class":1250},[1036,9844,1758],{"class":1254},[1036,9846,5507],{"class":1250},[1036,9848,1255],{"class":1254},[1036,9850,9851,9853,9855,9857,9859,9861,9863,9865,9867,9869,9871,9873,9875,9877,9879,9881,9883,9885,9887],{"class":1038,"line":1360},[1036,9852,5514],{"class":1240},[1036,9854,2848],{"class":1059},[1036,9856,1251],{"class":1260},[1036,9858,1815],{"class":1254},[1036,9860,3330],{"class":1260},[1036,9862,1264],{"class":1254},[1036,9864,3336],{"class":3335},[1036,9866,1666],{"class":1254},[1036,9868,3341],{"class":1260},[1036,9870,1264],{"class":1254},[1036,9872,1341],{"class":1254},[1036,9874,3348],{"class":1046},[1036,9876,1279],{"class":1254},[1036,9878,1666],{"class":1254},[1036,9880,5543],{"class":1260},[1036,9882,1264],{"class":1254},[1036,9884,5548],{"class":1416},[1036,9886,1682],{"class":1254},[1036,9888,1441],{"class":1260},[1036,9890,9891],{"class":1038,"line":1383},[1036,9892,5000],{"class":1254},[1036,9894,9895],{"class":1038,"line":1388},[1036,9896,1319],{"emptyLinePlaceholder":21},[1036,9898,9899,9901,9903,9905,9907,9909,9911],{"class":1038,"line":1398},[1036,9900,4730],{"class":1537},[1036,9902,4733],{"class":1250},[1036,9904,1541],{"class":1254},[1036,9906,4738],{"class":1059},[1036,9908,1251],{"class":1250},[1036,9910,4743],{"class":1254},[1036,9912,1441],{"class":1250},[1036,9914,9915],{"class":1038,"line":1408},[1036,9916,1319],{"emptyLinePlaceholder":21},[1036,9918,9919,9921,9923,9925,9927,9929,9931],{"class":1038,"line":1424},[1036,9920,4730],{"class":1537},[1036,9922,5592],{"class":1250},[1036,9924,1541],{"class":1254},[1036,9926,1852],{"class":1254},[1036,9928,5385],{"class":1059},[1036,9930,1251],{"class":1250},[1036,9932,1255],{"class":1254},[1036,9934,9935,9937,9939,9941,9943,9945,9947,9949],{"class":1038,"line":1430},[1036,9936,1748],{"class":1260},[1036,9938,1264],{"class":1254},[1036,9940,5612],{"class":1250},[1036,9942,1758],{"class":1254},[1036,9944,4797],{"class":1250},[1036,9946,1758],{"class":1254},[1036,9948,1967],{"class":1250},[1036,9950,1282],{"class":1254},[1036,9952,9953,9955,9957,9959,9961,9963,9965,9967],{"class":1038,"line":1435},[1036,9954,1908],{"class":1260},[1036,9956,1264],{"class":1254},[1036,9958,5612],{"class":1250},[1036,9960,1758],{"class":1254},[1036,9962,4797],{"class":1250},[1036,9964,1758],{"class":1254},[1036,9966,1946],{"class":1250},[1036,9968,1282],{"class":1254},[1036,9970,9971,9973,9975,9977,9979,9981],{"class":1038,"line":2224},[1036,9972,5647],{"class":1260},[1036,9974,1264],{"class":1254},[1036,9976,1852],{"class":1254},[1036,9978,5365],{"class":1059},[1036,9980,1251],{"class":1250},[1036,9982,1255],{"class":1254},[1036,9984,9985,9987,9989,9991,9993,9995,9997,9999,10001,10003,10005,10007],{"class":1038,"line":2237},[1036,9986,5663],{"class":1260},[1036,9988,1264],{"class":1254},[1036,9990,3446],{"class":1254},[1036,9992,5468],{"class":1046},[1036,9994,4984],{"class":1254},[1036,9996,5502],{"class":1250},[1036,9998,1758],{"class":1254},[1036,10000,4797],{"class":1250},[1036,10002,1758],{"class":1254},[1036,10004,1967],{"class":1250},[1036,10006,4993],{"class":1254},[1036,10008,1282],{"class":1254},[1036,10010,10011,10013,10015],{"class":1038,"line":2267},[1036,10012,4881],{"class":1260},[1036,10014,1264],{"class":1254},[1036,10016,1330],{"class":1254},[1036,10018,10020,10022,10024,10026,10028,10030],{"class":10019,"line":2273},[1038,1519],[1036,10021,3425],{"class":1260},[1036,10023,1264],{"class":1254},[1036,10025,3101],{"class":1250},[1036,10027,1758],{"class":1254},[1036,10029,9544],{"class":1250},[1036,10031,10032],{"class":1420},"// Pass the selected model\n",[1036,10034,10036],{"class":10035,"line":2278},[1038,1519],[1036,10037,1427],{"class":1254},[1036,10039,10041,10043,10045],{"class":10040,"line":2310},[1038,1519],[1036,10042,2363],{"class":1254},[1036,10044,1832],{"class":1250},[1036,10046,1282],{"class":1254},[1036,10048,10049,10051,10053,10055,10057],{"class":1038,"line":2326},[1036,10050,5699],{"class":1260},[1036,10052,1251],{"class":1254},[1036,10054,5704],{"class":1892},[1036,10056,1832],{"class":1254},[1036,10058,1330],{"class":1254},[1036,10060,10061,10063,10065,10067,10069,10071,10073,10075,10077,10079,10081],{"class":1038,"line":2344},[1036,10062,5720],{"class":1240},[1036,10064,1901],{"class":1260},[1036,10066,5704],{"class":1250},[1036,10068,1758],{"class":1254},[1036,10070,5729],{"class":1250},[1036,10072,3625],{"class":1254},[1036,10074,1341],{"class":1254},[1036,10076,3911],{"class":1046},[1036,10078,1279],{"class":1254},[1036,10080,3313],{"class":1260},[1036,10082,1255],{"class":1254},[1036,10084,10085,10087,10089,10091,10093,10095],{"class":1038,"line":2360},[1036,10086,5747],{"class":1059},[1036,10088,1251],{"class":1260},[1036,10090,1279],{"class":1254},[1036,10092,1737],{"class":1046},[1036,10094,1279],{"class":1254},[1036,10096,1441],{"class":1260},[1036,10098,10099],{"class":1038,"line":2368},[1036,10100,1427],{"class":1254},[1036,10102,10103],{"class":1038,"line":3318},[1036,10104,1352],{"class":1254},[1036,10106,10107,10109,10111,10113,10115],{"class":1038,"line":3357},[1036,10108,5773],{"class":1260},[1036,10110,1251],{"class":1254},[1036,10112,5778],{"class":1892},[1036,10114,1832],{"class":1254},[1036,10116,1330],{"class":1254},[1036,10118,10119,10121,10123,10125,10127],{"class":1038,"line":3363},[1036,10120,5788],{"class":1250},[1036,10122,1758],{"class":1254},[1036,10124,5793],{"class":1059},[1036,10126,1251],{"class":1260},[1036,10128,1255],{"class":1254},[1036,10130,10131,10133,10135,10137,10139,10141],{"class":1038,"line":3368},[1036,10132,5803],{"class":1260},[1036,10134,1264],{"class":1254},[1036,10136,1341],{"class":1254},[1036,10138,471],{"class":1046},[1036,10140,1279],{"class":1254},[1036,10142,1282],{"class":1254},[1036,10144,10145,10147,10149,10151,10153,10155],{"class":1038,"line":3374},[1036,10146,5819],{"class":1260},[1036,10148,1264],{"class":1254},[1036,10150,5824],{"class":1250},[1036,10152,1758],{"class":1254},[1036,10154,4064],{"class":1250},[1036,10156,1282],{"class":1254},[1036,10158,10159,10161,10163,10165,10167],{"class":1038,"line":3394},[1036,10160,5836],{"class":1260},[1036,10162,1264],{"class":1254},[1036,10164,1341],{"class":1254},[1036,10166,5778],{"class":1046},[1036,10168,1305],{"class":1254},[1036,10170,10171,10173],{"class":1038,"line":3422},[1036,10172,3488],{"class":1254},[1036,10174,1441],{"class":1260},[1036,10176,10177],{"class":1038,"line":3438},[1036,10178,3360],{"class":1254},[1036,10180,10181,10183],{"class":1038,"line":3457},[1036,10182,1438],{"class":1254},[1036,10184,1441],{"class":1250},[1036,10186,10187],{"class":1038,"line":3485},[1036,10188,1319],{"emptyLinePlaceholder":21},[1036,10190,10191,10193,10195,10197,10199,10201,10203,10205],{"class":1038,"line":3493},[1036,10192,5873],{"class":1537},[1036,10194,5876],{"class":1059},[1036,10196,1251],{"class":1254},[1036,10198,5881],{"class":1892},[1036,10200,1264],{"class":1254},[1036,10202,5886],{"class":1042},[1036,10204,1832],{"class":1254},[1036,10206,1330],{"class":1254},[1036,10208,10209,10211,10213,10215],{"class":1038,"line":3498},[1036,10210,5895],{"class":1250},[1036,10212,1758],{"class":1254},[1036,10214,5900],{"class":1059},[1036,10216,2618],{"class":1260},[1036,10218,10219,10221,10223,10225,10227,10229,10231,10233,10235],{"class":1038,"line":3564},[1036,10220,3303],{"class":1240},[1036,10222,1901],{"class":1260},[1036,10224,4792],{"class":1250},[1036,10226,1758],{"class":1254},[1036,10228,4797],{"class":1250},[1036,10230,1758],{"class":1254},[1036,10232,4802],{"class":1059},[1036,10234,4805],{"class":1260},[1036,10236,1255],{"class":1254},[1036,10238,10239,10241,10243,10245,10247,10249,10251,10253,10255,10257,10259,10261],{"class":1038,"line":3569},[1036,10240,5927],{"class":1250},[1036,10242,1758],{"class":1254},[1036,10244,5932],{"class":1059},[1036,10246,1251],{"class":1260},[1036,10248,1815],{"class":1254},[1036,10250,1669],{"class":1260},[1036,10252,1264],{"class":1254},[1036,10254,4938],{"class":1250},[1036,10256,1758],{"class":1254},[1036,10258,4797],{"class":1250},[1036,10260,1682],{"class":1254},[1036,10262,1441],{"class":1260},[1036,10264,10265,10267,10269,10271,10273],{"class":1038,"line":3574},[1036,10266,5955],{"class":1250},[1036,10268,1758],{"class":1254},[1036,10270,4797],{"class":1250},[1036,10272,2572],{"class":1254},[1036,10274,5964],{"class":1254},[1036,10276,10277],{"class":1038,"line":3580},[1036,10278,3360],{"class":1254},[1036,10280,10281],{"class":1038,"line":3610},[1036,10282,5000],{"class":1254},[1036,10284,10285],{"class":1038,"line":3652},[1036,10286,1319],{"emptyLinePlaceholder":21},[1036,10288,10289,10291,10293,10295,10297],{"class":1038,"line":3681},[1036,10290,5986],{"class":1059},[1036,10292,1251],{"class":1250},[1036,10294,1755],{"class":1254},[1036,10296,1775],{"class":1537},[1036,10298,1330],{"class":1254},[1036,10300,10301,10303,10305,10307,10309,10311,10313,10315,10317,10319,10321,10323,10325],{"class":1038,"line":3693},[1036,10302,3303],{"class":1240},[1036,10304,1901],{"class":1260},[1036,10306,5502],{"class":1250},[1036,10308,1758],{"class":1254},[1036,10310,4797],{"class":1250},[1036,10312,3620],{"class":1254},[1036,10314,1946],{"class":1250},[1036,10316,1758],{"class":1254},[1036,10318,3598],{"class":1250},[1036,10320,3625],{"class":1254},[1036,10322,3604],{"class":3335},[1036,10324,3313],{"class":1260},[1036,10326,1255],{"class":1254},[1036,10328,10329,10331,10333,10335],{"class":1038,"line":3709},[1036,10330,5927],{"class":1250},[1036,10332,1758],{"class":1254},[1036,10334,6031],{"class":1059},[1036,10336,2618],{"class":1260},[1036,10338,10339],{"class":1038,"line":3723},[1036,10340,3360],{"class":1254},[1036,10342,10343,10345],{"class":1038,"line":3730},[1036,10344,1438],{"class":1254},[1036,10346,1441],{"class":1250},[1036,10348,10349,10351,10353],{"class":1038,"line":3735},[1036,10350,1585],{"class":1254},[1036,10352,4709],{"class":1260},[1036,10354,1515],{"class":1254},[1036,10356,10357],{"class":1038,"line":3740},[1036,10358,1319],{"emptyLinePlaceholder":21},[1036,10360,10361,10363,10365],{"class":1038,"line":3746},[1036,10362,1509],{"class":1254},[1036,10364,1512],{"class":1260},[1036,10366,1515],{"class":1254},[1036,10368,10369,10371,10373,10375,10377,10379,10381,10383],{"class":1038,"line":3763},[1036,10370,1522],{"class":1254},[1036,10372,5027],{"class":1260},[1036,10374,5030],{"class":1537},[1036,10376,1541],{"class":1254},[1036,10378,1468],{"class":1254},[1036,10380,5037],{"class":1046},[1036,10382,1468],{"class":1254},[1036,10384,1515],{"class":1254},[1036,10386,10387,10389,10391,10393,10395],{"class":1038,"line":3785},[1036,10388,1531],{"class":1254},[1036,10390,1512],{"class":1260},[1036,10392,5050],{"class":1254},[1036,10394,7731],{"class":1537},[1036,10396,1515],{"class":1254},[1036,10398,10399,10401,10403],{"class":1038,"line":3803},[1036,10400,1555],{"class":1254},[1036,10402,7741],{"class":1260},[1036,10404,1561],{"class":1254},[1036,10406,10407,10409,10411],{"class":1038,"line":3811},[1036,10408,1566],{"class":1254},[1036,10410,1512],{"class":1260},[1036,10412,1515],{"class":1254},[1036,10414,10415,10417,10419,10421,10423],{"class":1038,"line":3828},[1036,10416,1531],{"class":1254},[1036,10418,1512],{"class":1260},[1036,10420,5050],{"class":1254},[1036,10422,5053],{"class":1537},[1036,10424,1515],{"class":1254},[1036,10426,10427,10429,10431,10433,10435,10437,10439,10441],{"class":1038,"line":3847},[1036,10428,1555],{"class":1254},[1036,10430,5062],{"class":1260},[1036,10432,5065],{"class":1537},[1036,10434,1541],{"class":1254},[1036,10436,1468],{"class":1254},[1036,10438,6108],{"class":1046},[1036,10440,1468],{"class":1254},[1036,10442,1515],{"class":1254},[1036,10444,10445,10447],{"class":1038,"line":3855},[1036,10446,5081],{"class":1254},[1036,10448,6119],{"class":1260},[1036,10450,10451,10453,10455,10457,10459],{"class":1038,"line":3860},[1036,10452,6124],{"class":1537},[1036,10454,1541],{"class":1254},[1036,10456,1468],{"class":1254},[1036,10458,6131],{"class":1046},[1036,10460,5138],{"class":1254},[1036,10462,10463,10465,10467,10469,10471],{"class":1038,"line":3866},[1036,10464,5144],{"class":1537},[1036,10466,1541],{"class":1254},[1036,10468,1468],{"class":1254},[1036,10470,6144],{"class":1046},[1036,10472,5138],{"class":1254},[1036,10474,10475],{"class":1038,"line":3886},[1036,10476,6151],{"class":1537},[1036,10478,10479,10481,10483,10485,10487],{"class":1038,"line":3901},[1036,10480,6156],{"class":1537},[1036,10482,1541],{"class":1254},[1036,10484,1468],{"class":1254},[1036,10486,6163],{"class":1046},[1036,10488,5138],{"class":1254},[1036,10490,10491],{"class":1038,"line":3918},[1036,10492,5204],{"class":1254},[1036,10494,10495,10497,10499,10501,10503,10505,10507,10509,10511,10513,10515],{"class":1038,"line":3942},[1036,10496,5210],{"class":1254},[1036,10498,1512],{"class":1260},[1036,10500,5050],{"class":1254},[1036,10502,344],{"class":1537},[1036,10504,1541],{"class":1254},[1036,10506,1468],{"class":1254},[1036,10508,1815],{"class":1254},[1036,10510,6188],{"class":1250},[1036,10512,1438],{"class":1254},[1036,10514,1468],{"class":1254},[1036,10516,1515],{"class":1254},[1036,10518,10519,10521,10523,10525,10527,10529,10531,10533,10535,10537,10539,10541,10543,10545,10547,10549,10551,10553,10555,10557,10559,10561,10563,10565,10567,10569,10571,10573,10575,10577,10579,10581],{"class":1038,"line":3953},[1036,10520,6199],{"class":1254},[1036,10522,1512],{"class":1260},[1036,10524,6204],{"class":1240},[1036,10526,1541],{"class":1254},[1036,10528,1468],{"class":1254},[1036,10530,6211],{"class":1250},[1036,10532,1666],{"class":1254},[1036,10534,6216],{"class":1250},[1036,10536,6219],{"class":1254},[1036,10538,2567],{"class":1250},[1036,10540,1758],{"class":1254},[1036,10542,2148],{"class":1250},[1036,10544,1468],{"class":1254},[1036,10546,6230],{"class":1254},[1036,10548,6233],{"class":1537},[1036,10550,1541],{"class":1254},[1036,10552,6238],{"class":1254},[1036,10554,4064],{"class":1250},[1036,10556,1758],{"class":1254},[1036,10558,1967],{"class":1250},[1036,10560,1438],{"class":1254},[1036,10562,6249],{"class":1046},[1036,10564,4984],{"class":1254},[1036,10566,6254],{"class":1250},[1036,10568,1758],{"class":1254},[1036,10570,5729],{"class":1250},[1036,10572,1438],{"class":1254},[1036,10574,6249],{"class":1046},[1036,10576,4984],{"class":1254},[1036,10578,6267],{"class":1250},[1036,10580,6270],{"class":1254},[1036,10582,1515],{"class":1254},[1036,10584,10585,10587,10589,10591,10593,10595,10597,10599,10601,10603,10605,10607,10609,10611,10613,10615,10617,10619,10621,10623,10625,10627,10629],{"class":1038,"line":3961},[1036,10586,6277],{"class":1254},[1036,10588,6280],{"class":1260},[1036,10590,6283],{"class":1537},[1036,10592,1541],{"class":1254},[1036,10594,1468],{"class":1254},[1036,10596,6290],{"class":1046},[1036,10598,1468],{"class":1254},[1036,10600,6295],{"class":1537},[1036,10602,1541],{"class":1254},[1036,10604,1468],{"class":1254},[1036,10606,6302],{"class":1046},[1036,10608,1468],{"class":1254},[1036,10610,6307],{"class":1537},[1036,10612,1541],{"class":1254},[1036,10614,1468],{"class":1254},[1036,10616,6314],{"class":1046},[1036,10618,1468],{"class":1254},[1036,10620,5065],{"class":1537},[1036,10622,1541],{"class":1254},[1036,10624,1468],{"class":1254},[1036,10626,6325],{"class":1046},[1036,10628,1468],{"class":1254},[1036,10630,1561],{"class":1254},[1036,10632,10633,10635,10637,10639,10641,10643,10645,10647,10649,10651,10653,10655,10657,10659,10661,10663,10665],{"class":1038,"line":3967},[1036,10634,6277],{"class":1254},[1036,10636,936],{"class":1260},[1036,10638,6338],{"class":1537},[1036,10640,1541],{"class":1254},[1036,10642,1468],{"class":1254},[1036,10644,6345],{"class":1046},[1036,10646,1468],{"class":1254},[1036,10648,5065],{"class":1537},[1036,10650,1541],{"class":1254},[1036,10652,1468],{"class":1254},[1036,10654,6356],{"class":1046},[1036,10656,1468],{"class":1254},[1036,10658,2615],{"class":1254},[1036,10660,6363],{"class":1250},[1036,10662,1585],{"class":1254},[1036,10664,936],{"class":1260},[1036,10666,1515],{"class":1254},[1036,10668,10669,10671,10673],{"class":1038,"line":3972},[1036,10670,6374],{"class":1254},[1036,10672,1512],{"class":1260},[1036,10674,1515],{"class":1254},[1036,10676,10677,10679,10681],{"class":1038,"line":3995},[1036,10678,6383],{"class":1254},[1036,10680,1512],{"class":1260},[1036,10682,1515],{"class":1254},[1036,10684,10685,10687,10689],{"class":1038,"line":4001},[1036,10686,5107],{"class":1254},[1036,10688,4680],{"class":1260},[1036,10690,1515],{"class":1254},[1036,10692,10693],{"class":1038,"line":4021},[1036,10694,1319],{"emptyLinePlaceholder":21},[1036,10696,10697,10699],{"class":1038,"line":4027},[1036,10698,5081],{"class":1254},[1036,10700,5123],{"class":1260},[1036,10702,10703,10705,10707,10709,10711],{"class":1038,"line":4073},[1036,10704,5129],{"class":1537},[1036,10706,1541],{"class":1254},[1036,10708,1468],{"class":1254},[1036,10710,4792],{"class":1046},[1036,10712,5138],{"class":1254},[1036,10714,10715,10717,10719,10721,10723],{"class":1038,"line":4089},[1036,10716,6422],{"class":1537},[1036,10718,1541],{"class":1254},[1036,10720,1468],{"class":1254},[1036,10722,6429],{"class":1046},[1036,10724,5138],{"class":1254},[1036,10726,10727,10729,10731,10733,10735],{"class":1038,"line":4122},[1036,10728,5159],{"class":1537},[1036,10730,1541],{"class":1254},[1036,10732,1468],{"class":1254},[1036,10734,5166],{"class":1046},[1036,10736,5138],{"class":1254},[1036,10738,10739,10741,10743,10745,10747],{"class":1038,"line":4136},[1036,10740,6156],{"class":1537},[1036,10742,1541],{"class":1254},[1036,10744,1468],{"class":1254},[1036,10746,6454],{"class":1046},[1036,10748,5138],{"class":1254},[1036,10750,10751,10753,10755,10757,10759],{"class":1038,"line":4144},[1036,10752,5189],{"class":1537},[1036,10754,1541],{"class":1254},[1036,10756,1468],{"class":1254},[1036,10758,6467],{"class":1046},[1036,10760,5138],{"class":1254},[1036,10762,10763],{"class":1038,"line":4149},[1036,10764,5204],{"class":1254},[1036,10766,10767,10769,10771,10773,10776],{"class":1038,"line":4156},[1036,10768,5210],{"class":1254},[1036,10770,1512],{"class":1260},[1036,10772,5050],{"class":1254},[1036,10774,10775],{"class":1537},"footer",[1036,10777,1515],{"class":1254},[1036,10779,10780,10782,10785,10788,10790,10792,10794,10796],{"class":1038,"line":4161},[1036,10781,6199],{"class":1254},[1036,10783,10784],{"class":1260},"ModelSelect",[1036,10786,10787],{"class":1537}," v-model",[1036,10789,1541],{"class":1254},[1036,10791,1468],{"class":1254},[1036,10793,4235],{"class":1046},[1036,10795,1468],{"class":1254},[1036,10797,1561],{"class":1254},[1036,10799,10801,10803,10805],{"class":10800,"line":4179},[1038,1519],[1036,10802,6383],{"class":1254},[1036,10804,1512],{"class":1260},[1036,10806,1515],{"class":1254},[1036,10808,10810],{"class":10809,"line":6542},[1038,1519],[1036,10811,1319],{"emptyLinePlaceholder":21},[1036,10813,10815,10817],{"class":10814,"line":6551},[1038,1519],[1036,10816,5210],{"class":1254},[1036,10818,6480],{"class":1260},[1036,10820,10821,10823,10825,10827,10829],{"class":1038,"line":6560},[1036,10822,6485],{"class":1537},[1036,10824,1541],{"class":1254},[1036,10826,1468],{"class":1254},[1036,10828,6144],{"class":1046},[1036,10830,5138],{"class":1254},[1036,10832,10833,10835,10837,10839,10841],{"class":1038,"line":6569},[1036,10834,6498],{"class":1537},[1036,10836,1541],{"class":1254},[1036,10838,1468],{"class":1254},[1036,10840,5223],{"class":1046},[1036,10842,5138],{"class":1254},[1036,10844,10845,10847,10849,10851,10853],{"class":1038,"line":6578},[1036,10846,6511],{"class":1537},[1036,10848,1541],{"class":1254},[1036,10850,1468],{"class":1254},[1036,10852,6518],{"class":1046},[1036,10854,5138],{"class":1254},[1036,10856,10857,10859,10861,10863,10865],{"class":1038,"line":9088},[1036,10858,6525],{"class":1537},[1036,10860,1541],{"class":1254},[1036,10862,1468],{"class":1254},[1036,10864,6532],{"class":1046},[1036,10866,5138],{"class":1254},[1036,10868,10869],{"class":1038,"line":9097},[1036,10870,6539],{"class":1254},[1036,10872,10873,10875,10877],{"class":1038,"line":9106},[1036,10874,5107],{"class":1254},[1036,10876,4674],{"class":1260},[1036,10878,1515],{"class":1254},[1036,10880,10882,10884,10886],{"class":1038,"line":10881},94,[1036,10883,5241],{"class":1254},[1036,10885,5062],{"class":1260},[1036,10887,1515],{"class":1254},[1036,10889,10891,10893,10895],{"class":1038,"line":10890},95,[1036,10892,1566],{"class":1254},[1036,10894,1512],{"class":1260},[1036,10896,1515],{"class":1254},[1036,10898,10900,10902,10904],{"class":1038,"line":10899},96,[1036,10901,1576],{"class":1254},[1036,10903,5027],{"class":1260},[1036,10905,1515],{"class":1254},[1036,10907,10909,10911,10913],{"class":1038,"line":10908},97,[1036,10910,1585],{"class":1254},[1036,10912,1512],{"class":1260},[1036,10914,1515],{"class":1254},[940,10916,10918],{"id":10917},"going-further","Going further",[936,10920,10921],{},"You now have a working AI chatbot with database persistence! To take it further, consider adding:",[936,10923,10924],{},[954,10925,10926],{},"User Authentication",[936,10928,10929,10930,10935],{},"Add authentication with ",[1011,10931,10934],{"href":10932,"rel":10933},"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,10937,10938],{},[954,10939,141],{},[936,10941,10942,10943,10948],{},"Extend your chatbot with ",[1011,10944,10947],{"href":10945,"rel":10946},"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,10950,10952],{"className":1231,"code":10951,"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,10953,10954,10973,10991,10995,11010,11026,11043,11074,11082,11102,11107,11142,11146],{"__ignoreMap":1031},[1036,10955,10956,10958,10960,10963,10965,10967,10969,10971],{"class":1038,"line":1039},[1036,10957,1657],{"class":1240},[1036,10959,1660],{"class":1254},[1036,10961,10962],{"class":1250}," tool",[1036,10964,1682],{"class":1254},[1036,10966,1685],{"class":1240},[1036,10968,1341],{"class":1254},[1036,10970,2483],{"class":1046},[1036,10972,1305],{"class":1254},[1036,10974,10975,10977,10979,10981,10983,10985,10987,10989],{"class":1038,"line":1056},[1036,10976,1657],{"class":1240},[1036,10978,1660],{"class":1254},[1036,10980,2518],{"class":1250},[1036,10982,1682],{"class":1254},[1036,10984,1685],{"class":1240},[1036,10986,1341],{"class":1254},[1036,10988,2527],{"class":1046},[1036,10990,1305],{"class":1254},[1036,10992,10993],{"class":1038,"line":1270},[1036,10994,1319],{"emptyLinePlaceholder":21},[1036,10996,10997,10999,11002,11004,11006,11008],{"class":1038,"line":1285},[1036,10998,4730],{"class":1537},[1036,11000,11001],{"class":1250}," weatherTool ",[1036,11003,1541],{"class":1254},[1036,11005,10962],{"class":1059},[1036,11007,1251],{"class":1250},[1036,11009,1255],{"class":1254},[1036,11011,11012,11015,11017,11019,11022,11024],{"class":1038,"line":1297},[1036,11013,11014],{"class":1260},"  description",[1036,11016,1264],{"class":1254},[1036,11018,1341],{"class":1254},[1036,11020,11021],{"class":1046},"Get the current weather for a location",[1036,11023,1279],{"class":1254},[1036,11025,1282],{"class":1254},[1036,11027,11028,11031,11033,11035,11037,11039,11041],{"class":1038,"line":1308},[1036,11029,11030],{"class":1260},"  parameters",[1036,11032,1264],{"class":1254},[1036,11034,2518],{"class":1250},[1036,11036,1758],{"class":1254},[1036,11038,2590],{"class":1059},[1036,11040,1251],{"class":1250},[1036,11042,1255],{"class":1254},[1036,11044,11045,11048,11050,11052,11054,11056,11058,11060,11063,11065,11067,11070,11072],{"class":1038,"line":1316},[1036,11046,11047],{"class":1260},"    location",[1036,11049,1264],{"class":1254},[1036,11051,2518],{"class":1250},[1036,11053,1758],{"class":1254},[1036,11055,3074],{"class":1059},[1036,11057,1755],{"class":1250},[1036,11059,1758],{"class":1254},[1036,11061,11062],{"class":1059},"describe",[1036,11064,1251],{"class":1250},[1036,11066,1279],{"class":1254},[1036,11068,11069],{"class":1046},"The city name",[1036,11071,1279],{"class":1254},[1036,11073,1441],{"class":1250},[1036,11075,11076,11078,11080],{"class":1038,"line":1322},[1036,11077,2363],{"class":1254},[1036,11079,1832],{"class":1250},[1036,11081,1282],{"class":1254},[1036,11083,11084,11087,11089,11091,11093,11096,11098,11100],{"class":1038,"line":1333},[1036,11085,11086],{"class":1059},"  execute",[1036,11088,1264],{"class":1254},[1036,11090,3771],{"class":1537},[1036,11092,1889],{"class":1254},[1036,11094,11095],{"class":1892}," location",[1036,11097,1896],{"class":1254},[1036,11099,1775],{"class":1537},[1036,11101,1330],{"class":1254},[1036,11103,11104],{"class":1038,"line":1349},[1036,11105,11106],{"class":1420},"    // Fetch weather data from an API\n",[1036,11108,11109,11112,11114,11116,11118,11121,11123,11126,11128,11131,11133,11135,11138,11140],{"class":1038,"line":1355},[1036,11110,11111],{"class":1240},"    return",[1036,11113,1660],{"class":1254},[1036,11115,11095],{"class":1250},[1036,11117,1666],{"class":1254},[1036,11119,11120],{"class":1260}," temperature",[1036,11122,1264],{"class":1254},[1036,11124,11125],{"class":3335}," 22",[1036,11127,1666],{"class":1254},[1036,11129,11130],{"class":1260}," condition",[1036,11132,1264],{"class":1254},[1036,11134,1341],{"class":1254},[1036,11136,11137],{"class":1046},"Sunny",[1036,11139,1279],{"class":1254},[1036,11141,9311],{"class":1254},[1036,11143,11144],{"class":1038,"line":1360},[1036,11145,3360],{"class":1254},[1036,11147,11148,11150],{"class":1038,"line":1383},[1036,11149,1438],{"class":1254},[1036,11151,1441],{"class":1250},[983,11153,11155],{"icon":11154,"target":986,"to":987},"i-lucide-rocket",[936,11156,11157,11158,11160,11161,1758],{},"The official ",[954,11159,993],{}," includes all these features and more. Get started instantly with ",[1033,11162,11163],{},"npx nuxi@latest init -t ui/chat my-chat-app",[940,11165,11167],{"id":11166},"deploying-to-vercel","Deploying to Vercel",[936,11169,11170],{},"Deploy your chatbot to Vercel with zero configuration:",[1026,11172,11174],{"className":1028,"code":11173,"language":1030,"meta":1031,"style":1031},"npx vercel deploy\n",[1033,11175,11176],{"__ignoreMap":1031},[1036,11177,11178,11180,11183],{"class":1038,"line":1039},[1036,11179,1043],{"class":1042},[1036,11181,11182],{"class":1046}," vercel",[1036,11184,11185],{"class":1046}," deploy\n",[936,11187,11188],{},"Then, in the Vercel dashboard:",[948,11190,11191,11197],{},[951,11192,11193,11194,11196],{},"Enable ",[954,11195,4191],{}," and add credits so requests can be processed.",[951,11198,11199,11200,11203],{},"Add a ",[954,11201,11202],{},"Turso"," database from the Vercel Marketplace and connect it to your project (it will provision the database and add the required environment variables automatically).",[11205,11206,11207],"blockquote",{},[936,11208,11209,11210,11215,11216,11218],{},"Note: On Vercel, you ",[954,11211,11212,11213],{},"don’t need to manually add ",[1033,11214,1608],{}," — Vercel handles the gateway configuration for deployments. Keep using ",[1033,11217,1595],{}," locally for development.",[1615,11220,11221],{"to":1013,"target":986},[936,11222,11223,11224,1758],{},"Learn more about setting up AI Gateway in the ",[954,11225,11226],{},"Vercel AI Gateway documentation",[940,11228,11230],{"id":11229},"conclusion","Conclusion",[936,11232,11233],{},"You've built a complete AI chatbot with:",[948,11235,11236,11242,11248,11253,11258],{},[951,11237,11238,11241],{},[954,11239,11240],{},"A complete chat interface"," using Nuxt UI components",[951,11243,11244,11247],{},[954,11245,11246],{},"Real-time streaming responses"," with the AI SDK",[951,11249,11250,11252],{},[954,11251,968],{}," with MDC for rich content display",[951,11254,11255,11257],{},[954,11256,974],{}," via AI Gateway",[951,11259,11260,11263],{},[954,11261,11262],{},"Database persistence"," with SQLite (local) / Turso (production) and Drizzle ORM",[936,11265,11266],{},"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,11268,11269],{},[954,11270,11271],{},"Resources:",[948,11273,11274,11281,11288,11295,11301],{},[951,11275,11276],{},[1011,11277,11280],{"href":11278,"rel":11279},"https://ui.nuxt.com/components/chat-messages",[1015],"Nuxt UI Chat Components",[951,11282,11283],{},[1011,11284,11287],{"href":11285,"rel":11286},"https://hub.nuxt.com/docs/features/database",[1015],"NuxtHub Database",[951,11289,11290],{},[1011,11291,11294],{"href":11292,"rel":11293},"https://ai-sdk.dev",[1015],"AI SDK Documentation",[951,11296,11297],{},[1011,11298,11300],{"href":1013,"rel":11299},[1015],"AI Gateway Documentation",[951,11302,11303],{},[1011,11304,11306],{"href":987,"rel":11305},[1015],"AI Chat Template",[936,11308,11309],{},"We're excited to see what you'll build!",[11311,11312,11313],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":1031,"searchDepth":1056,"depth":1056,"links":11315},[11316,11317,11318,11324,11329,11332,11333,11337,11338,11339,11344,11345,11346],{"id":942,"depth":1056,"text":943},{"id":997,"depth":1056,"text":998},{"id":1020,"depth":1056,"text":1021,"children":11319},[11320,11321,11322,11323],{"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":11325},[11326,11327,11328],{"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":11330},[11331],{"id":4684,"depth":1270,"text":4685},{"id":5304,"depth":1056,"text":5305},{"id":6739,"depth":1056,"text":6740,"children":11334},[11335,11336],{"id":6746,"depth":1270,"text":6747},{"id":6906,"depth":1270,"text":6907},{"id":7404,"depth":1056,"text":7405},{"id":7947,"depth":1056,"text":7948},{"id":9124,"depth":1056,"text":9125,"children":11340},[11341,11342,11343],{"id":9135,"depth":1270,"text":9136},{"id":9406,"depth":1270,"text":9407},{"id":9667,"depth":1270,"text":9668},{"id":10917,"depth":1056,"text":10918},{"id":11166,"depth":1056,"text":11167},{"id":11229,"depth":1056,"text":11230},"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":11352},"Tutorial","/blog/how-to-build-an-ai-chat",{"title":920,"description":11348},"blog/how-to-build-an-ai-chat","sF-X00IyVVRUYqwN17Ubpm4H6Z1IRgi6gKRm3dRrqnY",1769700201909]