|
@@ -583,6 +583,17 @@
|
|
|
var AI_UBAO_CONVERSATION_API =
|
|
var AI_UBAO_CONVERSATION_API =
|
|
|
"https://prod.ailien.shop/ai/life-manager/api/v1/ubao-conversation/history/conversation";
|
|
"https://prod.ailien.shop/ai/life-manager/api/v1/ubao-conversation/history/conversation";
|
|
|
|
|
|
|
|
|
|
+ /** 仅发图时的默认提示,分享页不展示 */
|
|
|
|
|
+ var IMAGE_ONLY_DEFAULT_PROMPT = "请帮我看看这些图片";
|
|
|
|
|
+
|
|
|
|
|
+ function isImageOnlyPlaceholderText(text) {
|
|
|
|
|
+ var t = String(text || "").trim();
|
|
|
|
|
+ if (!t) return true;
|
|
|
|
|
+ if (t === IMAGE_ONLY_DEFAULT_PROMPT) return true;
|
|
|
|
|
+ if (t === "[图片]" || t === "【图片】" || t === "[图]" || t === "【图】") return true;
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
var sharePayloadCache = null;
|
|
var sharePayloadCache = null;
|
|
|
var conversationApiDebugInfo = null;
|
|
var conversationApiDebugInfo = null;
|
|
|
var weChatJssdkConfigured = false;
|
|
var weChatJssdkConfigured = false;
|
|
@@ -1176,7 +1187,11 @@
|
|
|
for (var i = 0; i < list.length; i++) {
|
|
for (var i = 0; i < list.length; i++) {
|
|
|
var m = list[i];
|
|
var m = list[i];
|
|
|
if (!m || m.role !== "user") continue;
|
|
if (!m || m.role !== "user") continue;
|
|
|
- if (m.isImage) return "[图片]";
|
|
|
|
|
|
|
+ if (m.isImage) {
|
|
|
|
|
+ var imgText = String(m.content || "").trim();
|
|
|
|
|
+ if (imgText && !isImageOnlyPlaceholderText(imgText)) return imgText;
|
|
|
|
|
+ continue;
|
|
|
|
|
+ }
|
|
|
var t = String(m.content || "").trim();
|
|
var t = String(m.content || "").trim();
|
|
|
if (t) return t;
|
|
if (t) return t;
|
|
|
}
|
|
}
|
|
@@ -1229,7 +1244,7 @@
|
|
|
buildUserBubbleImagesHtml(imageUrls) +
|
|
buildUserBubbleImagesHtml(imageUrls) +
|
|
|
"</div></div>";
|
|
"</div></div>";
|
|
|
var imageUserText = String(msg.content || "").trim();
|
|
var imageUserText = String(msg.content || "").trim();
|
|
|
- if (imageUserText) {
|
|
|
|
|
|
|
+ if (imageUserText && !isImageOnlyPlaceholderText(imageUserText)) {
|
|
|
html +=
|
|
html +=
|
|
|
'<div class="row row--user"><div class="user-bubble">' +
|
|
'<div class="row row--user"><div class="user-bubble">' +
|
|
|
escHtml(imageUserText) +
|
|
escHtml(imageUserText) +
|
|
@@ -1238,7 +1253,7 @@
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
var userText = String(msg.content || "").trim();
|
|
var userText = String(msg.content || "").trim();
|
|
|
- if (!userText) continue;
|
|
|
|
|
|
|
+ if (!userText || isImageOnlyPlaceholderText(userText)) continue;
|
|
|
html +=
|
|
html +=
|
|
|
'<div class="row row--user"><div class="user-bubble">' +
|
|
'<div class="row row--user"><div class="user-bubble">' +
|
|
|
escHtml(userText) +
|
|
escHtml(userText) +
|
|
@@ -1297,7 +1312,8 @@
|
|
|
count += 1;
|
|
count += 1;
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
- if (String(msg.content || "").trim()) count += 1;
|
|
|
|
|
|
|
+ var userContent = String(msg.content || "").trim();
|
|
|
|
|
+ if (userContent && !isImageOnlyPlaceholderText(userContent)) count += 1;
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
if (msg.role === "ai" || msg.role === "assistant") {
|
|
if (msg.role === "ai" || msg.role === "assistant") {
|