first commit

This commit is contained in:
zch1234qq
2025-10-16 21:24:18 +08:00
commit b9d03d05cc
35 changed files with 10191 additions and 0 deletions

64
app/types/types.ts Normal file
View File

@ -0,0 +1,64 @@
/**
* 消息类型接口
*/
export interface Message {
/**
* 消息唯一标识符
*/
id: string;
/**
* 消息内容
*/
content: string;
/**
* 发送者类型
*/
sender: 'user' | 'bot';
/**
* 消息时间戳
*/
timestamp: Date;
}
/**
* Coze API 配置接口
*/
export interface CozeConfig {
/**
* Coze API 密钥
*/
apiKey: string;
/**
* Bot ID
*/
botId: string;
}
/**
* 聊天上下文接口
*/
export interface ChatContext {
/**
* 当前对话ID
*/
conversationId: string | null;
/**
* 历史消息列表
*/
messages: Message[];
/**
* 是否已初始化
*/
isInitialized: boolean;
}
/**
* 流式响应回调函数类型
*/
export type StreamCallback = (partialText: string, isDone: boolean) => void;