{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "ai-sdk-backend",
  "type": "registry:page",
  "title": "AI SDK Backend",
  "description": "Next.js route handler that streams chat completions through the AI SDK.",
  "dependencies": [
    "ai",
    "@ai-sdk/openai",
    "@assistant-ui/react-ai-sdk"
  ],
  "files": [
    {
      "type": "registry:page",
      "path": "app/api/chat/route.ts",
      "target": "app/api/chat/route.ts",
      "content": "import { openai } from \"@ai-sdk/openai\";\nimport { frontendTools } from \"@assistant-ui/react-ai-sdk\";\nimport {\n  streamText,\n  convertToModelMessages,\n  type UIMessage,\n  type JSONSchema7,\n} from \"ai\";\n\nexport async function POST(req: Request) {\n  const {\n    messages,\n    system,\n    tools,\n  }: {\n    messages: UIMessage[];\n    system?: string;\n    tools?: Record<string, { description?: string; parameters: JSONSchema7 }>;\n  } = await req.json();\n\n  const result = streamText({\n    model: openai(\"gpt-5.6-luna\"),\n    messages: await convertToModelMessages(messages),\n    tools: {\n      ...frontendTools(tools ?? {}),\n    },\n    ...(system === undefined ? {} : { system }),\n  });\n\n  return result.toUIMessageStreamResponse();\n}\n"
    }
  ]
}