[{"data":1,"prerenderedAt":11369},["ShallowReactive",2],{"navigation":3,"-blog-how-to-build-an-ai-chat":929},[4],{"title":5,"path":6,"stem":7,"children":8,"page":36},"Docs","/docs","docs",[9,163,792,828],{"title":10,"path":11,"stem":12,"children":13,"framework":16,"category":16,"description":16,"icon":30},"Get Started","/docs/getting-started","docs/1.getting-started/1.index",[14,19,37,47,53,76,140],{"title":15,"path":11,"stem":12,"framework":16,"category":16,"description":17,"icon":18},"Introduction",null,"Nuxt UI is a comprehensive Vue UI component library (Nuxt optional), offering 125+ accessible, Tailwind CSS components for building modern web applications.","i-lucide-house",{"title":20,"framework":16,"category":16,"description":16,"shadow":21,"path":22,"stem":23,"children":24,"page":36},"Installation",true,"/docs/getting-started/installation","docs/1.getting-started/2.installation",[25,31],{"title":20,"path":26,"stem":27,"framework":28,"category":16,"description":29,"icon":30},"/docs/getting-started/installation/nuxt","docs/1.getting-started/2.installation/1.nuxt","nuxt","Learn how to install and configure Nuxt UI in your Nuxt application.","i-lucide-square-play",{"title":20,"path":32,"stem":33,"framework":34,"category":16,"description":35,"icon":30},"/docs/getting-started/installation/vue","docs/1.getting-started/2.installation/2.vue","vue","Learn how to install and configure Nuxt UI in your Vue application, compatible with both plain Vite and Inertia.",false,{"title":38,"framework":16,"category":16,"description":16,"icon":39,"shadow":21,"path":40,"stem":41,"children":42,"page":36},"Migration","i-lucide-arrow-right-left","/docs/getting-started/migration","docs/1.getting-started/3.migration",[43],{"title":38,"path":44,"stem":45,"framework":16,"category":16,"description":46,"icon":39},"/docs/getting-started/migration/v4","docs/1.getting-started/3.migration/1.v4","A comprehensive guide to migrate your application from Nuxt UI v3 to Nuxt UI v4.",{"title":48,"path":49,"stem":50,"framework":16,"category":16,"description":51,"icon":52},"Contribution","/docs/getting-started/contribution","docs/1.getting-started/4.contribution","A comprehensive guide on contributing to Nuxt UI, including project structure, development workflow, and best practices.","i-lucide-handshake",{"title":54,"path":55,"stem":56,"children":57,"page":36},"Theme","/docs/getting-started/theme","docs/1.getting-started/5.theme",[58,64,70],{"title":59,"path":60,"stem":61,"framework":16,"category":16,"description":62,"icon":63},"Design System","/docs/getting-started/theme/design-system","docs/1.getting-started/5.theme/1.design-system","Nuxt UI's design system uses Tailwind CSS for simple theming and easy customization.","i-lucide-palette",{"title":65,"path":66,"stem":67,"framework":16,"category":16,"description":68,"icon":69},"CSS Variables","/docs/getting-started/theme/css-variables","docs/1.getting-started/5.theme/2.css-variables","Nuxt UI uses CSS variables as design tokens for flexible, consistent theming with built-in light and dark mode support.","i-lucide-swatch-book",{"title":71,"path":72,"stem":73,"framework":16,"category":16,"description":74,"icon":75},"Components","/docs/getting-started/theme/components","docs/1.getting-started/5.theme/3.components","Learn how to customize Nuxt UI components with the Tailwind Variants API for advanced, flexible, and maintainable styling.","i-lucide-layout-grid",{"title":77,"framework":16,"category":16,"description":16,"path":78,"stem":79,"children":80,"page":36},"Integrations","/docs/getting-started/integrations","docs/1.getting-started/6.integrations",[81,95,101,115,129,135],{"title":82,"framework":16,"category":16,"description":16,"shadow":21,"path":83,"stem":84,"children":85,"page":36},"Icons","/docs/getting-started/integrations/icons","docs/1.getting-started/6.integrations/1.icons",[86,91],{"title":82,"path":87,"stem":88,"framework":28,"category":16,"description":89,"icon":90},"/docs/getting-started/integrations/icons/nuxt","docs/1.getting-started/6.integrations/1.icons/1.nuxt","Nuxt UI integrates with Nuxt Icon to access over 200,000+ icons from Iconify.","i-lucide-smile",{"title":82,"path":92,"stem":93,"framework":34,"category":16,"description":94,"icon":90},"/docs/getting-started/integrations/icons/vue","docs/1.getting-started/6.integrations/1.icons/2.vue","Nuxt UI integrates with Iconify to access over 200,000+ icons.",{"title":96,"path":97,"stem":98,"framework":28,"category":16,"description":99,"icon":100},"Fonts","/docs/getting-started/integrations/fonts","docs/1.getting-started/6.integrations/2.fonts","Nuxt UI integrates with Nuxt Fonts to provide plug-and-play font optimization.","i-lucide-a-large-small",{"title":102,"framework":16,"category":16,"description":16,"shadow":21,"path":103,"stem":104,"children":105,"page":36},"Color Mode","/docs/getting-started/integrations/color-mode","docs/1.getting-started/6.integrations/3.color-mode",[106,111],{"title":102,"path":107,"stem":108,"framework":28,"category":16,"description":109,"icon":110},"/docs/getting-started/integrations/color-mode/nuxt","docs/1.getting-started/6.integrations/3.color-mode/1.nuxt","Nuxt UI integrates with Nuxt Color Mode to allow for easy switching between light and dark themes.","i-lucide-sun-moon",{"title":102,"path":112,"stem":113,"framework":34,"category":16,"description":114,"icon":110},"/docs/getting-started/integrations/color-mode/vue","docs/1.getting-started/6.integrations/3.color-mode/2.vue","Nuxt UI integrates with VueUse to allow for easy switching between light and dark themes.",{"title":116,"framework":16,"category":16,"description":16,"shadow":21,"path":117,"stem":118,"children":119,"page":36},"I18n","/docs/getting-started/integrations/i18n","docs/1.getting-started/6.integrations/4.i18n",[120,126],{"title":121,"path":122,"stem":123,"framework":28,"category":16,"description":124,"icon":125},"Internationalization (i18n)","/docs/getting-started/integrations/i18n/nuxt","docs/1.getting-started/6.integrations/4.i18n/1.nuxt","Nuxt UI supports 50+ locales and multi-directional (LTR/RTL) internationalization.","i-lucide-languages",{"title":121,"path":127,"stem":128,"framework":34,"category":16,"description":124,"icon":125},"/docs/getting-started/integrations/i18n/vue","docs/1.getting-started/6.integrations/4.i18n/2.vue",{"title":130,"path":131,"stem":132,"framework":28,"category":16,"description":133,"icon":134},"Content","/docs/getting-started/integrations/content","docs/1.getting-started/6.integrations/5.content","Nuxt UI integrates with Nuxt Content to deliver beautiful typography and consistent component styling.","i-simple-icons-markdown",{"title":136,"path":137,"stem":138,"framework":34,"category":16,"description":139,"icon":134},"SSR","/docs/getting-started/integrations/ssr","docs/1.getting-started/6.integrations/6.ssr","Nuxt UI has first-party support for Vue SSR. This guide will help you have it fully enabled.",{"title":141,"framework":16,"category":16,"description":16,"path":142,"stem":143,"children":144,"page":36},"Agents","/docs/getting-started/ai","docs/1.getting-started/7.ai",[145,151,157],{"title":146,"path":147,"stem":148,"framework":16,"category":16,"description":149,"icon":150},"MCP Server","/docs/getting-started/ai/mcp","docs/1.getting-started/7.ai/1.mcp","Use Nuxt UI components in your AI assistants with Model Context Protocol support.","i-lucide-server",{"title":152,"path":153,"stem":154,"framework":16,"category":16,"description":155,"icon":156},"LLMs.txt","/docs/getting-started/ai/llms-txt","docs/1.getting-started/7.ai/2.llms-txt","How to get AI tools like Cursor, Windsurf, GitHub Copilot, ChatGPT, and Claude to understand Nuxt UI components, theming, and best practices.","i-lucide-bot",{"title":158,"path":159,"stem":160,"framework":16,"category":16,"description":161,"icon":162},"Skills","/docs/getting-started/ai/skills","docs/1.getting-started/7.ai/3.skills","Install Nuxt UI skills to give AI coding agents deep knowledge of components, theming, and best practices.","i-lucide-sparkles",{"title":71,"framework":16,"category":16,"description":16,"icon":164,"path":165,"stem":166,"children":167,"page":36},"i-lucide-square-code","/docs/components","docs/2.components",[168,174,180,186,192,197,202,207,212,217,222,228,233,238,243,248,253,258,264,269,274,279,284,290,295,300,305,311,316,321,326,331,336,341,346,352,357,362,367,372,378,384,389,394,399,404,409,414,419,424,429,434,439,446,451,456,461,466,471,476,481,486,491,496,501,506,511,516,521,526,531,536,541,546,551,556,561,567,572,577,582,587,592,597,602,607,612,617,622,627,632,637,642,647,652,657,662,667,672,677,682,687,692,697,702,707,712,717,722,727,732,737,742,747,752,757,762,767,772,777,782,787],{"title":169,"path":170,"stem":171,"framework":16,"category":172,"description":173},"Accordion","/docs/components/accordion","docs/2.components/accordion","data","A stacked set of collapsible panels.",{"title":175,"path":176,"stem":177,"framework":16,"category":178,"description":179},"Alert","/docs/components/alert","docs/2.components/alert","element","A callout to draw user's attention.",{"title":181,"path":182,"stem":183,"framework":16,"category":184,"description":185},"App","/docs/components/app","docs/2.components/app","layout","Wraps your app to provide global configurations and more.",{"title":187,"path":188,"stem":189,"framework":16,"category":190,"description":191},"AuthForm","/docs/components/auth-form","docs/2.components/auth-form","page","A customizable Form to create login, register or password reset forms.",{"title":193,"path":194,"stem":195,"framework":16,"category":178,"description":196},"Avatar","/docs/components/avatar","docs/2.components/avatar","An img element with fallback and Nuxt Image support.",{"title":198,"path":199,"stem":200,"framework":16,"category":178,"description":201},"AvatarGroup","/docs/components/avatar-group","docs/2.components/avatar-group","Stack multiple avatars in a group.",{"title":203,"path":204,"stem":205,"framework":16,"category":178,"description":206},"Badge","/docs/components/badge","docs/2.components/badge","A short text to represent a status or a category.",{"title":208,"path":209,"stem":210,"framework":16,"category":178,"description":211},"Banner","/docs/components/banner","docs/2.components/banner","Display a banner at the top of your website to inform users about important information.",{"title":213,"path":214,"stem":215,"framework":16,"category":190,"description":216},"BlogPost","/docs/components/blog-post","docs/2.components/blog-post","A customizable article to display in a blog page.",{"title":218,"path":219,"stem":220,"framework":16,"category":190,"description":221},"BlogPosts","/docs/components/blog-posts","docs/2.components/blog-posts","Display a list of blog posts in a responsive grid layout.",{"title":223,"path":224,"stem":225,"framework":16,"category":226,"description":227},"Breadcrumb","/docs/components/breadcrumb","docs/2.components/breadcrumb","navigation","A hierarchy of links to navigate through a website.",{"title":229,"path":230,"stem":231,"framework":16,"category":178,"description":232},"Button","/docs/components/button","docs/2.components/button","A button element that can act as a link or trigger an action.",{"title":234,"path":235,"stem":236,"framework":16,"category":178,"description":237},"Calendar","/docs/components/calendar","docs/2.components/calendar","A calendar component for selecting single dates, multiple dates or date ranges.",{"title":239,"path":240,"stem":241,"framework":16,"category":178,"description":242},"Card","/docs/components/card","docs/2.components/card","Display content in a card with a header, body and footer.",{"title":244,"path":245,"stem":246,"framework":16,"category":172,"description":247},"Carousel","/docs/components/carousel","docs/2.components/carousel","A carousel with motion and swipe built using Embla.",{"title":249,"path":250,"stem":251,"framework":16,"category":190,"description":252},"ChangelogVersion","/docs/components/changelog-version","docs/2.components/changelog-version","A customizable article to display in a changelog.",{"title":254,"path":255,"stem":256,"framework":16,"category":190,"description":257},"ChangelogVersions","/docs/components/changelog-versions","docs/2.components/changelog-versions","Display a list of changelog versions in a timeline.",{"title":259,"path":260,"stem":261,"framework":16,"category":262,"description":263},"ChatMessage","/docs/components/chat-message","docs/2.components/chat-message","chat","Display a chat message with icon, avatar, and actions.",{"title":265,"path":266,"stem":267,"framework":16,"category":262,"description":268},"ChatMessages","/docs/components/chat-messages","docs/2.components/chat-messages","Display a list of chat messages, designed to work seamlessly with Vercel AI SDK.",{"title":270,"path":271,"stem":272,"framework":16,"category":262,"description":273},"ChatPalette","/docs/components/chat-palette","docs/2.components/chat-palette","A chat palette to create a chatbot interface inside an overlay.",{"title":275,"path":276,"stem":277,"framework":16,"category":262,"description":278},"ChatPrompt","/docs/components/chat-prompt","docs/2.components/chat-prompt","An enhanced Textarea for submitting prompts in AI chat interfaces.",{"title":280,"path":281,"stem":282,"framework":16,"category":262,"description":283},"ChatPromptSubmit","/docs/components/chat-prompt-submit","docs/2.components/chat-prompt-submit","A Button for submitting chat prompts with automatic status handling.",{"title":285,"path":286,"stem":287,"framework":16,"category":288,"description":289},"Checkbox","/docs/components/checkbox","docs/2.components/checkbox","form","An input element to toggle between checked and unchecked states.",{"title":291,"path":292,"stem":293,"framework":16,"category":288,"description":294},"CheckboxGroup","/docs/components/checkbox-group","docs/2.components/checkbox-group","A set of checklist buttons to select multiple option from a list.",{"title":296,"path":297,"stem":298,"framework":16,"category":178,"description":299},"Chip","/docs/components/chip","docs/2.components/chip","An indicator of a numeric value or a state.",{"title":301,"path":302,"stem":303,"framework":16,"category":178,"description":304},"Collapsible","/docs/components/collapsible","docs/2.components/collapsible","A collapsible element to toggle visibility of its content.",{"title":306,"path":307,"stem":308,"framework":16,"category":309,"description":310},"ColorModeAvatar","/docs/components/color-mode-avatar","docs/2.components/color-mode-avatar","color-mode","An Avatar with a different source for light and dark mode.",{"title":312,"path":313,"stem":314,"framework":16,"category":309,"description":315},"ColorModeButton","/docs/components/color-mode-button","docs/2.components/color-mode-button","A Button to switch between light and dark mode.",{"title":317,"path":318,"stem":319,"framework":16,"category":309,"description":320},"ColorModeImage","/docs/components/color-mode-image","docs/2.components/color-mode-image","An image element with a different source for light and dark mode.",{"title":322,"path":323,"stem":324,"framework":16,"category":309,"description":325},"ColorModeSelect","/docs/components/color-mode-select","docs/2.components/color-mode-select","A Select to switch between system, dark & light mode.",{"title":327,"path":328,"stem":329,"framework":16,"category":309,"description":330},"ColorModeSwitch","/docs/components/color-mode-switch","docs/2.components/color-mode-switch","A switch to toggle between light and dark mode.",{"title":332,"path":333,"stem":334,"framework":16,"category":288,"description":335},"ColorPicker","/docs/components/color-picker","docs/2.components/color-picker","A component to select a color.",{"title":337,"path":338,"stem":339,"framework":16,"category":226,"description":340},"CommandPalette","/docs/components/command-palette","docs/2.components/command-palette","A command palette with full-text search powered by Fuse.js for efficient fuzzy matching.",{"title":342,"path":343,"stem":344,"framework":16,"category":184,"description":345},"Container","/docs/components/container","docs/2.components/container","A container lets you center and constrain the width of your content.",{"title":347,"path":348,"stem":349,"framework":28,"category":350,"description":351},"ContentNavigation","/docs/components/content-navigation","docs/2.components/content-navigation","content","An accordion-style navigation component for organizing page links.",{"title":353,"path":354,"stem":355,"framework":28,"category":350,"description":356},"ContentSearch","/docs/components/content-search","docs/2.components/content-search","A ready to use CommandPalette to add to your documentation.",{"title":358,"path":359,"stem":360,"framework":28,"category":350,"description":361},"ContentSearchButton","/docs/components/content-search-button","docs/2.components/content-search-button","A pre-styled Button to open the ContentSearch modal.",{"title":363,"path":364,"stem":365,"framework":28,"category":350,"description":366},"ContentSurround","/docs/components/content-surround","docs/2.components/content-surround","A pair of prev and next links to navigate between pages.",{"title":368,"path":369,"stem":370,"framework":28,"category":350,"description":371},"ContentToc","/docs/components/content-toc","docs/2.components/content-toc","A sticky Table of Contents with automatic active anchor link highlighting.",{"title":373,"path":374,"stem":375,"framework":16,"category":376,"description":377},"ContextMenu","/docs/components/context-menu","docs/2.components/context-menu","overlay","A menu to display actions when right-clicking on an element.",{"title":379,"path":380,"stem":381,"framework":16,"category":382,"description":383},"DashboardGroup","/docs/components/dashboard-group","docs/2.components/dashboard-group","dashboard","A fixed layout component that provides context for dashboard components with sidebar state management and persistence.",{"title":385,"path":386,"stem":387,"framework":16,"category":382,"description":388},"DashboardNavbar","/docs/components/dashboard-navbar","docs/2.components/dashboard-navbar","A responsive navbar to display in a dashboard.",{"title":390,"path":391,"stem":392,"framework":16,"category":382,"description":393},"DashboardPanel","/docs/components/dashboard-panel","docs/2.components/dashboard-panel","A resizable panel to display in a dashboard.",{"title":395,"path":396,"stem":397,"framework":16,"category":382,"description":398},"DashboardResizeHandle","/docs/components/dashboard-resize-handle","docs/2.components/dashboard-resize-handle","A handle to resize a sidebar or panel.",{"title":400,"path":401,"stem":402,"framework":16,"category":382,"description":403},"DashboardSearch","/docs/components/dashboard-search","docs/2.components/dashboard-search","A ready to use CommandPalette to add to your dashboard.",{"title":405,"path":406,"stem":407,"framework":16,"category":382,"description":408},"DashboardSearchButton","/docs/components/dashboard-search-button","docs/2.components/dashboard-search-button","A pre-styled Button to open the DashboardSearch modal.",{"title":410,"path":411,"stem":412,"framework":16,"category":382,"description":413},"DashboardSidebar","/docs/components/dashboard-sidebar","docs/2.components/dashboard-sidebar","A resizable and collapsible sidebar to display in a dashboard.",{"title":415,"path":416,"stem":417,"framework":16,"category":382,"description":418},"DashboardSidebarCollapse","/docs/components/dashboard-sidebar-collapse","docs/2.components/dashboard-sidebar-collapse","A Button to collapse the sidebar on desktop.",{"title":420,"path":421,"stem":422,"framework":16,"category":382,"description":423},"DashboardSidebarToggle","/docs/components/dashboard-sidebar-toggle","docs/2.components/dashboard-sidebar-toggle","A Button to toggle the sidebar on mobile.",{"title":425,"path":426,"stem":427,"framework":16,"category":382,"description":428},"DashboardToolbar","/docs/components/dashboard-toolbar","docs/2.components/dashboard-toolbar","A toolbar to display under the navbar in a dashboard.",{"title":430,"path":431,"stem":432,"framework":16,"category":376,"description":433},"Drawer","/docs/components/drawer","docs/2.components/drawer","A drawer that smoothly slides in & out of the screen.",{"title":435,"path":436,"stem":437,"framework":16,"category":376,"description":438},"DropdownMenu","/docs/components/dropdown-menu","docs/2.components/dropdown-menu","A menu to display actions when clicking on an element.",{"title":440,"path":441,"stem":442,"framework":16,"category":443,"description":444,"badge":445},"Editor","/docs/components/editor","docs/2.components/editor","editor","A rich text editor component based on TipTap with support for markdown, HTML, and JSON content types.","New",{"title":447,"path":448,"stem":449,"framework":16,"category":443,"description":450,"badge":445},"EditorDragHandle","/docs/components/editor-drag-handle","docs/2.components/editor-drag-handle","A draggable handle for reordering and selecting blocks in the editor.",{"title":452,"path":453,"stem":454,"framework":16,"category":443,"description":455,"badge":445},"EditorEmojiMenu","/docs/components/editor-emoji-menu","docs/2.components/editor-emoji-menu","An emoji picker menu that displays emoji suggestions when typing the : character in the editor.",{"title":457,"path":458,"stem":459,"framework":16,"category":443,"description":460,"badge":445},"EditorMentionMenu","/docs/components/editor-mention-menu","docs/2.components/editor-mention-menu","A mention menu that displays user suggestions when typing a trigger character in the editor.",{"title":462,"path":463,"stem":464,"framework":16,"category":443,"description":465,"badge":445},"EditorSuggestionMenu","/docs/components/editor-suggestion-menu","docs/2.components/editor-suggestion-menu","A command menu that displays formatting and action suggestions when typing the / character in the editor.",{"title":467,"path":468,"stem":469,"framework":16,"category":443,"description":470,"badge":445},"EditorToolbar","/docs/components/editor-toolbar","docs/2.components/editor-toolbar","A customizable toolbar for editor actions that can be displayed as fixed, bubble, or floating menu.",{"title":472,"path":473,"stem":474,"framework":16,"category":172,"description":475},"Empty","/docs/components/empty","docs/2.components/empty","A component to display an empty state.",{"title":477,"path":478,"stem":479,"framework":16,"category":184,"description":480},"Error","/docs/components/error","docs/2.components/error","A pre-built error component with NuxtError support.",{"title":482,"path":483,"stem":484,"framework":16,"category":178,"description":485},"FieldGroup","/docs/components/field-group","docs/2.components/field-group","Group multiple button-like elements together.",{"title":487,"path":488,"stem":489,"framework":16,"category":288,"description":490},"FileUpload","/docs/components/file-upload","docs/2.components/file-upload","An input element to upload files.",{"title":492,"path":493,"stem":494,"framework":16,"category":184,"description":495},"Footer","/docs/components/footer","docs/2.components/footer","A responsive footer component.",{"title":497,"path":498,"stem":499,"framework":16,"category":226,"description":500},"FooterColumns","/docs/components/footer-columns","docs/2.components/footer-columns","A list of links as columns to display in your Footer.",{"title":502,"path":503,"stem":504,"framework":16,"category":288,"description":505},"Form","/docs/components/form","docs/2.components/form","A form component with built-in validation and submission handling.",{"title":507,"path":508,"stem":509,"framework":16,"category":288,"description":510},"FormField","/docs/components/form-field","docs/2.components/form-field","A wrapper for form elements that provides validation and error handling.",{"title":512,"path":513,"stem":514,"framework":16,"category":184,"description":515},"Header","/docs/components/header","docs/2.components/header","A responsive header component.",{"title":517,"path":518,"stem":519,"framework":16,"category":178,"description":520},"Icon","/docs/components/icon","docs/2.components/icon","A component to display any icon from Iconify or another component.",{"title":522,"path":523,"stem":524,"framework":16,"category":288,"description":525},"Input","/docs/components/input","docs/2.components/input","An input element to enter text.",{"title":527,"path":528,"stem":529,"framework":16,"category":288,"description":530},"InputDate","/docs/components/input-date","docs/2.components/input-date","An input component for date selection.",{"title":532,"path":533,"stem":534,"framework":16,"category":288,"description":535},"InputMenu","/docs/components/input-menu","docs/2.components/input-menu","An autocomplete input with real-time suggestions.",{"title":537,"path":538,"stem":539,"framework":16,"category":288,"description":540},"InputNumber","/docs/components/input-number","docs/2.components/input-number","An input for numerical values with a customizable range.",{"title":542,"path":543,"stem":544,"framework":16,"category":288,"description":545},"InputTags","/docs/components/input-tags","docs/2.components/input-tags","An input element that displays interactive tags.",{"title":547,"path":548,"stem":549,"framework":16,"category":288,"description":550},"InputTime","/docs/components/input-time","docs/2.components/input-time","An input for selecting a time.",{"title":552,"path":553,"stem":554,"framework":16,"category":178,"description":555},"Kbd","/docs/components/kbd","docs/2.components/kbd","A kbd element to display a keyboard key.",{"title":557,"path":558,"stem":559,"framework":16,"category":226,"description":560},"Link","/docs/components/link","docs/2.components/link","A wrapper around \u003CNuxtLink> with extra props.",{"title":562,"path":563,"stem":564,"framework":16,"category":565,"description":566},"LocaleSelect","/docs/components/locale-select","docs/2.components/locale-select","i18n","A Select to switch between locales.",{"title":568,"path":569,"stem":570,"framework":16,"category":184,"description":571},"Main","/docs/components/main","docs/2.components/main","A main element that fills the available viewport height.",{"title":573,"path":574,"stem":575,"framework":16,"category":172,"description":576},"Marquee","/docs/components/marquee","docs/2.components/marquee","A component to create infinite scrolling content.",{"title":578,"path":579,"stem":580,"framework":16,"category":376,"description":581},"Modal","/docs/components/modal","docs/2.components/modal","A dialog window that can be used to display a message or request user input.",{"title":583,"path":584,"stem":585,"framework":16,"category":226,"description":586},"NavigationMenu","/docs/components/navigation-menu","docs/2.components/navigation-menu","A list of links that can be displayed horizontally or vertically.",{"title":588,"path":589,"stem":590,"framework":16,"category":190,"description":591},"Page","/docs/components/page","docs/2.components/page","A grid layout for your pages with left and right columns.",{"title":593,"path":594,"stem":595,"framework":16,"category":190,"description":596},"PageAnchors","/docs/components/page-anchors","docs/2.components/page-anchors","A list of anchors to be displayed in the page.",{"title":598,"path":599,"stem":600,"framework":16,"category":190,"description":601},"PageAside","/docs/components/page-aside","docs/2.components/page-aside","A sticky aside to display your page navigation.",{"title":603,"path":604,"stem":605,"framework":16,"category":190,"description":606},"PageBody","/docs/components/page-body","docs/2.components/page-body","The main content of your page.",{"title":608,"path":609,"stem":610,"framework":16,"category":190,"description":611},"PageCard","/docs/components/page-card","docs/2.components/page-card","A pre-styled card component that displays a title, description and optional link.",{"title":613,"path":614,"stem":615,"framework":16,"category":190,"description":616},"PageColumns","/docs/components/page-columns","docs/2.components/page-columns","A responsive multi-column layout system for organizing content side-by-side.",{"title":618,"path":619,"stem":620,"framework":16,"category":190,"description":621},"PageCTA","/docs/components/page-cta","docs/2.components/page-cta","A call to action section to display in your pages.",{"title":623,"path":624,"stem":625,"framework":16,"category":190,"description":626},"PageFeature","/docs/components/page-feature","docs/2.components/page-feature","A component to showcase key features of your application.",{"title":628,"path":629,"stem":630,"framework":16,"category":190,"description":631},"PageGrid","/docs/components/page-grid","docs/2.components/page-grid","A responsive grid system for displaying content in a flexible layout.",{"title":633,"path":634,"stem":635,"framework":16,"category":190,"description":636},"PageHeader","/docs/components/page-header","docs/2.components/page-header","A responsive header for your pages.",{"title":638,"path":639,"stem":640,"framework":16,"category":190,"description":641},"PageHero","/docs/components/page-hero","docs/2.components/page-hero","A responsive hero for your pages.",{"title":643,"path":644,"stem":645,"framework":16,"category":190,"description":646},"PageLinks","/docs/components/page-links","docs/2.components/page-links","A list of links to be displayed in the page.",{"title":648,"path":649,"stem":650,"framework":16,"category":190,"description":651},"PageList","/docs/components/page-list","docs/2.components/page-list","A vertical list layout for displaying content in a stacked format.",{"title":653,"path":654,"stem":655,"framework":16,"category":190,"description":656},"PageLogos","/docs/components/page-logos","docs/2.components/page-logos","A list of logos or images to display on your pages.",{"title":658,"path":659,"stem":660,"framework":16,"category":190,"description":661},"PageSection","/docs/components/page-section","docs/2.components/page-section","A responsive section for your pages.",{"title":663,"path":664,"stem":665,"framework":16,"category":226,"description":666},"Pagination","/docs/components/pagination","docs/2.components/pagination","A list of buttons or links to navigate through pages.",{"title":668,"path":669,"stem":670,"framework":16,"category":288,"description":671},"PinInput","/docs/components/pin-input","docs/2.components/pin-input","An input element to enter a pin.",{"title":673,"path":674,"stem":675,"framework":16,"category":376,"description":676},"Popover","/docs/components/popover","docs/2.components/popover","A non-modal dialog that floats around a trigger element.",{"title":678,"path":679,"stem":680,"framework":16,"category":190,"description":681},"PricingPlan","/docs/components/pricing-plan","docs/2.components/pricing-plan","A customizable pricing plan to display in a pricing page.",{"title":683,"path":684,"stem":685,"framework":16,"category":190,"description":686},"PricingPlans","/docs/components/pricing-plans","docs/2.components/pricing-plans","Display a list of pricing plans in a responsive grid layout.",{"title":688,"path":689,"stem":690,"framework":16,"category":190,"description":691},"PricingTable","/docs/components/pricing-table","docs/2.components/pricing-table","A responsive pricing table component that displays tiered pricing plans with feature comparisons.",{"title":693,"path":694,"stem":695,"framework":16,"category":178,"description":696},"Progress","/docs/components/progress","docs/2.components/progress","An indicator showing the progress of a task.",{"title":698,"path":699,"stem":700,"framework":16,"category":288,"description":701},"RadioGroup","/docs/components/radio-group","docs/2.components/radio-group","A set of radio buttons to select a single option from a list.",{"title":703,"path":704,"stem":705,"framework":16,"category":172,"description":706,"badge":445},"ScrollArea","/docs/components/scroll-area","docs/2.components/scroll-area","A flexible scroll container with virtualization support.",{"title":708,"path":709,"stem":710,"framework":16,"category":288,"description":711},"Select","/docs/components/select","docs/2.components/select","A select element to choose from a list of options.",{"title":713,"path":714,"stem":715,"framework":16,"category":288,"description":716},"SelectMenu","/docs/components/select-menu","docs/2.components/select-menu","An advanced searchable select element.",{"title":718,"path":719,"stem":720,"framework":16,"category":178,"description":721},"Separator","/docs/components/separator","docs/2.components/separator","Separates content horizontally or vertically.",{"title":723,"path":724,"stem":725,"framework":16,"category":178,"description":726},"Skeleton","/docs/components/skeleton","docs/2.components/skeleton","A placeholder to show while content is loading.",{"title":728,"path":729,"stem":730,"framework":16,"category":376,"description":731},"Slideover","/docs/components/slideover","docs/2.components/slideover","A dialog that slides in from any side of the screen.",{"title":733,"path":734,"stem":735,"framework":16,"category":288,"description":736},"Slider","/docs/components/slider","docs/2.components/slider","An input to select a numeric value within a range.",{"title":738,"path":739,"stem":740,"framework":16,"category":226,"description":741},"Stepper","/docs/components/stepper","docs/2.components/stepper","A set of steps that are used to indicate progress through a multi-step process.",{"title":743,"path":744,"stem":745,"framework":16,"category":288,"description":746},"Switch","/docs/components/switch","docs/2.components/switch","A control that toggles between two states.",{"title":748,"path":749,"stem":750,"framework":16,"category":172,"description":751},"Table","/docs/components/table","docs/2.components/table","A responsive table element to display data in rows and columns.",{"title":753,"path":754,"stem":755,"framework":16,"category":226,"description":756},"Tabs","/docs/components/tabs","docs/2.components/tabs","A set of tab panels that are displayed one at a time.",{"title":758,"path":759,"stem":760,"framework":16,"category":288,"description":761},"Textarea","/docs/components/textarea","docs/2.components/textarea","A textarea element to input multi-line text.",{"title":54,"path":763,"stem":764,"framework":16,"category":184,"description":765,"badge":766},"/docs/components/theme","docs/2.components/theme","A headless component to theme child components.","Soon",{"title":768,"path":769,"stem":770,"framework":16,"category":172,"description":771},"Timeline","/docs/components/timeline","docs/2.components/timeline","A component that displays a sequence of events with dates, titles, icons or avatars.",{"title":773,"path":774,"stem":775,"framework":16,"category":376,"description":776},"Toast","/docs/components/toast","docs/2.components/toast","A succinct message to provide information or feedback to the user.",{"title":778,"path":779,"stem":780,"framework":16,"category":376,"description":781},"Tooltip","/docs/components/tooltip","docs/2.components/tooltip","A popup that reveals information when hovering over an element.",{"title":783,"path":784,"stem":785,"framework":16,"category":172,"description":786},"Tree","/docs/components/tree","docs/2.components/tree","A tree view component to display and interact with hierarchical data structures.",{"title":788,"path":789,"stem":790,"framework":16,"category":172,"description":791},"User","/docs/components/user","docs/2.components/user","Display user information with name, description and avatar.",{"title":793,"framework":16,"category":16,"description":16,"icon":794,"path":795,"stem":796,"children":797,"page":36},"Composables","i-lucide-square-function","/docs/composables","docs/3.composables",[798,803,808,813,818,823],{"title":799,"path":800,"stem":801,"framework":16,"category":16,"description":802},"defineLocale","/docs/composables/define-locale","docs/3.composables/define-locale","A utility to create a custom locale for your app.",{"title":804,"path":805,"stem":806,"framework":16,"category":16,"description":807},"defineShortcuts","/docs/composables/define-shortcuts","docs/3.composables/define-shortcuts","A composable to define keyboard shortcuts in your app.",{"title":809,"path":810,"stem":811,"framework":16,"category":16,"description":812},"extendLocale","/docs/composables/extend-locale","docs/3.composables/extend-locale","A utility to extend an existing locale with custom translations.",{"title":814,"path":815,"stem":816,"framework":16,"category":16,"description":817},"extractShortcuts","/docs/composables/extract-shortcuts","docs/3.composables/extract-shortcuts","A utility to extract keyboard shortcuts from menu items.",{"title":819,"path":820,"stem":821,"framework":16,"category":16,"description":822},"useOverlay","/docs/composables/use-overlay","docs/3.composables/use-overlay","A composable to programmatically control overlays.",{"title":824,"path":825,"stem":826,"framework":16,"category":16,"description":827},"useToast","/docs/composables/use-toast","docs/3.composables/use-toast","A composable to display toast notifications in your app.",{"title":829,"path":830,"stem":831,"children":832,"framework":28,"category":16,"description":16,"icon":928},"Typography","/docs/typography","docs/4.typography/1.index",[833,835,840,845,850,855,860,864,869,873,878,883,888,893,898,902,907,911,915,919,924],{"title":15,"path":830,"stem":831,"framework":28,"category":16,"description":834},"Beautiful typography components and utilities to style your content with Nuxt UI.",{"title":836,"path":837,"stem":838,"framework":28,"category":16,"description":839},"Headers and text","/docs/typography/headers-and-text","docs/4.typography/2.headers-and-text","Beautifully styled headings, paragraphs, text formatting, and links for optimal readability.",{"title":841,"path":842,"stem":843,"framework":28,"category":16,"description":844},"Lists and tables","/docs/typography/lists-and-tables","docs/4.typography/3.lists-and-tables","Organize information with styled lists and responsive tables for clear, consistent readability.",{"title":846,"path":847,"stem":848,"framework":28,"category":16,"description":849},"Images and embeds","/docs/typography/images-and-embeds","docs/4.typography/4.images-and-embeds","Responsive images, videos, and rich media embeds to enhance and illustrate your documentation.",{"title":851,"path":852,"stem":853,"framework":28,"category":16,"description":854},"Code","/docs/typography/code","docs/4.typography/5.code","Display inline code and syntax-highlighted code blocks with copy-to-clipboard support.",{"title":169,"path":856,"stem":857,"framework":28,"category":858,"description":859},"/docs/typography/accordion","docs/4.typography/accordion","components","Create expandable content sections for better information organization.",{"title":203,"path":861,"stem":862,"framework":28,"category":858,"description":863},"/docs/typography/badge","docs/4.typography/badge","Display version numbers, status labels, and tags within your content.",{"title":865,"path":866,"stem":867,"framework":28,"category":858,"description":868},"Callout","/docs/typography/callout","docs/4.typography/callout","Highlight important information with eye-catching colored boxes and icons.",{"title":239,"path":870,"stem":871,"framework":28,"category":858,"description":872},"/docs/typography/card","docs/4.typography/card","Create highlighted content blocks with optional links and navigation.",{"title":874,"path":875,"stem":876,"framework":28,"category":858,"description":877},"CardGroup","/docs/typography/card-group","docs/4.typography/card-group","Organize multiple cards in responsive grid layouts for better content presentation.",{"title":879,"path":880,"stem":881,"framework":28,"category":858,"description":882},"CodeCollapse","/docs/typography/code-collapse","docs/4.typography/code-collapse","Make long code blocks collapsible to save space and improve readability.",{"title":884,"path":885,"stem":886,"framework":28,"category":858,"description":887},"CodeGroup","/docs/typography/code-group","docs/4.typography/code-group","Group multiple code examples in tabbed interfaces for easy comparison.",{"title":889,"path":890,"stem":891,"framework":28,"category":858,"description":892},"CodePreview","/docs/typography/code-preview","docs/4.typography/code-preview","Display code examples with a preview and their source for clearer documentation.",{"title":894,"path":895,"stem":896,"framework":28,"category":858,"description":897},"CodeTree","/docs/typography/code-tree","docs/4.typography/code-tree","Visualize file and folder structures with syntax-highlighted code.",{"title":301,"path":899,"stem":900,"framework":28,"category":858,"description":901},"/docs/typography/collapsible","docs/4.typography/collapsible","Toggle content visibility with smooth expand and collapse animations.",{"title":903,"path":904,"stem":905,"framework":28,"category":858,"description":906},"Field","/docs/typography/field","docs/4.typography/field","Document API parameters, props, and configuration options clearly.",{"title":482,"path":908,"stem":909,"framework":28,"category":858,"description":910},"/docs/typography/field-group","docs/4.typography/field-group","Group related fields together for comprehensive API documentation.",{"title":517,"path":912,"stem":913,"framework":28,"category":858,"description":914},"/docs/typography/icon","docs/4.typography/icon","Display icons from popular icon libraries to enhance your content.",{"title":552,"path":916,"stem":917,"framework":28,"category":858,"description":918},"/docs/typography/kbd","docs/4.typography/kbd","Display keyboard shortcuts and key combinations with proper styling.",{"title":920,"path":921,"stem":922,"framework":28,"category":858,"description":923},"Steps","/docs/typography/steps","docs/4.typography/steps","Transform headings into numbered step-by-step guides and tutorials.",{"title":753,"path":925,"stem":926,"framework":28,"category":858,"description":927},"/docs/typography/tabs","docs/4.typography/tabs","Organize related content in interactive tabbed interfaces.","i-lucide-square-pilcrow",{"id":930,"title":931,"authors":932,"body":943,"date":11359,"description":11360,"extension":11361,"image":11362,"meta":11363,"navigation":36,"path":11365,"seo":11366,"stem":11367,"__hash__":11368},"posts/blog/how-to-build-an-ai-chat.md","Build an AI Chatbot with Nuxt, Nuxt UI, and AI SDK",[933,938],{"name":934,"avatar":935,"to":937},"Hugo Richard",{"src":936},"https://github.com/hugorcd.png","https://x.com/hugorcd",{"name":939,"avatar":940,"to":942},"Benjamin Canac",{"src":941},"https://github.com/benjamincanac.png","https://x.com/benjamincanac",{"type":944,"value":945,"toc":11326},"minimark",[946,950,955,958,993,1006,1010,1013,1029,1033,1036,1074,1079,1082,1226,1230,1237,1453,1456,1495,1499,1506,1601,1608,1625,1635,1639,1653,2384,2387,2405,2415,2419,2427,2431,2442,2810,2814,2841,4195,4198,4203,4210,4215,4226,4231,4240,4258,4263,4279,4292,4296,4299,4674,4678,4693,4697,4705,5281,5288,5313,5317,5336,6596,6599,6604,6615,6653,6668,6673,6680,6694,6699,6720,6725,6730,6737,6748,6752,6755,6759,6762,6915,6919,6944,7413,7417,7956,7960,9124,9133,9137,9144,9148,9158,9415,9419,9427,9676,9680,9683,10926,10930,10933,10938,10947,10952,10961,11164,11176,11180,11183,11198,11201,11216,11231,11239,11243,11246,11276,11279,11284,11319,11322],[947,948,949],"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.",[951,952,954],"h2",{"id":953},"what-were-building","What we're building",[947,956,957],{},"By the end of this tutorial, you'll have a fully functional AI chatbot with:",[959,960,961,969,975,981,987],"ul",{},[962,963,964,968],"li",{},[965,966,967],"strong",{},"Streaming responses"," that appear in real-time as the AI generates them",[962,970,971,974],{},[965,972,973],{},"A beautiful chat interface"," built with Nuxt UI's purpose-built chat components",[962,976,977,980],{},[965,978,979],{},"Markdown rendering"," for rich AI responses with code highlighting",[962,982,983,986],{},[965,984,985],{},"Multi-model support"," allowing users to switch between OpenAI, Anthropic, and Google models",[962,988,989,992],{},[965,990,991],{},"Server-side AI integration"," using Nitro API routes and the AI SDK",[994,995,999],"callout",{"icon":996,"target":997,"to":998},"i-simple-icons-github","_blank","https://github.com/nuxt-ui-templates/chat",[947,1000,1001,1002,1005],{},"Check out the complete ",[965,1003,1004],{},"AI Chat template"," on GitHub for a production-ready implementation with authentication, database persistence, and more.",[951,1007,1009],{"id":1008},"prerequisites","Prerequisites",[947,1011,1012],{},"Before we start, make sure you have:",[959,1014,1015,1018],{},[962,1016,1017],{},"Node.js 20+ installed",[962,1019,1020,1021,1028],{},"A ",[1022,1023,1027],"a",{"href":1024,"rel":1025},"https://vercel.com/docs/ai-gateway",[1026],"nofollow","Vercel AI Gateway"," API key (provides access to multiple AI providers through a single endpoint)",[951,1030,1032],{"id":1031},"project-setup","Project setup",[947,1034,1035],{},"Start by creating a new Nuxt project:",[1037,1038,1043],"pre",{"className":1039,"code":1040,"language":1041,"meta":1042,"style":1042},"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","",[1044,1045,1046,1065],"code",{"__ignoreMap":1042},[1047,1048,1051,1055,1059,1062],"span",{"class":1049,"line":1050},"line",1,[1047,1052,1054],{"class":1053},"sBMFI","npx",[1047,1056,1058],{"class":1057},"sfazB"," nuxi@latest",[1047,1060,1061],{"class":1057}," init",[1047,1063,1064],{"class":1057}," nuxt-ai-chat\n",[1047,1066,1068,1072],{"class":1049,"line":1067},2,[1047,1069,1071],{"class":1070},"s2Zo4","cd",[1047,1073,1064],{"class":1057},[1075,1076,1078],"h3",{"id":1077},"installing-dependencies","Installing dependencies",[947,1080,1081],{},"Install Nuxt UI and the AI-specific dependencies:",[1083,1084,1086,1129,1161,1194],"code-group",{"sync":1085},"pm",[1037,1087,1090],{"className":1039,"code":1088,"filename":1089,"language":1041,"meta":1042,"style":1042},"pnpm add @nuxt/ui tailwindcss @nuxtjs/mdc @nuxthub/core drizzle-orm drizzle-kit @libsql/client ai @ai-sdk/vue zod\n","pnpm",[1044,1091,1092],{"__ignoreMap":1042},[1047,1093,1094,1096,1099,1102,1105,1108,1111,1114,1117,1120,1123,1126],{"class":1049,"line":1050},[1047,1095,1089],{"class":1053},[1047,1097,1098],{"class":1057}," add",[1047,1100,1101],{"class":1057}," @nuxt/ui",[1047,1103,1104],{"class":1057}," tailwindcss",[1047,1106,1107],{"class":1057}," @nuxtjs/mdc",[1047,1109,1110],{"class":1057}," @nuxthub/core",[1047,1112,1113],{"class":1057}," drizzle-orm",[1047,1115,1116],{"class":1057}," drizzle-kit",[1047,1118,1119],{"class":1057}," @libsql/client",[1047,1121,1122],{"class":1057}," ai",[1047,1124,1125],{"class":1057}," @ai-sdk/vue",[1047,1127,1128],{"class":1057}," zod\n",[1037,1130,1133],{"className":1039,"code":1131,"filename":1132,"language":1041,"meta":1042,"style":1042},"yarn add @nuxt/ui tailwindcss @nuxtjs/mdc @nuxthub/core drizzle-orm drizzle-kit @libsql/client ai @ai-sdk/vue zod\n","yarn",[1044,1134,1135],{"__ignoreMap":1042},[1047,1136,1137,1139,1141,1143,1145,1147,1149,1151,1153,1155,1157,1159],{"class":1049,"line":1050},[1047,1138,1132],{"class":1053},[1047,1140,1098],{"class":1057},[1047,1142,1101],{"class":1057},[1047,1144,1104],{"class":1057},[1047,1146,1107],{"class":1057},[1047,1148,1110],{"class":1057},[1047,1150,1113],{"class":1057},[1047,1152,1116],{"class":1057},[1047,1154,1119],{"class":1057},[1047,1156,1122],{"class":1057},[1047,1158,1125],{"class":1057},[1047,1160,1128],{"class":1057},[1037,1162,1165],{"className":1039,"code":1163,"filename":1164,"language":1041,"meta":1042,"style":1042},"npm install @nuxt/ui tailwindcss @nuxtjs/mdc @nuxthub/core drizzle-orm drizzle-kit @libsql/client ai @ai-sdk/vue zod\n","npm",[1044,1166,1167],{"__ignoreMap":1042},[1047,1168,1169,1171,1174,1176,1178,1180,1182,1184,1186,1188,1190,1192],{"class":1049,"line":1050},[1047,1170,1164],{"class":1053},[1047,1172,1173],{"class":1057}," install",[1047,1175,1101],{"class":1057},[1047,1177,1104],{"class":1057},[1047,1179,1107],{"class":1057},[1047,1181,1110],{"class":1057},[1047,1183,1113],{"class":1057},[1047,1185,1116],{"class":1057},[1047,1187,1119],{"class":1057},[1047,1189,1122],{"class":1057},[1047,1191,1125],{"class":1057},[1047,1193,1128],{"class":1057},[1037,1195,1198],{"className":1039,"code":1196,"filename":1197,"language":1041,"meta":1042,"style":1042},"bun add @nuxt/ui tailwindcss @nuxtjs/mdc @nuxthub/core drizzle-orm drizzle-kit @libsql/client ai @ai-sdk/vue zod\n","bun",[1044,1199,1200],{"__ignoreMap":1042},[1047,1201,1202,1204,1206,1208,1210,1212,1214,1216,1218,1220,1222,1224],{"class":1049,"line":1050},[1047,1203,1197],{"class":1053},[1047,1205,1098],{"class":1057},[1047,1207,1101],{"class":1057},[1047,1209,1104],{"class":1057},[1047,1211,1107],{"class":1057},[1047,1213,1110],{"class":1057},[1047,1215,1113],{"class":1057},[1047,1217,1116],{"class":1057},[1047,1219,1119],{"class":1057},[1047,1221,1122],{"class":1057},[1047,1223,1125],{"class":1057},[1047,1225,1128],{"class":1057},[1075,1227,1229],{"id":1228},"configuration","Configuration",[947,1231,1232,1233,1236],{},"Update your ",[1044,1234,1235],{},"nuxt.config.ts"," to register the modules:",[1238,1239,1240],"code-tree-intersection",{},[1037,1241,1245],{"className":1242,"code":1243,"filename":1235,"language":1244,"meta":1042,"style":1042},"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",[1044,1246,1247,1267,1279,1294,1306,1317,1325,1331,1342,1358,1364,1369,1392,1397,1407,1417,1433,1439,1444],{"__ignoreMap":1042},[1047,1248,1249,1253,1256,1259,1263],{"class":1049,"line":1050},[1047,1250,1252],{"class":1251},"s7zQu","export",[1047,1254,1255],{"class":1251}," default",[1047,1257,1258],{"class":1070}," defineNuxtConfig",[1047,1260,1262],{"class":1261},"sTEyZ","(",[1047,1264,1266],{"class":1265},"sMK4o","{\n",[1047,1268,1269,1273,1276],{"class":1049,"line":1067},[1047,1270,1272],{"class":1271},"swJcz","  modules",[1047,1274,1275],{"class":1265},":",[1047,1277,1278],{"class":1261}," [\n",[1047,1280,1282,1285,1288,1291],{"class":1049,"line":1281},3,[1047,1283,1284],{"class":1265},"    '",[1047,1286,1287],{"class":1057},"@nuxt/ui",[1047,1289,1290],{"class":1265},"'",[1047,1292,1293],{"class":1265},",\n",[1047,1295,1297,1299,1302,1304],{"class":1049,"line":1296},4,[1047,1298,1284],{"class":1265},[1047,1300,1301],{"class":1057},"@nuxtjs/mdc",[1047,1303,1290],{"class":1265},[1047,1305,1293],{"class":1265},[1047,1307,1309,1311,1314],{"class":1049,"line":1308},5,[1047,1310,1284],{"class":1265},[1047,1312,1313],{"class":1057},"@nuxthub/core",[1047,1315,1316],{"class":1265},"'\n",[1047,1318,1320,1323],{"class":1049,"line":1319},6,[1047,1321,1322],{"class":1261},"  ]",[1047,1324,1293],{"class":1265},[1047,1326,1328],{"class":1049,"line":1327},7,[1047,1329,1330],{"emptyLinePlaceholder":21},"\n",[1047,1332,1334,1337,1339],{"class":1049,"line":1333},8,[1047,1335,1336],{"class":1271},"  hub",[1047,1338,1275],{"class":1265},[1047,1340,1341],{"class":1265}," {\n",[1047,1343,1345,1348,1350,1353,1356],{"class":1049,"line":1344},9,[1047,1346,1347],{"class":1271},"    db",[1047,1349,1275],{"class":1265},[1047,1351,1352],{"class":1265}," '",[1047,1354,1355],{"class":1057},"sqlite",[1047,1357,1316],{"class":1265},[1047,1359,1361],{"class":1049,"line":1360},10,[1047,1362,1363],{"class":1265},"  },\n",[1047,1365,1367],{"class":1049,"line":1366},11,[1047,1368,1330],{"emptyLinePlaceholder":21},[1047,1370,1372,1375,1377,1380,1382,1385,1387,1390],{"class":1049,"line":1371},12,[1047,1373,1374],{"class":1271},"  css",[1047,1376,1275],{"class":1265},[1047,1378,1379],{"class":1261}," [",[1047,1381,1290],{"class":1265},[1047,1383,1384],{"class":1057},"~/assets/css/main.css",[1047,1386,1290],{"class":1265},[1047,1388,1389],{"class":1261},"]",[1047,1391,1293],{"class":1265},[1047,1393,1395],{"class":1049,"line":1394},13,[1047,1396,1330],{"emptyLinePlaceholder":21},[1047,1398,1400,1403,1405],{"class":1049,"line":1399},14,[1047,1401,1402],{"class":1271},"  mdc",[1047,1404,1275],{"class":1265},[1047,1406,1341],{"class":1265},[1047,1408,1410,1413,1415],{"class":1049,"line":1409},15,[1047,1411,1412],{"class":1271},"    headings",[1047,1414,1275],{"class":1265},[1047,1416,1341],{"class":1265},[1047,1418,1420,1423,1425,1429],{"class":1049,"line":1419},16,[1047,1421,1422],{"class":1271},"      anchorLinks",[1047,1424,1275],{"class":1265},[1047,1426,1428],{"class":1427},"sfNiH"," false",[1047,1430,1432],{"class":1431},"sHwdD"," // Disable anchor links in AI responses\n",[1047,1434,1436],{"class":1049,"line":1435},17,[1047,1437,1438],{"class":1265},"    }\n",[1047,1440,1442],{"class":1049,"line":1441},18,[1047,1443,1363],{"class":1265},[1047,1445,1447,1450],{"class":1049,"line":1446},19,[1047,1448,1449],{"class":1265},"}",[1047,1451,1452],{"class":1261},")\n",[947,1454,1455],{},"Create the main CSS file to import Tailwind CSS and Nuxt UI:",[1238,1457,1458],{},[1037,1459,1464],{"className":1460,"code":1461,"filename":1462,"language":1463,"meta":1042,"style":1042},"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",[1044,1465,1466,1483],{"__ignoreMap":1042},[1047,1467,1468,1471,1474,1477,1480],{"class":1049,"line":1050},[1047,1469,1470],{"class":1251},"@import",[1047,1472,1473],{"class":1265}," \"",[1047,1475,1476],{"class":1057},"tailwindcss",[1047,1478,1479],{"class":1265},"\"",[1047,1481,1482],{"class":1265},";\n",[1047,1484,1485,1487,1489,1491,1493],{"class":1049,"line":1067},[1047,1486,1470],{"class":1251},[1047,1488,1473],{"class":1265},[1047,1490,1287],{"class":1057},[1047,1492,1479],{"class":1265},[1047,1494,1482],{"class":1265},[1075,1496,1498],{"id":1497},"setting-up-the-app","Setting up the app",[947,1500,1501,1502,1505],{},"Nuxt UI requires wrapping your app with ",[1044,1503,1504],{},"UApp"," for modals, toasts, and overlays to work properly:",[1238,1507,1508],{},[1037,1509,1514],{"className":1510,"code":1511,"filename":1512,"highlights":1513,"language":34,"meta":1042,"style":1042},"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",[1067,1319],[1044,1515,1516,1527,1538,1562,1573,1582,1592],{"__ignoreMap":1042},[1047,1517,1518,1521,1524],{"class":1049,"line":1050},[1047,1519,1520],{"class":1265},"\u003C",[1047,1522,1523],{"class":1271},"template",[1047,1525,1526],{"class":1265},">\n",[1047,1528,1531,1534,1536],{"class":1529,"line":1067},[1049,1530],"highlight",[1047,1532,1533],{"class":1265},"  \u003C",[1047,1535,1504],{"class":1271},[1047,1537,1526],{"class":1265},[1047,1539,1540,1543,1546,1550,1553,1555,1558,1560],{"class":1049,"line":1281},[1047,1541,1542],{"class":1265},"    \u003C",[1047,1544,1545],{"class":1271},"UDashboardGroup",[1047,1547,1549],{"class":1548},"spNyl"," unit",[1047,1551,1552],{"class":1265},"=",[1047,1554,1479],{"class":1265},[1047,1556,1557],{"class":1057},"rem",[1047,1559,1479],{"class":1265},[1047,1561,1526],{"class":1265},[1047,1563,1564,1567,1570],{"class":1049,"line":1296},[1047,1565,1566],{"class":1265},"      \u003C",[1047,1568,1569],{"class":1271},"NuxtPage",[1047,1571,1572],{"class":1265}," />\n",[1047,1574,1575,1578,1580],{"class":1049,"line":1308},[1047,1576,1577],{"class":1265},"    \u003C/",[1047,1579,1545],{"class":1271},[1047,1581,1526],{"class":1265},[1047,1583,1585,1588,1590],{"class":1584,"line":1319},[1049,1530],[1047,1586,1587],{"class":1265},"  \u003C/",[1047,1589,1504],{"class":1271},[1047,1591,1526],{"class":1265},[1047,1593,1594,1597,1599],{"class":1049,"line":1327},[1047,1595,1596],{"class":1265},"\u003C/",[1047,1598,1523],{"class":1271},[1047,1600,1526],{"class":1265},[947,1602,1603,1604,1607],{},"Create a ",[1044,1605,1606],{},".env"," file with your AI Gateway API key:",[1238,1609,1610],{},[1037,1611,1613],{"className":1039,"code":1612,"filename":1606,"language":1041,"meta":1042,"style":1042},"AI_GATEWAY_API_KEY=your-api-key-here\n",[1044,1614,1615],{"__ignoreMap":1042},[1047,1616,1617,1620,1622],{"class":1049,"line":1050},[1047,1618,1619],{"class":1261},"AI_GATEWAY_API_KEY",[1047,1621,1552],{"class":1265},[1047,1623,1624],{"class":1057},"your-api-key-here\n",[1626,1627,1628],"note",{},[947,1629,1630,1631,1634],{},"With ",[1022,1632,1027],{"href":1024,"rel":1633},[1026],", 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.",[1075,1636,1638],{"id":1637},"setting-up-the-database","Setting up the database",[947,1640,1641,1646,1647,1652],{},[1022,1642,1645],{"href":1643,"rel":1644},"https://hub.nuxt.com",[1026],"NuxtHub"," provides a zero-config database powered by ",[1022,1648,1651],{"href":1649,"rel":1650},"https://orm.drizzle.team",[1026],"Drizzle ORM",". Here is the schema for the chat application:",[1238,1654,1655],{},[1656,1657,1658],"code-collapse",{},[1037,1659,1662],{"className":1242,"code":1660,"filename":1661,"language":1244,"meta":1042,"style":1042},"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",[1044,1663,1664,1704,1724,1728,1755,1800,1813,1870,1876,1880,1915,1927,1934,1938,1964,2009,2075,2144,2183,2233,2246,2276,2282,2287,2319,2335,2353,2369,2377],{"__ignoreMap":1042},[1047,1665,1666,1669,1672,1675,1678,1681,1683,1686,1688,1691,1694,1697,1699,1702],{"class":1049,"line":1050},[1047,1667,1668],{"class":1251},"import",[1047,1670,1671],{"class":1265}," {",[1047,1673,1674],{"class":1261}," sqliteTable",[1047,1676,1677],{"class":1265},",",[1047,1679,1680],{"class":1261}," text",[1047,1682,1677],{"class":1265},[1047,1684,1685],{"class":1261}," integer",[1047,1687,1677],{"class":1265},[1047,1689,1690],{"class":1261}," index",[1047,1692,1693],{"class":1265}," }",[1047,1695,1696],{"class":1251}," from",[1047,1698,1352],{"class":1265},[1047,1700,1701],{"class":1057},"drizzle-orm/sqlite-core",[1047,1703,1316],{"class":1265},[1047,1705,1706,1708,1710,1713,1715,1717,1719,1722],{"class":1049,"line":1067},[1047,1707,1668],{"class":1251},[1047,1709,1671],{"class":1265},[1047,1711,1712],{"class":1261}," relations",[1047,1714,1693],{"class":1265},[1047,1716,1696],{"class":1251},[1047,1718,1352],{"class":1265},[1047,1720,1721],{"class":1057},"drizzle-orm",[1047,1723,1316],{"class":1265},[1047,1725,1726],{"class":1049,"line":1281},[1047,1727,1330],{"emptyLinePlaceholder":21},[1047,1729,1730,1732,1735,1738,1740,1742,1744,1746,1749,1751,1753],{"class":1049,"line":1296},[1047,1731,1252],{"class":1251},[1047,1733,1734],{"class":1548}," const",[1047,1736,1737],{"class":1261}," chats ",[1047,1739,1552],{"class":1265},[1047,1741,1674],{"class":1070},[1047,1743,1262],{"class":1261},[1047,1745,1290],{"class":1265},[1047,1747,1748],{"class":1057},"chats",[1047,1750,1290],{"class":1265},[1047,1752,1677],{"class":1265},[1047,1754,1341],{"class":1265},[1047,1756,1757,1760,1762,1764,1767,1770,1773,1775,1777,1780,1782,1784,1787,1790,1792,1795,1798],{"class":1049,"line":1308},[1047,1758,1759],{"class":1271},"  id",[1047,1761,1275],{"class":1265},[1047,1763,1680],{"class":1070},[1047,1765,1766],{"class":1261},"()",[1047,1768,1769],{"class":1265},".",[1047,1771,1772],{"class":1070},"primaryKey",[1047,1774,1766],{"class":1261},[1047,1776,1769],{"class":1265},[1047,1778,1779],{"class":1070},"$defaultFn",[1047,1781,1262],{"class":1261},[1047,1783,1766],{"class":1265},[1047,1785,1786],{"class":1548}," =>",[1047,1788,1789],{"class":1261}," crypto",[1047,1791,1769],{"class":1265},[1047,1793,1794],{"class":1070},"randomUUID",[1047,1796,1797],{"class":1261},"())",[1047,1799,1293],{"class":1265},[1047,1801,1802,1805,1807,1809,1811],{"class":1049,"line":1319},[1047,1803,1804],{"class":1271},"  title",[1047,1806,1275],{"class":1265},[1047,1808,1680],{"class":1070},[1047,1810,1766],{"class":1261},[1047,1812,1293],{"class":1265},[1047,1814,1815,1818,1820,1822,1824,1827,1830,1832,1834,1837,1839,1841,1844,1846,1849,1851,1853,1855,1857,1859,1861,1864,1867],{"class":1049,"line":1327},[1047,1816,1817],{"class":1271},"  createdAt",[1047,1819,1275],{"class":1265},[1047,1821,1685],{"class":1070},[1047,1823,1262],{"class":1261},[1047,1825,1826],{"class":1265},"{",[1047,1828,1829],{"class":1271}," mode",[1047,1831,1275],{"class":1265},[1047,1833,1352],{"class":1265},[1047,1835,1836],{"class":1057},"timestamp",[1047,1838,1290],{"class":1265},[1047,1840,1693],{"class":1265},[1047,1842,1843],{"class":1261},")",[1047,1845,1769],{"class":1265},[1047,1847,1848],{"class":1070},"notNull",[1047,1850,1766],{"class":1261},[1047,1852,1769],{"class":1265},[1047,1854,1779],{"class":1070},[1047,1856,1262],{"class":1261},[1047,1858,1766],{"class":1265},[1047,1860,1786],{"class":1548},[1047,1862,1863],{"class":1265}," new",[1047,1865,1866],{"class":1070}," Date",[1047,1868,1869],{"class":1261},"())\n",[1047,1871,1872,1874],{"class":1049,"line":1333},[1047,1873,1449],{"class":1265},[1047,1875,1452],{"class":1261},[1047,1877,1878],{"class":1049,"line":1344},[1047,1879,1330],{"emptyLinePlaceholder":21},[1047,1881,1882,1884,1886,1889,1891,1893,1896,1898,1901,1905,1908,1910,1913],{"class":1049,"line":1360},[1047,1883,1252],{"class":1251},[1047,1885,1734],{"class":1548},[1047,1887,1888],{"class":1261}," chatsRelations ",[1047,1890,1552],{"class":1265},[1047,1892,1712],{"class":1070},[1047,1894,1895],{"class":1261},"(chats",[1047,1897,1677],{"class":1265},[1047,1899,1900],{"class":1265}," ({",[1047,1902,1904],{"class":1903},"sHdIc"," many",[1047,1906,1907],{"class":1265}," })",[1047,1909,1786],{"class":1548},[1047,1911,1912],{"class":1261}," (",[1047,1914,1266],{"class":1265},[1047,1916,1917,1920,1922,1924],{"class":1049,"line":1366},[1047,1918,1919],{"class":1271},"  messages",[1047,1921,1275],{"class":1265},[1047,1923,1904],{"class":1070},[1047,1925,1926],{"class":1261},"(messages)\n",[1047,1928,1929,1931],{"class":1049,"line":1371},[1047,1930,1449],{"class":1265},[1047,1932,1933],{"class":1261},"))\n",[1047,1935,1936],{"class":1049,"line":1394},[1047,1937,1330],{"emptyLinePlaceholder":21},[1047,1939,1940,1942,1944,1947,1949,1951,1953,1955,1958,1960,1962],{"class":1049,"line":1399},[1047,1941,1252],{"class":1251},[1047,1943,1734],{"class":1548},[1047,1945,1946],{"class":1261}," messages ",[1047,1948,1552],{"class":1265},[1047,1950,1674],{"class":1070},[1047,1952,1262],{"class":1261},[1047,1954,1290],{"class":1265},[1047,1956,1957],{"class":1057},"messages",[1047,1959,1290],{"class":1265},[1047,1961,1677],{"class":1265},[1047,1963,1341],{"class":1265},[1047,1965,1966,1968,1970,1972,1974,1976,1979,1981,1983,1985,1987,1989,1991,1993,1995,1997,1999,2001,2003,2005,2007],{"class":1049,"line":1409},[1047,1967,1759],{"class":1271},[1047,1969,1275],{"class":1265},[1047,1971,1680],{"class":1070},[1047,1973,1262],{"class":1261},[1047,1975,1290],{"class":1265},[1047,1977,1978],{"class":1057},"id",[1047,1980,1290],{"class":1265},[1047,1982,1843],{"class":1261},[1047,1984,1769],{"class":1265},[1047,1986,1772],{"class":1070},[1047,1988,1766],{"class":1261},[1047,1990,1769],{"class":1265},[1047,1992,1779],{"class":1070},[1047,1994,1262],{"class":1261},[1047,1996,1766],{"class":1265},[1047,1998,1786],{"class":1548},[1047,2000,1789],{"class":1261},[1047,2002,1769],{"class":1265},[1047,2004,1794],{"class":1070},[1047,2006,1797],{"class":1261},[1047,2008,1293],{"class":1265},[1047,2010,2011,2014,2016,2018,2020,2022,2025,2027,2029,2031,2033,2035,2037,2040,2042,2044,2046,2049,2051,2053,2055,2057,2060,2062,2064,2067,2069,2071,2073],{"class":1049,"line":1419},[1047,2012,2013],{"class":1271},"  chatId",[1047,2015,1275],{"class":1265},[1047,2017,1680],{"class":1070},[1047,2019,1262],{"class":1261},[1047,2021,1290],{"class":1265},[1047,2023,2024],{"class":1057},"chat_id",[1047,2026,1290],{"class":1265},[1047,2028,1843],{"class":1261},[1047,2030,1769],{"class":1265},[1047,2032,1848],{"class":1070},[1047,2034,1766],{"class":1261},[1047,2036,1769],{"class":1265},[1047,2038,2039],{"class":1070},"references",[1047,2041,1262],{"class":1261},[1047,2043,1766],{"class":1265},[1047,2045,1786],{"class":1548},[1047,2047,2048],{"class":1261}," chats",[1047,2050,1769],{"class":1265},[1047,2052,1978],{"class":1261},[1047,2054,1677],{"class":1265},[1047,2056,1671],{"class":1265},[1047,2058,2059],{"class":1271}," onDelete",[1047,2061,1275],{"class":1265},[1047,2063,1352],{"class":1265},[1047,2065,2066],{"class":1057},"cascade",[1047,2068,1290],{"class":1265},[1047,2070,1693],{"class":1265},[1047,2072,1843],{"class":1261},[1047,2074,1293],{"class":1265},[1047,2076,2077,2080,2082,2084,2086,2088,2091,2093,2095,2097,2100,2102,2104,2106,2109,2111,2113,2115,2118,2120,2122,2124,2127,2129,2132,2134,2136,2138,2140,2142],{"class":1049,"line":1435},[1047,2078,2079],{"class":1271},"  role",[1047,2081,1275],{"class":1265},[1047,2083,1680],{"class":1070},[1047,2085,1262],{"class":1261},[1047,2087,1290],{"class":1265},[1047,2089,2090],{"class":1057},"role",[1047,2092,1290],{"class":1265},[1047,2094,1677],{"class":1265},[1047,2096,1671],{"class":1265},[1047,2098,2099],{"class":1271}," enum",[1047,2101,1275],{"class":1265},[1047,2103,1379],{"class":1261},[1047,2105,1290],{"class":1265},[1047,2107,2108],{"class":1057},"user",[1047,2110,1290],{"class":1265},[1047,2112,1677],{"class":1265},[1047,2114,1352],{"class":1265},[1047,2116,2117],{"class":1057},"assistant",[1047,2119,1290],{"class":1265},[1047,2121,1677],{"class":1265},[1047,2123,1352],{"class":1265},[1047,2125,2126],{"class":1057},"system",[1047,2128,1290],{"class":1265},[1047,2130,2131],{"class":1261},"] ",[1047,2133,1449],{"class":1265},[1047,2135,1843],{"class":1261},[1047,2137,1769],{"class":1265},[1047,2139,1848],{"class":1070},[1047,2141,1766],{"class":1261},[1047,2143,1293],{"class":1265},[1047,2145,2146,2149,2151,2153,2155,2157,2160,2162,2164,2166,2168,2170,2172,2175,2177,2179,2181],{"class":1049,"line":1441},[1047,2147,2148],{"class":1271},"  parts",[1047,2150,1275],{"class":1265},[1047,2152,1680],{"class":1070},[1047,2154,1262],{"class":1261},[1047,2156,1290],{"class":1265},[1047,2158,2159],{"class":1057},"parts",[1047,2161,1290],{"class":1265},[1047,2163,1677],{"class":1265},[1047,2165,1671],{"class":1265},[1047,2167,1829],{"class":1271},[1047,2169,1275],{"class":1265},[1047,2171,1352],{"class":1265},[1047,2173,2174],{"class":1057},"json",[1047,2176,1290],{"class":1265},[1047,2178,1693],{"class":1265},[1047,2180,1843],{"class":1261},[1047,2182,1293],{"class":1265},[1047,2184,2185,2187,2189,2191,2193,2195,2197,2199,2201,2203,2205,2207,2209,2211,2213,2215,2217,2219,2221,2223,2225,2227,2229,2231],{"class":1049,"line":1446},[1047,2186,1817],{"class":1271},[1047,2188,1275],{"class":1265},[1047,2190,1685],{"class":1070},[1047,2192,1262],{"class":1261},[1047,2194,1826],{"class":1265},[1047,2196,1829],{"class":1271},[1047,2198,1275],{"class":1265},[1047,2200,1352],{"class":1265},[1047,2202,1836],{"class":1057},[1047,2204,1290],{"class":1265},[1047,2206,1693],{"class":1265},[1047,2208,1843],{"class":1261},[1047,2210,1769],{"class":1265},[1047,2212,1848],{"class":1070},[1047,2214,1766],{"class":1261},[1047,2216,1769],{"class":1265},[1047,2218,1779],{"class":1070},[1047,2220,1262],{"class":1261},[1047,2222,1766],{"class":1265},[1047,2224,1786],{"class":1548},[1047,2226,1863],{"class":1265},[1047,2228,1866],{"class":1070},[1047,2230,1797],{"class":1261},[1047,2232,1293],{"class":1265},[1047,2234,2236,2239,2242,2244],{"class":1049,"line":2235},20,[1047,2237,2238],{"class":1265},"},",[1047,2240,2241],{"class":1903}," table",[1047,2243,1786],{"class":1548},[1047,2245,1278],{"class":1261},[1047,2247,2249,2252,2254,2256,2259,2261,2263,2265,2268,2271,2273],{"class":1049,"line":2248},21,[1047,2250,2251],{"class":1070},"  index",[1047,2253,1262],{"class":1261},[1047,2255,1290],{"class":1265},[1047,2257,2258],{"class":1057},"messages_chat_id_idx",[1047,2260,1290],{"class":1265},[1047,2262,1843],{"class":1261},[1047,2264,1769],{"class":1265},[1047,2266,2267],{"class":1070},"on",[1047,2269,2270],{"class":1261},"(table",[1047,2272,1769],{"class":1265},[1047,2274,2275],{"class":1261},"chatId)\n",[1047,2277,2279],{"class":1049,"line":2278},22,[1047,2280,2281],{"class":1261},"])\n",[1047,2283,2285],{"class":1049,"line":2284},23,[1047,2286,1330],{"emptyLinePlaceholder":21},[1047,2288,2290,2292,2294,2297,2299,2301,2304,2306,2308,2311,2313,2315,2317],{"class":1049,"line":2289},24,[1047,2291,1252],{"class":1251},[1047,2293,1734],{"class":1548},[1047,2295,2296],{"class":1261}," messagesRelations ",[1047,2298,1552],{"class":1265},[1047,2300,1712],{"class":1070},[1047,2302,2303],{"class":1261},"(messages",[1047,2305,1677],{"class":1265},[1047,2307,1900],{"class":1265},[1047,2309,2310],{"class":1903}," one",[1047,2312,1907],{"class":1265},[1047,2314,1786],{"class":1548},[1047,2316,1912],{"class":1261},[1047,2318,1266],{"class":1265},[1047,2320,2322,2325,2327,2329,2331,2333],{"class":1049,"line":2321},25,[1047,2323,2324],{"class":1271},"  chat",[1047,2326,1275],{"class":1265},[1047,2328,2310],{"class":1070},[1047,2330,1895],{"class":1261},[1047,2332,1677],{"class":1265},[1047,2334,1341],{"class":1265},[1047,2336,2338,2341,2343,2346,2348,2351],{"class":1049,"line":2337},26,[1047,2339,2340],{"class":1271},"    fields",[1047,2342,1275],{"class":1265},[1047,2344,2345],{"class":1261}," [messages",[1047,2347,1769],{"class":1265},[1047,2349,2350],{"class":1261},"chatId]",[1047,2352,1293],{"class":1265},[1047,2354,2356,2359,2361,2364,2366],{"class":1049,"line":2355},27,[1047,2357,2358],{"class":1271},"    references",[1047,2360,1275],{"class":1265},[1047,2362,2363],{"class":1261}," [chats",[1047,2365,1769],{"class":1265},[1047,2367,2368],{"class":1261},"id]\n",[1047,2370,2372,2375],{"class":1049,"line":2371},28,[1047,2373,2374],{"class":1265},"  }",[1047,2376,1452],{"class":1261},[1047,2378,2380,2382],{"class":1049,"line":2379},29,[1047,2381,1449],{"class":1265},[1047,2383,1933],{"class":1261},[947,2385,2386],{},"Generate the database migrations from your schema:",[1037,2388,2390],{"className":1039,"code":2389,"language":1041,"meta":1042,"style":1042},"npx nuxt db generate\n",[1044,2391,2392],{"__ignoreMap":1042},[1047,2393,2394,2396,2399,2402],{"class":1049,"line":1050},[1047,2395,1054],{"class":1053},[1047,2397,2398],{"class":1057}," nuxt",[1047,2400,2401],{"class":1057}," db",[1047,2403,2404],{"class":1057}," generate\n",[2406,2407,2408],"tip",{},[947,2409,2410,2411,2414],{},"Migrations are automatically applied when you start the development server with ",[1044,2412,2413],{},"npx nuxt dev",". NuxtHub uses SQLite locally, so no external database is required during development.",[951,2416,2418],{"id":2417},"building-the-backend","Building the backend",[947,2420,2421,2422,1769],{},"This section covers integrating AI on the server. The following API endpoints handle chat creation, AI streaming, and data persistence using ",[1022,2423,2426],{"href":2424,"rel":2425},"https://nitro.build",[1026],"Nitro",[1075,2428,2430],{"id":2429},"creating-a-chat","Creating a chat",[947,2432,2433,2434,2441],{},"First, create the endpoint that initializes a new chat and saves the first message to the database. This uses the ",[1022,2435,2438],{"href":2436,"rel":2437},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/ui-message",[1026],[1044,2439,2440],{},"UIMessage"," type from the AI SDK:",[1238,2443,2444],{},[1037,2445,2448],{"className":1242,"code":2446,"filename":2447,"language":1244,"meta":1042,"style":1042},"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",[1044,2449,2450,2474,2497,2521,2541,2545,2569,2606,2630,2643,2647,2652,2703,2707,2712,2741,2757,2772,2786,2792,2796,2804],{"__ignoreMap":1042},[1047,2451,2452,2454,2456,2459,2461,2464,2466,2468,2470,2472],{"class":1049,"line":1050},[1047,2453,1668],{"class":1251},[1047,2455,1671],{"class":1265},[1047,2457,2458],{"class":1261}," defineEventHandler",[1047,2460,1677],{"class":1265},[1047,2462,2463],{"class":1261}," readValidatedBody",[1047,2465,1693],{"class":1265},[1047,2467,1696],{"class":1251},[1047,2469,1352],{"class":1265},[1047,2471,1075],{"class":1057},[1047,2473,1316],{"class":1265},[1047,2475,2476,2478,2481,2483,2486,2488,2490,2492,2495],{"class":1049,"line":1067},[1047,2477,1668],{"class":1251},[1047,2479,2480],{"class":1251}," type",[1047,2482,1671],{"class":1265},[1047,2484,2485],{"class":1261}," UIMessage",[1047,2487,1693],{"class":1265},[1047,2489,1696],{"class":1251},[1047,2491,1352],{"class":1265},[1047,2493,2494],{"class":1057},"ai",[1047,2496,1316],{"class":1265},[1047,2498,2499,2501,2503,2505,2507,2510,2512,2514,2516,2519],{"class":1049,"line":1281},[1047,2500,1668],{"class":1251},[1047,2502,1671],{"class":1265},[1047,2504,2401],{"class":1261},[1047,2506,1677],{"class":1265},[1047,2508,2509],{"class":1261}," schema",[1047,2511,1693],{"class":1265},[1047,2513,1696],{"class":1251},[1047,2515,1352],{"class":1265},[1047,2517,2518],{"class":1057},"hub:db",[1047,2520,1316],{"class":1265},[1047,2522,2523,2525,2527,2530,2532,2534,2536,2539],{"class":1049,"line":1296},[1047,2524,1668],{"class":1251},[1047,2526,1671],{"class":1265},[1047,2528,2529],{"class":1261}," z",[1047,2531,1693],{"class":1265},[1047,2533,1696],{"class":1251},[1047,2535,1352],{"class":1265},[1047,2537,2538],{"class":1057},"zod",[1047,2540,1316],{"class":1265},[1047,2542,2543],{"class":1049,"line":1308},[1047,2544,1330],{"emptyLinePlaceholder":21},[1047,2546,2547,2549,2551,2553,2555,2558,2560,2563,2565,2567],{"class":1049,"line":1319},[1047,2548,1252],{"class":1251},[1047,2550,1255],{"class":1251},[1047,2552,2458],{"class":1070},[1047,2554,1262],{"class":1261},[1047,2556,2557],{"class":1548},"async",[1047,2559,1912],{"class":1265},[1047,2561,2562],{"class":1903},"event",[1047,2564,1843],{"class":1265},[1047,2566,1786],{"class":1548},[1047,2568,1341],{"class":1265},[1047,2570,2571,2574,2576,2579,2581,2584,2587,2589,2591,2593,2595,2597,2599,2602,2604],{"class":1049,"line":1327},[1047,2572,2573],{"class":1548},"  const",[1047,2575,1671],{"class":1265},[1047,2577,2578],{"class":1261}," message",[1047,2580,1693],{"class":1265},[1047,2582,2583],{"class":1265}," =",[1047,2585,2586],{"class":1251}," await",[1047,2588,2463],{"class":1070},[1047,2590,1262],{"class":1271},[1047,2592,2562],{"class":1261},[1047,2594,1677],{"class":1265},[1047,2596,2529],{"class":1261},[1047,2598,1769],{"class":1265},[1047,2600,2601],{"class":1070},"object",[1047,2603,1262],{"class":1271},[1047,2605,1266],{"class":1265},[1047,2607,2608,2611,2613,2615,2617,2620,2622,2624,2627],{"class":1049,"line":1333},[1047,2609,2610],{"class":1271},"    message",[1047,2612,1275],{"class":1265},[1047,2614,2529],{"class":1261},[1047,2616,1769],{"class":1265},[1047,2618,2619],{"class":1070},"custom",[1047,2621,1520],{"class":1265},[1047,2623,2440],{"class":1053},[1047,2625,2626],{"class":1265},">",[1047,2628,2629],{"class":1271},"()\n",[1047,2631,2632,2634,2636,2638,2641],{"class":1049,"line":1344},[1047,2633,2374],{"class":1265},[1047,2635,1843],{"class":1271},[1047,2637,1769],{"class":1265},[1047,2639,2640],{"class":1261},"parse",[1047,2642,1452],{"class":1271},[1047,2644,2645],{"class":1049,"line":1360},[1047,2646,1330],{"emptyLinePlaceholder":21},[1047,2648,2649],{"class":1049,"line":1366},[1047,2650,2651],{"class":1431},"  // Create a new chat\n",[1047,2653,2654,2656,2658,2660,2662,2664,2666,2668,2670,2673,2675,2678,2680,2682,2684,2686,2689,2691,2694,2696,2698,2701],{"class":1049,"line":1371},[1047,2655,2573],{"class":1548},[1047,2657,1379],{"class":1265},[1047,2659,262],{"class":1261},[1047,2661,1389],{"class":1265},[1047,2663,2583],{"class":1265},[1047,2665,2586],{"class":1251},[1047,2667,2401],{"class":1261},[1047,2669,1769],{"class":1265},[1047,2671,2672],{"class":1070},"insert",[1047,2674,1262],{"class":1271},[1047,2676,2677],{"class":1261},"schema",[1047,2679,1769],{"class":1265},[1047,2681,1748],{"class":1261},[1047,2683,1843],{"class":1271},[1047,2685,1769],{"class":1265},[1047,2687,2688],{"class":1070},"values",[1047,2690,1262],{"class":1271},[1047,2692,2693],{"class":1265},"{}",[1047,2695,1843],{"class":1271},[1047,2697,1769],{"class":1265},[1047,2699,2700],{"class":1070},"returning",[1047,2702,2629],{"class":1271},[1047,2704,2705],{"class":1049,"line":1394},[1047,2706,1330],{"emptyLinePlaceholder":21},[1047,2708,2709],{"class":1049,"line":1399},[1047,2710,2711],{"class":1431},"  // Save the first user message\n",[1047,2713,2714,2717,2719,2721,2723,2725,2727,2729,2731,2733,2735,2737,2739],{"class":1049,"line":1409},[1047,2715,2716],{"class":1251},"  await",[1047,2718,2401],{"class":1261},[1047,2720,1769],{"class":1265},[1047,2722,2672],{"class":1070},[1047,2724,1262],{"class":1271},[1047,2726,2677],{"class":1261},[1047,2728,1769],{"class":1265},[1047,2730,1957],{"class":1261},[1047,2732,1843],{"class":1271},[1047,2734,1769],{"class":1265},[1047,2736,2688],{"class":1070},[1047,2738,1262],{"class":1271},[1047,2740,1266],{"class":1265},[1047,2742,2743,2746,2748,2751,2753,2755],{"class":1049,"line":1419},[1047,2744,2745],{"class":1271},"    chatId",[1047,2747,1275],{"class":1265},[1047,2749,2750],{"class":1261}," chat",[1047,2752,1769],{"class":1265},[1047,2754,1978],{"class":1261},[1047,2756,1293],{"class":1265},[1047,2758,2759,2762,2764,2766,2768,2770],{"class":1049,"line":1435},[1047,2760,2761],{"class":1271},"    role",[1047,2763,1275],{"class":1265},[1047,2765,1352],{"class":1265},[1047,2767,2108],{"class":1057},[1047,2769,1290],{"class":1265},[1047,2771,1293],{"class":1265},[1047,2773,2774,2777,2779,2781,2783],{"class":1049,"line":1441},[1047,2775,2776],{"class":1271},"    parts",[1047,2778,1275],{"class":1265},[1047,2780,2578],{"class":1261},[1047,2782,1769],{"class":1265},[1047,2784,2785],{"class":1261},"parts\n",[1047,2787,2788,2790],{"class":1049,"line":1446},[1047,2789,2374],{"class":1265},[1047,2791,1452],{"class":1271},[1047,2793,2794],{"class":1049,"line":2235},[1047,2795,1330],{"emptyLinePlaceholder":21},[1047,2797,2798,2801],{"class":1049,"line":2248},[1047,2799,2800],{"class":1251},"  return",[1047,2802,2803],{"class":1261}," chat\n",[1047,2805,2806,2808],{"class":1049,"line":2278},[1047,2807,1449],{"class":1265},[1047,2809,1452],{"class":1261},[1075,2811,2813],{"id":2812},"streaming-ai-responses","Streaming AI responses",[947,2815,2816,2817,2824,2825,2832,2833,2840],{},"Next, create the endpoint that handles the AI conversation. This endpoint uses ",[1022,2818,2821],{"href":2819,"rel":2820},"https://ai-sdk.dev/docs/reference/ai-sdk-core/stream-text",[1026],[1044,2822,2823],{},"streamText",", ",[1022,2826,2829],{"href":2827,"rel":2828},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/create-ui-message-stream",[1026],[1044,2830,2831],{},"createUIMessageStream",", and ",[1022,2834,2837],{"href":2835,"rel":2836},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/create-ui-message-stream-response",[1026],[1044,2838,2839],{},"createUIMessageStreamResponse"," from the AI SDK:",[1238,2842,2843],{},[1656,2844,2845],{},[1037,2846,2849],{"className":1242,"code":2847,"filename":2848,"language":1244,"meta":1042,"style":1042},"import { createError, defineEventHandler, getValidatedRouterParams, readValidatedBody } from 'h3'\nimport { eq } from 'drizzle-orm'\nimport { db, schema } from 'hub:db'\nimport { z } from 'zod'\nimport {\n  convertToModelMessages,\n  createUIMessageStream,\n  createUIMessageStreamResponse,\n  generateText,\n  streamText\n} from 'ai'\nimport type { UIMessage } from 'ai'\n\nexport default defineEventHandler(async (event) => {\n  const { id } = await getValidatedRouterParams(event, z.object({\n    id: z.string()\n  }).parse)\n\n  const { model, messages } = await readValidatedBody(event, z.object({\n    model: z.string().default('openai/gpt-4o-mini'),\n    messages: z.array(z.custom\u003CUIMessage>())\n  }).parse)\n\n  // Fetch the chat from the database\n  const chat = await db.query.chats.findFirst({\n    where: (chat, { eq }) => eq(chat.id, id as string)\n  })\n\n  if (!chat) {\n    throw createError({ statusCode: 404, statusMessage: 'Chat not found' })\n  }\n\n  // Generate a title for the chat if it doesn't have one\n  if (!chat.title) {\n    const { text: title } = await generateText({\n      model: 'openai/gpt-4o-mini',\n      system: `Generate a short title (max 30 characters) based on the user's message. No quotes or punctuation.`,\n      prompt: JSON.stringify(messages[0])\n    })\n\n    await db.update(schema.chats).set({ title }).where(eq(schema.chats.id, id))\n  }\n\n  // Save the user message if it's a follow-up\n  const lastMessage = messages[messages.length - 1]\n  if (lastMessage?.role === 'user' && messages.length > 1) {\n    await db.insert(schema.messages).values({\n      chatId: id,\n      role: 'user',\n      parts: lastMessage.parts\n    })\n  }\n\n  // Create the streaming response\n  const stream = createUIMessageStream({\n    execute: async ({ writer }) => {\n      const result = streamText({\n        model,\n        system: `You are a helpful AI assistant. Be concise and friendly.`,\n        messages: await convertToModelMessages(messages)\n      })\n\n      // Notify the client that a title was generated\n      if (!chat.title) {\n        writer.write({\n          type: 'data-chat-title',\n          data: { message: 'Title generated' },\n          transient: true\n        })\n      }\n\n      writer.merge(result.toUIMessageStream())\n    },\n    onFinish: async ({ messages }) => {\n      // Save the assistant's response to the database\n      await db.insert(schema.messages).values(messages.map(message => ({\n        chatId: chat.id,\n        role: message.role as 'user' | 'assistant',\n        parts: message.parts\n      })))\n    }\n  })\n\n  return createUIMessageStreamResponse({ stream })\n})\n","server/api/chats/[id].post.ts",[1044,2850,2851,2883,2902,2924,2942,2948,2955,2962,2969,2976,2981,2993,3013,3017,3039,3072,3088,3100,3104,3142,3175,3206,3218,3222,3227,3257,3300,3306,3310,3327,3366,3372,3377,3383,3403,3431,3447,3466,3494,3502,3507,3573,3578,3583,3589,3619,3661,3690,3702,3718,3732,3739,3744,3749,3755,3772,3794,3812,3820,3837,3856,3864,3869,3875,3895,3910,3927,3951,3962,3970,3976,3981,4004,4010,4030,4036,4082,4098,4131,4145,4153,4158,4165,4170,4188],{"__ignoreMap":1042},[1047,2852,2853,2855,2857,2860,2862,2864,2866,2869,2871,2873,2875,2877,2879,2881],{"class":1049,"line":1050},[1047,2854,1668],{"class":1251},[1047,2856,1671],{"class":1265},[1047,2858,2859],{"class":1261}," createError",[1047,2861,1677],{"class":1265},[1047,2863,2458],{"class":1261},[1047,2865,1677],{"class":1265},[1047,2867,2868],{"class":1261}," getValidatedRouterParams",[1047,2870,1677],{"class":1265},[1047,2872,2463],{"class":1261},[1047,2874,1693],{"class":1265},[1047,2876,1696],{"class":1251},[1047,2878,1352],{"class":1265},[1047,2880,1075],{"class":1057},[1047,2882,1316],{"class":1265},[1047,2884,2885,2887,2889,2892,2894,2896,2898,2900],{"class":1049,"line":1067},[1047,2886,1668],{"class":1251},[1047,2888,1671],{"class":1265},[1047,2890,2891],{"class":1261}," eq",[1047,2893,1693],{"class":1265},[1047,2895,1696],{"class":1251},[1047,2897,1352],{"class":1265},[1047,2899,1721],{"class":1057},[1047,2901,1316],{"class":1265},[1047,2903,2904,2906,2908,2910,2912,2914,2916,2918,2920,2922],{"class":1049,"line":1281},[1047,2905,1668],{"class":1251},[1047,2907,1671],{"class":1265},[1047,2909,2401],{"class":1261},[1047,2911,1677],{"class":1265},[1047,2913,2509],{"class":1261},[1047,2915,1693],{"class":1265},[1047,2917,1696],{"class":1251},[1047,2919,1352],{"class":1265},[1047,2921,2518],{"class":1057},[1047,2923,1316],{"class":1265},[1047,2925,2926,2928,2930,2932,2934,2936,2938,2940],{"class":1049,"line":1296},[1047,2927,1668],{"class":1251},[1047,2929,1671],{"class":1265},[1047,2931,2529],{"class":1261},[1047,2933,1693],{"class":1265},[1047,2935,1696],{"class":1251},[1047,2937,1352],{"class":1265},[1047,2939,2538],{"class":1057},[1047,2941,1316],{"class":1265},[1047,2943,2944,2946],{"class":1049,"line":1308},[1047,2945,1668],{"class":1251},[1047,2947,1341],{"class":1265},[1047,2949,2950,2953],{"class":1049,"line":1319},[1047,2951,2952],{"class":1261},"  convertToModelMessages",[1047,2954,1293],{"class":1265},[1047,2956,2957,2960],{"class":1049,"line":1327},[1047,2958,2959],{"class":1261},"  createUIMessageStream",[1047,2961,1293],{"class":1265},[1047,2963,2964,2967],{"class":1049,"line":1333},[1047,2965,2966],{"class":1261},"  createUIMessageStreamResponse",[1047,2968,1293],{"class":1265},[1047,2970,2971,2974],{"class":1049,"line":1344},[1047,2972,2973],{"class":1261},"  generateText",[1047,2975,1293],{"class":1265},[1047,2977,2978],{"class":1049,"line":1360},[1047,2979,2980],{"class":1261},"  streamText\n",[1047,2982,2983,2985,2987,2989,2991],{"class":1049,"line":1366},[1047,2984,1449],{"class":1265},[1047,2986,1696],{"class":1251},[1047,2988,1352],{"class":1265},[1047,2990,2494],{"class":1057},[1047,2992,1316],{"class":1265},[1047,2994,2995,2997,2999,3001,3003,3005,3007,3009,3011],{"class":1049,"line":1371},[1047,2996,1668],{"class":1251},[1047,2998,2480],{"class":1251},[1047,3000,1671],{"class":1265},[1047,3002,2485],{"class":1261},[1047,3004,1693],{"class":1265},[1047,3006,1696],{"class":1251},[1047,3008,1352],{"class":1265},[1047,3010,2494],{"class":1057},[1047,3012,1316],{"class":1265},[1047,3014,3015],{"class":1049,"line":1394},[1047,3016,1330],{"emptyLinePlaceholder":21},[1047,3018,3019,3021,3023,3025,3027,3029,3031,3033,3035,3037],{"class":1049,"line":1399},[1047,3020,1252],{"class":1251},[1047,3022,1255],{"class":1251},[1047,3024,2458],{"class":1070},[1047,3026,1262],{"class":1261},[1047,3028,2557],{"class":1548},[1047,3030,1912],{"class":1265},[1047,3032,2562],{"class":1903},[1047,3034,1843],{"class":1265},[1047,3036,1786],{"class":1548},[1047,3038,1341],{"class":1265},[1047,3040,3041,3043,3045,3048,3050,3052,3054,3056,3058,3060,3062,3064,3066,3068,3070],{"class":1049,"line":1409},[1047,3042,2573],{"class":1548},[1047,3044,1671],{"class":1265},[1047,3046,3047],{"class":1261}," id",[1047,3049,1693],{"class":1265},[1047,3051,2583],{"class":1265},[1047,3053,2586],{"class":1251},[1047,3055,2868],{"class":1070},[1047,3057,1262],{"class":1271},[1047,3059,2562],{"class":1261},[1047,3061,1677],{"class":1265},[1047,3063,2529],{"class":1261},[1047,3065,1769],{"class":1265},[1047,3067,2601],{"class":1070},[1047,3069,1262],{"class":1271},[1047,3071,1266],{"class":1265},[1047,3073,3074,3077,3079,3081,3083,3086],{"class":1049,"line":1419},[1047,3075,3076],{"class":1271},"    id",[1047,3078,1275],{"class":1265},[1047,3080,2529],{"class":1261},[1047,3082,1769],{"class":1265},[1047,3084,3085],{"class":1070},"string",[1047,3087,2629],{"class":1271},[1047,3089,3090,3092,3094,3096,3098],{"class":1049,"line":1435},[1047,3091,2374],{"class":1265},[1047,3093,1843],{"class":1271},[1047,3095,1769],{"class":1265},[1047,3097,2640],{"class":1261},[1047,3099,1452],{"class":1271},[1047,3101,3102],{"class":1049,"line":1441},[1047,3103,1330],{"emptyLinePlaceholder":21},[1047,3105,3106,3108,3110,3113,3115,3118,3120,3122,3124,3126,3128,3130,3132,3134,3136,3138,3140],{"class":1049,"line":1446},[1047,3107,2573],{"class":1548},[1047,3109,1671],{"class":1265},[1047,3111,3112],{"class":1261}," model",[1047,3114,1677],{"class":1265},[1047,3116,3117],{"class":1261}," messages",[1047,3119,1693],{"class":1265},[1047,3121,2583],{"class":1265},[1047,3123,2586],{"class":1251},[1047,3125,2463],{"class":1070},[1047,3127,1262],{"class":1271},[1047,3129,2562],{"class":1261},[1047,3131,1677],{"class":1265},[1047,3133,2529],{"class":1261},[1047,3135,1769],{"class":1265},[1047,3137,2601],{"class":1070},[1047,3139,1262],{"class":1271},[1047,3141,1266],{"class":1265},[1047,3143,3144,3147,3149,3151,3153,3155,3157,3159,3162,3164,3166,3169,3171,3173],{"class":1049,"line":2235},[1047,3145,3146],{"class":1271},"    model",[1047,3148,1275],{"class":1265},[1047,3150,2529],{"class":1261},[1047,3152,1769],{"class":1265},[1047,3154,3085],{"class":1070},[1047,3156,1766],{"class":1271},[1047,3158,1769],{"class":1265},[1047,3160,3161],{"class":1070},"default",[1047,3163,1262],{"class":1271},[1047,3165,1290],{"class":1265},[1047,3167,3168],{"class":1057},"openai/gpt-4o-mini",[1047,3170,1290],{"class":1265},[1047,3172,1843],{"class":1271},[1047,3174,1293],{"class":1265},[1047,3176,3177,3180,3182,3184,3186,3189,3191,3194,3196,3198,3200,3202,3204],{"class":1049,"line":2248},[1047,3178,3179],{"class":1271},"    messages",[1047,3181,1275],{"class":1265},[1047,3183,2529],{"class":1261},[1047,3185,1769],{"class":1265},[1047,3187,3188],{"class":1070},"array",[1047,3190,1262],{"class":1271},[1047,3192,3193],{"class":1261},"z",[1047,3195,1769],{"class":1265},[1047,3197,2619],{"class":1070},[1047,3199,1520],{"class":1265},[1047,3201,2440],{"class":1053},[1047,3203,2626],{"class":1265},[1047,3205,1869],{"class":1271},[1047,3207,3208,3210,3212,3214,3216],{"class":1049,"line":2278},[1047,3209,2374],{"class":1265},[1047,3211,1843],{"class":1271},[1047,3213,1769],{"class":1265},[1047,3215,2640],{"class":1261},[1047,3217,1452],{"class":1271},[1047,3219,3220],{"class":1049,"line":2284},[1047,3221,1330],{"emptyLinePlaceholder":21},[1047,3223,3224],{"class":1049,"line":2289},[1047,3225,3226],{"class":1431},"  // Fetch the chat from the database\n",[1047,3228,3229,3231,3233,3235,3237,3239,3241,3244,3246,3248,3250,3253,3255],{"class":1049,"line":2321},[1047,3230,2573],{"class":1548},[1047,3232,2750],{"class":1261},[1047,3234,2583],{"class":1265},[1047,3236,2586],{"class":1251},[1047,3238,2401],{"class":1261},[1047,3240,1769],{"class":1265},[1047,3242,3243],{"class":1261},"query",[1047,3245,1769],{"class":1265},[1047,3247,1748],{"class":1261},[1047,3249,1769],{"class":1265},[1047,3251,3252],{"class":1070},"findFirst",[1047,3254,1262],{"class":1271},[1047,3256,1266],{"class":1265},[1047,3258,3259,3262,3264,3266,3268,3270,3272,3274,3276,3278,3280,3282,3284,3286,3288,3290,3292,3295,3298],{"class":1049,"line":2337},[1047,3260,3261],{"class":1070},"    where",[1047,3263,1275],{"class":1265},[1047,3265,1912],{"class":1265},[1047,3267,262],{"class":1903},[1047,3269,1677],{"class":1265},[1047,3271,1671],{"class":1265},[1047,3273,2891],{"class":1903},[1047,3275,1907],{"class":1265},[1047,3277,1786],{"class":1548},[1047,3279,2891],{"class":1070},[1047,3281,1262],{"class":1271},[1047,3283,262],{"class":1261},[1047,3285,1769],{"class":1265},[1047,3287,1978],{"class":1261},[1047,3289,1677],{"class":1265},[1047,3291,3047],{"class":1261},[1047,3293,3294],{"class":1251}," as",[1047,3296,3297],{"class":1053}," string",[1047,3299,1452],{"class":1271},[1047,3301,3302,3304],{"class":1049,"line":2355},[1047,3303,2374],{"class":1265},[1047,3305,1452],{"class":1271},[1047,3307,3308],{"class":1049,"line":2371},[1047,3309,1330],{"emptyLinePlaceholder":21},[1047,3311,3312,3315,3317,3320,3322,3325],{"class":1049,"line":2379},[1047,3313,3314],{"class":1251},"  if",[1047,3316,1912],{"class":1271},[1047,3318,3319],{"class":1265},"!",[1047,3321,262],{"class":1261},[1047,3323,3324],{"class":1271},") ",[1047,3326,1266],{"class":1265},[1047,3328,3330,3333,3335,3337,3339,3342,3344,3348,3350,3353,3355,3357,3360,3362,3364],{"class":1049,"line":3329},30,[1047,3331,3332],{"class":1251},"    throw",[1047,3334,2859],{"class":1070},[1047,3336,1262],{"class":1271},[1047,3338,1826],{"class":1265},[1047,3340,3341],{"class":1271}," statusCode",[1047,3343,1275],{"class":1265},[1047,3345,3347],{"class":3346},"sbssI"," 404",[1047,3349,1677],{"class":1265},[1047,3351,3352],{"class":1271}," statusMessage",[1047,3354,1275],{"class":1265},[1047,3356,1352],{"class":1265},[1047,3358,3359],{"class":1057},"Chat not found",[1047,3361,1290],{"class":1265},[1047,3363,1693],{"class":1265},[1047,3365,1452],{"class":1271},[1047,3367,3369],{"class":1049,"line":3368},31,[1047,3370,3371],{"class":1265},"  }\n",[1047,3373,3375],{"class":1049,"line":3374},32,[1047,3376,1330],{"emptyLinePlaceholder":21},[1047,3378,3380],{"class":1049,"line":3379},33,[1047,3381,3382],{"class":1431},"  // Generate a title for the chat if it doesn't have one\n",[1047,3384,3386,3388,3390,3392,3394,3396,3399,3401],{"class":1049,"line":3385},34,[1047,3387,3314],{"class":1251},[1047,3389,1912],{"class":1271},[1047,3391,3319],{"class":1265},[1047,3393,262],{"class":1261},[1047,3395,1769],{"class":1265},[1047,3397,3398],{"class":1261},"title",[1047,3400,3324],{"class":1271},[1047,3402,1266],{"class":1265},[1047,3404,3406,3409,3411,3413,3415,3418,3420,3422,3424,3427,3429],{"class":1049,"line":3405},35,[1047,3407,3408],{"class":1548},"    const",[1047,3410,1671],{"class":1265},[1047,3412,1680],{"class":1271},[1047,3414,1275],{"class":1265},[1047,3416,3417],{"class":1261}," title",[1047,3419,1693],{"class":1265},[1047,3421,2583],{"class":1265},[1047,3423,2586],{"class":1251},[1047,3425,3426],{"class":1070}," generateText",[1047,3428,1262],{"class":1271},[1047,3430,1266],{"class":1265},[1047,3432,3434,3437,3439,3441,3443,3445],{"class":1049,"line":3433},36,[1047,3435,3436],{"class":1271},"      model",[1047,3438,1275],{"class":1265},[1047,3440,1352],{"class":1265},[1047,3442,3168],{"class":1057},[1047,3444,1290],{"class":1265},[1047,3446,1293],{"class":1265},[1047,3448,3450,3453,3455,3458,3461,3464],{"class":1049,"line":3449},37,[1047,3451,3452],{"class":1271},"      system",[1047,3454,1275],{"class":1265},[1047,3456,3457],{"class":1265}," `",[1047,3459,3460],{"class":1057},"Generate a short title (max 30 characters) based on the user's message. No quotes or punctuation.",[1047,3462,3463],{"class":1265},"`",[1047,3465,1293],{"class":1265},[1047,3467,3469,3472,3474,3477,3479,3482,3484,3486,3489,3492],{"class":1049,"line":3468},38,[1047,3470,3471],{"class":1271},"      prompt",[1047,3473,1275],{"class":1265},[1047,3475,3476],{"class":1261}," JSON",[1047,3478,1769],{"class":1265},[1047,3480,3481],{"class":1070},"stringify",[1047,3483,1262],{"class":1271},[1047,3485,1957],{"class":1261},[1047,3487,3488],{"class":1271},"[",[1047,3490,3491],{"class":3346},"0",[1047,3493,2281],{"class":1271},[1047,3495,3497,3500],{"class":1049,"line":3496},39,[1047,3498,3499],{"class":1265},"    }",[1047,3501,1452],{"class":1271},[1047,3503,3505],{"class":1049,"line":3504},40,[1047,3506,1330],{"emptyLinePlaceholder":21},[1047,3508,3510,3513,3515,3517,3520,3522,3524,3526,3528,3530,3532,3535,3537,3539,3541,3543,3545,3547,3550,3552,3555,3557,3559,3561,3563,3565,3567,3569,3571],{"class":1049,"line":3509},41,[1047,3511,3512],{"class":1251},"    await",[1047,3514,2401],{"class":1261},[1047,3516,1769],{"class":1265},[1047,3518,3519],{"class":1070},"update",[1047,3521,1262],{"class":1271},[1047,3523,2677],{"class":1261},[1047,3525,1769],{"class":1265},[1047,3527,1748],{"class":1261},[1047,3529,1843],{"class":1271},[1047,3531,1769],{"class":1265},[1047,3533,3534],{"class":1070},"set",[1047,3536,1262],{"class":1271},[1047,3538,1826],{"class":1265},[1047,3540,3417],{"class":1261},[1047,3542,1693],{"class":1265},[1047,3544,1843],{"class":1271},[1047,3546,1769],{"class":1265},[1047,3548,3549],{"class":1070},"where",[1047,3551,1262],{"class":1271},[1047,3553,3554],{"class":1070},"eq",[1047,3556,1262],{"class":1271},[1047,3558,2677],{"class":1261},[1047,3560,1769],{"class":1265},[1047,3562,1748],{"class":1261},[1047,3564,1769],{"class":1265},[1047,3566,1978],{"class":1261},[1047,3568,1677],{"class":1265},[1047,3570,3047],{"class":1261},[1047,3572,1933],{"class":1271},[1047,3574,3576],{"class":1049,"line":3575},42,[1047,3577,3371],{"class":1265},[1047,3579,3581],{"class":1049,"line":3580},43,[1047,3582,1330],{"emptyLinePlaceholder":21},[1047,3584,3586],{"class":1049,"line":3585},44,[1047,3587,3588],{"class":1431},"  // Save the user message if it's a follow-up\n",[1047,3590,3592,3594,3597,3599,3601,3603,3605,3607,3610,3613,3616],{"class":1049,"line":3591},45,[1047,3593,2573],{"class":1548},[1047,3595,3596],{"class":1261}," lastMessage",[1047,3598,2583],{"class":1265},[1047,3600,3117],{"class":1261},[1047,3602,3488],{"class":1271},[1047,3604,1957],{"class":1261},[1047,3606,1769],{"class":1265},[1047,3608,3609],{"class":1261},"length",[1047,3611,3612],{"class":1265}," -",[1047,3614,3615],{"class":3346}," 1",[1047,3617,3618],{"class":1271},"]\n",[1047,3620,3622,3624,3626,3629,3632,3634,3637,3639,3641,3643,3646,3648,3650,3652,3655,3657,3659],{"class":1049,"line":3621},46,[1047,3623,3314],{"class":1251},[1047,3625,1912],{"class":1271},[1047,3627,3628],{"class":1261},"lastMessage",[1047,3630,3631],{"class":1265},"?.",[1047,3633,2090],{"class":1261},[1047,3635,3636],{"class":1265}," ===",[1047,3638,1352],{"class":1265},[1047,3640,2108],{"class":1057},[1047,3642,1290],{"class":1265},[1047,3644,3645],{"class":1265}," &&",[1047,3647,3117],{"class":1261},[1047,3649,1769],{"class":1265},[1047,3651,3609],{"class":1261},[1047,3653,3654],{"class":1265}," >",[1047,3656,3615],{"class":3346},[1047,3658,3324],{"class":1271},[1047,3660,1266],{"class":1265},[1047,3662,3664,3666,3668,3670,3672,3674,3676,3678,3680,3682,3684,3686,3688],{"class":1049,"line":3663},47,[1047,3665,3512],{"class":1251},[1047,3667,2401],{"class":1261},[1047,3669,1769],{"class":1265},[1047,3671,2672],{"class":1070},[1047,3673,1262],{"class":1271},[1047,3675,2677],{"class":1261},[1047,3677,1769],{"class":1265},[1047,3679,1957],{"class":1261},[1047,3681,1843],{"class":1271},[1047,3683,1769],{"class":1265},[1047,3685,2688],{"class":1070},[1047,3687,1262],{"class":1271},[1047,3689,1266],{"class":1265},[1047,3691,3693,3696,3698,3700],{"class":1049,"line":3692},48,[1047,3694,3695],{"class":1271},"      chatId",[1047,3697,1275],{"class":1265},[1047,3699,3047],{"class":1261},[1047,3701,1293],{"class":1265},[1047,3703,3705,3708,3710,3712,3714,3716],{"class":1049,"line":3704},49,[1047,3706,3707],{"class":1271},"      role",[1047,3709,1275],{"class":1265},[1047,3711,1352],{"class":1265},[1047,3713,2108],{"class":1057},[1047,3715,1290],{"class":1265},[1047,3717,1293],{"class":1265},[1047,3719,3721,3724,3726,3728,3730],{"class":1049,"line":3720},50,[1047,3722,3723],{"class":1271},"      parts",[1047,3725,1275],{"class":1265},[1047,3727,3596],{"class":1261},[1047,3729,1769],{"class":1265},[1047,3731,2785],{"class":1261},[1047,3733,3735,3737],{"class":1049,"line":3734},51,[1047,3736,3499],{"class":1265},[1047,3738,1452],{"class":1271},[1047,3740,3742],{"class":1049,"line":3741},52,[1047,3743,3371],{"class":1265},[1047,3745,3747],{"class":1049,"line":3746},53,[1047,3748,1330],{"emptyLinePlaceholder":21},[1047,3750,3752],{"class":1049,"line":3751},54,[1047,3753,3754],{"class":1431},"  // Create the streaming response\n",[1047,3756,3758,3760,3763,3765,3768,3770],{"class":1049,"line":3757},55,[1047,3759,2573],{"class":1548},[1047,3761,3762],{"class":1261}," stream",[1047,3764,2583],{"class":1265},[1047,3766,3767],{"class":1070}," createUIMessageStream",[1047,3769,1262],{"class":1271},[1047,3771,1266],{"class":1265},[1047,3773,3775,3778,3780,3783,3785,3788,3790,3792],{"class":1049,"line":3774},56,[1047,3776,3777],{"class":1070},"    execute",[1047,3779,1275],{"class":1265},[1047,3781,3782],{"class":1548}," async",[1047,3784,1900],{"class":1265},[1047,3786,3787],{"class":1903}," writer",[1047,3789,1907],{"class":1265},[1047,3791,1786],{"class":1548},[1047,3793,1341],{"class":1265},[1047,3795,3797,3800,3803,3805,3808,3810],{"class":1049,"line":3796},57,[1047,3798,3799],{"class":1548},"      const",[1047,3801,3802],{"class":1261}," result",[1047,3804,2583],{"class":1265},[1047,3806,3807],{"class":1070}," streamText",[1047,3809,1262],{"class":1271},[1047,3811,1266],{"class":1265},[1047,3813,3815,3818],{"class":1049,"line":3814},58,[1047,3816,3817],{"class":1261},"        model",[1047,3819,1293],{"class":1265},[1047,3821,3823,3826,3828,3830,3833,3835],{"class":1049,"line":3822},59,[1047,3824,3825],{"class":1271},"        system",[1047,3827,1275],{"class":1265},[1047,3829,3457],{"class":1265},[1047,3831,3832],{"class":1057},"You are a helpful AI assistant. Be concise and friendly.",[1047,3834,3463],{"class":1265},[1047,3836,1293],{"class":1265},[1047,3838,3840,3843,3845,3847,3850,3852,3854],{"class":1049,"line":3839},60,[1047,3841,3842],{"class":1271},"        messages",[1047,3844,1275],{"class":1265},[1047,3846,2586],{"class":1251},[1047,3848,3849],{"class":1070}," convertToModelMessages",[1047,3851,1262],{"class":1271},[1047,3853,1957],{"class":1261},[1047,3855,1452],{"class":1271},[1047,3857,3859,3862],{"class":1049,"line":3858},61,[1047,3860,3861],{"class":1265},"      }",[1047,3863,1452],{"class":1271},[1047,3865,3867],{"class":1049,"line":3866},62,[1047,3868,1330],{"emptyLinePlaceholder":21},[1047,3870,3872],{"class":1049,"line":3871},63,[1047,3873,3874],{"class":1431},"      // Notify the client that a title was generated\n",[1047,3876,3878,3881,3883,3885,3887,3889,3891,3893],{"class":1049,"line":3877},64,[1047,3879,3880],{"class":1251},"      if",[1047,3882,1912],{"class":1271},[1047,3884,3319],{"class":1265},[1047,3886,262],{"class":1261},[1047,3888,1769],{"class":1265},[1047,3890,3398],{"class":1261},[1047,3892,3324],{"class":1271},[1047,3894,1266],{"class":1265},[1047,3896,3898,3901,3903,3906,3908],{"class":1049,"line":3897},65,[1047,3899,3900],{"class":1261},"        writer",[1047,3902,1769],{"class":1265},[1047,3904,3905],{"class":1070},"write",[1047,3907,1262],{"class":1271},[1047,3909,1266],{"class":1265},[1047,3911,3913,3916,3918,3920,3923,3925],{"class":1049,"line":3912},66,[1047,3914,3915],{"class":1271},"          type",[1047,3917,1275],{"class":1265},[1047,3919,1352],{"class":1265},[1047,3921,3922],{"class":1057},"data-chat-title",[1047,3924,1290],{"class":1265},[1047,3926,1293],{"class":1265},[1047,3928,3930,3933,3935,3937,3939,3941,3943,3946,3948],{"class":1049,"line":3929},67,[1047,3931,3932],{"class":1271},"          data",[1047,3934,1275],{"class":1265},[1047,3936,1671],{"class":1265},[1047,3938,2578],{"class":1271},[1047,3940,1275],{"class":1265},[1047,3942,1352],{"class":1265},[1047,3944,3945],{"class":1057},"Title generated",[1047,3947,1290],{"class":1265},[1047,3949,3950],{"class":1265}," },\n",[1047,3952,3954,3957,3959],{"class":1049,"line":3953},68,[1047,3955,3956],{"class":1271},"          transient",[1047,3958,1275],{"class":1265},[1047,3960,3961],{"class":1427}," true\n",[1047,3963,3965,3968],{"class":1049,"line":3964},69,[1047,3966,3967],{"class":1265},"        }",[1047,3969,1452],{"class":1271},[1047,3971,3973],{"class":1049,"line":3972},70,[1047,3974,3975],{"class":1265},"      }\n",[1047,3977,3979],{"class":1049,"line":3978},71,[1047,3980,1330],{"emptyLinePlaceholder":21},[1047,3982,3984,3987,3989,3992,3994,3997,3999,4002],{"class":1049,"line":3983},72,[1047,3985,3986],{"class":1261},"      writer",[1047,3988,1769],{"class":1265},[1047,3990,3991],{"class":1070},"merge",[1047,3993,1262],{"class":1271},[1047,3995,3996],{"class":1261},"result",[1047,3998,1769],{"class":1265},[1047,4000,4001],{"class":1070},"toUIMessageStream",[1047,4003,1869],{"class":1271},[1047,4005,4007],{"class":1049,"line":4006},73,[1047,4008,4009],{"class":1265},"    },\n",[1047,4011,4013,4016,4018,4020,4022,4024,4026,4028],{"class":1049,"line":4012},74,[1047,4014,4015],{"class":1070},"    onFinish",[1047,4017,1275],{"class":1265},[1047,4019,3782],{"class":1548},[1047,4021,1900],{"class":1265},[1047,4023,3117],{"class":1903},[1047,4025,1907],{"class":1265},[1047,4027,1786],{"class":1548},[1047,4029,1341],{"class":1265},[1047,4031,4033],{"class":1049,"line":4032},75,[1047,4034,4035],{"class":1431},"      // Save the assistant's response to the database\n",[1047,4037,4039,4042,4044,4046,4048,4050,4052,4054,4056,4058,4060,4062,4064,4066,4068,4071,4073,4076,4078,4080],{"class":1049,"line":4038},76,[1047,4040,4041],{"class":1251},"      await",[1047,4043,2401],{"class":1261},[1047,4045,1769],{"class":1265},[1047,4047,2672],{"class":1070},[1047,4049,1262],{"class":1271},[1047,4051,2677],{"class":1261},[1047,4053,1769],{"class":1265},[1047,4055,1957],{"class":1261},[1047,4057,1843],{"class":1271},[1047,4059,1769],{"class":1265},[1047,4061,2688],{"class":1070},[1047,4063,1262],{"class":1271},[1047,4065,1957],{"class":1261},[1047,4067,1769],{"class":1265},[1047,4069,4070],{"class":1070},"map",[1047,4072,1262],{"class":1271},[1047,4074,4075],{"class":1903},"message",[1047,4077,1786],{"class":1548},[1047,4079,1912],{"class":1271},[1047,4081,1266],{"class":1265},[1047,4083,4085,4088,4090,4092,4094,4096],{"class":1049,"line":4084},77,[1047,4086,4087],{"class":1271},"        chatId",[1047,4089,1275],{"class":1265},[1047,4091,2750],{"class":1261},[1047,4093,1769],{"class":1265},[1047,4095,1978],{"class":1261},[1047,4097,1293],{"class":1265},[1047,4099,4101,4104,4106,4108,4110,4112,4114,4116,4118,4120,4123,4125,4127,4129],{"class":1049,"line":4100},78,[1047,4102,4103],{"class":1271},"        role",[1047,4105,1275],{"class":1265},[1047,4107,2578],{"class":1261},[1047,4109,1769],{"class":1265},[1047,4111,2090],{"class":1261},[1047,4113,3294],{"class":1251},[1047,4115,1352],{"class":1265},[1047,4117,2108],{"class":1057},[1047,4119,1290],{"class":1265},[1047,4121,4122],{"class":1265}," |",[1047,4124,1352],{"class":1265},[1047,4126,2117],{"class":1057},[1047,4128,1290],{"class":1265},[1047,4130,1293],{"class":1265},[1047,4132,4134,4137,4139,4141,4143],{"class":1049,"line":4133},79,[1047,4135,4136],{"class":1271},"        parts",[1047,4138,1275],{"class":1265},[1047,4140,2578],{"class":1261},[1047,4142,1769],{"class":1265},[1047,4144,2785],{"class":1261},[1047,4146,4148,4150],{"class":1049,"line":4147},80,[1047,4149,3861],{"class":1265},[1047,4151,4152],{"class":1271},")))\n",[1047,4154,4156],{"class":1049,"line":4155},81,[1047,4157,1438],{"class":1265},[1047,4159,4161,4163],{"class":1049,"line":4160},82,[1047,4162,2374],{"class":1265},[1047,4164,1452],{"class":1271},[1047,4166,4168],{"class":1049,"line":4167},83,[1047,4169,1330],{"emptyLinePlaceholder":21},[1047,4171,4173,4175,4178,4180,4182,4184,4186],{"class":1049,"line":4172},84,[1047,4174,2800],{"class":1251},[1047,4176,4177],{"class":1070}," createUIMessageStreamResponse",[1047,4179,1262],{"class":1271},[1047,4181,1826],{"class":1265},[1047,4183,3762],{"class":1261},[1047,4185,1693],{"class":1265},[1047,4187,1452],{"class":1271},[1047,4189,4191,4193],{"class":1049,"line":4190},85,[1047,4192,1449],{"class":1265},[1047,4194,1452],{"class":1261},[947,4196,4197],{},"Here's what each part does:",[947,4199,4200],{},[965,4201,4202],{},"AI Gateway",[947,4204,4205,4206,4209],{},"Thanks to ",[1022,4207,1027],{"href":1024,"rel":4208},[1026],", we can use any AI model supported by the gateway just by specifying the model name.",[947,4211,4212],{},[965,4213,4214],{},"Automatic Title Generation",[947,4216,4217,4218,4225],{},"When a chat doesn't have a title yet, we use ",[1022,4219,4222],{"href":4220,"rel":4221},"https://ai-sdk.dev/docs/reference/ai-sdk-core/generate-text#generatetext",[1026],[1044,4223,4224],{},"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\".",[947,4227,4228],{},[965,4229,4230],{},"Streaming with streamText",[947,4232,4233,4234,4239],{},"The ",[1022,4235,4237],{"href":2819,"rel":4236},[1026],[1044,4238,2823],{}," function generates a streaming response from the AI model. Key options include:",[959,4241,4242,4248,4253],{},[962,4243,4244,4247],{},[1044,4245,4246],{},"model",": The AI model to use",[962,4249,4250,4252],{},[1044,4251,2126],{},": Instructions that guide the AI's behavior",[962,4254,4255,4257],{},[1044,4256,1957],{},": The conversation history",[947,4259,4260],{},[965,4261,4262],{},"UIMessageStream",[947,4264,4233,4265,4271,4272,4278],{},[1022,4266,4269],{"href":4267,"rel":4268},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/create-ui-message-stream#createuimessagestream",[1026],[1044,4270,2831],{}," and ",[1022,4273,4276],{"href":4274,"rel":4275},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/create-ui-message-stream-response#createuimessagestreamresponse",[1026],[1044,4277,2839],{}," 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.",[947,4280,4233,4281,4284,4285,4287,4288,4291],{},[1044,4282,4283],{},"writer.write()"," method allows sending custom data events to the client (like ",[1044,4286,3922],{},"), while ",[1044,4289,4290],{},"onFinish"," is called when streaming completes, perfect for persisting the assistant's response.",[1075,4293,4295],{"id":4294},"fetching-a-chat","Fetching a chat",[947,4297,4298],{},"Add an endpoint to fetch existing chat data from your database:",[1238,4300,4301],{},[1037,4302,4305],{"className":1242,"code":4303,"filename":4304,"language":1244,"meta":1042,"style":1042},"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",[1044,4306,4307,4333,4356,4378,4396,4400,4422,4454,4468,4480,4484,4512,4543,4552,4561,4590,4594,4598,4604,4608,4622,4654,4658,4662,4668],{"__ignoreMap":1042},[1047,4308,4309,4311,4313,4315,4317,4319,4321,4323,4325,4327,4329,4331],{"class":1049,"line":1050},[1047,4310,1668],{"class":1251},[1047,4312,1671],{"class":1265},[1047,4314,2859],{"class":1261},[1047,4316,1677],{"class":1265},[1047,4318,2458],{"class":1261},[1047,4320,1677],{"class":1265},[1047,4322,2868],{"class":1261},[1047,4324,1693],{"class":1265},[1047,4326,1696],{"class":1251},[1047,4328,1352],{"class":1265},[1047,4330,1075],{"class":1057},[1047,4332,1316],{"class":1265},[1047,4334,4335,4337,4339,4342,4344,4346,4348,4350,4352,4354],{"class":1049,"line":1067},[1047,4336,1668],{"class":1251},[1047,4338,1671],{"class":1265},[1047,4340,4341],{"class":1261}," asc",[1047,4343,1677],{"class":1265},[1047,4345,2891],{"class":1261},[1047,4347,1693],{"class":1265},[1047,4349,1696],{"class":1251},[1047,4351,1352],{"class":1265},[1047,4353,1721],{"class":1057},[1047,4355,1316],{"class":1265},[1047,4357,4358,4360,4362,4364,4366,4368,4370,4372,4374,4376],{"class":1049,"line":1281},[1047,4359,1668],{"class":1251},[1047,4361,1671],{"class":1265},[1047,4363,2401],{"class":1261},[1047,4365,1677],{"class":1265},[1047,4367,2509],{"class":1261},[1047,4369,1693],{"class":1265},[1047,4371,1696],{"class":1251},[1047,4373,1352],{"class":1265},[1047,4375,2518],{"class":1057},[1047,4377,1316],{"class":1265},[1047,4379,4380,4382,4384,4386,4388,4390,4392,4394],{"class":1049,"line":1296},[1047,4381,1668],{"class":1251},[1047,4383,1671],{"class":1265},[1047,4385,2529],{"class":1261},[1047,4387,1693],{"class":1265},[1047,4389,1696],{"class":1251},[1047,4391,1352],{"class":1265},[1047,4393,2538],{"class":1057},[1047,4395,1316],{"class":1265},[1047,4397,4398],{"class":1049,"line":1308},[1047,4399,1330],{"emptyLinePlaceholder":21},[1047,4401,4402,4404,4406,4408,4410,4412,4414,4416,4418,4420],{"class":1049,"line":1319},[1047,4403,1252],{"class":1251},[1047,4405,1255],{"class":1251},[1047,4407,2458],{"class":1070},[1047,4409,1262],{"class":1261},[1047,4411,2557],{"class":1548},[1047,4413,1912],{"class":1265},[1047,4415,2562],{"class":1903},[1047,4417,1843],{"class":1265},[1047,4419,1786],{"class":1548},[1047,4421,1341],{"class":1265},[1047,4423,4424,4426,4428,4430,4432,4434,4436,4438,4440,4442,4444,4446,4448,4450,4452],{"class":1049,"line":1327},[1047,4425,2573],{"class":1548},[1047,4427,1671],{"class":1265},[1047,4429,3047],{"class":1261},[1047,4431,1693],{"class":1265},[1047,4433,2583],{"class":1265},[1047,4435,2586],{"class":1251},[1047,4437,2868],{"class":1070},[1047,4439,1262],{"class":1271},[1047,4441,2562],{"class":1261},[1047,4443,1677],{"class":1265},[1047,4445,2529],{"class":1261},[1047,4447,1769],{"class":1265},[1047,4449,2601],{"class":1070},[1047,4451,1262],{"class":1271},[1047,4453,1266],{"class":1265},[1047,4455,4456,4458,4460,4462,4464,4466],{"class":1049,"line":1333},[1047,4457,3076],{"class":1271},[1047,4459,1275],{"class":1265},[1047,4461,2529],{"class":1261},[1047,4463,1769],{"class":1265},[1047,4465,3085],{"class":1070},[1047,4467,2629],{"class":1271},[1047,4469,4470,4472,4474,4476,4478],{"class":1049,"line":1344},[1047,4471,2374],{"class":1265},[1047,4473,1843],{"class":1271},[1047,4475,1769],{"class":1265},[1047,4477,2640],{"class":1261},[1047,4479,1452],{"class":1271},[1047,4481,4482],{"class":1049,"line":1360},[1047,4483,1330],{"emptyLinePlaceholder":21},[1047,4485,4486,4488,4490,4492,4494,4496,4498,4500,4502,4504,4506,4508,4510],{"class":1049,"line":1366},[1047,4487,2573],{"class":1548},[1047,4489,2750],{"class":1261},[1047,4491,2583],{"class":1265},[1047,4493,2586],{"class":1251},[1047,4495,2401],{"class":1261},[1047,4497,1769],{"class":1265},[1047,4499,3243],{"class":1261},[1047,4501,1769],{"class":1265},[1047,4503,1748],{"class":1261},[1047,4505,1769],{"class":1265},[1047,4507,3252],{"class":1070},[1047,4509,1262],{"class":1271},[1047,4511,1266],{"class":1265},[1047,4513,4514,4516,4518,4520,4522,4524,4526,4528,4530,4532,4534,4536,4538,4541],{"class":1049,"line":1371},[1047,4515,3261],{"class":1271},[1047,4517,1275],{"class":1265},[1047,4519,1912],{"class":1271},[1047,4521,3554],{"class":1070},[1047,4523,1262],{"class":1271},[1047,4525,2677],{"class":1261},[1047,4527,1769],{"class":1265},[1047,4529,1748],{"class":1261},[1047,4531,1769],{"class":1265},[1047,4533,1978],{"class":1261},[1047,4535,1677],{"class":1265},[1047,4537,3047],{"class":1261},[1047,4539,4540],{"class":1271},"))",[1047,4542,1293],{"class":1265},[1047,4544,4545,4548,4550],{"class":1049,"line":1394},[1047,4546,4547],{"class":1271},"    with",[1047,4549,1275],{"class":1265},[1047,4551,1341],{"class":1265},[1047,4553,4554,4557,4559],{"class":1049,"line":1399},[1047,4555,4556],{"class":1271},"      messages",[1047,4558,1275],{"class":1265},[1047,4560,1341],{"class":1265},[1047,4562,4563,4566,4568,4571,4573,4575,4577,4579,4581,4583,4585,4588],{"class":1049,"line":1409},[1047,4564,4565],{"class":1070},"        orderBy",[1047,4567,1275],{"class":1265},[1047,4569,4570],{"class":1265}," ()",[1047,4572,1786],{"class":1548},[1047,4574,4341],{"class":1070},[1047,4576,1262],{"class":1271},[1047,4578,2677],{"class":1261},[1047,4580,1769],{"class":1265},[1047,4582,1957],{"class":1261},[1047,4584,1769],{"class":1265},[1047,4586,4587],{"class":1261},"createdAt",[1047,4589,1452],{"class":1271},[1047,4591,4592],{"class":1049,"line":1419},[1047,4593,3975],{"class":1265},[1047,4595,4596],{"class":1049,"line":1435},[1047,4597,1438],{"class":1265},[1047,4599,4600,4602],{"class":1049,"line":1441},[1047,4601,2374],{"class":1265},[1047,4603,1452],{"class":1271},[1047,4605,4606],{"class":1049,"line":1446},[1047,4607,1330],{"emptyLinePlaceholder":21},[1047,4609,4610,4612,4614,4616,4618,4620],{"class":1049,"line":2235},[1047,4611,3314],{"class":1251},[1047,4613,1912],{"class":1271},[1047,4615,3319],{"class":1265},[1047,4617,262],{"class":1261},[1047,4619,3324],{"class":1271},[1047,4621,1266],{"class":1265},[1047,4623,4624,4626,4628,4630,4632,4634,4636,4638,4640,4642,4644,4646,4648,4650,4652],{"class":1049,"line":2248},[1047,4625,3332],{"class":1251},[1047,4627,2859],{"class":1070},[1047,4629,1262],{"class":1271},[1047,4631,1826],{"class":1265},[1047,4633,3341],{"class":1271},[1047,4635,1275],{"class":1265},[1047,4637,3347],{"class":3346},[1047,4639,1677],{"class":1265},[1047,4641,3352],{"class":1271},[1047,4643,1275],{"class":1265},[1047,4645,1352],{"class":1265},[1047,4647,3359],{"class":1057},[1047,4649,1290],{"class":1265},[1047,4651,1693],{"class":1265},[1047,4653,1452],{"class":1271},[1047,4655,4656],{"class":1049,"line":2278},[1047,4657,3371],{"class":1265},[1047,4659,4660],{"class":1049,"line":2284},[1047,4661,1330],{"emptyLinePlaceholder":21},[1047,4663,4664,4666],{"class":1049,"line":2289},[1047,4665,2800],{"class":1251},[1047,4667,2803],{"class":1261},[1047,4669,4670,4672],{"class":1049,"line":2321},[1047,4671,1449],{"class":1265},[1047,4673,1452],{"class":1261},[951,4675,4677],{"id":4676},"wire-up-the-ui","Wire up the UI",[947,4679,4680,4681,4686,4687,4692],{},"Nuxt UI provides purpose-built components for AI chat interfaces: ",[1022,4682,4683],{"href":276},[1044,4684,4685],{},"UChatPrompt"," for the input area and ",[1022,4688,4689],{"href":266},[1044,4690,4691],{},"UChatMessages"," for displaying the conversation.",[1075,4694,4696],{"id":4695},"creating-the-home-page","Creating the home page",[947,4698,4699,4700,4704],{},"The home page is where users start a new conversation. The ",[1022,4701,4702],{"href":276},[1044,4703,4685],{}," component provides a textarea with auto-resize, keyboard shortcuts, and a submit button:",[1238,4706,4707],{},[1037,4708,4712],{"className":1510,"code":4709,"filename":4710,"highlights":4711,"language":34,"meta":1042,"style":1042},"\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",[3385,3405,3433,3449,3468,3496,3504,3509,3575],[1044,4713,4714,4737,4757,4775,4779,4793,4820,4824,4837,4841,4846,4872,4888,4897,4906,4920,4958,4962,4966,4972,4976,4981,5007,5012,5020,5024,5032,5053,5067,5088,5109,5114,5123,5127,5135,5150,5165,5180,5195,5210,5216,5239,5248,5257,5265,5273],{"__ignoreMap":1042},[1047,4715,4716,4718,4721,4724,4727,4729,4731,4733,4735],{"class":1049,"line":1050},[1047,4717,1520],{"class":1265},[1047,4719,4720],{"class":1271},"script",[1047,4722,4723],{"class":1548}," setup",[1047,4725,4726],{"class":1548}," lang",[1047,4728,1552],{"class":1265},[1047,4730,1479],{"class":1265},[1047,4732,1244],{"class":1057},[1047,4734,1479],{"class":1265},[1047,4736,1526],{"class":1265},[1047,4738,4739,4742,4745,4747,4750,4752,4755],{"class":1049,"line":1067},[1047,4740,4741],{"class":1548},"const",[1047,4743,4744],{"class":1261}," input ",[1047,4746,1552],{"class":1265},[1047,4748,4749],{"class":1070}," ref",[1047,4751,1262],{"class":1261},[1047,4753,4754],{"class":1265},"''",[1047,4756,1452],{"class":1261},[1047,4758,4759,4761,4764,4766,4768,4770,4773],{"class":1049,"line":1281},[1047,4760,4741],{"class":1548},[1047,4762,4763],{"class":1261}," loading ",[1047,4765,1552],{"class":1265},[1047,4767,4749],{"class":1070},[1047,4769,1262],{"class":1261},[1047,4771,4772],{"class":1427},"false",[1047,4774,1452],{"class":1261},[1047,4776,4777],{"class":1049,"line":1296},[1047,4778,1330],{"emptyLinePlaceholder":21},[1047,4780,4781,4783,4786,4789,4791],{"class":1049,"line":1308},[1047,4782,2557],{"class":1548},[1047,4784,4785],{"class":1548}," function",[1047,4787,4788],{"class":1070}," createChat",[1047,4790,1766],{"class":1265},[1047,4792,1341],{"class":1265},[1047,4794,4795,4797,4799,4801,4804,4806,4809,4811,4814,4817],{"class":1049,"line":1319},[1047,4796,3314],{"class":1251},[1047,4798,1912],{"class":1271},[1047,4800,3319],{"class":1265},[1047,4802,4803],{"class":1261},"input",[1047,4805,1769],{"class":1265},[1047,4807,4808],{"class":1261},"value",[1047,4810,1769],{"class":1265},[1047,4812,4813],{"class":1070},"trim",[1047,4815,4816],{"class":1271},"()) ",[1047,4818,4819],{"class":1251},"return\n",[1047,4821,4822],{"class":1049,"line":1327},[1047,4823,1330],{"emptyLinePlaceholder":21},[1047,4825,4826,4829,4831,4833,4835],{"class":1049,"line":1333},[1047,4827,4828],{"class":1261},"  loading",[1047,4830,1769],{"class":1265},[1047,4832,4808],{"class":1261},[1047,4834,2583],{"class":1265},[1047,4836,3961],{"class":1427},[1047,4838,4839],{"class":1049,"line":1344},[1047,4840,1330],{"emptyLinePlaceholder":21},[1047,4842,4843],{"class":1049,"line":1360},[1047,4844,4845],{"class":1431},"  // Create a new chat on the server\n",[1047,4847,4848,4850,4852,4854,4856,4859,4861,4863,4866,4868,4870],{"class":1049,"line":1366},[1047,4849,2573],{"class":1548},[1047,4851,2750],{"class":1261},[1047,4853,2583],{"class":1265},[1047,4855,2586],{"class":1251},[1047,4857,4858],{"class":1070}," $fetch",[1047,4860,1262],{"class":1271},[1047,4862,1290],{"class":1265},[1047,4864,4865],{"class":1057},"/api/chats",[1047,4867,1290],{"class":1265},[1047,4869,1677],{"class":1265},[1047,4871,1341],{"class":1265},[1047,4873,4874,4877,4879,4881,4884,4886],{"class":1049,"line":1371},[1047,4875,4876],{"class":1271},"    method",[1047,4878,1275],{"class":1265},[1047,4880,1352],{"class":1265},[1047,4882,4883],{"class":1057},"POST",[1047,4885,1290],{"class":1265},[1047,4887,1293],{"class":1265},[1047,4889,4890,4893,4895],{"class":1049,"line":1394},[1047,4891,4892],{"class":1271},"    body",[1047,4894,1275],{"class":1265},[1047,4896,1341],{"class":1265},[1047,4898,4899,4902,4904],{"class":1049,"line":1399},[1047,4900,4901],{"class":1271},"      message",[1047,4903,1275],{"class":1265},[1047,4905,1341],{"class":1265},[1047,4907,4908,4910,4912,4914,4916,4918],{"class":1049,"line":1409},[1047,4909,4103],{"class":1271},[1047,4911,1275],{"class":1265},[1047,4913,1352],{"class":1265},[1047,4915,2108],{"class":1057},[1047,4917,1290],{"class":1265},[1047,4919,1293],{"class":1265},[1047,4921,4922,4924,4926,4928,4930,4932,4934,4936,4939,4941,4943,4945,4947,4950,4952,4954,4956],{"class":1049,"line":1419},[1047,4923,4136],{"class":1271},[1047,4925,1275],{"class":1265},[1047,4927,1379],{"class":1271},[1047,4929,1826],{"class":1265},[1047,4931,2480],{"class":1271},[1047,4933,1275],{"class":1265},[1047,4935,1352],{"class":1265},[1047,4937,4938],{"class":1057},"text",[1047,4940,1290],{"class":1265},[1047,4942,1677],{"class":1265},[1047,4944,1680],{"class":1271},[1047,4946,1275],{"class":1265},[1047,4948,4949],{"class":1261}," input",[1047,4951,1769],{"class":1265},[1047,4953,4808],{"class":1261},[1047,4955,1693],{"class":1265},[1047,4957,3618],{"class":1271},[1047,4959,4960],{"class":1049,"line":1435},[1047,4961,3975],{"class":1265},[1047,4963,4964],{"class":1049,"line":1441},[1047,4965,1438],{"class":1265},[1047,4967,4968,4970],{"class":1049,"line":1446},[1047,4969,2374],{"class":1265},[1047,4971,1452],{"class":1271},[1047,4973,4974],{"class":1049,"line":2235},[1047,4975,1330],{"emptyLinePlaceholder":21},[1047,4977,4978],{"class":1049,"line":2248},[1047,4979,4980],{"class":1431},"  // Navigate to the chat page\n",[1047,4982,4983,4986,4988,4990,4993,4996,4998,5000,5002,5005],{"class":1049,"line":2278},[1047,4984,4985],{"class":1070},"  navigateTo",[1047,4987,1262],{"class":1271},[1047,4989,3463],{"class":1265},[1047,4991,4992],{"class":1057},"/chat/",[1047,4994,4995],{"class":1265},"${",[1047,4997,262],{"class":1261},[1047,4999,1769],{"class":1265},[1047,5001,1978],{"class":1261},[1047,5003,5004],{"class":1265},"}`",[1047,5006,1452],{"class":1271},[1047,5008,5009],{"class":1049,"line":2284},[1047,5010,5011],{"class":1265},"}\n",[1047,5013,5014,5016,5018],{"class":1049,"line":2289},[1047,5015,1596],{"class":1265},[1047,5017,4720],{"class":1271},[1047,5019,1526],{"class":1265},[1047,5021,5022],{"class":1049,"line":2321},[1047,5023,1330],{"emptyLinePlaceholder":21},[1047,5025,5026,5028,5030],{"class":1049,"line":2337},[1047,5027,1520],{"class":1265},[1047,5029,1523],{"class":1271},[1047,5031,1526],{"class":1265},[1047,5033,5034,5036,5039,5042,5044,5046,5049,5051],{"class":1049,"line":2355},[1047,5035,1533],{"class":1265},[1047,5037,5038],{"class":1271},"UDashboardPanel",[1047,5040,5041],{"class":1548}," :ui",[1047,5043,1552],{"class":1265},[1047,5045,1479],{"class":1265},[1047,5047,5048],{"class":1057},"{ body: 'p-0 sm:p-0' }",[1047,5050,1479],{"class":1265},[1047,5052,1526],{"class":1265},[1047,5054,5055,5057,5059,5062,5065],{"class":1049,"line":2371},[1047,5056,1542],{"class":1265},[1047,5058,1523],{"class":1271},[1047,5060,5061],{"class":1265}," #",[1047,5063,5064],{"class":1548},"body",[1047,5066,1526],{"class":1265},[1047,5068,5069,5071,5074,5077,5079,5081,5084,5086],{"class":1049,"line":2379},[1047,5070,1566],{"class":1265},[1047,5072,5073],{"class":1271},"UContainer",[1047,5075,5076],{"class":1548}," class",[1047,5078,1552],{"class":1265},[1047,5080,1479],{"class":1265},[1047,5082,5083],{"class":1057},"min-h-dvh flex flex-col justify-center gap-6 py-8",[1047,5085,1479],{"class":1265},[1047,5087,1526],{"class":1265},[1047,5089,5090,5093,5096,5098,5100,5102,5105,5107],{"class":1049,"line":3329},[1047,5091,5092],{"class":1265},"        \u003C",[1047,5094,5095],{"class":1271},"h1",[1047,5097,5076],{"class":1548},[1047,5099,1552],{"class":1265},[1047,5101,1479],{"class":1265},[1047,5103,5104],{"class":1057},"text-3xl sm:text-4xl text-highlighted font-bold",[1047,5106,1479],{"class":1265},[1047,5108,1526],{"class":1265},[1047,5110,5111],{"class":1049,"line":3368},[1047,5112,5113],{"class":1261},"          How can I help you today?\n",[1047,5115,5116,5119,5121],{"class":1049,"line":3374},[1047,5117,5118],{"class":1265},"        \u003C/",[1047,5120,5095],{"class":1271},[1047,5122,1526],{"class":1265},[1047,5124,5125],{"class":1049,"line":3379},[1047,5126,1330],{"emptyLinePlaceholder":21},[1047,5128,5130,5132],{"class":5129,"line":3385},[1049,1530],[1047,5131,5092],{"class":1265},[1047,5133,5134],{"class":1271},"UChatPrompt\n",[1047,5136,5138,5141,5143,5145,5147],{"class":5137,"line":3405},[1049,1530],[1047,5139,5140],{"class":1548},"          v-model",[1047,5142,1552],{"class":1265},[1047,5144,1479],{"class":1265},[1047,5146,4803],{"class":1057},[1047,5148,5149],{"class":1265},"\"\n",[1047,5151,5153,5156,5158,5160,5163],{"class":5152,"line":3433},[1049,1530],[1047,5154,5155],{"class":1548},"          :status",[1047,5157,1552],{"class":1265},[1047,5159,1479],{"class":1265},[1047,5161,5162],{"class":1057},"loading ? 'streaming' : 'ready'",[1047,5164,5149],{"class":1265},[1047,5166,5168,5171,5173,5175,5178],{"class":5167,"line":3449},[1049,1530],[1047,5169,5170],{"class":1548},"          variant",[1047,5172,1552],{"class":1265},[1047,5174,1479],{"class":1265},[1047,5176,5177],{"class":1057},"subtle",[1047,5179,5149],{"class":1265},[1047,5181,5183,5186,5188,5190,5193],{"class":5182,"line":3468},[1049,1530],[1047,5184,5185],{"class":1548},"          placeholder",[1047,5187,1552],{"class":1265},[1047,5189,1479],{"class":1265},[1047,5191,5192],{"class":1057},"Ask me anything...",[1047,5194,5149],{"class":1265},[1047,5196,5198,5201,5203,5205,5208],{"class":5197,"line":3496},[1049,1530],[1047,5199,5200],{"class":1548},"          @submit",[1047,5202,1552],{"class":1265},[1047,5204,1479],{"class":1265},[1047,5206,5207],{"class":1057},"createChat",[1047,5209,5149],{"class":1265},[1047,5211,5213],{"class":5212,"line":3504},[1049,1530],[1047,5214,5215],{"class":1265},"        >\n",[1047,5217,5219,5222,5225,5228,5230,5232,5235,5237],{"class":5218,"line":3509},[1049,1530],[1047,5220,5221],{"class":1265},"          \u003C",[1047,5223,5224],{"class":1271},"UChatPromptSubmit",[1047,5226,5227],{"class":1548}," color",[1047,5229,1552],{"class":1265},[1047,5231,1479],{"class":1265},[1047,5233,5234],{"class":1057},"neutral",[1047,5236,1479],{"class":1265},[1047,5238,1572],{"class":1265},[1047,5240,5242,5244,5246],{"class":5241,"line":3575},[1049,1530],[1047,5243,5118],{"class":1265},[1047,5245,4685],{"class":1271},[1047,5247,1526],{"class":1265},[1047,5249,5250,5253,5255],{"class":1049,"line":3580},[1047,5251,5252],{"class":1265},"      \u003C/",[1047,5254,5073],{"class":1271},[1047,5256,1526],{"class":1265},[1047,5258,5259,5261,5263],{"class":1049,"line":3585},[1047,5260,1577],{"class":1265},[1047,5262,1523],{"class":1271},[1047,5264,1526],{"class":1265},[1047,5266,5267,5269,5271],{"class":1049,"line":3591},[1047,5268,1587],{"class":1265},[1047,5270,5038],{"class":1271},[1047,5272,1526],{"class":1265},[1047,5274,5275,5277,5279],{"class":1049,"line":3621},[1047,5276,1596],{"class":1265},[1047,5278,1523],{"class":1271},[1047,5280,1526],{"class":1265},[947,5282,4233,5283,5287],{},[1022,5284,5285],{"href":276},[1044,5286,4685],{}," component automatically handles:",[959,5289,5290,5297,5300,5310],{},[962,5291,5292,5293],{},"Form submission when pressing ",[5294,5295],"kbd",{"value":5296},"enter",[962,5298,5299],{},"Auto-resizing as you type",[962,5301,5302,5303,5306,5307],{},"A loading state when ",[1044,5304,5305],{},"status"," is set to ",[1044,5308,5309],{},"streaming",[962,5311,5312],{},"Focus management and keyboard shortcuts",[951,5314,5316],{"id":5315},"creating-the-chat-page","Creating the chat page",[947,5318,5319,5320,5327,5328,5335],{},"The chat page is where the actual conversation happens. It integrates the AI SDK's ",[1022,5321,5324],{"href":5322,"rel":5323},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/chat",[1026],[1044,5325,5326],{},"Chat"," class and ",[1022,5329,5332],{"href":5330,"rel":5331},"https://ai-sdk.dev/docs/reference/ai-sdk-ui/default-chat-transport",[1026],[1044,5333,5334],{},"DefaultChatTransport"," for real-time streaming.",[1238,5337,5338],{},[1656,5339,5340],{},[1037,5341,5345],{"className":1510,"code":5342,"filename":5343,"highlights":5344,"language":34,"meta":1042,"style":1042},"\u003Cscript setup lang=\"ts\">\nimport { DefaultChatTransport } from 'ai'\nimport { Chat } from '@ai-sdk/vue'\n\nconst route = useRoute()\nconst toast = useToast()\n\n// Fetch existing chat data\nconst { data: chatData } = await useFetch(`/api/chats/${route.params.id}`)\n\nif (!chatData.value) {\n  throw createError({ statusCode: 404, statusMessage: 'Chat not found', fatal: true })\n}\n\nconst input = ref('')\n\n// Initialize the Chat class from AI SDK\nconst chat = new Chat({\n  id: chatData.value.id,\n  messages: chatData.value.messages,\n  transport: new DefaultChatTransport({\n    api: `/api/chats/${chatData.value.id}`\n  }),\n  onData(dataPart) {\n    // Refresh the chat list when a title is generated\n    if (dataPart.type === 'data-chat-title') {\n      refreshNuxtData('chats')\n    }\n  },\n  onError(error) {\n    toast.add({\n      title: 'Error',\n      description: error.message,\n      color: 'error'\n    })\n  }\n})\n\nfunction handleSubmit(e: Event) {\n  e.preventDefault()\n  if (input.value.trim()) {\n    chat.sendMessage({ text: input.value })\n    input.value = ''\n  }\n}\n\n// Auto-generate response for first message\nonMounted(() => {\n  if (chatData.value?.messages.length === 1) {\n    chat.regenerate()\n  }\n})\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CUDashboardPanel :ui=\"{ body: 'p-0 sm:p-0' }\">\n    \u003Ctemplate #body>\n      \u003CUContainer class=\"min-h-dvh flex flex-col py-4 sm:py-6\">\n        \u003CUChatMessages\n          :messages=\"chat.messages\"\n          :status=\"chat.status\"\n          should-auto-scroll\n          class=\"flex-1\"\n        >\n          \u003Ctemplate #content=\"{ message }\">\n            \u003Ctemplate v-for=\"(part, index) in message.parts\" :key=\"`${message.id}-${part.type}-${index}`\">\n              \u003CMDC v-if=\"part.type === 'text' && message.role === 'assistant'\" :value=\"part.text\" :cache-key=\"`${message.id}-${index}`\" class=\"*:first:mt-0 *:last:mb-0\" />\n              \u003Cp v-else-if=\"part.type === 'text' && message.role === 'user'\" class=\"whitespace-pre-wrap\">{{ part.text }}\u003C/p>\n            \u003C/template>\n          \u003C/template>\n        \u003C/UChatMessages>\n\n        \u003CUChatPrompt\n          v-model=\"input\"\n          :error=\"chat.error\"\n          variant=\"subtle\"\n          class=\"sticky bottom-0\"\n          @submit=\"handleSubmit\"\n        >\n          \u003CUChatPromptSubmit\n            :status=\"chat.status\"\n            color=\"neutral\"\n            @stop=\"chat.stop()\"\n            @reload=\"chat.regenerate()\"\n          />\n        \u003C/UChatPrompt>\n      \u003C/UContainer>\n    \u003C/template>\n  \u003C/UDashboardPanel>\n\u003C/template>\n","app/pages/chat/[id].vue",[1067,1281,1296,1446,2235,2248,2278,2284,2289,2321,2337,2355,2371,2379,3329,3368,3374,3379,3385,3405,3433,3449,3468],[1044,5346,5347,5367,5387,5408,5413,5427,5441,5445,5450,5498,5502,5521,5564,5568,5572,5588,5592,5597,5614,5634,5653,5669,5696,5705,5720,5726,5753,5769,5774,5779,5794,5809,5825,5842,5856,5863,5868,5875,5880,5902,5914,5934,5962,5976,5980,5984,5988,5993,6006,6034,6045,6049,6055,6063,6067,6075,6093,6105,6124,6131,6145,6158,6163,6177,6181,6206,6284,6341,6381,6390,6399,6407,6411,6417,6429,6443,6455,6468,6481,6485,6492,6505,6518,6532,6546,6551,6560,6569,6578,6587],{"__ignoreMap":1042},[1047,5348,5349,5351,5353,5355,5357,5359,5361,5363,5365],{"class":1049,"line":1050},[1047,5350,1520],{"class":1265},[1047,5352,4720],{"class":1271},[1047,5354,4723],{"class":1548},[1047,5356,4726],{"class":1548},[1047,5358,1552],{"class":1265},[1047,5360,1479],{"class":1265},[1047,5362,1244],{"class":1057},[1047,5364,1479],{"class":1265},[1047,5366,1526],{"class":1265},[1047,5368,5370,5372,5374,5377,5379,5381,5383,5385],{"class":5369,"line":1067},[1049,1530],[1047,5371,1668],{"class":1251},[1047,5373,1671],{"class":1265},[1047,5375,5376],{"class":1261}," DefaultChatTransport",[1047,5378,1693],{"class":1265},[1047,5380,1696],{"class":1251},[1047,5382,1352],{"class":1265},[1047,5384,2494],{"class":1057},[1047,5386,1316],{"class":1265},[1047,5388,5390,5392,5394,5397,5399,5401,5403,5406],{"class":5389,"line":1281},[1049,1530],[1047,5391,1668],{"class":1251},[1047,5393,1671],{"class":1265},[1047,5395,5396],{"class":1261}," Chat",[1047,5398,1693],{"class":1265},[1047,5400,1696],{"class":1251},[1047,5402,1352],{"class":1265},[1047,5404,5405],{"class":1057},"@ai-sdk/vue",[1047,5407,1316],{"class":1265},[1047,5409,5411],{"class":5410,"line":1296},[1049,1530],[1047,5412,1330],{"emptyLinePlaceholder":21},[1047,5414,5415,5417,5420,5422,5425],{"class":1049,"line":1308},[1047,5416,4741],{"class":1548},[1047,5418,5419],{"class":1261}," route ",[1047,5421,1552],{"class":1265},[1047,5423,5424],{"class":1070}," useRoute",[1047,5426,2629],{"class":1261},[1047,5428,5429,5431,5434,5436,5439],{"class":1049,"line":1319},[1047,5430,4741],{"class":1548},[1047,5432,5433],{"class":1261}," toast ",[1047,5435,1552],{"class":1265},[1047,5437,5438],{"class":1070}," useToast",[1047,5440,2629],{"class":1261},[1047,5442,5443],{"class":1049,"line":1327},[1047,5444,1330],{"emptyLinePlaceholder":21},[1047,5446,5447],{"class":1049,"line":1333},[1047,5448,5449],{"class":1431},"// Fetch existing chat data\n",[1047,5451,5452,5454,5456,5459,5461,5464,5466,5468,5470,5473,5475,5477,5480,5482,5485,5487,5490,5492,5494,5496],{"class":1049,"line":1344},[1047,5453,4741],{"class":1548},[1047,5455,1671],{"class":1265},[1047,5457,5458],{"class":1271}," data",[1047,5460,1275],{"class":1265},[1047,5462,5463],{"class":1261}," chatData ",[1047,5465,1449],{"class":1265},[1047,5467,2583],{"class":1265},[1047,5469,2586],{"class":1251},[1047,5471,5472],{"class":1070}," useFetch",[1047,5474,1262],{"class":1261},[1047,5476,3463],{"class":1265},[1047,5478,5479],{"class":1057},"/api/chats/",[1047,5481,4995],{"class":1265},[1047,5483,5484],{"class":1261},"route",[1047,5486,1769],{"class":1265},[1047,5488,5489],{"class":1261},"params",[1047,5491,1769],{"class":1265},[1047,5493,1978],{"class":1261},[1047,5495,5004],{"class":1265},[1047,5497,1452],{"class":1261},[1047,5499,5500],{"class":1049,"line":1360},[1047,5501,1330],{"emptyLinePlaceholder":21},[1047,5503,5504,5507,5509,5511,5514,5516,5519],{"class":1049,"line":1366},[1047,5505,5506],{"class":1251},"if",[1047,5508,1912],{"class":1261},[1047,5510,3319],{"class":1265},[1047,5512,5513],{"class":1261},"chatData",[1047,5515,1769],{"class":1265},[1047,5517,5518],{"class":1261},"value) ",[1047,5520,1266],{"class":1265},[1047,5522,5523,5526,5528,5530,5532,5534,5536,5538,5540,5542,5544,5546,5548,5550,5552,5555,5557,5560,5562],{"class":1049,"line":1371},[1047,5524,5525],{"class":1251},"  throw",[1047,5527,2859],{"class":1070},[1047,5529,1262],{"class":1271},[1047,5531,1826],{"class":1265},[1047,5533,3341],{"class":1271},[1047,5535,1275],{"class":1265},[1047,5537,3347],{"class":3346},[1047,5539,1677],{"class":1265},[1047,5541,3352],{"class":1271},[1047,5543,1275],{"class":1265},[1047,5545,1352],{"class":1265},[1047,5547,3359],{"class":1057},[1047,5549,1290],{"class":1265},[1047,5551,1677],{"class":1265},[1047,5553,5554],{"class":1271}," fatal",[1047,5556,1275],{"class":1265},[1047,5558,5559],{"class":1427}," true",[1047,5561,1693],{"class":1265},[1047,5563,1452],{"class":1271},[1047,5565,5566],{"class":1049,"line":1394},[1047,5567,5011],{"class":1265},[1047,5569,5570],{"class":1049,"line":1399},[1047,5571,1330],{"emptyLinePlaceholder":21},[1047,5573,5574,5576,5578,5580,5582,5584,5586],{"class":1049,"line":1409},[1047,5575,4741],{"class":1548},[1047,5577,4744],{"class":1261},[1047,5579,1552],{"class":1265},[1047,5581,4749],{"class":1070},[1047,5583,1262],{"class":1261},[1047,5585,4754],{"class":1265},[1047,5587,1452],{"class":1261},[1047,5589,5590],{"class":1049,"line":1419},[1047,5591,1330],{"emptyLinePlaceholder":21},[1047,5593,5594],{"class":1049,"line":1435},[1047,5595,5596],{"class":1431},"// Initialize the Chat class from AI SDK\n",[1047,5598,5599,5601,5604,5606,5608,5610,5612],{"class":1049,"line":1441},[1047,5600,4741],{"class":1548},[1047,5602,5603],{"class":1261}," chat ",[1047,5605,1552],{"class":1265},[1047,5607,1863],{"class":1265},[1047,5609,5396],{"class":1070},[1047,5611,1262],{"class":1261},[1047,5613,1266],{"class":1265},[1047,5615,5617,5619,5621,5624,5626,5628,5630,5632],{"class":5616,"line":1446},[1049,1530],[1047,5618,1759],{"class":1271},[1047,5620,1275],{"class":1265},[1047,5622,5623],{"class":1261}," chatData",[1047,5625,1769],{"class":1265},[1047,5627,4808],{"class":1261},[1047,5629,1769],{"class":1265},[1047,5631,1978],{"class":1261},[1047,5633,1293],{"class":1265},[1047,5635,5637,5639,5641,5643,5645,5647,5649,5651],{"class":5636,"line":2235},[1049,1530],[1047,5638,1919],{"class":1271},[1047,5640,1275],{"class":1265},[1047,5642,5623],{"class":1261},[1047,5644,1769],{"class":1265},[1047,5646,4808],{"class":1261},[1047,5648,1769],{"class":1265},[1047,5650,1957],{"class":1261},[1047,5652,1293],{"class":1265},[1047,5654,5656,5659,5661,5663,5665,5667],{"class":5655,"line":2248},[1049,1530],[1047,5657,5658],{"class":1271},"  transport",[1047,5660,1275],{"class":1265},[1047,5662,1863],{"class":1265},[1047,5664,5376],{"class":1070},[1047,5666,1262],{"class":1261},[1047,5668,1266],{"class":1265},[1047,5670,5672,5675,5677,5679,5681,5683,5685,5687,5689,5691,5693],{"class":5671,"line":2278},[1049,1530],[1047,5673,5674],{"class":1271},"    api",[1047,5676,1275],{"class":1265},[1047,5678,3457],{"class":1265},[1047,5680,5479],{"class":1057},[1047,5682,4995],{"class":1265},[1047,5684,5513],{"class":1261},[1047,5686,1769],{"class":1265},[1047,5688,4808],{"class":1261},[1047,5690,1769],{"class":1265},[1047,5692,1978],{"class":1261},[1047,5694,5695],{"class":1265},"}`\n",[1047,5697,5699,5701,5703],{"class":5698,"line":2284},[1049,1530],[1047,5700,2374],{"class":1265},[1047,5702,1843],{"class":1261},[1047,5704,1293],{"class":1265},[1047,5706,5708,5711,5713,5716,5718],{"class":5707,"line":2289},[1049,1530],[1047,5709,5710],{"class":1271},"  onData",[1047,5712,1262],{"class":1265},[1047,5714,5715],{"class":1903},"dataPart",[1047,5717,1843],{"class":1265},[1047,5719,1341],{"class":1265},[1047,5721,5723],{"class":5722,"line":2321},[1049,1530],[1047,5724,5725],{"class":1431},"    // Refresh the chat list when a title is generated\n",[1047,5727,5729,5732,5734,5736,5738,5741,5743,5745,5747,5749,5751],{"class":5728,"line":2337},[1049,1530],[1047,5730,5731],{"class":1251},"    if",[1047,5733,1912],{"class":1271},[1047,5735,5715],{"class":1261},[1047,5737,1769],{"class":1265},[1047,5739,5740],{"class":1261},"type",[1047,5742,3636],{"class":1265},[1047,5744,1352],{"class":1265},[1047,5746,3922],{"class":1057},[1047,5748,1290],{"class":1265},[1047,5750,3324],{"class":1271},[1047,5752,1266],{"class":1265},[1047,5754,5756,5759,5761,5763,5765,5767],{"class":5755,"line":2355},[1049,1530],[1047,5757,5758],{"class":1070},"      refreshNuxtData",[1047,5760,1262],{"class":1271},[1047,5762,1290],{"class":1265},[1047,5764,1748],{"class":1057},[1047,5766,1290],{"class":1265},[1047,5768,1452],{"class":1271},[1047,5770,5772],{"class":5771,"line":2371},[1049,1530],[1047,5773,1438],{"class":1265},[1047,5775,5777],{"class":5776,"line":2379},[1049,1530],[1047,5778,1363],{"class":1265},[1047,5780,5782,5785,5787,5790,5792],{"class":5781,"line":3329},[1049,1530],[1047,5783,5784],{"class":1271},"  onError",[1047,5786,1262],{"class":1265},[1047,5788,5789],{"class":1903},"error",[1047,5791,1843],{"class":1265},[1047,5793,1341],{"class":1265},[1047,5795,5797,5800,5802,5805,5807],{"class":5796,"line":3368},[1049,1530],[1047,5798,5799],{"class":1261},"    toast",[1047,5801,1769],{"class":1265},[1047,5803,5804],{"class":1070},"add",[1047,5806,1262],{"class":1271},[1047,5808,1266],{"class":1265},[1047,5810,5812,5815,5817,5819,5821,5823],{"class":5811,"line":3374},[1049,1530],[1047,5813,5814],{"class":1271},"      title",[1047,5816,1275],{"class":1265},[1047,5818,1352],{"class":1265},[1047,5820,477],{"class":1057},[1047,5822,1290],{"class":1265},[1047,5824,1293],{"class":1265},[1047,5826,5828,5831,5833,5836,5838,5840],{"class":5827,"line":3379},[1049,1530],[1047,5829,5830],{"class":1271},"      description",[1047,5832,1275],{"class":1265},[1047,5834,5835],{"class":1261}," error",[1047,5837,1769],{"class":1265},[1047,5839,4075],{"class":1261},[1047,5841,1293],{"class":1265},[1047,5843,5845,5848,5850,5852,5854],{"class":5844,"line":3385},[1049,1530],[1047,5846,5847],{"class":1271},"      color",[1047,5849,1275],{"class":1265},[1047,5851,1352],{"class":1265},[1047,5853,5789],{"class":1057},[1047,5855,1316],{"class":1265},[1047,5857,5859,5861],{"class":5858,"line":3405},[1049,1530],[1047,5860,3499],{"class":1265},[1047,5862,1452],{"class":1271},[1047,5864,5866],{"class":5865,"line":3433},[1049,1530],[1047,5867,3371],{"class":1265},[1047,5869,5871,5873],{"class":5870,"line":3449},[1049,1530],[1047,5872,1449],{"class":1265},[1047,5874,1452],{"class":1261},[1047,5876,5878],{"class":5877,"line":3468},[1049,1530],[1047,5879,1330],{"emptyLinePlaceholder":21},[1047,5881,5882,5885,5888,5890,5893,5895,5898,5900],{"class":1049,"line":3496},[1047,5883,5884],{"class":1548},"function",[1047,5886,5887],{"class":1070}," handleSubmit",[1047,5889,1262],{"class":1265},[1047,5891,5892],{"class":1903},"e",[1047,5894,1275],{"class":1265},[1047,5896,5897],{"class":1053}," Event",[1047,5899,1843],{"class":1265},[1047,5901,1341],{"class":1265},[1047,5903,5904,5907,5909,5912],{"class":1049,"line":3504},[1047,5905,5906],{"class":1261},"  e",[1047,5908,1769],{"class":1265},[1047,5910,5911],{"class":1070},"preventDefault",[1047,5913,2629],{"class":1271},[1047,5915,5916,5918,5920,5922,5924,5926,5928,5930,5932],{"class":1049,"line":3509},[1047,5917,3314],{"class":1251},[1047,5919,1912],{"class":1271},[1047,5921,4803],{"class":1261},[1047,5923,1769],{"class":1265},[1047,5925,4808],{"class":1261},[1047,5927,1769],{"class":1265},[1047,5929,4813],{"class":1070},[1047,5931,4816],{"class":1271},[1047,5933,1266],{"class":1265},[1047,5935,5936,5939,5941,5944,5946,5948,5950,5952,5954,5956,5958,5960],{"class":1049,"line":3575},[1047,5937,5938],{"class":1261},"    chat",[1047,5940,1769],{"class":1265},[1047,5942,5943],{"class":1070},"sendMessage",[1047,5945,1262],{"class":1271},[1047,5947,1826],{"class":1265},[1047,5949,1680],{"class":1271},[1047,5951,1275],{"class":1265},[1047,5953,4949],{"class":1261},[1047,5955,1769],{"class":1265},[1047,5957,4808],{"class":1261},[1047,5959,1693],{"class":1265},[1047,5961,1452],{"class":1271},[1047,5963,5964,5967,5969,5971,5973],{"class":1049,"line":3580},[1047,5965,5966],{"class":1261},"    input",[1047,5968,1769],{"class":1265},[1047,5970,4808],{"class":1261},[1047,5972,2583],{"class":1265},[1047,5974,5975],{"class":1265}," ''\n",[1047,5977,5978],{"class":1049,"line":3585},[1047,5979,3371],{"class":1265},[1047,5981,5982],{"class":1049,"line":3591},[1047,5983,5011],{"class":1265},[1047,5985,5986],{"class":1049,"line":3621},[1047,5987,1330],{"emptyLinePlaceholder":21},[1047,5989,5990],{"class":1049,"line":3663},[1047,5991,5992],{"class":1431},"// Auto-generate response for first message\n",[1047,5994,5995,5998,6000,6002,6004],{"class":1049,"line":3692},[1047,5996,5997],{"class":1070},"onMounted",[1047,5999,1262],{"class":1261},[1047,6001,1766],{"class":1265},[1047,6003,1786],{"class":1548},[1047,6005,1341],{"class":1265},[1047,6007,6008,6010,6012,6014,6016,6018,6020,6022,6024,6026,6028,6030,6032],{"class":1049,"line":3704},[1047,6009,3314],{"class":1251},[1047,6011,1912],{"class":1271},[1047,6013,5513],{"class":1261},[1047,6015,1769],{"class":1265},[1047,6017,4808],{"class":1261},[1047,6019,3631],{"class":1265},[1047,6021,1957],{"class":1261},[1047,6023,1769],{"class":1265},[1047,6025,3609],{"class":1261},[1047,6027,3636],{"class":1265},[1047,6029,3615],{"class":3346},[1047,6031,3324],{"class":1271},[1047,6033,1266],{"class":1265},[1047,6035,6036,6038,6040,6043],{"class":1049,"line":3720},[1047,6037,5938],{"class":1261},[1047,6039,1769],{"class":1265},[1047,6041,6042],{"class":1070},"regenerate",[1047,6044,2629],{"class":1271},[1047,6046,6047],{"class":1049,"line":3734},[1047,6048,3371],{"class":1265},[1047,6050,6051,6053],{"class":1049,"line":3741},[1047,6052,1449],{"class":1265},[1047,6054,1452],{"class":1261},[1047,6056,6057,6059,6061],{"class":1049,"line":3746},[1047,6058,1596],{"class":1265},[1047,6060,4720],{"class":1271},[1047,6062,1526],{"class":1265},[1047,6064,6065],{"class":1049,"line":3751},[1047,6066,1330],{"emptyLinePlaceholder":21},[1047,6068,6069,6071,6073],{"class":1049,"line":3757},[1047,6070,1520],{"class":1265},[1047,6072,1523],{"class":1271},[1047,6074,1526],{"class":1265},[1047,6076,6077,6079,6081,6083,6085,6087,6089,6091],{"class":1049,"line":3774},[1047,6078,1533],{"class":1265},[1047,6080,5038],{"class":1271},[1047,6082,5041],{"class":1548},[1047,6084,1552],{"class":1265},[1047,6086,1479],{"class":1265},[1047,6088,5048],{"class":1057},[1047,6090,1479],{"class":1265},[1047,6092,1526],{"class":1265},[1047,6094,6095,6097,6099,6101,6103],{"class":1049,"line":3796},[1047,6096,1542],{"class":1265},[1047,6098,1523],{"class":1271},[1047,6100,5061],{"class":1265},[1047,6102,5064],{"class":1548},[1047,6104,1526],{"class":1265},[1047,6106,6107,6109,6111,6113,6115,6117,6120,6122],{"class":1049,"line":3814},[1047,6108,1566],{"class":1265},[1047,6110,5073],{"class":1271},[1047,6112,5076],{"class":1548},[1047,6114,1552],{"class":1265},[1047,6116,1479],{"class":1265},[1047,6118,6119],{"class":1057},"min-h-dvh flex flex-col py-4 sm:py-6",[1047,6121,1479],{"class":1265},[1047,6123,1526],{"class":1265},[1047,6125,6126,6128],{"class":1049,"line":3822},[1047,6127,5092],{"class":1265},[1047,6129,6130],{"class":1271},"UChatMessages\n",[1047,6132,6133,6136,6138,6140,6143],{"class":1049,"line":3839},[1047,6134,6135],{"class":1548},"          :messages",[1047,6137,1552],{"class":1265},[1047,6139,1479],{"class":1265},[1047,6141,6142],{"class":1057},"chat.messages",[1047,6144,5149],{"class":1265},[1047,6146,6147,6149,6151,6153,6156],{"class":1049,"line":3858},[1047,6148,5155],{"class":1548},[1047,6150,1552],{"class":1265},[1047,6152,1479],{"class":1265},[1047,6154,6155],{"class":1057},"chat.status",[1047,6157,5149],{"class":1265},[1047,6159,6160],{"class":1049,"line":3866},[1047,6161,6162],{"class":1548},"          should-auto-scroll\n",[1047,6164,6165,6168,6170,6172,6175],{"class":1049,"line":3871},[1047,6166,6167],{"class":1548},"          class",[1047,6169,1552],{"class":1265},[1047,6171,1479],{"class":1265},[1047,6173,6174],{"class":1057},"flex-1",[1047,6176,5149],{"class":1265},[1047,6178,6179],{"class":1049,"line":3877},[1047,6180,5215],{"class":1265},[1047,6182,6183,6185,6187,6189,6191,6193,6195,6197,6200,6202,6204],{"class":1049,"line":3897},[1047,6184,5221],{"class":1265},[1047,6186,1523],{"class":1271},[1047,6188,5061],{"class":1265},[1047,6190,350],{"class":1548},[1047,6192,1552],{"class":1265},[1047,6194,1479],{"class":1265},[1047,6196,1826],{"class":1265},[1047,6198,6199],{"class":1261}," message ",[1047,6201,1449],{"class":1265},[1047,6203,1479],{"class":1265},[1047,6205,1526],{"class":1265},[1047,6207,6208,6211,6213,6216,6218,6220,6223,6225,6228,6231,6233,6235,6237,6239,6242,6245,6247,6250,6252,6254,6256,6258,6261,6263,6266,6268,6270,6272,6274,6276,6279,6282],{"class":1049,"line":3912},[1047,6209,6210],{"class":1265},"            \u003C",[1047,6212,1523],{"class":1271},[1047,6214,6215],{"class":1251}," v-for",[1047,6217,1552],{"class":1265},[1047,6219,1479],{"class":1265},[1047,6221,6222],{"class":1261},"(part",[1047,6224,1677],{"class":1265},[1047,6226,6227],{"class":1261}," index) ",[1047,6229,6230],{"class":1265},"in",[1047,6232,2578],{"class":1261},[1047,6234,1769],{"class":1265},[1047,6236,2159],{"class":1261},[1047,6238,1479],{"class":1265},[1047,6240,6241],{"class":1265}," :",[1047,6243,6244],{"class":1548},"key",[1047,6246,1552],{"class":1265},[1047,6248,6249],{"class":1265},"\"`${",[1047,6251,4075],{"class":1261},[1047,6253,1769],{"class":1265},[1047,6255,1978],{"class":1261},[1047,6257,1449],{"class":1265},[1047,6259,6260],{"class":1057},"-",[1047,6262,4995],{"class":1265},[1047,6264,6265],{"class":1261},"part",[1047,6267,1769],{"class":1265},[1047,6269,5740],{"class":1261},[1047,6271,1449],{"class":1265},[1047,6273,6260],{"class":1057},[1047,6275,4995],{"class":1265},[1047,6277,6278],{"class":1261},"index",[1047,6280,6281],{"class":1265},"}`\"",[1047,6283,1526],{"class":1265},[1047,6285,6286,6289,6292,6295,6297,6299,6302,6304,6307,6309,6311,6314,6316,6319,6321,6323,6326,6328,6330,6332,6334,6337,6339],{"class":1049,"line":3929},[1047,6287,6288],{"class":1265},"              \u003C",[1047,6290,6291],{"class":1271},"MDC",[1047,6293,6294],{"class":1548}," v-if",[1047,6296,1552],{"class":1265},[1047,6298,1479],{"class":1265},[1047,6300,6301],{"class":1057},"part.type === 'text' && message.role === 'assistant'",[1047,6303,1479],{"class":1265},[1047,6305,6306],{"class":1548}," :value",[1047,6308,1552],{"class":1265},[1047,6310,1479],{"class":1265},[1047,6312,6313],{"class":1057},"part.text",[1047,6315,1479],{"class":1265},[1047,6317,6318],{"class":1548}," :cache-key",[1047,6320,1552],{"class":1265},[1047,6322,1479],{"class":1265},[1047,6324,6325],{"class":1057},"`${message.id}-${index}`",[1047,6327,1479],{"class":1265},[1047,6329,5076],{"class":1548},[1047,6331,1552],{"class":1265},[1047,6333,1479],{"class":1265},[1047,6335,6336],{"class":1057},"*:first:mt-0 *:last:mb-0",[1047,6338,1479],{"class":1265},[1047,6340,1572],{"class":1265},[1047,6342,6343,6345,6347,6350,6352,6354,6357,6359,6361,6363,6365,6368,6370,6372,6375,6377,6379],{"class":1049,"line":3953},[1047,6344,6288],{"class":1265},[1047,6346,947],{"class":1271},[1047,6348,6349],{"class":1548}," v-else-if",[1047,6351,1552],{"class":1265},[1047,6353,1479],{"class":1265},[1047,6355,6356],{"class":1057},"part.type === 'text' && message.role === 'user'",[1047,6358,1479],{"class":1265},[1047,6360,5076],{"class":1548},[1047,6362,1552],{"class":1265},[1047,6364,1479],{"class":1265},[1047,6366,6367],{"class":1057},"whitespace-pre-wrap",[1047,6369,1479],{"class":1265},[1047,6371,2626],{"class":1265},[1047,6373,6374],{"class":1261},"{{ part.text }}",[1047,6376,1596],{"class":1265},[1047,6378,947],{"class":1271},[1047,6380,1526],{"class":1265},[1047,6382,6383,6386,6388],{"class":1049,"line":3964},[1047,6384,6385],{"class":1265},"            \u003C/",[1047,6387,1523],{"class":1271},[1047,6389,1526],{"class":1265},[1047,6391,6392,6395,6397],{"class":1049,"line":3972},[1047,6393,6394],{"class":1265},"          \u003C/",[1047,6396,1523],{"class":1271},[1047,6398,1526],{"class":1265},[1047,6400,6401,6403,6405],{"class":1049,"line":3978},[1047,6402,5118],{"class":1265},[1047,6404,4691],{"class":1271},[1047,6406,1526],{"class":1265},[1047,6408,6409],{"class":1049,"line":3983},[1047,6410,1330],{"emptyLinePlaceholder":21},[1047,6412,6413,6415],{"class":1049,"line":4006},[1047,6414,5092],{"class":1265},[1047,6416,5134],{"class":1271},[1047,6418,6419,6421,6423,6425,6427],{"class":1049,"line":4012},[1047,6420,5140],{"class":1548},[1047,6422,1552],{"class":1265},[1047,6424,1479],{"class":1265},[1047,6426,4803],{"class":1057},[1047,6428,5149],{"class":1265},[1047,6430,6431,6434,6436,6438,6441],{"class":1049,"line":4032},[1047,6432,6433],{"class":1548},"          :error",[1047,6435,1552],{"class":1265},[1047,6437,1479],{"class":1265},[1047,6439,6440],{"class":1057},"chat.error",[1047,6442,5149],{"class":1265},[1047,6444,6445,6447,6449,6451,6453],{"class":1049,"line":4038},[1047,6446,5170],{"class":1548},[1047,6448,1552],{"class":1265},[1047,6450,1479],{"class":1265},[1047,6452,5177],{"class":1057},[1047,6454,5149],{"class":1265},[1047,6456,6457,6459,6461,6463,6466],{"class":1049,"line":4084},[1047,6458,6167],{"class":1548},[1047,6460,1552],{"class":1265},[1047,6462,1479],{"class":1265},[1047,6464,6465],{"class":1057},"sticky bottom-0",[1047,6467,5149],{"class":1265},[1047,6469,6470,6472,6474,6476,6479],{"class":1049,"line":4100},[1047,6471,5200],{"class":1548},[1047,6473,1552],{"class":1265},[1047,6475,1479],{"class":1265},[1047,6477,6478],{"class":1057},"handleSubmit",[1047,6480,5149],{"class":1265},[1047,6482,6483],{"class":1049,"line":4133},[1047,6484,5215],{"class":1265},[1047,6486,6487,6489],{"class":1049,"line":4147},[1047,6488,5221],{"class":1265},[1047,6490,6491],{"class":1271},"UChatPromptSubmit\n",[1047,6493,6494,6497,6499,6501,6503],{"class":1049,"line":4155},[1047,6495,6496],{"class":1548},"            :status",[1047,6498,1552],{"class":1265},[1047,6500,1479],{"class":1265},[1047,6502,6155],{"class":1057},[1047,6504,5149],{"class":1265},[1047,6506,6507,6510,6512,6514,6516],{"class":1049,"line":4160},[1047,6508,6509],{"class":1548},"            color",[1047,6511,1552],{"class":1265},[1047,6513,1479],{"class":1265},[1047,6515,5234],{"class":1057},[1047,6517,5149],{"class":1265},[1047,6519,6520,6523,6525,6527,6530],{"class":1049,"line":4167},[1047,6521,6522],{"class":1548},"            @stop",[1047,6524,1552],{"class":1265},[1047,6526,1479],{"class":1265},[1047,6528,6529],{"class":1057},"chat.stop()",[1047,6531,5149],{"class":1265},[1047,6533,6534,6537,6539,6541,6544],{"class":1049,"line":4172},[1047,6535,6536],{"class":1548},"            @reload",[1047,6538,1552],{"class":1265},[1047,6540,1479],{"class":1265},[1047,6542,6543],{"class":1057},"chat.regenerate()",[1047,6545,5149],{"class":1265},[1047,6547,6548],{"class":1049,"line":4190},[1047,6549,6550],{"class":1265},"          />\n",[1047,6552,6554,6556,6558],{"class":1049,"line":6553},86,[1047,6555,5118],{"class":1265},[1047,6557,4685],{"class":1271},[1047,6559,1526],{"class":1265},[1047,6561,6563,6565,6567],{"class":1049,"line":6562},87,[1047,6564,5252],{"class":1265},[1047,6566,5073],{"class":1271},[1047,6568,1526],{"class":1265},[1047,6570,6572,6574,6576],{"class":1049,"line":6571},88,[1047,6573,1577],{"class":1265},[1047,6575,1523],{"class":1271},[1047,6577,1526],{"class":1265},[1047,6579,6581,6583,6585],{"class":1049,"line":6580},89,[1047,6582,1587],{"class":1265},[1047,6584,5038],{"class":1271},[1047,6586,1526],{"class":1265},[1047,6588,6590,6592,6594],{"class":1049,"line":6589},90,[1047,6591,1596],{"class":1265},[1047,6593,1523],{"class":1271},[1047,6595,1526],{"class":1265},[947,6597,6598],{},"Here's a breakdown of the key parts:",[947,6600,6601],{},[965,6602,6603],{},"The Chat Class",[947,6605,4233,6606,6611,6612,6614],{},[1022,6607,6609],{"href":5322,"rel":6608},[1026],[1044,6610,5326],{}," class from ",[1044,6613,5405],{}," manages the entire conversation state. It handles:",[959,6616,6617,6622,6637,6643,6648],{},[962,6618,6619,6620],{},"Message history with ",[1044,6621,6142],{},[962,6623,6624,6625,1912,6627,2824,6630,2824,6633,2824,6635,1843],{},"Connection status with ",[1044,6626,6155],{},[1044,6628,6629],{},"ready",[1044,6631,6632],{},"submitted",[1044,6634,5309],{},[1044,6636,5789],{},[962,6638,6639,6640],{},"Sending messages with ",[1044,6641,6642],{},"chat.sendMessage()",[962,6644,6645,6646],{},"Stopping generation with ",[1044,6647,6529],{},[962,6649,6650,6651],{},"Regenerating responses with ",[1044,6652,6543],{},[947,6654,4233,6655,6658,6659,6664,6665,6667],{},[1044,6656,6657],{},"onData"," callback receives ",[1022,6660,6663],{"href":6661,"rel":6662},"https://ai-sdk.dev/docs/ai-sdk-ui/streaming-data",[1026],"custom data events"," from the server (like ",[1044,6666,3922],{},"), allowing you to react to server-side events during streaming.",[947,6669,6670],{},[965,6671,6672],{},"UChatMessages Component",[947,6674,4233,6675,6679],{},[1022,6676,6677],{"href":266},[1044,6678,4691],{}," component is purpose-built for AI chatbots with:",[959,6681,6682,6685,6688,6691],{},[962,6683,6684],{},"Auto-scroll to bottom on load",[962,6686,6687],{},"Continuous scrolling as messages stream in",[962,6689,6690],{},"A loading indicator while the assistant processes",[962,6692,6693],{},"An \"Auto scroll\" button when scrolled up",[947,6695,6696],{},[965,6697,6698],{},"Rendering Markdown with MDC",[947,6700,6701,6702,6708,6709,6715,6716,6719],{},"AI models often respond with markdown formatting (code blocks, lists, bold text, etc.). We use the ",[1022,6703,6706],{"href":6704,"rel":6705},"https://github.com/nuxt-content/mdc#mdc",[1026],[1044,6707,6291],{}," component from ",[1022,6710,6713],{"href":6711,"rel":6712},"https://github.com/nuxt-content/mdc",[1026],[1044,6714,1301],{}," to render this content beautifully. The ",[1044,6717,6718],{},"getTextFromMessage"," utility extracts the text content from AI SDK v5 message parts.",[1626,6721,6722],{"to":830},[947,6723,6724],{},"Nuxt UI provides pre-styled prose components, so your markdown content will be automatically styled to match your theme.",[947,6726,6727],{},[965,6728,6729],{},"UChatPromptSubmit Component",[947,6731,4233,6732,6736],{},[1022,6733,6734],{"href":281},[1044,6735,5224],{}," component adapts based on the chat status:",[959,6738,6739,6742,6745],{},[962,6740,6741],{},"Shows a send button when ready",[962,6743,6744],{},"Shows a stop button while streaming",[962,6746,6747],{},"Shows a reload button after an error",[951,6749,6751],{"id":6750},"adding-chat-history","Adding chat history",[947,6753,6754],{},"This section adds a dropdown menu to list previous chats and navigate between them.",[1075,6756,6758],{"id":6757},"listing-chats-api","Listing chats API",[947,6760,6761],{},"First, create an endpoint to fetch all chats:",[1238,6763,6764],{},[1037,6765,6768],{"className":1242,"code":6766,"filename":6767,"language":1244,"meta":1042,"style":1042},"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",[1044,6769,6770,6788,6810,6829,6833,6851,6876,6903,6909],{"__ignoreMap":1042},[1047,6771,6772,6774,6776,6778,6780,6782,6784,6786],{"class":1049,"line":1050},[1047,6773,1668],{"class":1251},[1047,6775,1671],{"class":1265},[1047,6777,2458],{"class":1261},[1047,6779,1693],{"class":1265},[1047,6781,1696],{"class":1251},[1047,6783,1352],{"class":1265},[1047,6785,1075],{"class":1057},[1047,6787,1316],{"class":1265},[1047,6789,6790,6792,6794,6796,6798,6800,6802,6804,6806,6808],{"class":1049,"line":1067},[1047,6791,1668],{"class":1251},[1047,6793,1671],{"class":1265},[1047,6795,2401],{"class":1261},[1047,6797,1677],{"class":1265},[1047,6799,2509],{"class":1261},[1047,6801,1693],{"class":1265},[1047,6803,1696],{"class":1251},[1047,6805,1352],{"class":1265},[1047,6807,2518],{"class":1057},[1047,6809,1316],{"class":1265},[1047,6811,6812,6814,6816,6819,6821,6823,6825,6827],{"class":1049,"line":1281},[1047,6813,1668],{"class":1251},[1047,6815,1671],{"class":1265},[1047,6817,6818],{"class":1261}," desc",[1047,6820,1693],{"class":1265},[1047,6822,1696],{"class":1251},[1047,6824,1352],{"class":1265},[1047,6826,1721],{"class":1057},[1047,6828,1316],{"class":1265},[1047,6830,6831],{"class":1049,"line":1296},[1047,6832,1330],{"emptyLinePlaceholder":21},[1047,6834,6835,6837,6839,6841,6843,6845,6847,6849],{"class":1049,"line":1308},[1047,6836,1252],{"class":1251},[1047,6838,1255],{"class":1251},[1047,6840,2458],{"class":1070},[1047,6842,1262],{"class":1261},[1047,6844,2557],{"class":1548},[1047,6846,4570],{"class":1265},[1047,6848,1786],{"class":1548},[1047,6850,1341],{"class":1265},[1047,6852,6853,6855,6857,6859,6861,6863,6865,6867,6869,6872,6874],{"class":1049,"line":1319},[1047,6854,2800],{"class":1251},[1047,6856,2586],{"class":1251},[1047,6858,2401],{"class":1261},[1047,6860,1769],{"class":1265},[1047,6862,3243],{"class":1261},[1047,6864,1769],{"class":1265},[1047,6866,1748],{"class":1261},[1047,6868,1769],{"class":1265},[1047,6870,6871],{"class":1070},"findMany",[1047,6873,1262],{"class":1271},[1047,6875,1266],{"class":1265},[1047,6877,6878,6881,6883,6885,6887,6889,6891,6893,6895,6897,6899,6901],{"class":1049,"line":1327},[1047,6879,6880],{"class":1070},"    orderBy",[1047,6882,1275],{"class":1265},[1047,6884,4570],{"class":1265},[1047,6886,1786],{"class":1548},[1047,6888,6818],{"class":1070},[1047,6890,1262],{"class":1271},[1047,6892,2677],{"class":1261},[1047,6894,1769],{"class":1265},[1047,6896,1748],{"class":1261},[1047,6898,1769],{"class":1265},[1047,6900,4587],{"class":1261},[1047,6902,1452],{"class":1271},[1047,6904,6905,6907],{"class":1049,"line":1333},[1047,6906,2374],{"class":1265},[1047,6908,1452],{"class":1271},[1047,6910,6911,6913],{"class":1049,"line":1344},[1047,6912,1449],{"class":1265},[1047,6914,1452],{"class":1261},[1075,6916,6918],{"id":6917},"building-the-chats-history-dropdown","Building the chats history dropdown",[947,6920,6921,6922,6927,6928,6933,6934,6927,6941,6943],{},"The component uses ",[1022,6923,6924],{"href":436},[1044,6925,6926],{},"UDropdownMenu"," with a ",[1022,6929,6930],{"href":230},[1044,6931,6932],{},"UButton"," as trigger. Use ",[1022,6935,6938],{"href":6936,"rel":6937},"https://nuxt.com/docs/api/composables/use-fetch",[1026],[1044,6939,6940],{},"useFetch",[1044,6942,6244],{}," to fetch and cache the chat list:",[1238,6945,6946],{},[1037,6947,6950],{"className":1510,"code":6948,"filename":6949,"language":34,"meta":1042,"style":1042},"\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",[1044,6951,6952,6972,6984,6988,7018,7033,7047,7053,7057,7077,7082,7098,7114,7130,7154,7158,7183,7208,7230,7256,7262,7266,7274,7278,7286,7317,7324,7338,7352,7366,7378,7392,7397,7405],{"__ignoreMap":1042},[1047,6953,6954,6956,6958,6960,6962,6964,6966,6968,6970],{"class":1049,"line":1050},[1047,6955,1520],{"class":1265},[1047,6957,4720],{"class":1271},[1047,6959,4723],{"class":1548},[1047,6961,4726],{"class":1548},[1047,6963,1552],{"class":1265},[1047,6965,1479],{"class":1265},[1047,6967,1244],{"class":1057},[1047,6969,1479],{"class":1265},[1047,6971,1526],{"class":1265},[1047,6973,6974,6976,6978,6980,6982],{"class":1049,"line":1067},[1047,6975,4741],{"class":1548},[1047,6977,5419],{"class":1261},[1047,6979,1552],{"class":1265},[1047,6981,5424],{"class":1070},[1047,6983,2629],{"class":1261},[1047,6985,6986],{"class":1049,"line":1281},[1047,6987,1330],{"emptyLinePlaceholder":21},[1047,6989,6990,6992,6994,6996,6998,7000,7002,7004,7006,7008,7010,7012,7014,7016],{"class":1049,"line":1296},[1047,6991,4741],{"class":1548},[1047,6993,1671],{"class":1265},[1047,6995,5458],{"class":1271},[1047,6997,1275],{"class":1265},[1047,6999,1737],{"class":1261},[1047,7001,1449],{"class":1265},[1047,7003,2583],{"class":1265},[1047,7005,5472],{"class":1070},[1047,7007,1262],{"class":1261},[1047,7009,1290],{"class":1265},[1047,7011,4865],{"class":1057},[1047,7013,1290],{"class":1265},[1047,7015,1677],{"class":1265},[1047,7017,1341],{"class":1265},[1047,7019,7020,7023,7025,7027,7029,7031],{"class":1049,"line":1308},[1047,7021,7022],{"class":1271},"  key",[1047,7024,1275],{"class":1265},[1047,7026,1352],{"class":1265},[1047,7028,1748],{"class":1057},[1047,7030,1290],{"class":1265},[1047,7032,1293],{"class":1265},[1047,7034,7035,7038,7040,7042,7044],{"class":1049,"line":1319},[1047,7036,7037],{"class":1070},"  default",[1047,7039,1275],{"class":1265},[1047,7041,4570],{"class":1265},[1047,7043,1786],{"class":1548},[1047,7045,7046],{"class":1261}," []\n",[1047,7048,7049,7051],{"class":1049,"line":1327},[1047,7050,1449],{"class":1265},[1047,7052,1452],{"class":1261},[1047,7054,7055],{"class":1049,"line":1333},[1047,7056,1330],{"emptyLinePlaceholder":21},[1047,7058,7059,7061,7064,7066,7069,7071,7073,7075],{"class":1049,"line":1344},[1047,7060,4741],{"class":1548},[1047,7062,7063],{"class":1261}," items ",[1047,7065,1552],{"class":1265},[1047,7067,7068],{"class":1070}," computed",[1047,7070,1262],{"class":1261},[1047,7072,1766],{"class":1265},[1047,7074,1786],{"class":1548},[1047,7076,1278],{"class":1261},[1047,7078,7079],{"class":1049,"line":1360},[1047,7080,7081],{"class":1265},"  {\n",[1047,7083,7084,7087,7089,7091,7094,7096],{"class":1049,"line":1366},[1047,7085,7086],{"class":1271},"    label",[1047,7088,1275],{"class":1265},[1047,7090,1352],{"class":1265},[1047,7092,7093],{"class":1057},"New chat",[1047,7095,1290],{"class":1265},[1047,7097,1293],{"class":1265},[1047,7099,7100,7103,7105,7107,7110,7112],{"class":1049,"line":1371},[1047,7101,7102],{"class":1271},"    to",[1047,7104,1275],{"class":1265},[1047,7106,1352],{"class":1265},[1047,7108,7109],{"class":1057},"/",[1047,7111,1290],{"class":1265},[1047,7113,1293],{"class":1265},[1047,7115,7116,7119,7121,7123,7126,7128],{"class":1049,"line":1394},[1047,7117,7118],{"class":1271},"    icon",[1047,7120,1275],{"class":1265},[1047,7122,1352],{"class":1265},[1047,7124,7125],{"class":1057},"i-lucide-plus-square",[1047,7127,1290],{"class":1265},[1047,7129,1293],{"class":1265},[1047,7131,7132,7135,7137,7140,7142,7145,7148,7150,7152],{"class":1049,"line":1399},[1047,7133,7134],{"class":1271},"    active",[1047,7136,1275],{"class":1265},[1047,7138,7139],{"class":1261}," route",[1047,7141,1769],{"class":1265},[1047,7143,7144],{"class":1261},"name ",[1047,7146,7147],{"class":1265},"===",[1047,7149,1352],{"class":1265},[1047,7151,6278],{"class":1057},[1047,7153,1316],{"class":1265},[1047,7155,7156],{"class":1049,"line":1409},[1047,7157,1363],{"class":1265},[1047,7159,7160,7163,7165,7167,7169,7171,7173,7175,7177,7179,7181],{"class":1049,"line":1419},[1047,7161,7162],{"class":1265},"  ...",[1047,7164,1748],{"class":1261},[1047,7166,1769],{"class":1265},[1047,7168,4808],{"class":1261},[1047,7170,1769],{"class":1265},[1047,7172,4070],{"class":1070},[1047,7174,1262],{"class":1261},[1047,7176,262],{"class":1903},[1047,7178,1786],{"class":1548},[1047,7180,1912],{"class":1261},[1047,7182,1266],{"class":1265},[1047,7184,7185,7187,7189,7191,7193,7196,7199,7201,7204,7206],{"class":1049,"line":1435},[1047,7186,7086],{"class":1271},[1047,7188,1275],{"class":1265},[1047,7190,2750],{"class":1261},[1047,7192,1769],{"class":1265},[1047,7194,7195],{"class":1261},"title ",[1047,7197,7198],{"class":1265},"||",[1047,7200,1352],{"class":1265},[1047,7202,7203],{"class":1057},"Untitled",[1047,7205,1290],{"class":1265},[1047,7207,1293],{"class":1265},[1047,7209,7210,7212,7214,7216,7218,7220,7222,7224,7226,7228],{"class":1049,"line":1441},[1047,7211,7102],{"class":1271},[1047,7213,1275],{"class":1265},[1047,7215,3457],{"class":1265},[1047,7217,4992],{"class":1057},[1047,7219,4995],{"class":1265},[1047,7221,262],{"class":1261},[1047,7223,1769],{"class":1265},[1047,7225,1978],{"class":1261},[1047,7227,5004],{"class":1265},[1047,7229,1293],{"class":1265},[1047,7231,7232,7234,7236,7238,7240,7242,7244,7247,7249,7251,7253],{"class":1049,"line":1446},[1047,7233,7134],{"class":1271},[1047,7235,1275],{"class":1265},[1047,7237,7139],{"class":1261},[1047,7239,1769],{"class":1265},[1047,7241,5489],{"class":1261},[1047,7243,1769],{"class":1265},[1047,7245,7246],{"class":1261},"id ",[1047,7248,7147],{"class":1265},[1047,7250,2750],{"class":1261},[1047,7252,1769],{"class":1265},[1047,7254,7255],{"class":1261},"id\n",[1047,7257,7258,7260],{"class":1049,"line":2235},[1047,7259,2374],{"class":1265},[1047,7261,1933],{"class":1261},[1047,7263,7264],{"class":1049,"line":2248},[1047,7265,2281],{"class":1261},[1047,7267,7268,7270,7272],{"class":1049,"line":2278},[1047,7269,1596],{"class":1265},[1047,7271,4720],{"class":1271},[1047,7273,1526],{"class":1265},[1047,7275,7276],{"class":1049,"line":2284},[1047,7277,1330],{"emptyLinePlaceholder":21},[1047,7279,7280,7282,7284],{"class":1049,"line":2289},[1047,7281,1520],{"class":1265},[1047,7283,1523],{"class":1271},[1047,7285,1526],{"class":1265},[1047,7287,7288,7290,7292,7295,7297,7299,7302,7304,7306,7308,7310,7313,7315],{"class":1049,"line":2321},[1047,7289,1533],{"class":1265},[1047,7291,6926],{"class":1271},[1047,7293,7294],{"class":1548}," :items",[1047,7296,1552],{"class":1265},[1047,7298,1479],{"class":1265},[1047,7300,7301],{"class":1057},"items",[1047,7303,1479],{"class":1265},[1047,7305,5076],{"class":1548},[1047,7307,1552],{"class":1265},[1047,7309,1479],{"class":1265},[1047,7311,7312],{"class":1057},"m-2",[1047,7314,1479],{"class":1265},[1047,7316,1526],{"class":1265},[1047,7318,7319,7321],{"class":1049,"line":2337},[1047,7320,1542],{"class":1265},[1047,7322,7323],{"class":1271},"UButton\n",[1047,7325,7326,7329,7331,7333,7336],{"class":1049,"line":2355},[1047,7327,7328],{"class":1548},"      icon",[1047,7330,1552],{"class":1265},[1047,7332,1479],{"class":1265},[1047,7334,7335],{"class":1057},"i-lucide-messages-square",[1047,7337,5149],{"class":1265},[1047,7339,7340,7343,7345,7347,7350],{"class":1049,"line":2371},[1047,7341,7342],{"class":1548},"      variant",[1047,7344,1552],{"class":1265},[1047,7346,1479],{"class":1265},[1047,7348,7349],{"class":1057},"ghost",[1047,7351,5149],{"class":1265},[1047,7353,7354,7357,7359,7361,7364],{"class":1049,"line":2379},[1047,7355,7356],{"class":1548},"      label",[1047,7358,1552],{"class":1265},[1047,7360,1479],{"class":1265},[1047,7362,7363],{"class":1057},"Chats History",[1047,7365,5149],{"class":1265},[1047,7367,7368,7370,7372,7374,7376],{"class":1049,"line":3329},[1047,7369,5847],{"class":1548},[1047,7371,1552],{"class":1265},[1047,7373,1479],{"class":1265},[1047,7375,5234],{"class":1057},[1047,7377,5149],{"class":1265},[1047,7379,7380,7383,7385,7387,7390],{"class":1049,"line":3368},[1047,7381,7382],{"class":1548},"      class",[1047,7384,1552],{"class":1265},[1047,7386,1479],{"class":1265},[1047,7388,7389],{"class":1057},"w-fit",[1047,7391,5149],{"class":1265},[1047,7393,7394],{"class":1049,"line":3374},[1047,7395,7396],{"class":1265},"    />\n",[1047,7398,7399,7401,7403],{"class":1049,"line":3379},[1047,7400,1587],{"class":1265},[1047,7402,6926],{"class":1271},[1047,7404,1526],{"class":1265},[1047,7406,7407,7409,7411],{"class":1049,"line":3385},[1047,7408,1596],{"class":1265},[1047,7410,1523],{"class":1271},[1047,7412,1526],{"class":1265},[951,7414,7416],{"id":7415},"integrating-history-in-the-home-page","Integrating history in the home page",[1238,7418,7419],{},[1656,7420,7421],{},[1037,7422,7425],{"className":1510,"code":7423,"filename":4710,"highlights":7424,"language":34,"meta":1042,"style":1042},"\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",[2371,2379,3329],[1044,7426,7427,7447,7463,7479,7483,7495,7517,7521,7533,7537,7541,7565,7579,7587,7595,7609,7645,7649,7653,7659,7663,7667,7689,7693,7701,7705,7713,7731,7745,7755,7764,7776,7794,7812,7816,7824,7828,7834,7846,7858,7870,7882,7894,7898,7916,7924,7932,7940,7948],{"__ignoreMap":1042},[1047,7428,7429,7431,7433,7435,7437,7439,7441,7443,7445],{"class":1049,"line":1050},[1047,7430,1520],{"class":1265},[1047,7432,4720],{"class":1271},[1047,7434,4723],{"class":1548},[1047,7436,4726],{"class":1548},[1047,7438,1552],{"class":1265},[1047,7440,1479],{"class":1265},[1047,7442,1244],{"class":1057},[1047,7444,1479],{"class":1265},[1047,7446,1526],{"class":1265},[1047,7448,7449,7451,7453,7455,7457,7459,7461],{"class":1049,"line":1067},[1047,7450,4741],{"class":1548},[1047,7452,4744],{"class":1261},[1047,7454,1552],{"class":1265},[1047,7456,4749],{"class":1070},[1047,7458,1262],{"class":1261},[1047,7460,4754],{"class":1265},[1047,7462,1452],{"class":1261},[1047,7464,7465,7467,7469,7471,7473,7475,7477],{"class":1049,"line":1281},[1047,7466,4741],{"class":1548},[1047,7468,4763],{"class":1261},[1047,7470,1552],{"class":1265},[1047,7472,4749],{"class":1070},[1047,7474,1262],{"class":1261},[1047,7476,4772],{"class":1427},[1047,7478,1452],{"class":1261},[1047,7480,7481],{"class":1049,"line":1296},[1047,7482,1330],{"emptyLinePlaceholder":21},[1047,7484,7485,7487,7489,7491,7493],{"class":1049,"line":1308},[1047,7486,2557],{"class":1548},[1047,7488,4785],{"class":1548},[1047,7490,4788],{"class":1070},[1047,7492,1766],{"class":1265},[1047,7494,1341],{"class":1265},[1047,7496,7497,7499,7501,7503,7505,7507,7509,7511,7513,7515],{"class":1049,"line":1319},[1047,7498,3314],{"class":1251},[1047,7500,1912],{"class":1271},[1047,7502,3319],{"class":1265},[1047,7504,4803],{"class":1261},[1047,7506,1769],{"class":1265},[1047,7508,4808],{"class":1261},[1047,7510,1769],{"class":1265},[1047,7512,4813],{"class":1070},[1047,7514,4816],{"class":1271},[1047,7516,4819],{"class":1251},[1047,7518,7519],{"class":1049,"line":1327},[1047,7520,1330],{"emptyLinePlaceholder":21},[1047,7522,7523,7525,7527,7529,7531],{"class":1049,"line":1333},[1047,7524,4828],{"class":1261},[1047,7526,1769],{"class":1265},[1047,7528,4808],{"class":1261},[1047,7530,2583],{"class":1265},[1047,7532,3961],{"class":1427},[1047,7534,7535],{"class":1049,"line":1344},[1047,7536,1330],{"emptyLinePlaceholder":21},[1047,7538,7539],{"class":1049,"line":1360},[1047,7540,4845],{"class":1431},[1047,7542,7543,7545,7547,7549,7551,7553,7555,7557,7559,7561,7563],{"class":1049,"line":1366},[1047,7544,2573],{"class":1548},[1047,7546,2750],{"class":1261},[1047,7548,2583],{"class":1265},[1047,7550,2586],{"class":1251},[1047,7552,4858],{"class":1070},[1047,7554,1262],{"class":1271},[1047,7556,1290],{"class":1265},[1047,7558,4865],{"class":1057},[1047,7560,1290],{"class":1265},[1047,7562,1677],{"class":1265},[1047,7564,1341],{"class":1265},[1047,7566,7567,7569,7571,7573,7575,7577],{"class":1049,"line":1371},[1047,7568,4876],{"class":1271},[1047,7570,1275],{"class":1265},[1047,7572,1352],{"class":1265},[1047,7574,4883],{"class":1057},[1047,7576,1290],{"class":1265},[1047,7578,1293],{"class":1265},[1047,7580,7581,7583,7585],{"class":1049,"line":1394},[1047,7582,4892],{"class":1271},[1047,7584,1275],{"class":1265},[1047,7586,1341],{"class":1265},[1047,7588,7589,7591,7593],{"class":1049,"line":1399},[1047,7590,4901],{"class":1271},[1047,7592,1275],{"class":1265},[1047,7594,1341],{"class":1265},[1047,7596,7597,7599,7601,7603,7605,7607],{"class":1049,"line":1409},[1047,7598,4103],{"class":1271},[1047,7600,1275],{"class":1265},[1047,7602,1352],{"class":1265},[1047,7604,2108],{"class":1057},[1047,7606,1290],{"class":1265},[1047,7608,1293],{"class":1265},[1047,7610,7611,7613,7615,7617,7619,7621,7623,7625,7627,7629,7631,7633,7635,7637,7639,7641,7643],{"class":1049,"line":1419},[1047,7612,4136],{"class":1271},[1047,7614,1275],{"class":1265},[1047,7616,1379],{"class":1271},[1047,7618,1826],{"class":1265},[1047,7620,2480],{"class":1271},[1047,7622,1275],{"class":1265},[1047,7624,1352],{"class":1265},[1047,7626,4938],{"class":1057},[1047,7628,1290],{"class":1265},[1047,7630,1677],{"class":1265},[1047,7632,1680],{"class":1271},[1047,7634,1275],{"class":1265},[1047,7636,4949],{"class":1261},[1047,7638,1769],{"class":1265},[1047,7640,4808],{"class":1261},[1047,7642,1693],{"class":1265},[1047,7644,3618],{"class":1271},[1047,7646,7647],{"class":1049,"line":1435},[1047,7648,3975],{"class":1265},[1047,7650,7651],{"class":1049,"line":1441},[1047,7652,1438],{"class":1265},[1047,7654,7655,7657],{"class":1049,"line":1446},[1047,7656,2374],{"class":1265},[1047,7658,1452],{"class":1271},[1047,7660,7661],{"class":1049,"line":2235},[1047,7662,1330],{"emptyLinePlaceholder":21},[1047,7664,7665],{"class":1049,"line":2248},[1047,7666,4980],{"class":1431},[1047,7668,7669,7671,7673,7675,7677,7679,7681,7683,7685,7687],{"class":1049,"line":2278},[1047,7670,4985],{"class":1070},[1047,7672,1262],{"class":1271},[1047,7674,3463],{"class":1265},[1047,7676,4992],{"class":1057},[1047,7678,4995],{"class":1265},[1047,7680,262],{"class":1261},[1047,7682,1769],{"class":1265},[1047,7684,1978],{"class":1261},[1047,7686,5004],{"class":1265},[1047,7688,1452],{"class":1271},[1047,7690,7691],{"class":1049,"line":2284},[1047,7692,5011],{"class":1265},[1047,7694,7695,7697,7699],{"class":1049,"line":2289},[1047,7696,1596],{"class":1265},[1047,7698,4720],{"class":1271},[1047,7700,1526],{"class":1265},[1047,7702,7703],{"class":1049,"line":2321},[1047,7704,1330],{"emptyLinePlaceholder":21},[1047,7706,7707,7709,7711],{"class":1049,"line":2337},[1047,7708,1520],{"class":1265},[1047,7710,1523],{"class":1271},[1047,7712,1526],{"class":1265},[1047,7714,7715,7717,7719,7721,7723,7725,7727,7729],{"class":1049,"line":2355},[1047,7716,1533],{"class":1265},[1047,7718,5038],{"class":1271},[1047,7720,5041],{"class":1548},[1047,7722,1552],{"class":1265},[1047,7724,1479],{"class":1265},[1047,7726,5048],{"class":1057},[1047,7728,1479],{"class":1265},[1047,7730,1526],{"class":1265},[1047,7732,7734,7736,7738,7740,7743],{"class":7733,"line":2371},[1049,1530],[1047,7735,1542],{"class":1265},[1047,7737,1523],{"class":1271},[1047,7739,5061],{"class":1265},[1047,7741,7742],{"class":1548},"header",[1047,7744,1526],{"class":1265},[1047,7746,7748,7750,7753],{"class":7747,"line":2379},[1049,1530],[1047,7749,1566],{"class":1265},[1047,7751,7752],{"class":1271},"ChatsHistory",[1047,7754,1572],{"class":1265},[1047,7756,7758,7760,7762],{"class":7757,"line":3329},[1049,1530],[1047,7759,1577],{"class":1265},[1047,7761,1523],{"class":1271},[1047,7763,1526],{"class":1265},[1047,7765,7766,7768,7770,7772,7774],{"class":1049,"line":3368},[1047,7767,1542],{"class":1265},[1047,7769,1523],{"class":1271},[1047,7771,5061],{"class":1265},[1047,7773,5064],{"class":1548},[1047,7775,1526],{"class":1265},[1047,7777,7778,7780,7782,7784,7786,7788,7790,7792],{"class":1049,"line":3374},[1047,7779,1566],{"class":1265},[1047,7781,5073],{"class":1271},[1047,7783,5076],{"class":1548},[1047,7785,1552],{"class":1265},[1047,7787,1479],{"class":1265},[1047,7789,5083],{"class":1057},[1047,7791,1479],{"class":1265},[1047,7793,1526],{"class":1265},[1047,7795,7796,7798,7800,7802,7804,7806,7808,7810],{"class":1049,"line":3379},[1047,7797,5092],{"class":1265},[1047,7799,5095],{"class":1271},[1047,7801,5076],{"class":1548},[1047,7803,1552],{"class":1265},[1047,7805,1479],{"class":1265},[1047,7807,5104],{"class":1057},[1047,7809,1479],{"class":1265},[1047,7811,1526],{"class":1265},[1047,7813,7814],{"class":1049,"line":3385},[1047,7815,5113],{"class":1261},[1047,7817,7818,7820,7822],{"class":1049,"line":3405},[1047,7819,5118],{"class":1265},[1047,7821,5095],{"class":1271},[1047,7823,1526],{"class":1265},[1047,7825,7826],{"class":1049,"line":3433},[1047,7827,1330],{"emptyLinePlaceholder":21},[1047,7829,7830,7832],{"class":1049,"line":3449},[1047,7831,5092],{"class":1265},[1047,7833,5134],{"class":1271},[1047,7835,7836,7838,7840,7842,7844],{"class":1049,"line":3468},[1047,7837,5140],{"class":1548},[1047,7839,1552],{"class":1265},[1047,7841,1479],{"class":1265},[1047,7843,4803],{"class":1057},[1047,7845,5149],{"class":1265},[1047,7847,7848,7850,7852,7854,7856],{"class":1049,"line":3496},[1047,7849,5155],{"class":1548},[1047,7851,1552],{"class":1265},[1047,7853,1479],{"class":1265},[1047,7855,5162],{"class":1057},[1047,7857,5149],{"class":1265},[1047,7859,7860,7862,7864,7866,7868],{"class":1049,"line":3504},[1047,7861,5170],{"class":1548},[1047,7863,1552],{"class":1265},[1047,7865,1479],{"class":1265},[1047,7867,5177],{"class":1057},[1047,7869,5149],{"class":1265},[1047,7871,7872,7874,7876,7878,7880],{"class":1049,"line":3509},[1047,7873,5185],{"class":1548},[1047,7875,1552],{"class":1265},[1047,7877,1479],{"class":1265},[1047,7879,5192],{"class":1057},[1047,7881,5149],{"class":1265},[1047,7883,7884,7886,7888,7890,7892],{"class":1049,"line":3575},[1047,7885,5200],{"class":1548},[1047,7887,1552],{"class":1265},[1047,7889,1479],{"class":1265},[1047,7891,5207],{"class":1057},[1047,7893,5149],{"class":1265},[1047,7895,7896],{"class":1049,"line":3580},[1047,7897,5215],{"class":1265},[1047,7899,7900,7902,7904,7906,7908,7910,7912,7914],{"class":1049,"line":3585},[1047,7901,5221],{"class":1265},[1047,7903,5224],{"class":1271},[1047,7905,5227],{"class":1548},[1047,7907,1552],{"class":1265},[1047,7909,1479],{"class":1265},[1047,7911,5234],{"class":1057},[1047,7913,1479],{"class":1265},[1047,7915,1572],{"class":1265},[1047,7917,7918,7920,7922],{"class":1049,"line":3591},[1047,7919,5118],{"class":1265},[1047,7921,4685],{"class":1271},[1047,7923,1526],{"class":1265},[1047,7925,7926,7928,7930],{"class":1049,"line":3621},[1047,7927,5252],{"class":1265},[1047,7929,5073],{"class":1271},[1047,7931,1526],{"class":1265},[1047,7933,7934,7936,7938],{"class":1049,"line":3663},[1047,7935,1577],{"class":1265},[1047,7937,1523],{"class":1271},[1047,7939,1526],{"class":1265},[1047,7941,7942,7944,7946],{"class":1049,"line":3692},[1047,7943,1587],{"class":1265},[1047,7945,5038],{"class":1271},[1047,7947,1526],{"class":1265},[1047,7949,7950,7952,7954],{"class":1049,"line":3704},[1047,7951,1596],{"class":1265},[1047,7953,1523],{"class":1271},[1047,7955,1526],{"class":1265},[951,7957,7959],{"id":7958},"integrating-history-in-the-chat-page","Integrating history in the chat page",[1238,7961,7962],{},[1656,7963,7964],{},[1037,7965,7968],{"className":1510,"code":7966,"filename":5343,"highlights":7967,"language":34,"meta":1042,"style":1042},"\u003Cscript setup lang=\"ts\">\nimport { DefaultChatTransport } from 'ai'\nimport { Chat } from '@ai-sdk/vue'\n\nconst route = useRoute()\nconst toast = useToast()\n\n// Fetch existing chat data\nconst { data: chatData } = await useFetch(`/api/chats/${route.params.id}`)\n\nif (!chatData.value) {\n  throw createError({ statusCode: 404, statusMessage: 'Chat not found', fatal: true })\n}\n\nconst input = ref('')\n\n// Initialize the Chat class from AI SDK\nconst chat = new Chat({\n  id: chatData.value.id,\n  messages: chatData.value.messages,\n  transport: new DefaultChatTransport({\n    api: `/api/chats/${chatData.value.id}`\n  }),\n  onData(dataPart) {\n    // Refresh the chat list when a title is generated\n    if (dataPart.type === 'data-chat-title') {\n      refreshNuxtData('chats')\n    }\n  },\n  onError(error) {\n    toast.add({\n      title: 'Error',\n      description: error.message,\n      color: 'error'\n    })\n  }\n})\n\nfunction handleSubmit(e: Event) {\n  e.preventDefault()\n  if (input.value.trim()) {\n    chat.sendMessage({ text: input.value })\n    input.value = ''\n  }\n}\n\n// Auto-generate response for first message\nonMounted(() => {\n  if (chatData.value?.messages.length === 1) {\n    chat.regenerate()\n  }\n})\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CUDashboardPanel :ui=\"{ body: 'p-0 sm:p-0' }\">\n    \u003Ctemplate #header>\n      \u003CChatsHistory />\n    \u003C/template>\n    \u003Ctemplate #body>\n      \u003CUContainer class=\"min-h-dvh flex flex-col py-4 sm:py-6\">\n        \u003CUChatMessages\n          :messages=\"chat.messages\"\n          :status=\"chat.status\"\n          should-auto-scroll\n          class=\"flex-1\"\n        >\n          \u003Ctemplate #content=\"{ message }\">\n            \u003Ctemplate v-for=\"(part, index) in message.parts\" :key=\"`${message.id}-${part.type}-${index}`\">\n              \u003CMDC v-if=\"part.type === 'text' && message.role === 'assistant'\" :value=\"part.text\" :cache-key=\"`${message.id}-${index}`\" class=\"*:first:mt-0 *:last:mb-0\" />\n              \u003Cp v-else-if=\"part.type === 'text' && message.role === 'user'\" class=\"whitespace-pre-wrap\">{{ part.text }}\u003C/p>\n            \u003C/template>\n          \u003C/template>\n        \u003C/UChatMessages>\n\n        \u003CUChatPrompt\n          v-model=\"input\"\n          :error=\"chat.error\"\n          variant=\"subtle\"\n          class=\"sticky bottom-0\"\n          @submit=\"handleSubmit\"\n        >\n          \u003CUChatPromptSubmit\n            :status=\"chat.status\"\n            color=\"neutral\"\n            @stop=\"chat.stop()\"\n            @reload=\"chat.regenerate()\"\n          />\n        \u003C/UChatPrompt>\n      \u003C/UContainer>\n    \u003C/template>\n  \u003C/UDashboardPanel>\n\u003C/template>\n",[3814,3822,3839],[1044,7969,7970,7990,8008,8026,8030,8042,8054,8058,8062,8104,8108,8124,8164,8168,8172,8188,8192,8196,8212,8230,8248,8262,8286,8294,8306,8310,8334,8348,8352,8356,8368,8380,8394,8408,8420,8426,8430,8436,8440,8458,8468,8488,8514,8526,8530,8534,8538,8542,8554,8582,8592,8596,8602,8610,8614,8622,8640,8652,8661,8670,8683,8701,8707,8719,8731,8735,8747,8751,8775,8841,8889,8925,8933,8941,8949,8953,8959,8971,8983,8995,9007,9019,9023,9029,9041,9053,9065,9077,9081,9089,9097,9106,9115],{"__ignoreMap":1042},[1047,7971,7972,7974,7976,7978,7980,7982,7984,7986,7988],{"class":1049,"line":1050},[1047,7973,1520],{"class":1265},[1047,7975,4720],{"class":1271},[1047,7977,4723],{"class":1548},[1047,7979,4726],{"class":1548},[1047,7981,1552],{"class":1265},[1047,7983,1479],{"class":1265},[1047,7985,1244],{"class":1057},[1047,7987,1479],{"class":1265},[1047,7989,1526],{"class":1265},[1047,7991,7992,7994,7996,7998,8000,8002,8004,8006],{"class":1049,"line":1067},[1047,7993,1668],{"class":1251},[1047,7995,1671],{"class":1265},[1047,7997,5376],{"class":1261},[1047,7999,1693],{"class":1265},[1047,8001,1696],{"class":1251},[1047,8003,1352],{"class":1265},[1047,8005,2494],{"class":1057},[1047,8007,1316],{"class":1265},[1047,8009,8010,8012,8014,8016,8018,8020,8022,8024],{"class":1049,"line":1281},[1047,8011,1668],{"class":1251},[1047,8013,1671],{"class":1265},[1047,8015,5396],{"class":1261},[1047,8017,1693],{"class":1265},[1047,8019,1696],{"class":1251},[1047,8021,1352],{"class":1265},[1047,8023,5405],{"class":1057},[1047,8025,1316],{"class":1265},[1047,8027,8028],{"class":1049,"line":1296},[1047,8029,1330],{"emptyLinePlaceholder":21},[1047,8031,8032,8034,8036,8038,8040],{"class":1049,"line":1308},[1047,8033,4741],{"class":1548},[1047,8035,5419],{"class":1261},[1047,8037,1552],{"class":1265},[1047,8039,5424],{"class":1070},[1047,8041,2629],{"class":1261},[1047,8043,8044,8046,8048,8050,8052],{"class":1049,"line":1319},[1047,8045,4741],{"class":1548},[1047,8047,5433],{"class":1261},[1047,8049,1552],{"class":1265},[1047,8051,5438],{"class":1070},[1047,8053,2629],{"class":1261},[1047,8055,8056],{"class":1049,"line":1327},[1047,8057,1330],{"emptyLinePlaceholder":21},[1047,8059,8060],{"class":1049,"line":1333},[1047,8061,5449],{"class":1431},[1047,8063,8064,8066,8068,8070,8072,8074,8076,8078,8080,8082,8084,8086,8088,8090,8092,8094,8096,8098,8100,8102],{"class":1049,"line":1344},[1047,8065,4741],{"class":1548},[1047,8067,1671],{"class":1265},[1047,8069,5458],{"class":1271},[1047,8071,1275],{"class":1265},[1047,8073,5463],{"class":1261},[1047,8075,1449],{"class":1265},[1047,8077,2583],{"class":1265},[1047,8079,2586],{"class":1251},[1047,8081,5472],{"class":1070},[1047,8083,1262],{"class":1261},[1047,8085,3463],{"class":1265},[1047,8087,5479],{"class":1057},[1047,8089,4995],{"class":1265},[1047,8091,5484],{"class":1261},[1047,8093,1769],{"class":1265},[1047,8095,5489],{"class":1261},[1047,8097,1769],{"class":1265},[1047,8099,1978],{"class":1261},[1047,8101,5004],{"class":1265},[1047,8103,1452],{"class":1261},[1047,8105,8106],{"class":1049,"line":1360},[1047,8107,1330],{"emptyLinePlaceholder":21},[1047,8109,8110,8112,8114,8116,8118,8120,8122],{"class":1049,"line":1366},[1047,8111,5506],{"class":1251},[1047,8113,1912],{"class":1261},[1047,8115,3319],{"class":1265},[1047,8117,5513],{"class":1261},[1047,8119,1769],{"class":1265},[1047,8121,5518],{"class":1261},[1047,8123,1266],{"class":1265},[1047,8125,8126,8128,8130,8132,8134,8136,8138,8140,8142,8144,8146,8148,8150,8152,8154,8156,8158,8160,8162],{"class":1049,"line":1371},[1047,8127,5525],{"class":1251},[1047,8129,2859],{"class":1070},[1047,8131,1262],{"class":1271},[1047,8133,1826],{"class":1265},[1047,8135,3341],{"class":1271},[1047,8137,1275],{"class":1265},[1047,8139,3347],{"class":3346},[1047,8141,1677],{"class":1265},[1047,8143,3352],{"class":1271},[1047,8145,1275],{"class":1265},[1047,8147,1352],{"class":1265},[1047,8149,3359],{"class":1057},[1047,8151,1290],{"class":1265},[1047,8153,1677],{"class":1265},[1047,8155,5554],{"class":1271},[1047,8157,1275],{"class":1265},[1047,8159,5559],{"class":1427},[1047,8161,1693],{"class":1265},[1047,8163,1452],{"class":1271},[1047,8165,8166],{"class":1049,"line":1394},[1047,8167,5011],{"class":1265},[1047,8169,8170],{"class":1049,"line":1399},[1047,8171,1330],{"emptyLinePlaceholder":21},[1047,8173,8174,8176,8178,8180,8182,8184,8186],{"class":1049,"line":1409},[1047,8175,4741],{"class":1548},[1047,8177,4744],{"class":1261},[1047,8179,1552],{"class":1265},[1047,8181,4749],{"class":1070},[1047,8183,1262],{"class":1261},[1047,8185,4754],{"class":1265},[1047,8187,1452],{"class":1261},[1047,8189,8190],{"class":1049,"line":1419},[1047,8191,1330],{"emptyLinePlaceholder":21},[1047,8193,8194],{"class":1049,"line":1435},[1047,8195,5596],{"class":1431},[1047,8197,8198,8200,8202,8204,8206,8208,8210],{"class":1049,"line":1441},[1047,8199,4741],{"class":1548},[1047,8201,5603],{"class":1261},[1047,8203,1552],{"class":1265},[1047,8205,1863],{"class":1265},[1047,8207,5396],{"class":1070},[1047,8209,1262],{"class":1261},[1047,8211,1266],{"class":1265},[1047,8213,8214,8216,8218,8220,8222,8224,8226,8228],{"class":1049,"line":1446},[1047,8215,1759],{"class":1271},[1047,8217,1275],{"class":1265},[1047,8219,5623],{"class":1261},[1047,8221,1769],{"class":1265},[1047,8223,4808],{"class":1261},[1047,8225,1769],{"class":1265},[1047,8227,1978],{"class":1261},[1047,8229,1293],{"class":1265},[1047,8231,8232,8234,8236,8238,8240,8242,8244,8246],{"class":1049,"line":2235},[1047,8233,1919],{"class":1271},[1047,8235,1275],{"class":1265},[1047,8237,5623],{"class":1261},[1047,8239,1769],{"class":1265},[1047,8241,4808],{"class":1261},[1047,8243,1769],{"class":1265},[1047,8245,1957],{"class":1261},[1047,8247,1293],{"class":1265},[1047,8249,8250,8252,8254,8256,8258,8260],{"class":1049,"line":2248},[1047,8251,5658],{"class":1271},[1047,8253,1275],{"class":1265},[1047,8255,1863],{"class":1265},[1047,8257,5376],{"class":1070},[1047,8259,1262],{"class":1261},[1047,8261,1266],{"class":1265},[1047,8263,8264,8266,8268,8270,8272,8274,8276,8278,8280,8282,8284],{"class":1049,"line":2278},[1047,8265,5674],{"class":1271},[1047,8267,1275],{"class":1265},[1047,8269,3457],{"class":1265},[1047,8271,5479],{"class":1057},[1047,8273,4995],{"class":1265},[1047,8275,5513],{"class":1261},[1047,8277,1769],{"class":1265},[1047,8279,4808],{"class":1261},[1047,8281,1769],{"class":1265},[1047,8283,1978],{"class":1261},[1047,8285,5695],{"class":1265},[1047,8287,8288,8290,8292],{"class":1049,"line":2284},[1047,8289,2374],{"class":1265},[1047,8291,1843],{"class":1261},[1047,8293,1293],{"class":1265},[1047,8295,8296,8298,8300,8302,8304],{"class":1049,"line":2289},[1047,8297,5710],{"class":1271},[1047,8299,1262],{"class":1265},[1047,8301,5715],{"class":1903},[1047,8303,1843],{"class":1265},[1047,8305,1341],{"class":1265},[1047,8307,8308],{"class":1049,"line":2321},[1047,8309,5725],{"class":1431},[1047,8311,8312,8314,8316,8318,8320,8322,8324,8326,8328,8330,8332],{"class":1049,"line":2337},[1047,8313,5731],{"class":1251},[1047,8315,1912],{"class":1271},[1047,8317,5715],{"class":1261},[1047,8319,1769],{"class":1265},[1047,8321,5740],{"class":1261},[1047,8323,3636],{"class":1265},[1047,8325,1352],{"class":1265},[1047,8327,3922],{"class":1057},[1047,8329,1290],{"class":1265},[1047,8331,3324],{"class":1271},[1047,8333,1266],{"class":1265},[1047,8335,8336,8338,8340,8342,8344,8346],{"class":1049,"line":2355},[1047,8337,5758],{"class":1070},[1047,8339,1262],{"class":1271},[1047,8341,1290],{"class":1265},[1047,8343,1748],{"class":1057},[1047,8345,1290],{"class":1265},[1047,8347,1452],{"class":1271},[1047,8349,8350],{"class":1049,"line":2371},[1047,8351,1438],{"class":1265},[1047,8353,8354],{"class":1049,"line":2379},[1047,8355,1363],{"class":1265},[1047,8357,8358,8360,8362,8364,8366],{"class":1049,"line":3329},[1047,8359,5784],{"class":1271},[1047,8361,1262],{"class":1265},[1047,8363,5789],{"class":1903},[1047,8365,1843],{"class":1265},[1047,8367,1341],{"class":1265},[1047,8369,8370,8372,8374,8376,8378],{"class":1049,"line":3368},[1047,8371,5799],{"class":1261},[1047,8373,1769],{"class":1265},[1047,8375,5804],{"class":1070},[1047,8377,1262],{"class":1271},[1047,8379,1266],{"class":1265},[1047,8381,8382,8384,8386,8388,8390,8392],{"class":1049,"line":3374},[1047,8383,5814],{"class":1271},[1047,8385,1275],{"class":1265},[1047,8387,1352],{"class":1265},[1047,8389,477],{"class":1057},[1047,8391,1290],{"class":1265},[1047,8393,1293],{"class":1265},[1047,8395,8396,8398,8400,8402,8404,8406],{"class":1049,"line":3379},[1047,8397,5830],{"class":1271},[1047,8399,1275],{"class":1265},[1047,8401,5835],{"class":1261},[1047,8403,1769],{"class":1265},[1047,8405,4075],{"class":1261},[1047,8407,1293],{"class":1265},[1047,8409,8410,8412,8414,8416,8418],{"class":1049,"line":3385},[1047,8411,5847],{"class":1271},[1047,8413,1275],{"class":1265},[1047,8415,1352],{"class":1265},[1047,8417,5789],{"class":1057},[1047,8419,1316],{"class":1265},[1047,8421,8422,8424],{"class":1049,"line":3405},[1047,8423,3499],{"class":1265},[1047,8425,1452],{"class":1271},[1047,8427,8428],{"class":1049,"line":3433},[1047,8429,3371],{"class":1265},[1047,8431,8432,8434],{"class":1049,"line":3449},[1047,8433,1449],{"class":1265},[1047,8435,1452],{"class":1261},[1047,8437,8438],{"class":1049,"line":3468},[1047,8439,1330],{"emptyLinePlaceholder":21},[1047,8441,8442,8444,8446,8448,8450,8452,8454,8456],{"class":1049,"line":3496},[1047,8443,5884],{"class":1548},[1047,8445,5887],{"class":1070},[1047,8447,1262],{"class":1265},[1047,8449,5892],{"class":1903},[1047,8451,1275],{"class":1265},[1047,8453,5897],{"class":1053},[1047,8455,1843],{"class":1265},[1047,8457,1341],{"class":1265},[1047,8459,8460,8462,8464,8466],{"class":1049,"line":3504},[1047,8461,5906],{"class":1261},[1047,8463,1769],{"class":1265},[1047,8465,5911],{"class":1070},[1047,8467,2629],{"class":1271},[1047,8469,8470,8472,8474,8476,8478,8480,8482,8484,8486],{"class":1049,"line":3509},[1047,8471,3314],{"class":1251},[1047,8473,1912],{"class":1271},[1047,8475,4803],{"class":1261},[1047,8477,1769],{"class":1265},[1047,8479,4808],{"class":1261},[1047,8481,1769],{"class":1265},[1047,8483,4813],{"class":1070},[1047,8485,4816],{"class":1271},[1047,8487,1266],{"class":1265},[1047,8489,8490,8492,8494,8496,8498,8500,8502,8504,8506,8508,8510,8512],{"class":1049,"line":3575},[1047,8491,5938],{"class":1261},[1047,8493,1769],{"class":1265},[1047,8495,5943],{"class":1070},[1047,8497,1262],{"class":1271},[1047,8499,1826],{"class":1265},[1047,8501,1680],{"class":1271},[1047,8503,1275],{"class":1265},[1047,8505,4949],{"class":1261},[1047,8507,1769],{"class":1265},[1047,8509,4808],{"class":1261},[1047,8511,1693],{"class":1265},[1047,8513,1452],{"class":1271},[1047,8515,8516,8518,8520,8522,8524],{"class":1049,"line":3580},[1047,8517,5966],{"class":1261},[1047,8519,1769],{"class":1265},[1047,8521,4808],{"class":1261},[1047,8523,2583],{"class":1265},[1047,8525,5975],{"class":1265},[1047,8527,8528],{"class":1049,"line":3585},[1047,8529,3371],{"class":1265},[1047,8531,8532],{"class":1049,"line":3591},[1047,8533,5011],{"class":1265},[1047,8535,8536],{"class":1049,"line":3621},[1047,8537,1330],{"emptyLinePlaceholder":21},[1047,8539,8540],{"class":1049,"line":3663},[1047,8541,5992],{"class":1431},[1047,8543,8544,8546,8548,8550,8552],{"class":1049,"line":3692},[1047,8545,5997],{"class":1070},[1047,8547,1262],{"class":1261},[1047,8549,1766],{"class":1265},[1047,8551,1786],{"class":1548},[1047,8553,1341],{"class":1265},[1047,8555,8556,8558,8560,8562,8564,8566,8568,8570,8572,8574,8576,8578,8580],{"class":1049,"line":3704},[1047,8557,3314],{"class":1251},[1047,8559,1912],{"class":1271},[1047,8561,5513],{"class":1261},[1047,8563,1769],{"class":1265},[1047,8565,4808],{"class":1261},[1047,8567,3631],{"class":1265},[1047,8569,1957],{"class":1261},[1047,8571,1769],{"class":1265},[1047,8573,3609],{"class":1261},[1047,8575,3636],{"class":1265},[1047,8577,3615],{"class":3346},[1047,8579,3324],{"class":1271},[1047,8581,1266],{"class":1265},[1047,8583,8584,8586,8588,8590],{"class":1049,"line":3720},[1047,8585,5938],{"class":1261},[1047,8587,1769],{"class":1265},[1047,8589,6042],{"class":1070},[1047,8591,2629],{"class":1271},[1047,8593,8594],{"class":1049,"line":3734},[1047,8595,3371],{"class":1265},[1047,8597,8598,8600],{"class":1049,"line":3741},[1047,8599,1449],{"class":1265},[1047,8601,1452],{"class":1261},[1047,8603,8604,8606,8608],{"class":1049,"line":3746},[1047,8605,1596],{"class":1265},[1047,8607,4720],{"class":1271},[1047,8609,1526],{"class":1265},[1047,8611,8612],{"class":1049,"line":3751},[1047,8613,1330],{"emptyLinePlaceholder":21},[1047,8615,8616,8618,8620],{"class":1049,"line":3757},[1047,8617,1520],{"class":1265},[1047,8619,1523],{"class":1271},[1047,8621,1526],{"class":1265},[1047,8623,8624,8626,8628,8630,8632,8634,8636,8638],{"class":1049,"line":3774},[1047,8625,1533],{"class":1265},[1047,8627,5038],{"class":1271},[1047,8629,5041],{"class":1548},[1047,8631,1552],{"class":1265},[1047,8633,1479],{"class":1265},[1047,8635,5048],{"class":1057},[1047,8637,1479],{"class":1265},[1047,8639,1526],{"class":1265},[1047,8641,8642,8644,8646,8648,8650],{"class":1049,"line":3796},[1047,8643,1542],{"class":1265},[1047,8645,1523],{"class":1271},[1047,8647,5061],{"class":1265},[1047,8649,7742],{"class":1548},[1047,8651,1526],{"class":1265},[1047,8653,8655,8657,8659],{"class":8654,"line":3814},[1049,1530],[1047,8656,1566],{"class":1265},[1047,8658,7752],{"class":1271},[1047,8660,1572],{"class":1265},[1047,8662,8664,8666,8668],{"class":8663,"line":3822},[1049,1530],[1047,8665,1577],{"class":1265},[1047,8667,1523],{"class":1271},[1047,8669,1526],{"class":1265},[1047,8671,8673,8675,8677,8679,8681],{"class":8672,"line":3839},[1049,1530],[1047,8674,1542],{"class":1265},[1047,8676,1523],{"class":1271},[1047,8678,5061],{"class":1265},[1047,8680,5064],{"class":1548},[1047,8682,1526],{"class":1265},[1047,8684,8685,8687,8689,8691,8693,8695,8697,8699],{"class":1049,"line":3858},[1047,8686,1566],{"class":1265},[1047,8688,5073],{"class":1271},[1047,8690,5076],{"class":1548},[1047,8692,1552],{"class":1265},[1047,8694,1479],{"class":1265},[1047,8696,6119],{"class":1057},[1047,8698,1479],{"class":1265},[1047,8700,1526],{"class":1265},[1047,8702,8703,8705],{"class":1049,"line":3866},[1047,8704,5092],{"class":1265},[1047,8706,6130],{"class":1271},[1047,8708,8709,8711,8713,8715,8717],{"class":1049,"line":3871},[1047,8710,6135],{"class":1548},[1047,8712,1552],{"class":1265},[1047,8714,1479],{"class":1265},[1047,8716,6142],{"class":1057},[1047,8718,5149],{"class":1265},[1047,8720,8721,8723,8725,8727,8729],{"class":1049,"line":3877},[1047,8722,5155],{"class":1548},[1047,8724,1552],{"class":1265},[1047,8726,1479],{"class":1265},[1047,8728,6155],{"class":1057},[1047,8730,5149],{"class":1265},[1047,8732,8733],{"class":1049,"line":3897},[1047,8734,6162],{"class":1548},[1047,8736,8737,8739,8741,8743,8745],{"class":1049,"line":3912},[1047,8738,6167],{"class":1548},[1047,8740,1552],{"class":1265},[1047,8742,1479],{"class":1265},[1047,8744,6174],{"class":1057},[1047,8746,5149],{"class":1265},[1047,8748,8749],{"class":1049,"line":3929},[1047,8750,5215],{"class":1265},[1047,8752,8753,8755,8757,8759,8761,8763,8765,8767,8769,8771,8773],{"class":1049,"line":3953},[1047,8754,5221],{"class":1265},[1047,8756,1523],{"class":1271},[1047,8758,5061],{"class":1265},[1047,8760,350],{"class":1548},[1047,8762,1552],{"class":1265},[1047,8764,1479],{"class":1265},[1047,8766,1826],{"class":1265},[1047,8768,6199],{"class":1261},[1047,8770,1449],{"class":1265},[1047,8772,1479],{"class":1265},[1047,8774,1526],{"class":1265},[1047,8776,8777,8779,8781,8783,8785,8787,8789,8791,8793,8795,8797,8799,8801,8803,8805,8807,8809,8811,8813,8815,8817,8819,8821,8823,8825,8827,8829,8831,8833,8835,8837,8839],{"class":1049,"line":3964},[1047,8778,6210],{"class":1265},[1047,8780,1523],{"class":1271},[1047,8782,6215],{"class":1251},[1047,8784,1552],{"class":1265},[1047,8786,1479],{"class":1265},[1047,8788,6222],{"class":1261},[1047,8790,1677],{"class":1265},[1047,8792,6227],{"class":1261},[1047,8794,6230],{"class":1265},[1047,8796,2578],{"class":1261},[1047,8798,1769],{"class":1265},[1047,8800,2159],{"class":1261},[1047,8802,1479],{"class":1265},[1047,8804,6241],{"class":1265},[1047,8806,6244],{"class":1548},[1047,8808,1552],{"class":1265},[1047,8810,6249],{"class":1265},[1047,8812,4075],{"class":1261},[1047,8814,1769],{"class":1265},[1047,8816,1978],{"class":1261},[1047,8818,1449],{"class":1265},[1047,8820,6260],{"class":1057},[1047,8822,4995],{"class":1265},[1047,8824,6265],{"class":1261},[1047,8826,1769],{"class":1265},[1047,8828,5740],{"class":1261},[1047,8830,1449],{"class":1265},[1047,8832,6260],{"class":1057},[1047,8834,4995],{"class":1265},[1047,8836,6278],{"class":1261},[1047,8838,6281],{"class":1265},[1047,8840,1526],{"class":1265},[1047,8842,8843,8845,8847,8849,8851,8853,8855,8857,8859,8861,8863,8865,8867,8869,8871,8873,8875,8877,8879,8881,8883,8885,8887],{"class":1049,"line":3972},[1047,8844,6288],{"class":1265},[1047,8846,6291],{"class":1271},[1047,8848,6294],{"class":1548},[1047,8850,1552],{"class":1265},[1047,8852,1479],{"class":1265},[1047,8854,6301],{"class":1057},[1047,8856,1479],{"class":1265},[1047,8858,6306],{"class":1548},[1047,8860,1552],{"class":1265},[1047,8862,1479],{"class":1265},[1047,8864,6313],{"class":1057},[1047,8866,1479],{"class":1265},[1047,8868,6318],{"class":1548},[1047,8870,1552],{"class":1265},[1047,8872,1479],{"class":1265},[1047,8874,6325],{"class":1057},[1047,8876,1479],{"class":1265},[1047,8878,5076],{"class":1548},[1047,8880,1552],{"class":1265},[1047,8882,1479],{"class":1265},[1047,8884,6336],{"class":1057},[1047,8886,1479],{"class":1265},[1047,8888,1572],{"class":1265},[1047,8890,8891,8893,8895,8897,8899,8901,8903,8905,8907,8909,8911,8913,8915,8917,8919,8921,8923],{"class":1049,"line":3978},[1047,8892,6288],{"class":1265},[1047,8894,947],{"class":1271},[1047,8896,6349],{"class":1548},[1047,8898,1552],{"class":1265},[1047,8900,1479],{"class":1265},[1047,8902,6356],{"class":1057},[1047,8904,1479],{"class":1265},[1047,8906,5076],{"class":1548},[1047,8908,1552],{"class":1265},[1047,8910,1479],{"class":1265},[1047,8912,6367],{"class":1057},[1047,8914,1479],{"class":1265},[1047,8916,2626],{"class":1265},[1047,8918,6374],{"class":1261},[1047,8920,1596],{"class":1265},[1047,8922,947],{"class":1271},[1047,8924,1526],{"class":1265},[1047,8926,8927,8929,8931],{"class":1049,"line":3983},[1047,8928,6385],{"class":1265},[1047,8930,1523],{"class":1271},[1047,8932,1526],{"class":1265},[1047,8934,8935,8937,8939],{"class":1049,"line":4006},[1047,8936,6394],{"class":1265},[1047,8938,1523],{"class":1271},[1047,8940,1526],{"class":1265},[1047,8942,8943,8945,8947],{"class":1049,"line":4012},[1047,8944,5118],{"class":1265},[1047,8946,4691],{"class":1271},[1047,8948,1526],{"class":1265},[1047,8950,8951],{"class":1049,"line":4032},[1047,8952,1330],{"emptyLinePlaceholder":21},[1047,8954,8955,8957],{"class":1049,"line":4038},[1047,8956,5092],{"class":1265},[1047,8958,5134],{"class":1271},[1047,8960,8961,8963,8965,8967,8969],{"class":1049,"line":4084},[1047,8962,5140],{"class":1548},[1047,8964,1552],{"class":1265},[1047,8966,1479],{"class":1265},[1047,8968,4803],{"class":1057},[1047,8970,5149],{"class":1265},[1047,8972,8973,8975,8977,8979,8981],{"class":1049,"line":4100},[1047,8974,6433],{"class":1548},[1047,8976,1552],{"class":1265},[1047,8978,1479],{"class":1265},[1047,8980,6440],{"class":1057},[1047,8982,5149],{"class":1265},[1047,8984,8985,8987,8989,8991,8993],{"class":1049,"line":4133},[1047,8986,5170],{"class":1548},[1047,8988,1552],{"class":1265},[1047,8990,1479],{"class":1265},[1047,8992,5177],{"class":1057},[1047,8994,5149],{"class":1265},[1047,8996,8997,8999,9001,9003,9005],{"class":1049,"line":4147},[1047,8998,6167],{"class":1548},[1047,9000,1552],{"class":1265},[1047,9002,1479],{"class":1265},[1047,9004,6465],{"class":1057},[1047,9006,5149],{"class":1265},[1047,9008,9009,9011,9013,9015,9017],{"class":1049,"line":4155},[1047,9010,5200],{"class":1548},[1047,9012,1552],{"class":1265},[1047,9014,1479],{"class":1265},[1047,9016,6478],{"class":1057},[1047,9018,5149],{"class":1265},[1047,9020,9021],{"class":1049,"line":4160},[1047,9022,5215],{"class":1265},[1047,9024,9025,9027],{"class":1049,"line":4167},[1047,9026,5221],{"class":1265},[1047,9028,6491],{"class":1271},[1047,9030,9031,9033,9035,9037,9039],{"class":1049,"line":4172},[1047,9032,6496],{"class":1548},[1047,9034,1552],{"class":1265},[1047,9036,1479],{"class":1265},[1047,9038,6155],{"class":1057},[1047,9040,5149],{"class":1265},[1047,9042,9043,9045,9047,9049,9051],{"class":1049,"line":4190},[1047,9044,6509],{"class":1548},[1047,9046,1552],{"class":1265},[1047,9048,1479],{"class":1265},[1047,9050,5234],{"class":1057},[1047,9052,5149],{"class":1265},[1047,9054,9055,9057,9059,9061,9063],{"class":1049,"line":6553},[1047,9056,6522],{"class":1548},[1047,9058,1552],{"class":1265},[1047,9060,1479],{"class":1265},[1047,9062,6529],{"class":1057},[1047,9064,5149],{"class":1265},[1047,9066,9067,9069,9071,9073,9075],{"class":1049,"line":6562},[1047,9068,6536],{"class":1548},[1047,9070,1552],{"class":1265},[1047,9072,1479],{"class":1265},[1047,9074,6543],{"class":1057},[1047,9076,5149],{"class":1265},[1047,9078,9079],{"class":1049,"line":6571},[1047,9080,6550],{"class":1265},[1047,9082,9083,9085,9087],{"class":1049,"line":6580},[1047,9084,5118],{"class":1265},[1047,9086,4685],{"class":1271},[1047,9088,1526],{"class":1265},[1047,9090,9091,9093,9095],{"class":1049,"line":6589},[1047,9092,5252],{"class":1265},[1047,9094,5073],{"class":1271},[1047,9096,1526],{"class":1265},[1047,9098,9100,9102,9104],{"class":1049,"line":9099},91,[1047,9101,1577],{"class":1265},[1047,9103,1523],{"class":1271},[1047,9105,1526],{"class":1265},[1047,9107,9109,9111,9113],{"class":1049,"line":9108},92,[1047,9110,1587],{"class":1265},[1047,9112,5038],{"class":1271},[1047,9114,1526],{"class":1265},[1047,9116,9118,9120,9122],{"class":1049,"line":9117},93,[1047,9119,1596],{"class":1265},[1047,9121,1523],{"class":1271},[1047,9123,1526],{"class":1265},[947,9125,4233,9126,9129,9130,9132],{},[1044,9127,9128],{},"refreshNuxtData('chats')"," call in the chat page's ",[1044,9131,6657],{}," callback (as shown earlier) ensures the chat list updates automatically when a new title is generated.",[951,9134,9136],{"id":9135},"adding-multi-model-support","Adding multi-model support",[947,9138,9139,9140,9143],{},"One of the benefits of using ",[1022,9141,4202],{"href":1024,"rel":9142},[1026]," is the ability to switch between models seamlessly. This section adds a model selector to the chat.",[1075,9145,9147],{"id":9146},"creating-a-models-composable","Creating a models composable",[947,9149,9150,9151,1275],{},"Define the available models and persist the user's selection using ",[1022,9152,9155],{"href":9153,"rel":9154},"https://nuxt.com/docs/api/composables/use-cookie",[1026],[1044,9156,9157],{},"useCookie",[1238,9159,9160],{},[1037,9161,9164],{"className":1242,"code":9162,"filename":9163,"language":1244,"meta":1042,"style":1042},"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",[1044,9165,9166,9179,9190,9236,9279,9323,9328,9332,9362,9379,9385,9389,9395,9402,9407,9411],{"__ignoreMap":1042},[1047,9167,9168,9170,9172,9175,9177],{"class":1049,"line":1050},[1047,9169,1252],{"class":1251},[1047,9171,4785],{"class":1548},[1047,9173,9174],{"class":1070}," useModels",[1047,9176,1766],{"class":1265},[1047,9178,1341],{"class":1265},[1047,9180,9181,9183,9186,9188],{"class":1049,"line":1067},[1047,9182,2573],{"class":1548},[1047,9184,9185],{"class":1261}," models",[1047,9187,2583],{"class":1265},[1047,9189,1278],{"class":1271},[1047,9191,9192,9195,9198,9200,9202,9204,9206,9208,9211,9213,9215,9218,9220,9222,9225,9227,9229,9232,9234],{"class":1049,"line":1281},[1047,9193,9194],{"class":1265},"    {",[1047,9196,9197],{"class":1271}," value",[1047,9199,1275],{"class":1265},[1047,9201,1352],{"class":1265},[1047,9203,3168],{"class":1057},[1047,9205,1290],{"class":1265},[1047,9207,1677],{"class":1265},[1047,9209,9210],{"class":1271}," label",[1047,9212,1275],{"class":1265},[1047,9214,1352],{"class":1265},[1047,9216,9217],{"class":1057},"GPT-4o Mini",[1047,9219,1290],{"class":1265},[1047,9221,1677],{"class":1265},[1047,9223,9224],{"class":1271}," icon",[1047,9226,1275],{"class":1265},[1047,9228,1352],{"class":1265},[1047,9230,9231],{"class":1057},"i-simple-icons-openai",[1047,9233,1290],{"class":1265},[1047,9235,3950],{"class":1265},[1047,9237,9238,9240,9242,9244,9246,9249,9251,9253,9255,9257,9259,9262,9264,9266,9268,9270,9272,9275,9277],{"class":1049,"line":1296},[1047,9239,9194],{"class":1265},[1047,9241,9197],{"class":1271},[1047,9243,1275],{"class":1265},[1047,9245,1352],{"class":1265},[1047,9247,9248],{"class":1057},"anthropic/claude-3-5-haiku-latest",[1047,9250,1290],{"class":1265},[1047,9252,1677],{"class":1265},[1047,9254,9210],{"class":1271},[1047,9256,1275],{"class":1265},[1047,9258,1352],{"class":1265},[1047,9260,9261],{"class":1057},"Claude 3.5 Haiku",[1047,9263,1290],{"class":1265},[1047,9265,1677],{"class":1265},[1047,9267,9224],{"class":1271},[1047,9269,1275],{"class":1265},[1047,9271,1352],{"class":1265},[1047,9273,9274],{"class":1057},"i-simple-icons-anthropic",[1047,9276,1290],{"class":1265},[1047,9278,3950],{"class":1265},[1047,9280,9281,9283,9285,9287,9289,9292,9294,9296,9298,9300,9302,9305,9307,9309,9311,9313,9315,9318,9320],{"class":1049,"line":1308},[1047,9282,9194],{"class":1265},[1047,9284,9197],{"class":1271},[1047,9286,1275],{"class":1265},[1047,9288,1352],{"class":1265},[1047,9290,9291],{"class":1057},"google/gemini-2.0-flash",[1047,9293,1290],{"class":1265},[1047,9295,1677],{"class":1265},[1047,9297,9210],{"class":1271},[1047,9299,1275],{"class":1265},[1047,9301,1352],{"class":1265},[1047,9303,9304],{"class":1057},"Gemini 2.0 Flash",[1047,9306,1290],{"class":1265},[1047,9308,1677],{"class":1265},[1047,9310,9224],{"class":1271},[1047,9312,1275],{"class":1265},[1047,9314,1352],{"class":1265},[1047,9316,9317],{"class":1057},"i-simple-icons-google",[1047,9319,1290],{"class":1265},[1047,9321,9322],{"class":1265}," }\n",[1047,9324,9325],{"class":1049,"line":1319},[1047,9326,9327],{"class":1271},"  ]\n",[1047,9329,9330],{"class":1049,"line":1327},[1047,9331,1330],{"emptyLinePlaceholder":21},[1047,9333,9334,9336,9338,9340,9343,9345,9347,9349,9351,9353,9356,9358,9360],{"class":1049,"line":1333},[1047,9335,2573],{"class":1548},[1047,9337,3112],{"class":1261},[1047,9339,2583],{"class":1265},[1047,9341,9342],{"class":1070}," useCookie",[1047,9344,1520],{"class":1265},[1047,9346,3085],{"class":1053},[1047,9348,2626],{"class":1265},[1047,9350,1262],{"class":1271},[1047,9352,1290],{"class":1265},[1047,9354,9355],{"class":1057},"ai-model",[1047,9357,1290],{"class":1265},[1047,9359,1677],{"class":1265},[1047,9361,1341],{"class":1265},[1047,9363,9364,9367,9369,9371,9373,9375,9377],{"class":1049,"line":1344},[1047,9365,9366],{"class":1070},"    default",[1047,9368,1275],{"class":1265},[1047,9370,4570],{"class":1265},[1047,9372,1786],{"class":1548},[1047,9374,1352],{"class":1265},[1047,9376,3168],{"class":1057},[1047,9378,1316],{"class":1265},[1047,9380,9381,9383],{"class":1049,"line":1360},[1047,9382,2374],{"class":1265},[1047,9384,1452],{"class":1271},[1047,9386,9387],{"class":1049,"line":1366},[1047,9388,1330],{"emptyLinePlaceholder":21},[1047,9390,9391,9393],{"class":1049,"line":1371},[1047,9392,2800],{"class":1251},[1047,9394,1341],{"class":1265},[1047,9396,9397,9400],{"class":1049,"line":1394},[1047,9398,9399],{"class":1261},"    models",[1047,9401,1293],{"class":1265},[1047,9403,9404],{"class":1049,"line":1399},[1047,9405,9406],{"class":1261},"    model\n",[1047,9408,9409],{"class":1049,"line":1409},[1047,9410,3371],{"class":1265},[1047,9412,9413],{"class":1049,"line":1419},[1047,9414,5011],{"class":1265},[1075,9416,9418],{"id":9417},"building-the-model-selector","Building the model selector",[947,9420,1603,9421,9426],{},[1022,9422,9423],{"href":714},[1044,9424,9425],{},"USelectMenu"," component that displays the available models:",[1238,9428,9429],{},[1037,9430,9433],{"className":1510,"code":9431,"filename":9432,"language":34,"meta":1042,"style":1042},"\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",[1044,9434,9435,9455,9488,9492,9509,9513,9531,9565,9569,9577,9581,9589,9596,9609,9623,9637,9650,9663,9668],{"__ignoreMap":1042},[1047,9436,9437,9439,9441,9443,9445,9447,9449,9451,9453],{"class":1049,"line":1050},[1047,9438,1520],{"class":1265},[1047,9440,4720],{"class":1271},[1047,9442,4723],{"class":1548},[1047,9444,4726],{"class":1548},[1047,9446,1552],{"class":1265},[1047,9448,1479],{"class":1265},[1047,9450,1244],{"class":1057},[1047,9452,1479],{"class":1265},[1047,9454,1526],{"class":1265},[1047,9456,9457,9459,9462,9464,9467,9469,9471,9473,9475,9477,9480,9482,9484,9486],{"class":1049,"line":1067},[1047,9458,4741],{"class":1548},[1047,9460,9461],{"class":1261}," model ",[1047,9463,1552],{"class":1265},[1047,9465,9466],{"class":1070}," defineModel",[1047,9468,1520],{"class":1265},[1047,9470,3085],{"class":1053},[1047,9472,2626],{"class":1265},[1047,9474,1262],{"class":1261},[1047,9476,1826],{"class":1265},[1047,9478,9479],{"class":1271}," required",[1047,9481,1275],{"class":1265},[1047,9483,5559],{"class":1427},[1047,9485,1693],{"class":1265},[1047,9487,1452],{"class":1261},[1047,9489,9490],{"class":1049,"line":1281},[1047,9491,1330],{"emptyLinePlaceholder":21},[1047,9493,9494,9496,9498,9501,9503,9505,9507],{"class":1049,"line":1296},[1047,9495,4741],{"class":1548},[1047,9497,1671],{"class":1265},[1047,9499,9500],{"class":1261}," models ",[1047,9502,1449],{"class":1265},[1047,9504,2583],{"class":1265},[1047,9506,9174],{"class":1070},[1047,9508,2629],{"class":1261},[1047,9510,9511],{"class":1049,"line":1308},[1047,9512,1330],{"emptyLinePlaceholder":21},[1047,9514,9515,9517,9520,9522,9524,9526,9528],{"class":1049,"line":1319},[1047,9516,4741],{"class":1548},[1047,9518,9519],{"class":1261}," selectedModel ",[1047,9521,1552],{"class":1265},[1047,9523,7068],{"class":1070},[1047,9525,1262],{"class":1261},[1047,9527,1766],{"class":1265},[1047,9529,9530],{"class":1548}," =>\n",[1047,9532,9533,9536,9538,9541,9543,9546,9548,9551,9553,9556,9558,9560,9562],{"class":1049,"line":1327},[1047,9534,9535],{"class":1261},"  models",[1047,9537,1769],{"class":1265},[1047,9539,9540],{"class":1070},"find",[1047,9542,1262],{"class":1261},[1047,9544,9545],{"class":1903},"m",[1047,9547,1786],{"class":1548},[1047,9549,9550],{"class":1261}," m",[1047,9552,1769],{"class":1265},[1047,9554,9555],{"class":1261},"value ",[1047,9557,7147],{"class":1265},[1047,9559,3112],{"class":1261},[1047,9561,1769],{"class":1265},[1047,9563,9564],{"class":1261},"value)\n",[1047,9566,9567],{"class":1049,"line":1333},[1047,9568,1452],{"class":1261},[1047,9570,9571,9573,9575],{"class":1049,"line":1344},[1047,9572,1596],{"class":1265},[1047,9574,4720],{"class":1271},[1047,9576,1526],{"class":1265},[1047,9578,9579],{"class":1049,"line":1360},[1047,9580,1330],{"emptyLinePlaceholder":21},[1047,9582,9583,9585,9587],{"class":1049,"line":1366},[1047,9584,1520],{"class":1265},[1047,9586,1523],{"class":1271},[1047,9588,1526],{"class":1265},[1047,9590,9591,9593],{"class":1049,"line":1371},[1047,9592,1533],{"class":1265},[1047,9594,9595],{"class":1271},"USelectMenu\n",[1047,9597,9598,9601,9603,9605,9607],{"class":1049,"line":1394},[1047,9599,9600],{"class":1548},"    v-model",[1047,9602,1552],{"class":1265},[1047,9604,1479],{"class":1265},[1047,9606,4246],{"class":1057},[1047,9608,5149],{"class":1265},[1047,9610,9611,9614,9616,9618,9621],{"class":1049,"line":1399},[1047,9612,9613],{"class":1548},"    :items",[1047,9615,1552],{"class":1265},[1047,9617,1479],{"class":1265},[1047,9619,9620],{"class":1057},"models",[1047,9622,5149],{"class":1265},[1047,9624,9625,9628,9630,9632,9635],{"class":1049,"line":1409},[1047,9626,9627],{"class":1548},"    :icon",[1047,9629,1552],{"class":1265},[1047,9631,1479],{"class":1265},[1047,9633,9634],{"class":1057},"selectedModel?.icon",[1047,9636,5149],{"class":1265},[1047,9638,9639,9642,9644,9646,9648],{"class":1049,"line":1419},[1047,9640,9641],{"class":1548},"    variant",[1047,9643,1552],{"class":1265},[1047,9645,1479],{"class":1265},[1047,9647,7349],{"class":1057},[1047,9649,5149],{"class":1265},[1047,9651,9652,9655,9657,9659,9661],{"class":1049,"line":1435},[1047,9653,9654],{"class":1548},"    value-key",[1047,9656,1552],{"class":1265},[1047,9658,1479],{"class":1265},[1047,9660,4808],{"class":1057},[1047,9662,5149],{"class":1265},[1047,9664,9665],{"class":1049,"line":1441},[1047,9666,9667],{"class":1265},"  />\n",[1047,9669,9670,9672,9674],{"class":1049,"line":1446},[1047,9671,1596],{"class":1265},[1047,9673,1523],{"class":1271},[1047,9675,1526],{"class":1265},[1075,9677,9679],{"id":9678},"integrating-with-the-chat","Integrating with the chat",[947,9681,9682],{},"Update the chat page to include the model selector and pass the selected model to the server:",[1238,9684,9685],{},[1656,9686,9687],{},[1037,9688,9691],{"className":1510,"code":9689,"filename":5343,"highlights":9690,"language":34,"meta":1042,"style":1042},"\u003Cscript setup lang=\"ts\">\nimport { DefaultChatTransport } from 'ai'\nimport { Chat } from '@ai-sdk/vue'\n\nconst route = useRoute()\nconst toast = useToast()\nconst { model } = useModels()\n\nconst { data: chatData } = await useFetch(`/api/chats/${route.params.id}`)\n\nif (!chatData.value) {\n  throw createError({ statusCode: 404, statusMessage: 'Chat not found', fatal: true })\n}\n\nconst input = ref('')\n\nconst chat = new Chat({\n  id: chatData.value.id,\n  messages: chatData.value.messages,\n  transport: new DefaultChatTransport({\n    api: `/api/chats/${chatData.value.id}`,\n    body: {\n      model: model.value // Pass the selected model\n    }\n  }),\n  onData(dataPart) {\n    if (dataPart.type === 'data-chat-title') {\n      refreshNuxtData('chats')\n    }\n  },\n  onError(error) {\n    toast.add({\n      title: 'Error',\n      description: error.message,\n      color: 'error'\n    })\n  }\n})\n\nfunction handleSubmit(e: Event) {\n  e.preventDefault()\n  if (input.value.trim()) {\n    chat.sendMessage({ text: input.value })\n    input.value = ''\n  }\n}\n\nonMounted(() => {\n  if (chatData.value?.messages.length === 1) {\n    chat.regenerate()\n  }\n})\n\u003C/script>\n\n\u003Ctemplate>\n  \u003CUDashboardPanel :ui=\"{ body: 'p-0 sm:p-0' }\">\n    \u003Ctemplate #header>\n      \u003CChatsHistory />\n    \u003C/template>\n    \u003Ctemplate #body>\n      \u003CUContainer class=\"min-h-dvh flex flex-col py-4 sm:py-6\">\n        \u003CUChatMessages\n          :messages=\"chat.messages\"\n          :status=\"chat.status\"\n          should-auto-scroll\n          class=\"flex-1\"\n        >\n          \u003Ctemplate #content=\"{ message }\">\n            \u003Ctemplate v-for=\"(part, index) in message.parts\" :key=\"`${message.id}-${part.type}-${index}`\">\n              \u003CMDC v-if=\"part.type === 'text' && message.role === 'assistant'\" :value=\"part.text\" :cache-key=\"`${message.id}-${index}`\" class=\"*:first:mt-0 *:last:mb-0\" />\n              \u003Cp v-else-if=\"part.type === 'text' && message.role === 'user'\" class=\"whitespace-pre-wrap\">{{ part.text }}\u003C/p>\n            \u003C/template>\n          \u003C/template>\n        \u003C/UChatMessages>\n\n        \u003CUChatPrompt\n          v-model=\"input\"\n          :error=\"chat.error\"\n          variant=\"subtle\"\n          class=\"sticky bottom-0\"\n          @submit=\"handleSubmit\"\n        >\n          \u003Ctemplate #footer>\n            \u003CModelSelect v-model=\"model\" />\n          \u003C/template>\n\n          \u003CUChatPromptSubmit\n            :status=\"chat.status\"\n            color=\"neutral\"\n            @stop=\"chat.stop()\"\n            @reload=\"chat.regenerate()\"\n          />\n        \u003C/UChatPrompt>\n      \u003C/UContainer>\n    \u003C/template>\n  \u003C/UDashboardPanel>\n\u003C/template>\n",[1333,2284,2289,2321,4190,6553,6562],[1044,9692,9693,9713,9731,9749,9753,9765,9777,9793,9798,9840,9844,9860,9900,9904,9908,9924,9928,9944,9962,9980,9994,10020,10028,10044,10049,10058,10070,10094,10108,10112,10116,10128,10140,10154,10168,10180,10186,10190,10196,10200,10218,10228,10248,10274,10286,10290,10294,10298,10310,10338,10348,10352,10358,10366,10370,10378,10396,10408,10416,10424,10436,10454,10460,10472,10484,10488,10500,10504,10528,10594,10642,10678,10686,10694,10702,10706,10712,10724,10736,10748,10760,10772,10776,10789,10809,10818,10823,10830,10842,10854,10866,10878,10882,10890,10899,10908,10917],{"__ignoreMap":1042},[1047,9694,9695,9697,9699,9701,9703,9705,9707,9709,9711],{"class":1049,"line":1050},[1047,9696,1520],{"class":1265},[1047,9698,4720],{"class":1271},[1047,9700,4723],{"class":1548},[1047,9702,4726],{"class":1548},[1047,9704,1552],{"class":1265},[1047,9706,1479],{"class":1265},[1047,9708,1244],{"class":1057},[1047,9710,1479],{"class":1265},[1047,9712,1526],{"class":1265},[1047,9714,9715,9717,9719,9721,9723,9725,9727,9729],{"class":1049,"line":1067},[1047,9716,1668],{"class":1251},[1047,9718,1671],{"class":1265},[1047,9720,5376],{"class":1261},[1047,9722,1693],{"class":1265},[1047,9724,1696],{"class":1251},[1047,9726,1352],{"class":1265},[1047,9728,2494],{"class":1057},[1047,9730,1316],{"class":1265},[1047,9732,9733,9735,9737,9739,9741,9743,9745,9747],{"class":1049,"line":1281},[1047,9734,1668],{"class":1251},[1047,9736,1671],{"class":1265},[1047,9738,5396],{"class":1261},[1047,9740,1693],{"class":1265},[1047,9742,1696],{"class":1251},[1047,9744,1352],{"class":1265},[1047,9746,5405],{"class":1057},[1047,9748,1316],{"class":1265},[1047,9750,9751],{"class":1049,"line":1296},[1047,9752,1330],{"emptyLinePlaceholder":21},[1047,9754,9755,9757,9759,9761,9763],{"class":1049,"line":1308},[1047,9756,4741],{"class":1548},[1047,9758,5419],{"class":1261},[1047,9760,1552],{"class":1265},[1047,9762,5424],{"class":1070},[1047,9764,2629],{"class":1261},[1047,9766,9767,9769,9771,9773,9775],{"class":1049,"line":1319},[1047,9768,4741],{"class":1548},[1047,9770,5433],{"class":1261},[1047,9772,1552],{"class":1265},[1047,9774,5438],{"class":1070},[1047,9776,2629],{"class":1261},[1047,9778,9779,9781,9783,9785,9787,9789,9791],{"class":1049,"line":1327},[1047,9780,4741],{"class":1548},[1047,9782,1671],{"class":1265},[1047,9784,9461],{"class":1261},[1047,9786,1449],{"class":1265},[1047,9788,2583],{"class":1265},[1047,9790,9174],{"class":1070},[1047,9792,2629],{"class":1261},[1047,9794,9796],{"class":9795,"line":1333},[1049,1530],[1047,9797,1330],{"emptyLinePlaceholder":21},[1047,9799,9800,9802,9804,9806,9808,9810,9812,9814,9816,9818,9820,9822,9824,9826,9828,9830,9832,9834,9836,9838],{"class":1049,"line":1344},[1047,9801,4741],{"class":1548},[1047,9803,1671],{"class":1265},[1047,9805,5458],{"class":1271},[1047,9807,1275],{"class":1265},[1047,9809,5463],{"class":1261},[1047,9811,1449],{"class":1265},[1047,9813,2583],{"class":1265},[1047,9815,2586],{"class":1251},[1047,9817,5472],{"class":1070},[1047,9819,1262],{"class":1261},[1047,9821,3463],{"class":1265},[1047,9823,5479],{"class":1057},[1047,9825,4995],{"class":1265},[1047,9827,5484],{"class":1261},[1047,9829,1769],{"class":1265},[1047,9831,5489],{"class":1261},[1047,9833,1769],{"class":1265},[1047,9835,1978],{"class":1261},[1047,9837,5004],{"class":1265},[1047,9839,1452],{"class":1261},[1047,9841,9842],{"class":1049,"line":1360},[1047,9843,1330],{"emptyLinePlaceholder":21},[1047,9845,9846,9848,9850,9852,9854,9856,9858],{"class":1049,"line":1366},[1047,9847,5506],{"class":1251},[1047,9849,1912],{"class":1261},[1047,9851,3319],{"class":1265},[1047,9853,5513],{"class":1261},[1047,9855,1769],{"class":1265},[1047,9857,5518],{"class":1261},[1047,9859,1266],{"class":1265},[1047,9861,9862,9864,9866,9868,9870,9872,9874,9876,9878,9880,9882,9884,9886,9888,9890,9892,9894,9896,9898],{"class":1049,"line":1371},[1047,9863,5525],{"class":1251},[1047,9865,2859],{"class":1070},[1047,9867,1262],{"class":1271},[1047,9869,1826],{"class":1265},[1047,9871,3341],{"class":1271},[1047,9873,1275],{"class":1265},[1047,9875,3347],{"class":3346},[1047,9877,1677],{"class":1265},[1047,9879,3352],{"class":1271},[1047,9881,1275],{"class":1265},[1047,9883,1352],{"class":1265},[1047,9885,3359],{"class":1057},[1047,9887,1290],{"class":1265},[1047,9889,1677],{"class":1265},[1047,9891,5554],{"class":1271},[1047,9893,1275],{"class":1265},[1047,9895,5559],{"class":1427},[1047,9897,1693],{"class":1265},[1047,9899,1452],{"class":1271},[1047,9901,9902],{"class":1049,"line":1394},[1047,9903,5011],{"class":1265},[1047,9905,9906],{"class":1049,"line":1399},[1047,9907,1330],{"emptyLinePlaceholder":21},[1047,9909,9910,9912,9914,9916,9918,9920,9922],{"class":1049,"line":1409},[1047,9911,4741],{"class":1548},[1047,9913,4744],{"class":1261},[1047,9915,1552],{"class":1265},[1047,9917,4749],{"class":1070},[1047,9919,1262],{"class":1261},[1047,9921,4754],{"class":1265},[1047,9923,1452],{"class":1261},[1047,9925,9926],{"class":1049,"line":1419},[1047,9927,1330],{"emptyLinePlaceholder":21},[1047,9929,9930,9932,9934,9936,9938,9940,9942],{"class":1049,"line":1435},[1047,9931,4741],{"class":1548},[1047,9933,5603],{"class":1261},[1047,9935,1552],{"class":1265},[1047,9937,1863],{"class":1265},[1047,9939,5396],{"class":1070},[1047,9941,1262],{"class":1261},[1047,9943,1266],{"class":1265},[1047,9945,9946,9948,9950,9952,9954,9956,9958,9960],{"class":1049,"line":1441},[1047,9947,1759],{"class":1271},[1047,9949,1275],{"class":1265},[1047,9951,5623],{"class":1261},[1047,9953,1769],{"class":1265},[1047,9955,4808],{"class":1261},[1047,9957,1769],{"class":1265},[1047,9959,1978],{"class":1261},[1047,9961,1293],{"class":1265},[1047,9963,9964,9966,9968,9970,9972,9974,9976,9978],{"class":1049,"line":1446},[1047,9965,1919],{"class":1271},[1047,9967,1275],{"class":1265},[1047,9969,5623],{"class":1261},[1047,9971,1769],{"class":1265},[1047,9973,4808],{"class":1261},[1047,9975,1769],{"class":1265},[1047,9977,1957],{"class":1261},[1047,9979,1293],{"class":1265},[1047,9981,9982,9984,9986,9988,9990,9992],{"class":1049,"line":2235},[1047,9983,5658],{"class":1271},[1047,9985,1275],{"class":1265},[1047,9987,1863],{"class":1265},[1047,9989,5376],{"class":1070},[1047,9991,1262],{"class":1261},[1047,9993,1266],{"class":1265},[1047,9995,9996,9998,10000,10002,10004,10006,10008,10010,10012,10014,10016,10018],{"class":1049,"line":2248},[1047,9997,5674],{"class":1271},[1047,9999,1275],{"class":1265},[1047,10001,3457],{"class":1265},[1047,10003,5479],{"class":1057},[1047,10005,4995],{"class":1265},[1047,10007,5513],{"class":1261},[1047,10009,1769],{"class":1265},[1047,10011,4808],{"class":1261},[1047,10013,1769],{"class":1265},[1047,10015,1978],{"class":1261},[1047,10017,5004],{"class":1265},[1047,10019,1293],{"class":1265},[1047,10021,10022,10024,10026],{"class":1049,"line":2278},[1047,10023,4892],{"class":1271},[1047,10025,1275],{"class":1265},[1047,10027,1341],{"class":1265},[1047,10029,10031,10033,10035,10037,10039,10041],{"class":10030,"line":2284},[1049,1530],[1047,10032,3436],{"class":1271},[1047,10034,1275],{"class":1265},[1047,10036,3112],{"class":1261},[1047,10038,1769],{"class":1265},[1047,10040,9555],{"class":1261},[1047,10042,10043],{"class":1431},"// Pass the selected model\n",[1047,10045,10047],{"class":10046,"line":2289},[1049,1530],[1047,10048,1438],{"class":1265},[1047,10050,10052,10054,10056],{"class":10051,"line":2321},[1049,1530],[1047,10053,2374],{"class":1265},[1047,10055,1843],{"class":1261},[1047,10057,1293],{"class":1265},[1047,10059,10060,10062,10064,10066,10068],{"class":1049,"line":2337},[1047,10061,5710],{"class":1271},[1047,10063,1262],{"class":1265},[1047,10065,5715],{"class":1903},[1047,10067,1843],{"class":1265},[1047,10069,1341],{"class":1265},[1047,10071,10072,10074,10076,10078,10080,10082,10084,10086,10088,10090,10092],{"class":1049,"line":2355},[1047,10073,5731],{"class":1251},[1047,10075,1912],{"class":1271},[1047,10077,5715],{"class":1261},[1047,10079,1769],{"class":1265},[1047,10081,5740],{"class":1261},[1047,10083,3636],{"class":1265},[1047,10085,1352],{"class":1265},[1047,10087,3922],{"class":1057},[1047,10089,1290],{"class":1265},[1047,10091,3324],{"class":1271},[1047,10093,1266],{"class":1265},[1047,10095,10096,10098,10100,10102,10104,10106],{"class":1049,"line":2371},[1047,10097,5758],{"class":1070},[1047,10099,1262],{"class":1271},[1047,10101,1290],{"class":1265},[1047,10103,1748],{"class":1057},[1047,10105,1290],{"class":1265},[1047,10107,1452],{"class":1271},[1047,10109,10110],{"class":1049,"line":2379},[1047,10111,1438],{"class":1265},[1047,10113,10114],{"class":1049,"line":3329},[1047,10115,1363],{"class":1265},[1047,10117,10118,10120,10122,10124,10126],{"class":1049,"line":3368},[1047,10119,5784],{"class":1271},[1047,10121,1262],{"class":1265},[1047,10123,5789],{"class":1903},[1047,10125,1843],{"class":1265},[1047,10127,1341],{"class":1265},[1047,10129,10130,10132,10134,10136,10138],{"class":1049,"line":3374},[1047,10131,5799],{"class":1261},[1047,10133,1769],{"class":1265},[1047,10135,5804],{"class":1070},[1047,10137,1262],{"class":1271},[1047,10139,1266],{"class":1265},[1047,10141,10142,10144,10146,10148,10150,10152],{"class":1049,"line":3379},[1047,10143,5814],{"class":1271},[1047,10145,1275],{"class":1265},[1047,10147,1352],{"class":1265},[1047,10149,477],{"class":1057},[1047,10151,1290],{"class":1265},[1047,10153,1293],{"class":1265},[1047,10155,10156,10158,10160,10162,10164,10166],{"class":1049,"line":3385},[1047,10157,5830],{"class":1271},[1047,10159,1275],{"class":1265},[1047,10161,5835],{"class":1261},[1047,10163,1769],{"class":1265},[1047,10165,4075],{"class":1261},[1047,10167,1293],{"class":1265},[1047,10169,10170,10172,10174,10176,10178],{"class":1049,"line":3405},[1047,10171,5847],{"class":1271},[1047,10173,1275],{"class":1265},[1047,10175,1352],{"class":1265},[1047,10177,5789],{"class":1057},[1047,10179,1316],{"class":1265},[1047,10181,10182,10184],{"class":1049,"line":3433},[1047,10183,3499],{"class":1265},[1047,10185,1452],{"class":1271},[1047,10187,10188],{"class":1049,"line":3449},[1047,10189,3371],{"class":1265},[1047,10191,10192,10194],{"class":1049,"line":3468},[1047,10193,1449],{"class":1265},[1047,10195,1452],{"class":1261},[1047,10197,10198],{"class":1049,"line":3496},[1047,10199,1330],{"emptyLinePlaceholder":21},[1047,10201,10202,10204,10206,10208,10210,10212,10214,10216],{"class":1049,"line":3504},[1047,10203,5884],{"class":1548},[1047,10205,5887],{"class":1070},[1047,10207,1262],{"class":1265},[1047,10209,5892],{"class":1903},[1047,10211,1275],{"class":1265},[1047,10213,5897],{"class":1053},[1047,10215,1843],{"class":1265},[1047,10217,1341],{"class":1265},[1047,10219,10220,10222,10224,10226],{"class":1049,"line":3509},[1047,10221,5906],{"class":1261},[1047,10223,1769],{"class":1265},[1047,10225,5911],{"class":1070},[1047,10227,2629],{"class":1271},[1047,10229,10230,10232,10234,10236,10238,10240,10242,10244,10246],{"class":1049,"line":3575},[1047,10231,3314],{"class":1251},[1047,10233,1912],{"class":1271},[1047,10235,4803],{"class":1261},[1047,10237,1769],{"class":1265},[1047,10239,4808],{"class":1261},[1047,10241,1769],{"class":1265},[1047,10243,4813],{"class":1070},[1047,10245,4816],{"class":1271},[1047,10247,1266],{"class":1265},[1047,10249,10250,10252,10254,10256,10258,10260,10262,10264,10266,10268,10270,10272],{"class":1049,"line":3580},[1047,10251,5938],{"class":1261},[1047,10253,1769],{"class":1265},[1047,10255,5943],{"class":1070},[1047,10257,1262],{"class":1271},[1047,10259,1826],{"class":1265},[1047,10261,1680],{"class":1271},[1047,10263,1275],{"class":1265},[1047,10265,4949],{"class":1261},[1047,10267,1769],{"class":1265},[1047,10269,4808],{"class":1261},[1047,10271,1693],{"class":1265},[1047,10273,1452],{"class":1271},[1047,10275,10276,10278,10280,10282,10284],{"class":1049,"line":3585},[1047,10277,5966],{"class":1261},[1047,10279,1769],{"class":1265},[1047,10281,4808],{"class":1261},[1047,10283,2583],{"class":1265},[1047,10285,5975],{"class":1265},[1047,10287,10288],{"class":1049,"line":3591},[1047,10289,3371],{"class":1265},[1047,10291,10292],{"class":1049,"line":3621},[1047,10293,5011],{"class":1265},[1047,10295,10296],{"class":1049,"line":3663},[1047,10297,1330],{"emptyLinePlaceholder":21},[1047,10299,10300,10302,10304,10306,10308],{"class":1049,"line":3692},[1047,10301,5997],{"class":1070},[1047,10303,1262],{"class":1261},[1047,10305,1766],{"class":1265},[1047,10307,1786],{"class":1548},[1047,10309,1341],{"class":1265},[1047,10311,10312,10314,10316,10318,10320,10322,10324,10326,10328,10330,10332,10334,10336],{"class":1049,"line":3704},[1047,10313,3314],{"class":1251},[1047,10315,1912],{"class":1271},[1047,10317,5513],{"class":1261},[1047,10319,1769],{"class":1265},[1047,10321,4808],{"class":1261},[1047,10323,3631],{"class":1265},[1047,10325,1957],{"class":1261},[1047,10327,1769],{"class":1265},[1047,10329,3609],{"class":1261},[1047,10331,3636],{"class":1265},[1047,10333,3615],{"class":3346},[1047,10335,3324],{"class":1271},[1047,10337,1266],{"class":1265},[1047,10339,10340,10342,10344,10346],{"class":1049,"line":3720},[1047,10341,5938],{"class":1261},[1047,10343,1769],{"class":1265},[1047,10345,6042],{"class":1070},[1047,10347,2629],{"class":1271},[1047,10349,10350],{"class":1049,"line":3734},[1047,10351,3371],{"class":1265},[1047,10353,10354,10356],{"class":1049,"line":3741},[1047,10355,1449],{"class":1265},[1047,10357,1452],{"class":1261},[1047,10359,10360,10362,10364],{"class":1049,"line":3746},[1047,10361,1596],{"class":1265},[1047,10363,4720],{"class":1271},[1047,10365,1526],{"class":1265},[1047,10367,10368],{"class":1049,"line":3751},[1047,10369,1330],{"emptyLinePlaceholder":21},[1047,10371,10372,10374,10376],{"class":1049,"line":3757},[1047,10373,1520],{"class":1265},[1047,10375,1523],{"class":1271},[1047,10377,1526],{"class":1265},[1047,10379,10380,10382,10384,10386,10388,10390,10392,10394],{"class":1049,"line":3774},[1047,10381,1533],{"class":1265},[1047,10383,5038],{"class":1271},[1047,10385,5041],{"class":1548},[1047,10387,1552],{"class":1265},[1047,10389,1479],{"class":1265},[1047,10391,5048],{"class":1057},[1047,10393,1479],{"class":1265},[1047,10395,1526],{"class":1265},[1047,10397,10398,10400,10402,10404,10406],{"class":1049,"line":3796},[1047,10399,1542],{"class":1265},[1047,10401,1523],{"class":1271},[1047,10403,5061],{"class":1265},[1047,10405,7742],{"class":1548},[1047,10407,1526],{"class":1265},[1047,10409,10410,10412,10414],{"class":1049,"line":3814},[1047,10411,1566],{"class":1265},[1047,10413,7752],{"class":1271},[1047,10415,1572],{"class":1265},[1047,10417,10418,10420,10422],{"class":1049,"line":3822},[1047,10419,1577],{"class":1265},[1047,10421,1523],{"class":1271},[1047,10423,1526],{"class":1265},[1047,10425,10426,10428,10430,10432,10434],{"class":1049,"line":3839},[1047,10427,1542],{"class":1265},[1047,10429,1523],{"class":1271},[1047,10431,5061],{"class":1265},[1047,10433,5064],{"class":1548},[1047,10435,1526],{"class":1265},[1047,10437,10438,10440,10442,10444,10446,10448,10450,10452],{"class":1049,"line":3858},[1047,10439,1566],{"class":1265},[1047,10441,5073],{"class":1271},[1047,10443,5076],{"class":1548},[1047,10445,1552],{"class":1265},[1047,10447,1479],{"class":1265},[1047,10449,6119],{"class":1057},[1047,10451,1479],{"class":1265},[1047,10453,1526],{"class":1265},[1047,10455,10456,10458],{"class":1049,"line":3866},[1047,10457,5092],{"class":1265},[1047,10459,6130],{"class":1271},[1047,10461,10462,10464,10466,10468,10470],{"class":1049,"line":3871},[1047,10463,6135],{"class":1548},[1047,10465,1552],{"class":1265},[1047,10467,1479],{"class":1265},[1047,10469,6142],{"class":1057},[1047,10471,5149],{"class":1265},[1047,10473,10474,10476,10478,10480,10482],{"class":1049,"line":3877},[1047,10475,5155],{"class":1548},[1047,10477,1552],{"class":1265},[1047,10479,1479],{"class":1265},[1047,10481,6155],{"class":1057},[1047,10483,5149],{"class":1265},[1047,10485,10486],{"class":1049,"line":3897},[1047,10487,6162],{"class":1548},[1047,10489,10490,10492,10494,10496,10498],{"class":1049,"line":3912},[1047,10491,6167],{"class":1548},[1047,10493,1552],{"class":1265},[1047,10495,1479],{"class":1265},[1047,10497,6174],{"class":1057},[1047,10499,5149],{"class":1265},[1047,10501,10502],{"class":1049,"line":3929},[1047,10503,5215],{"class":1265},[1047,10505,10506,10508,10510,10512,10514,10516,10518,10520,10522,10524,10526],{"class":1049,"line":3953},[1047,10507,5221],{"class":1265},[1047,10509,1523],{"class":1271},[1047,10511,5061],{"class":1265},[1047,10513,350],{"class":1548},[1047,10515,1552],{"class":1265},[1047,10517,1479],{"class":1265},[1047,10519,1826],{"class":1265},[1047,10521,6199],{"class":1261},[1047,10523,1449],{"class":1265},[1047,10525,1479],{"class":1265},[1047,10527,1526],{"class":1265},[1047,10529,10530,10532,10534,10536,10538,10540,10542,10544,10546,10548,10550,10552,10554,10556,10558,10560,10562,10564,10566,10568,10570,10572,10574,10576,10578,10580,10582,10584,10586,10588,10590,10592],{"class":1049,"line":3964},[1047,10531,6210],{"class":1265},[1047,10533,1523],{"class":1271},[1047,10535,6215],{"class":1251},[1047,10537,1552],{"class":1265},[1047,10539,1479],{"class":1265},[1047,10541,6222],{"class":1261},[1047,10543,1677],{"class":1265},[1047,10545,6227],{"class":1261},[1047,10547,6230],{"class":1265},[1047,10549,2578],{"class":1261},[1047,10551,1769],{"class":1265},[1047,10553,2159],{"class":1261},[1047,10555,1479],{"class":1265},[1047,10557,6241],{"class":1265},[1047,10559,6244],{"class":1548},[1047,10561,1552],{"class":1265},[1047,10563,6249],{"class":1265},[1047,10565,4075],{"class":1261},[1047,10567,1769],{"class":1265},[1047,10569,1978],{"class":1261},[1047,10571,1449],{"class":1265},[1047,10573,6260],{"class":1057},[1047,10575,4995],{"class":1265},[1047,10577,6265],{"class":1261},[1047,10579,1769],{"class":1265},[1047,10581,5740],{"class":1261},[1047,10583,1449],{"class":1265},[1047,10585,6260],{"class":1057},[1047,10587,4995],{"class":1265},[1047,10589,6278],{"class":1261},[1047,10591,6281],{"class":1265},[1047,10593,1526],{"class":1265},[1047,10595,10596,10598,10600,10602,10604,10606,10608,10610,10612,10614,10616,10618,10620,10622,10624,10626,10628,10630,10632,10634,10636,10638,10640],{"class":1049,"line":3972},[1047,10597,6288],{"class":1265},[1047,10599,6291],{"class":1271},[1047,10601,6294],{"class":1548},[1047,10603,1552],{"class":1265},[1047,10605,1479],{"class":1265},[1047,10607,6301],{"class":1057},[1047,10609,1479],{"class":1265},[1047,10611,6306],{"class":1548},[1047,10613,1552],{"class":1265},[1047,10615,1479],{"class":1265},[1047,10617,6313],{"class":1057},[1047,10619,1479],{"class":1265},[1047,10621,6318],{"class":1548},[1047,10623,1552],{"class":1265},[1047,10625,1479],{"class":1265},[1047,10627,6325],{"class":1057},[1047,10629,1479],{"class":1265},[1047,10631,5076],{"class":1548},[1047,10633,1552],{"class":1265},[1047,10635,1479],{"class":1265},[1047,10637,6336],{"class":1057},[1047,10639,1479],{"class":1265},[1047,10641,1572],{"class":1265},[1047,10643,10644,10646,10648,10650,10652,10654,10656,10658,10660,10662,10664,10666,10668,10670,10672,10674,10676],{"class":1049,"line":3978},[1047,10645,6288],{"class":1265},[1047,10647,947],{"class":1271},[1047,10649,6349],{"class":1548},[1047,10651,1552],{"class":1265},[1047,10653,1479],{"class":1265},[1047,10655,6356],{"class":1057},[1047,10657,1479],{"class":1265},[1047,10659,5076],{"class":1548},[1047,10661,1552],{"class":1265},[1047,10663,1479],{"class":1265},[1047,10665,6367],{"class":1057},[1047,10667,1479],{"class":1265},[1047,10669,2626],{"class":1265},[1047,10671,6374],{"class":1261},[1047,10673,1596],{"class":1265},[1047,10675,947],{"class":1271},[1047,10677,1526],{"class":1265},[1047,10679,10680,10682,10684],{"class":1049,"line":3983},[1047,10681,6385],{"class":1265},[1047,10683,1523],{"class":1271},[1047,10685,1526],{"class":1265},[1047,10687,10688,10690,10692],{"class":1049,"line":4006},[1047,10689,6394],{"class":1265},[1047,10691,1523],{"class":1271},[1047,10693,1526],{"class":1265},[1047,10695,10696,10698,10700],{"class":1049,"line":4012},[1047,10697,5118],{"class":1265},[1047,10699,4691],{"class":1271},[1047,10701,1526],{"class":1265},[1047,10703,10704],{"class":1049,"line":4032},[1047,10705,1330],{"emptyLinePlaceholder":21},[1047,10707,10708,10710],{"class":1049,"line":4038},[1047,10709,5092],{"class":1265},[1047,10711,5134],{"class":1271},[1047,10713,10714,10716,10718,10720,10722],{"class":1049,"line":4084},[1047,10715,5140],{"class":1548},[1047,10717,1552],{"class":1265},[1047,10719,1479],{"class":1265},[1047,10721,4803],{"class":1057},[1047,10723,5149],{"class":1265},[1047,10725,10726,10728,10730,10732,10734],{"class":1049,"line":4100},[1047,10727,6433],{"class":1548},[1047,10729,1552],{"class":1265},[1047,10731,1479],{"class":1265},[1047,10733,6440],{"class":1057},[1047,10735,5149],{"class":1265},[1047,10737,10738,10740,10742,10744,10746],{"class":1049,"line":4133},[1047,10739,5170],{"class":1548},[1047,10741,1552],{"class":1265},[1047,10743,1479],{"class":1265},[1047,10745,5177],{"class":1057},[1047,10747,5149],{"class":1265},[1047,10749,10750,10752,10754,10756,10758],{"class":1049,"line":4147},[1047,10751,6167],{"class":1548},[1047,10753,1552],{"class":1265},[1047,10755,1479],{"class":1265},[1047,10757,6465],{"class":1057},[1047,10759,5149],{"class":1265},[1047,10761,10762,10764,10766,10768,10770],{"class":1049,"line":4155},[1047,10763,5200],{"class":1548},[1047,10765,1552],{"class":1265},[1047,10767,1479],{"class":1265},[1047,10769,6478],{"class":1057},[1047,10771,5149],{"class":1265},[1047,10773,10774],{"class":1049,"line":4160},[1047,10775,5215],{"class":1265},[1047,10777,10778,10780,10782,10784,10787],{"class":1049,"line":4167},[1047,10779,5221],{"class":1265},[1047,10781,1523],{"class":1271},[1047,10783,5061],{"class":1265},[1047,10785,10786],{"class":1548},"footer",[1047,10788,1526],{"class":1265},[1047,10790,10791,10793,10796,10799,10801,10803,10805,10807],{"class":1049,"line":4172},[1047,10792,6210],{"class":1265},[1047,10794,10795],{"class":1271},"ModelSelect",[1047,10797,10798],{"class":1548}," v-model",[1047,10800,1552],{"class":1265},[1047,10802,1479],{"class":1265},[1047,10804,4246],{"class":1057},[1047,10806,1479],{"class":1265},[1047,10808,1572],{"class":1265},[1047,10810,10812,10814,10816],{"class":10811,"line":4190},[1049,1530],[1047,10813,6394],{"class":1265},[1047,10815,1523],{"class":1271},[1047,10817,1526],{"class":1265},[1047,10819,10821],{"class":10820,"line":6553},[1049,1530],[1047,10822,1330],{"emptyLinePlaceholder":21},[1047,10824,10826,10828],{"class":10825,"line":6562},[1049,1530],[1047,10827,5221],{"class":1265},[1047,10829,6491],{"class":1271},[1047,10831,10832,10834,10836,10838,10840],{"class":1049,"line":6571},[1047,10833,6496],{"class":1548},[1047,10835,1552],{"class":1265},[1047,10837,1479],{"class":1265},[1047,10839,6155],{"class":1057},[1047,10841,5149],{"class":1265},[1047,10843,10844,10846,10848,10850,10852],{"class":1049,"line":6580},[1047,10845,6509],{"class":1548},[1047,10847,1552],{"class":1265},[1047,10849,1479],{"class":1265},[1047,10851,5234],{"class":1057},[1047,10853,5149],{"class":1265},[1047,10855,10856,10858,10860,10862,10864],{"class":1049,"line":6589},[1047,10857,6522],{"class":1548},[1047,10859,1552],{"class":1265},[1047,10861,1479],{"class":1265},[1047,10863,6529],{"class":1057},[1047,10865,5149],{"class":1265},[1047,10867,10868,10870,10872,10874,10876],{"class":1049,"line":9099},[1047,10869,6536],{"class":1548},[1047,10871,1552],{"class":1265},[1047,10873,1479],{"class":1265},[1047,10875,6543],{"class":1057},[1047,10877,5149],{"class":1265},[1047,10879,10880],{"class":1049,"line":9108},[1047,10881,6550],{"class":1265},[1047,10883,10884,10886,10888],{"class":1049,"line":9117},[1047,10885,5118],{"class":1265},[1047,10887,4685],{"class":1271},[1047,10889,1526],{"class":1265},[1047,10891,10893,10895,10897],{"class":1049,"line":10892},94,[1047,10894,5252],{"class":1265},[1047,10896,5073],{"class":1271},[1047,10898,1526],{"class":1265},[1047,10900,10902,10904,10906],{"class":1049,"line":10901},95,[1047,10903,1577],{"class":1265},[1047,10905,1523],{"class":1271},[1047,10907,1526],{"class":1265},[1047,10909,10911,10913,10915],{"class":1049,"line":10910},96,[1047,10912,1587],{"class":1265},[1047,10914,5038],{"class":1271},[1047,10916,1526],{"class":1265},[1047,10918,10920,10922,10924],{"class":1049,"line":10919},97,[1047,10921,1596],{"class":1265},[1047,10923,1523],{"class":1271},[1047,10925,1526],{"class":1265},[951,10927,10929],{"id":10928},"going-further","Going further",[947,10931,10932],{},"You now have a working AI chatbot with database persistence! To take it further, consider adding:",[947,10934,10935],{},[965,10936,10937],{},"User Authentication",[947,10939,10940,10941,10946],{},"Add authentication with ",[1022,10942,10945],{"href":10943,"rel":10944},"https://github.com/atinux/nuxt-auth-utils",[1026],"nuxt-auth-utils"," to let users access their chat history across devices and keep conversations private.",[947,10948,10949],{},[965,10950,10951],{},"AI Tools",[947,10953,10954,10955,10960],{},"Extend your chatbot with ",[1022,10956,10959],{"href":10957,"rel":10958},"https://ai-sdk.dev/docs/ai-sdk-core/tools-and-tool-calling",[1026],"AI SDK tools"," that can fetch real-time data, generate charts, or interact with external APIs:",[1037,10962,10964],{"className":1242,"code":10963,"language":1244,"meta":1042,"style":1042},"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",[1044,10965,10966,10985,11003,11007,11022,11038,11055,11086,11094,11114,11119,11154,11158],{"__ignoreMap":1042},[1047,10967,10968,10970,10972,10975,10977,10979,10981,10983],{"class":1049,"line":1050},[1047,10969,1668],{"class":1251},[1047,10971,1671],{"class":1265},[1047,10973,10974],{"class":1261}," tool",[1047,10976,1693],{"class":1265},[1047,10978,1696],{"class":1251},[1047,10980,1352],{"class":1265},[1047,10982,2494],{"class":1057},[1047,10984,1316],{"class":1265},[1047,10986,10987,10989,10991,10993,10995,10997,10999,11001],{"class":1049,"line":1067},[1047,10988,1668],{"class":1251},[1047,10990,1671],{"class":1265},[1047,10992,2529],{"class":1261},[1047,10994,1693],{"class":1265},[1047,10996,1696],{"class":1251},[1047,10998,1352],{"class":1265},[1047,11000,2538],{"class":1057},[1047,11002,1316],{"class":1265},[1047,11004,11005],{"class":1049,"line":1281},[1047,11006,1330],{"emptyLinePlaceholder":21},[1047,11008,11009,11011,11014,11016,11018,11020],{"class":1049,"line":1296},[1047,11010,4741],{"class":1548},[1047,11012,11013],{"class":1261}," weatherTool ",[1047,11015,1552],{"class":1265},[1047,11017,10974],{"class":1070},[1047,11019,1262],{"class":1261},[1047,11021,1266],{"class":1265},[1047,11023,11024,11027,11029,11031,11034,11036],{"class":1049,"line":1308},[1047,11025,11026],{"class":1271},"  description",[1047,11028,1275],{"class":1265},[1047,11030,1352],{"class":1265},[1047,11032,11033],{"class":1057},"Get the current weather for a location",[1047,11035,1290],{"class":1265},[1047,11037,1293],{"class":1265},[1047,11039,11040,11043,11045,11047,11049,11051,11053],{"class":1049,"line":1319},[1047,11041,11042],{"class":1271},"  parameters",[1047,11044,1275],{"class":1265},[1047,11046,2529],{"class":1261},[1047,11048,1769],{"class":1265},[1047,11050,2601],{"class":1070},[1047,11052,1262],{"class":1261},[1047,11054,1266],{"class":1265},[1047,11056,11057,11060,11062,11064,11066,11068,11070,11072,11075,11077,11079,11082,11084],{"class":1049,"line":1327},[1047,11058,11059],{"class":1271},"    location",[1047,11061,1275],{"class":1265},[1047,11063,2529],{"class":1261},[1047,11065,1769],{"class":1265},[1047,11067,3085],{"class":1070},[1047,11069,1766],{"class":1261},[1047,11071,1769],{"class":1265},[1047,11073,11074],{"class":1070},"describe",[1047,11076,1262],{"class":1261},[1047,11078,1290],{"class":1265},[1047,11080,11081],{"class":1057},"The city name",[1047,11083,1290],{"class":1265},[1047,11085,1452],{"class":1261},[1047,11087,11088,11090,11092],{"class":1049,"line":1333},[1047,11089,2374],{"class":1265},[1047,11091,1843],{"class":1261},[1047,11093,1293],{"class":1265},[1047,11095,11096,11099,11101,11103,11105,11108,11110,11112],{"class":1049,"line":1344},[1047,11097,11098],{"class":1070},"  execute",[1047,11100,1275],{"class":1265},[1047,11102,3782],{"class":1548},[1047,11104,1900],{"class":1265},[1047,11106,11107],{"class":1903}," location",[1047,11109,1907],{"class":1265},[1047,11111,1786],{"class":1548},[1047,11113,1341],{"class":1265},[1047,11115,11116],{"class":1049,"line":1360},[1047,11117,11118],{"class":1431},"    // Fetch weather data from an API\n",[1047,11120,11121,11124,11126,11128,11130,11133,11135,11138,11140,11143,11145,11147,11150,11152],{"class":1049,"line":1366},[1047,11122,11123],{"class":1251},"    return",[1047,11125,1671],{"class":1265},[1047,11127,11107],{"class":1261},[1047,11129,1677],{"class":1265},[1047,11131,11132],{"class":1271}," temperature",[1047,11134,1275],{"class":1265},[1047,11136,11137],{"class":3346}," 22",[1047,11139,1677],{"class":1265},[1047,11141,11142],{"class":1271}," condition",[1047,11144,1275],{"class":1265},[1047,11146,1352],{"class":1265},[1047,11148,11149],{"class":1057},"Sunny",[1047,11151,1290],{"class":1265},[1047,11153,9322],{"class":1265},[1047,11155,11156],{"class":1049,"line":1371},[1047,11157,3371],{"class":1265},[1047,11159,11160,11162],{"class":1049,"line":1394},[1047,11161,1449],{"class":1265},[1047,11163,1452],{"class":1261},[994,11165,11167],{"icon":11166,"target":997,"to":998},"i-lucide-rocket",[947,11168,11169,11170,11172,11173,1769],{},"The official ",[965,11171,1004],{}," includes all these features and more. Get started instantly with ",[1044,11174,11175],{},"npx nuxi@latest init -t ui/chat my-chat-app",[951,11177,11179],{"id":11178},"deploying-to-vercel","Deploying to Vercel",[947,11181,11182],{},"Deploy your chatbot to Vercel with zero configuration:",[1037,11184,11186],{"className":1039,"code":11185,"language":1041,"meta":1042,"style":1042},"npx vercel deploy\n",[1044,11187,11188],{"__ignoreMap":1042},[1047,11189,11190,11192,11195],{"class":1049,"line":1050},[1047,11191,1054],{"class":1053},[1047,11193,11194],{"class":1057}," vercel",[1047,11196,11197],{"class":1057}," deploy\n",[947,11199,11200],{},"Then, in the Vercel dashboard:",[959,11202,11203,11209],{},[962,11204,11205,11206,11208],{},"Enable ",[965,11207,4202],{}," and add credits so requests can be processed.",[962,11210,11211,11212,11215],{},"Add a ",[965,11213,11214],{},"Turso"," database from the Vercel Marketplace and connect it to your project (it will provision the database and add the required environment variables automatically).",[11217,11218,11219],"blockquote",{},[947,11220,11221,11222,11227,11228,11230],{},"Note: On Vercel, you ",[965,11223,11224,11225],{},"don’t need to manually add ",[1044,11226,1619],{}," — Vercel handles the gateway configuration for deployments. Keep using ",[1044,11229,1606],{}," locally for development.",[1626,11232,11233],{"to":1024,"target":997},[947,11234,11235,11236,1769],{},"Learn more about setting up AI Gateway in the ",[965,11237,11238],{},"Vercel AI Gateway documentation",[951,11240,11242],{"id":11241},"conclusion","Conclusion",[947,11244,11245],{},"You've built a complete AI chatbot with:",[959,11247,11248,11254,11260,11265,11270],{},[962,11249,11250,11253],{},[965,11251,11252],{},"A complete chat interface"," using Nuxt UI components",[962,11255,11256,11259],{},[965,11257,11258],{},"Real-time streaming responses"," with the AI SDK",[962,11261,11262,11264],{},[965,11263,979],{}," with MDC for rich content display",[962,11266,11267,11269],{},[965,11268,985],{}," via AI Gateway",[962,11271,11272,11275],{},[965,11273,11274],{},"Database persistence"," with SQLite (local) / Turso (production) and Drizzle ORM",[947,11277,11278],{},"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.",[947,11280,11281],{},[965,11282,11283],{},"Resources:",[959,11285,11286,11293,11300,11307,11313],{},[962,11287,11288],{},[1022,11289,11292],{"href":11290,"rel":11291},"https://ui.nuxt.com/components/chat-messages",[1026],"Nuxt UI Chat Components",[962,11294,11295],{},[1022,11296,11299],{"href":11297,"rel":11298},"https://hub.nuxt.com/docs/features/database",[1026],"NuxtHub Database",[962,11301,11302],{},[1022,11303,11306],{"href":11304,"rel":11305},"https://ai-sdk.dev",[1026],"AI SDK Documentation",[962,11308,11309],{},[1022,11310,11312],{"href":1024,"rel":11311},[1026],"AI Gateway Documentation",[962,11314,11315],{},[1022,11316,11318],{"href":998,"rel":11317},[1026],"AI Chat Template",[947,11320,11321],{},"We're excited to see what you'll build!",[11323,11324,11325],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html pre.shiki code .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sfNiH, html code.shiki .sfNiH{--shiki-light:#FF5370;--shiki-default:#FF9CAC;--shiki-dark:#FF9CAC}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .sbssI, html code.shiki .sbssI{--shiki-light:#F76D47;--shiki-default:#F78C6C;--shiki-dark:#F78C6C}",{"title":1042,"searchDepth":1067,"depth":1067,"links":11327},[11328,11329,11330,11336,11341,11344,11345,11349,11350,11351,11356,11357,11358],{"id":953,"depth":1067,"text":954},{"id":1008,"depth":1067,"text":1009},{"id":1031,"depth":1067,"text":1032,"children":11331},[11332,11333,11334,11335],{"id":1077,"depth":1281,"text":1078},{"id":1228,"depth":1281,"text":1229},{"id":1497,"depth":1281,"text":1498},{"id":1637,"depth":1281,"text":1638},{"id":2417,"depth":1067,"text":2418,"children":11337},[11338,11339,11340],{"id":2429,"depth":1281,"text":2430},{"id":2812,"depth":1281,"text":2813},{"id":4294,"depth":1281,"text":4295},{"id":4676,"depth":1067,"text":4677,"children":11342},[11343],{"id":4695,"depth":1281,"text":4696},{"id":5315,"depth":1067,"text":5316},{"id":6750,"depth":1067,"text":6751,"children":11346},[11347,11348],{"id":6757,"depth":1281,"text":6758},{"id":6917,"depth":1281,"text":6918},{"id":7415,"depth":1067,"text":7416},{"id":7958,"depth":1067,"text":7959},{"id":9135,"depth":1067,"text":9136,"children":11352},[11353,11354,11355],{"id":9146,"depth":1281,"text":9147},{"id":9417,"depth":1281,"text":9418},{"id":9678,"depth":1281,"text":9679},{"id":10928,"depth":1067,"text":10929},{"id":11178,"depth":1067,"text":11179},{"id":11241,"depth":1067,"text":11242},"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":11364},"Tutorial","/blog/how-to-build-an-ai-chat",{"title":931,"description":11360},"blog/how-to-build-an-ai-chat","sF-X00IyVVRUYqwN17Ubpm4H6Z1IRgi6gKRm3dRrqnY",1772538857002]