AI人设可以配置
This commit is contained in:
@@ -127,4 +127,22 @@ class LocalStorage {
|
||||
|
||||
/// 读选中的配置。null = 用默认。
|
||||
int? getAiConfigId() => _prefs?.getInt(_keyAiConfigId);
|
||||
|
||||
// ---- AI 人设配置 ----
|
||||
// 与模型配置各存各的 —— 两者正交,切一个不该动另一个。
|
||||
// 同样只存「用户选中了哪一条」,人设文本本身在服务端。
|
||||
static const _keyAiPersonaId = 'ai_persona_id';
|
||||
|
||||
/// 存选中的人设。null 表示「默认」(服务端内置的那套)。
|
||||
Future<void> saveAiPersonaId(int? id) async {
|
||||
final prefs = await _getPrefs();
|
||||
if (id == null) {
|
||||
await prefs.remove(_keyAiPersonaId);
|
||||
} else {
|
||||
await prefs.setInt(_keyAiPersonaId, id);
|
||||
}
|
||||
}
|
||||
|
||||
/// 读选中的人设。null = 用内置默认。
|
||||
int? getAiPersonaId() => _prefs?.getInt(_keyAiPersonaId);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user