Commit 034b26e
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
- app
- api
- api-docs
- assistants/threads/messages
- chat
- cron
- og
- v1
- completions
- contracts/deploy
- chat/[id]
- state
- components
- ai-elements
- chat
- header
- providers
- sidebar
- ui
- lib
- actions
- data
- hooks
- solidity
- public/assets
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
4 | | - | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
| 12 | + | |
20 | 13 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 14 | + | |
| 15 | + | |
25 | 16 | | |
26 | 17 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | 18 | | |
| 19 | + | |
32 | 20 | | |
33 | 21 | | |
34 | 22 | | |
| |||
This file was deleted.
0 commit comments