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