|
|
@@ -57,6 +57,9 @@ class ScanImageReplyController extends BaseController {
|
|
|
/// 是否上传页
|
|
|
RxBool isUploadPage = true.obs;
|
|
|
|
|
|
+ /// 是否生成结果中
|
|
|
+ RxBool isResultGenerating = false.obs;
|
|
|
+
|
|
|
/// 上传图片列表
|
|
|
Rxn<UploadInfo> uploadInfo = Rxn();
|
|
|
|
|
|
@@ -102,7 +105,11 @@ class ScanImageReplyController extends BaseController {
|
|
|
if (toneList.isNotEmpty) {
|
|
|
var newList =
|
|
|
toneList.map((item) {
|
|
|
- return OptionSelectItem("${item.emoji} ${item.title}");
|
|
|
+ return OptionSelectItem(
|
|
|
+ "${item.emoji} ${item.title}",
|
|
|
+ // 提交给服务端的数据,不能包含表情字符
|
|
|
+ item.title ?? "",
|
|
|
+ );
|
|
|
}).toList();
|
|
|
|
|
|
replyToneOptionSelectConfigList.clear();
|
|
|
@@ -184,8 +191,7 @@ class ScanImageReplyController extends BaseController {
|
|
|
// 上传的图片后端地址
|
|
|
List<String> imageList = [uploadInfo.value?.fileBackendPath ?? ""];
|
|
|
// 选择的回复语气
|
|
|
- // String title = currentSelectReplyToneOption.value?.name ?? "";
|
|
|
- String title = "高冷";
|
|
|
+ String title = currentSelectReplyToneOption.value?.value ?? "";
|
|
|
// 当前选择的回复模式
|
|
|
String mode = currentReplyMode.value?.value ?? "";
|
|
|
|
|
|
@@ -204,7 +210,11 @@ class ScanImageReplyController extends BaseController {
|
|
|
|
|
|
StringBuffer buffer = StringBuffer();
|
|
|
|
|
|
+ // 切换为生成中
|
|
|
+ isResultGenerating.value = true;
|
|
|
replyToneList.clear();
|
|
|
+ // 添加一条,正在回复的条目
|
|
|
+ replyToneList.add("");
|
|
|
replyToneList.refresh();
|
|
|
|
|
|
// 请求分析截图
|
|
|
@@ -220,9 +230,11 @@ class ScanImageReplyController extends BaseController {
|
|
|
IntimacyReplyAnalyzeResponse response =
|
|
|
IntimacyReplyAnalyzeResponse.fromJson(jsonDecode(json));
|
|
|
|
|
|
- List<String> contentList = response.choices?.map((item) {
|
|
|
- return item.delta?.content ?? "";
|
|
|
- }).toList() ?? [];
|
|
|
+ List<String> contentList =
|
|
|
+ response.choices?.map((item) {
|
|
|
+ return item.delta?.content ?? "";
|
|
|
+ }).toList() ??
|
|
|
+ [];
|
|
|
// 数组转字符串
|
|
|
String content = contentList.join("");
|
|
|
|