Skip to content

Commit 034b26e

Browse files
Markeljanclaude
andauthored
deprecate assistants upgrade next16 ai-sdkv6 openai-v6 (#37)
* Migrate from OpenAI Assistants API to Vercel AI SDK chat API This commit migrates the application from using OpenAI's Assistants API (threads/runs) to the modern Vercel AI SDK streamText chat API. Key changes: **Package Updates:** - Next.js 14.2 → 15.3 (with turbopack) - React 18 → React 19 - react-markdown 8 → 10 - next-auth updated to 5.0.0-beta.25 - Updated Radix UI components to latest versions - Updated remark plugins for react-markdown v10 compatibility - Zod downgraded from v4 to v3 for AI SDK compatibility **API Migration:** - Replaced `/api/assistants/threads/messages` with `/api/chat` - Migrated from AssistantResponse to streamText - Tools defined inline with Zod schemas and execute functions - Messages stored in Vercel KV instead of OpenAI threads **Component Updates:** - Chat component: useAssistant → useChat hook - Updated ChatPanel, PromptForm, ChatList, ChatMessage for new API - AgentCard updated with onNewChat callback - Fixed react-markdown v10 breaking changes (removed className prop, linkTarget) **Next.js 15 Compatibility:** - params/searchParams are now Promises (awaited in pages) - cookies() is now async (await cookies()) - Updated Radix UI Portal components (removed className prop) - Fixed RefObject types for React 19 * deprecate-assistants-upgrade-next16-aisdkv6-openaiv6 next 16 ai-sdk v6 openai v6 openai assistants removed / deprecated to readonly * fix invalid client components * Refactor agent retrieval and add new UI components Replaces all uses of getAgent with getAgentById for agent retrieval, centralizing agent data access. Adds new components for AI elements and header model badge, introduces a UI collapsible, and removes the old reasoning component. Updates chat API to use agent instructions and tools dynamically, and enhances OpenAI provider options. Also updates dependencies and constants to support these changes. --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 7c1681e commit 034b26e

93 files changed

Lines changed: 2394 additions & 2047 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

ROADMAP.md

Lines changed: 0 additions & 76 deletions
This file was deleted.

app/api/api-docs/route.ts

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,22 @@
1+
import type { HtmlRenderingConfiguration } from "@scalar/core/libs/html-rendering"
12
import { ApiReference } from "@scalar/nextjs-api-reference"
23
import openApiSpec from "@/public/openapi.json" with { type: "json" }
34

4-
const config = {
5+
const config: Partial<HtmlRenderingConfiguration> = {
56
theme: "saturn" as const,
67
metaData: {
78
title: "Web3GPT API",
89
description: "Web3GPT API Reference",
910
},
1011
authentication: {
11-
http: {
12-
bearer: {
13-
token: undefined,
14-
},
15-
basic: {
16-
username: "",
17-
password: "",
18-
},
19-
},
12+
preferredSecurityScheme: "bearerAuth",
2013
securitySchemes: {
21-
bearer: {
22-
type: "http",
23-
scheme: "bearer",
24-
bearerFormat: "Bearer",
14+
bearerAuth: {
15+
token: undefined,
2516
},
2617
},
27-
preferredSecurityScheme: "bearerAuth",
28-
},
29-
spec: {
30-
content: openApiSpec,
3118
},
19+
content: openApiSpec,
3220
hideClientButton: true,
3321
}
3422

app/api/assistants/threads/messages/route.ts

Lines changed: 0 additions & 222 deletions
This file was deleted.

0 commit comments

Comments
 (0)