ai-assistant-pro 0.2.36 → 0.2.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,7 +23,7 @@
23
23
  style="width: 32px; height: 32px; border-radius: 50%; margin-top: 13px;"
24
24
  alt=""
25
25
  />
26
- <div v-else class="robot-image-div"></div>
26
+ <img v-else class="robot-image-div" src="../static/robot.png" alt=""/>
27
27
  </div>
28
28
  <div v-if="list.type === 'user' && avatarUrl" class="robot">
29
29
  <img :src="avatarUrl" alt="" style="width: 32px; height: 32px; border-radius: 50%;">
@@ -1513,10 +1513,7 @@ export default {
1513
1513
 
1514
1514
  .robot-image-div {
1515
1515
  width: 32px;
1516
- height: 32px;
1517
- background: url("../static/robot.png");
1518
- background-size: 100%;
1519
- border-radius: 50%;
1516
+ height: 38px;
1520
1517
  margin-top: 13px;
1521
1518
  }
1522
1519
  </style>
@@ -7,7 +7,7 @@
7
7
  style="width: 32px; height: 32px; border-radius: 50%;"
8
8
  alt=""
9
9
  />
10
- <div v-else class="robot-image-div"></div>
10
+ <img v-else class="robot-image-div" src="../static/robot.png" alt=""/>
11
11
  </div>
12
12
  <div class="robot-message">
13
13
  <template v-if="prologue && prologue.trim()">
@@ -142,10 +142,7 @@ p {
142
142
 
143
143
  .robot-image-div {
144
144
  width: 32px;
145
- height: 32px;
146
- background: url("../static/robot.png");
147
- background-size: 100%;
148
- border-radius: 50%;
145
+ height: 38px;
149
146
  margin-top: 13px;
150
147
  }
151
148
  </style>
@@ -168,7 +168,7 @@ import Cookies from "js-cookie";
168
168
  import ChatType from "./chat-type.vue";
169
169
  import DigitalHuman from './digital-human.vue';
170
170
  import { marked } from 'marked';
171
- import { getUserInfo, editorCurrentData, MULTIMODAL_QUICK_PROMPT } from '../utils/config';
171
+ import { getUserInfo, editorCurrentData, resolveMultimodalQuickPrompt } from '../utils/config';
172
172
  import error401 from '../static/401.png'
173
173
  import error403 from '../static/403.png'
174
174
  import agentNull from '../static/agent-null.png'
@@ -432,9 +432,10 @@ export default {
432
432
  * 业务侧通过 ref 调用:传入已上传图片的 ossOriUrl,自动进入解题目并发起问答。
433
433
  * @param {string} ossOriUrl 图片 OSS 地址(业务侧上传后获得)
434
434
  * @param {string} [prompt] 可选,自定义提问文案;默认见 MULTIMODAL_QUICK_PROMPT
435
+ * @param {boolean} [hasSelect=false] 是否圈选区域;true 时使用圈选默认文案
435
436
  * @returns {Promise<boolean>}
436
437
  */
437
- async quickMultimodalAsk(ossOriUrl, prompt) {
438
+ async quickMultimodalAsk(ossOriUrl, prompt, hasSelect = false) {
438
439
  const url = (ossOriUrl || '').trim();
439
440
  if (!url) {
440
441
  this.$message.warning('缺少图片地址');
@@ -448,7 +449,7 @@ export default {
448
449
  return false;
449
450
  }
450
451
 
451
- const message = (prompt || MULTIMODAL_QUICK_PROMPT).trim();
452
+ const message = resolveMultimodalQuickPrompt(prompt, hasSelect);
452
453
 
453
454
  if (this.activeKey !== 'multimodal') {
454
455
  if (this.$refs.chatType) {
Binary file
@@ -33,6 +33,16 @@ export const errorList = [
33
33
  /** 业务侧触发解题目快速问答时的默认提问文案 */
34
34
  export const MULTIMODAL_QUICK_PROMPT = '这个我不太懂,可以帮我解释一下吗?';
35
35
 
36
+ /** 业务侧圈选区域后触发解题目快速问答时的默认提问文案 */
37
+ export const MULTIMODAL_QUICK_PROMPT_SELECT = '能帮我讲解一下圈出的部分吗?';
38
+
39
+ export function resolveMultimodalQuickPrompt(prompt, hasSelect = false) {
40
+ if (prompt != null && String(prompt).trim()) {
41
+ return String(prompt).trim();
42
+ }
43
+ return hasSelect ? MULTIMODAL_QUICK_PROMPT_SELECT : MULTIMODAL_QUICK_PROMPT;
44
+ }
45
+
36
46
  export const cacheMessageList = [
37
47
  {
38
48
  type: 'user',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ai-assistant-pro",
3
- "version": "0.2.36",
3
+ "version": "0.2.37",
4
4
  "description": "学习助手",
5
5
  "main": "dist/ai-assistant-pro.umd.js",
6
6
  "keywords": [