搜索

PythonReactSEOPDF
GitHub Skill

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 展示、消息编辑与重新生成、模型与参数设置。

ShouxinZhang☆ 0 仓库 Stars0 仓库 Forks

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

查看来源 ↗使用指南

技能说明

Agent Studio Chat

Follow the data flow

  • Start from src/components/features/chat/hooks/useChatLogic.ts (Vercel AI SDK useChat + 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.ts and src/components/features/settings/SettingsPanel.tsx

Make safe changes

  • Preserve UIMessage.parts when needed (reasoning parts may carry provider metadata; see src/app/api/chat/route.ts).
  • Prefer adding new transient UI flags to useChatUIStore to avoid prop drilling.
  • Keep feature code under src/components/features/chat/ and reuse src/components/ui/* primitives.

使用示例

查看来源仓库中的使用示例与配置说明。

查看来源 ↗

来源历史

收录时间
2026-01-20
索引更新时间
2026-01-26
Branch
main

收录与同步日期属于本站记录。源码修改历史请查看来源仓库。

GitHub ↗

chat Comments (0)

chat_bubble_outline

No comments yet. Be the first to share your thoughts!