ai-chat-bot-interface 1.6.18 → 1.6.20

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "ai-chat-bot-interface",
3
3
  "private": false,
4
- "version": "1.6.18",
4
+ "version": "1.6.20",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "description": "A AI chat bot interface. (private)",
package/src/ChatUi.vue CHANGED
@@ -356,32 +356,15 @@ onMounted(async () => {
356
356
  } else {
357
357
  await createConv();
358
358
  if (props.firstMsg) {
359
- // await chatConv([{ content: props.firstMsg, text: props.firstMsg }]);
360
- historyList.value = [
361
- {
362
- conversation_id: '',
363
- bot_id: props.botId,
364
- role: 'user',
365
- content: props.firstMsg,
366
- reasoning_content: '',
367
- status: 'ended',
368
- extra: [],
369
- },
370
- {
371
- conversation_id: '',
372
- bot_id: props.botId,
373
- role: 'assistant',
374
- content:
375
- '你好!请提供你的身高、年龄、体重、性别、日常运动水平等身体数据,以及口味偏好、饮食禁忌、疾病史等信息,我会为你制定饮食方案和提供配餐信息。',
376
- reasoning_content: '',
377
- status: 'ended',
378
- extra: [
379
- {
380
- showType: 'personalForm',
381
- },
382
- ],
383
- },
384
- ];
359
+ const perMsg = `本食谱为通用版${props.firstMsg}示例,依据以下女性常规身体数据制定:
360
+ 性别:女;
361
+ 年龄:25岁;
362
+ 身高:160cm;
363
+ 体重:60kg;
364
+ 日常运动水平:久坐;
365
+ 口味偏好及饮食禁忌:无;
366
+ 如需定制贴合个人情况的专属方案,请前往完善个人身体数据,获取个性化定制食谱。`;
367
+ await chatConv([{ content: perMsg, text: perMsg }]);
385
368
  }
386
369
  }
387
370
  scrollToEnd();
@@ -499,12 +482,12 @@ const chatConv = async (data) => {
499
482
  });
500
483
  historyList.value.push(uObj);
501
484
  isReq.value = '02';
502
- turns.value += 1;
503
485
  if (props.needLog) {
504
486
  Emits('log', {
505
487
  turns: turns.value,
506
488
  info: uObj,
507
489
  });
490
+ turns.value += 1;
508
491
  }
509
492
  const res = await fetch(
510
493
  `https://api.coze.cn/v3/chat?conversation_id=${conversationId.value}`,
@@ -586,6 +569,7 @@ const chatConv = async (data) => {
586
569
  turns: turns.value,
587
570
  info: historyList.value[idx],
588
571
  });
572
+ turns.value += 1;
589
573
  }
590
574
  scrollToEnd();
591
575
  break;
@@ -796,6 +780,14 @@ const handleCardTap = ({ type }, info) => {
796
780
  },
797
781
  ]);
798
782
  break;
783
+ case 'personalForm':
784
+ handleTagSel({
785
+ msg: '请为我生成一份个性化的健康的食谱',
786
+ name: '用户信息',
787
+ type: 'chat',
788
+ value: 'personalForm',
789
+ });
790
+ break;
799
791
  default:
800
792
  Emits('call', { type, info });
801
793
  }
@@ -34,6 +34,9 @@
34
34
  <div class="btn btn_2" @click.stop="handleBtn('ship_order')">
35
35
  <span class="name">去订餐</span>
36
36
  </div>
37
+ <div class="btn btn_1" @click.stop="handleBtn('personalForm')">
38
+ <span class="name">修改身体数据</span>
39
+ </div>
37
40
  </div>
38
41
  <div v-else class="btn_group">
39
42
  <div
@@ -106,7 +106,7 @@ const pfForm = ref([
106
106
  {
107
107
  key: 'sport',
108
108
  label: '日常运动水平',
109
- value: '轻体力',
109
+ value: '久坐',
110
110
  placeholder: '请输入',
111
111
  required: true,
112
112
  },