agent-studio-chat
Work on Agent Studio chat (UI + streaming) and the /api/chat route. Use for tasks like message rendering, reasoning display, editing/regenerate, Zustand chat stores, model/settings UI, and OpenRouter or Vercel AI SDK integration. 聊天功能开发/排障:流式输出、Reasoning 展示、消息编辑与重新生成、模型与参数设置。
Installation
Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.
Voir la source ↗GuidesInstructions
Agent Studio Chat
Follow the data flow
- Start from
src/components/features/chat/hooks/useChatLogic.ts(Vercel AI SDKuseChat+DefaultChatTransport). - Server route is
src/app/api/chat/route.ts(OpenRouter provider +streamText). - UI entry is
src/components/features/chat/ChatInterface.tsx(Virtuoso list +ChatInput).
Know the state layers
- Conversation persistence:
src/lib/store/useChatStore.ts - UI-only transient state (editing/copy):
src/lib/store/useChatUIStore.ts - Model + sampling + system instructions:
src/lib/store/useSettingsStore.tsandsrc/components/features/settings/SettingsPanel.tsx
Make safe changes
- Preserve
UIMessage.partswhen needed (reasoning parts may carry provider metadata; seesrc/app/api/chat/route.ts). - Prefer adding new transient UI flags to
useChatUIStoreto avoid prop drilling. - Keep feature code under
src/components/features/chat/and reusesrc/components/ui/*primitives.
Exemples
Consultez les exemples du dépôt source.
Voir la source ↗Historique source
- Date d’indexation
- 2026-01-20
- Mise à jour de l’index
- 2026-01-26
- Branch
- main
Les dates concernent ce répertoire. Consultez le dépôt pour l’historique du code.
GitHub ↗chat Comments (0)
Sign in to join the discussion and leave a comment.
No comments yet. Be the first to share your thoughts!