- BLE: 修复 BlueZ LocalName 与 Includes 冲突,串行注册与退避 - HTTP: 语音对话补 Live2D talking 标志与 session;Web 补 X-Session-Id - Flutter: 角色/对话/模型页 + API,Gradle/依赖升级,麦克风权限 - 文档: 新增 docs/STATUS.md,校准 CLAUDE/PROGRESS/README - 清理: 移除根目录截图与临时模型,运维脚本迁入 scripts/device
46 lines
1.1 KiB
Dart
46 lines
1.1 KiB
Dart
class ChatTurnResponse {
|
|
const ChatTurnResponse({
|
|
required this.sessionId,
|
|
required this.replyText,
|
|
this.transcription,
|
|
this.replyAudioPath,
|
|
this.error,
|
|
});
|
|
|
|
final String sessionId;
|
|
final String replyText;
|
|
final String? transcription;
|
|
final String? replyAudioPath;
|
|
final String? error;
|
|
|
|
bool get isOk => error == null || error!.isEmpty;
|
|
|
|
factory ChatTurnResponse.fromJson(Map<String, dynamic> json) {
|
|
return ChatTurnResponse(
|
|
sessionId: json['session_id']?.toString() ?? '',
|
|
replyText: json['reply_text']?.toString() ?? '',
|
|
transcription: json['transcription']?.toString(),
|
|
replyAudioPath: json['reply_audio_path']?.toString(),
|
|
error: json['error']?.toString(),
|
|
);
|
|
}
|
|
}
|
|
|
|
enum ChatBubbleRole { user, assistant, system }
|
|
|
|
class ChatBubble {
|
|
ChatBubble({
|
|
required this.role,
|
|
required this.text,
|
|
this.audioPath,
|
|
this.isPending = false,
|
|
DateTime? createdAt,
|
|
}) : createdAt = createdAt ?? DateTime.now();
|
|
|
|
final ChatBubbleRole role;
|
|
String text;
|
|
String? audioPath;
|
|
bool isPending;
|
|
final DateTime createdAt;
|
|
}
|