2 Star 13 Fork 3

ChangweiZhang / ChatUI

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
ChatMessage.ets 653 Bytes
一键复制 编辑 原始数据 按行查看 历史
ChangweiZhang 提交于 2024-03-17 19:37 . 增加图片消息支持
// 消息格式
import { ChatRole } from '../common/ChatConfig'
interface IChatMessage{
name?:string
content?:string
picurl?:string
role:ChatRole
}
class ChatMessage implements IChatMessage{
name?:string
picurl?:string
content?:string //|string[]
role:ChatRole
// constructor(mRole:ChatRole,mContent?:string,mName?:string,picUrl?:string) {
// this.content=mContent
// this.role=mRole
// this.name=mName
// this.picurl=picUrl
// }
constructor(data:IChatMessage) {
this.content=data.content
this.role=data.role
this.name=data.name
this.picurl=data.picurl
}
}
export {IChatMessage,ChatMessage}
TypeScript
1
https://gitee.com/changweizhang/ChatUI.git
git@gitee.com:changweizhang/ChatUI.git
changweizhang
ChatUI
ChatUI
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891