ai-chat-bot-interface 1.6.3 → 1.6.4

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.3",
4
+ "version": "1.6.4",
5
5
  "type": "module",
6
6
  "main": "index.js",
7
7
  "description": "A AI chat bot interface. (private)",
package/src/App.vue CHANGED
@@ -1,17 +1,31 @@
1
1
  <script setup>
2
2
  import ChatUi from './ChatUi.vue';
3
+ const handleLog = (log) => {
4
+ console.log('== message log ==', log);
5
+ };
3
6
  </script>
4
7
 
5
8
  <template>
6
9
  <div style="width: 100vw; height: 100vh">
7
10
  <chat-ui
8
- bot-id="7572460298389962778"
11
+ bot-id="7574379096097439754"
9
12
  token="sat_cSmj7ZyuePbkEpOKR7F259YuIfp2fjX9rJ3Om2O0gB9JzrGjAk8pSL269rbu8kzr"
10
13
  uid="262598"
11
14
  :def-msg="{ placeholder: '发消息...' }"
12
- :show-header="true"
13
- :card-list="{dishes: false}"
14
- content-tye="markdown"
15
+ :show-header="false"
16
+ :card-list="{ dishes: true, personalForm: true }"
17
+ :tag-list="[
18
+ {
19
+ name: '用户信息',
20
+ value: 'personalForm',
21
+ type: 'chat',
22
+ msg: '#用户信息',
23
+ },
24
+ ]"
25
+ :need-log="true"
26
+ content-type="markdown"
27
+ first-msg="你好"
28
+ @log="handleLog"
15
29
  />
16
30
  </div>
17
31
  </template>
package/src/ChatUi.vue CHANGED
@@ -308,6 +308,10 @@ const props = defineProps({
308
308
  type: Boolean,
309
309
  default: false,
310
310
  },
311
+ firstMsg: {
312
+ type: String,
313
+ default: '',
314
+ },
311
315
  });
312
316
 
313
317
  const Emits = defineEmits(['call', 'log']);
@@ -350,6 +354,9 @@ onMounted(async () => {
350
354
  isFirst.value = false;
351
355
  } else {
352
356
  await createConv();
357
+ if (props.firstMsg) {
358
+ await chatConv([{ content: props.firstMsg, text: props.firstMsg }]);
359
+ }
353
360
  }
354
361
  scrollToEnd();
355
362
  });