重构聊天会话管理,支持会话历史和存储
This commit is contained in:
@@ -4,6 +4,7 @@ import { config } from "@config/config";
|
||||
export type StreamEvent =
|
||||
| { type: "token"; sessionId: string; content: string }
|
||||
| { type: "done"; sessionId: string }
|
||||
| { type: "session_title"; sessionId: string; title: string }
|
||||
| {
|
||||
type: "progress";
|
||||
sessionId: string;
|
||||
@@ -182,6 +183,12 @@ export const streamAgentChat = async ({
|
||||
type: "done",
|
||||
sessionId: parsed.session_id ?? "",
|
||||
});
|
||||
} else if (event === "session_title") {
|
||||
onEvent({
|
||||
type: "session_title",
|
||||
sessionId: parsed.session_id ?? "",
|
||||
title: typeof parsed.title === "string" ? parsed.title : "",
|
||||
});
|
||||
} else if (event === "error") {
|
||||
onEvent({
|
||||
type: "error",
|
||||
|
||||
Reference in New Issue
Block a user