import { ContextInjected, TcbExtendedContext } from '@cloudbase/functions-typings' import type { DataModelMethods } from '@cloudbase/wx-cloud-client-sdk' import { SSESender } from './sse-sender' export type TcbContext = ContextInjected export interface ChatRecord { /** 异步回复内容 */ async_reply?: string /** 是否异步回复 */ need_async_reply?: boolean /** 请求 id */ trace_id?: string /** 回复的消息id */ reply?: string /** 被回复的消息id */ reply_to?: string /** 原始消息内容 */ origin_msg?: string /** 来源 */ trigger_src?: string /** 会话 */ conversation?: string /** 发送者 */ sender?: string /** 推荐问题 */ recommend_questions?: string[] /** 事件类型 */ event?: string /** 图片地址 */ image?: string /** 内容 */ content?: string /** 消息类型 */ type?: string /** 角色 */ role?: string /** 对话记录ID */ record_id?: string /** 智能体ID */ bot_id?: string } export type ChatRecordDataModel = DataModelMethods export type BotCoreSseSender = SSESender<{ content: string [key: string]: unknown }> export type PickRequired = T & Required>