Files
agent/app/types/types.ts
zch1234qq 4afe6529fb
Some checks failed
Docker Build and Deploy / build-and-push (push) Has been cancelled
Docker Build and Deploy / deploy-hk (push) Has been cancelled
qwe
2025-10-21 09:17:52 +08:00

61 lines
843 B
TypeScript

/**
* 消息类型接口
*/
export interface Message {
/**
* 消息唯一标识符
*/
id: string;
/**
* 消息内容
*/
content: string;
content_type: 'text'|'card';
/**
* 发送者类型
*/
role: 'user' | 'assistant';
/**
* 消息时间戳
*/
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;