AI助手优化-头像和对话功能
This commit is contained in:
@@ -6,10 +6,24 @@ class ChatSessionItem {
|
||||
final String title;
|
||||
final String updateTime;
|
||||
|
||||
/// 本会话绑定的人设 id。null = 内置默认人设。
|
||||
///
|
||||
/// 会话的人设在**新建时确定、之后不可改** —— 一次对话从头到尾是同一个人。
|
||||
final int? personaId;
|
||||
|
||||
/// 人设显示名。人设被删了会回落成「默认人设」,历史会话不会因此打不开
|
||||
final String personaName;
|
||||
|
||||
/// 人设头像相对路径。null = 用默认头像
|
||||
final String? personaAvatar;
|
||||
|
||||
const ChatSessionItem({
|
||||
required this.id,
|
||||
required this.title,
|
||||
required this.updateTime,
|
||||
this.personaId,
|
||||
this.personaName = '默认人设',
|
||||
this.personaAvatar,
|
||||
});
|
||||
|
||||
factory ChatSessionItem.fromJson(Map<String, dynamic> json) {
|
||||
@@ -17,6 +31,9 @@ class ChatSessionItem {
|
||||
id: asInt(json['id']),
|
||||
title: asNonEmpty(json['title'], '新对话'),
|
||||
updateTime: formatDateTime(json['updateTime']),
|
||||
personaId: asNullableInt(json['personaId']),
|
||||
personaName: asNonEmpty(json['personaName'], '默认人设'),
|
||||
personaAvatar: asNonEmpty(json['personaAvatar'], ''),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user