langgraph-vue3-chatbot 0.1.28 → 0.1.30
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/README.md +27 -4
- package/dist-lib/components/ai-bot/AskAiBot.vue.d.ts +2 -0
- package/dist-lib/components/ai-bot/AskAiBot.vue.d.ts.map +1 -1
- package/dist-lib/components/ai-bot/chatbot.css +1 -1
- package/dist-lib/components/ai-bot/lib/input-types.d.ts +2 -0
- package/dist-lib/components/ai-bot/lib/input-types.d.ts.map +1 -1
- package/dist-lib/index.js +469 -462
- package/dist-lib/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -190,7 +190,9 @@ const suggestions = [
|
|
|
190
190
|
|
|
191
191
|
## 组件实例 API
|
|
192
192
|
|
|
193
|
-
`ChatBot` 和 `AskAiBot` 都支持通过 `ref`
|
|
193
|
+
`ChatBot` 和 `AskAiBot` 都支持通过 `ref` 调用少量公开实例方法。
|
|
194
|
+
|
|
195
|
+
公共能力:
|
|
194
196
|
|
|
195
197
|
- `setTextInput(text: string)`:设置输入框文本
|
|
196
198
|
- `addAttachments(attachments: PromptInputAttachment[])`:添加附件
|
|
@@ -201,6 +203,11 @@ const suggestions = [
|
|
|
201
203
|
- `ChatBot` 会直接调用内部输入区现有逻辑
|
|
202
204
|
- `AskAiBot` 在折叠状态下调用 `sendMessage()` 时,会先自动展开再发送
|
|
203
205
|
|
|
206
|
+
`AskAiBot` 额外支持:
|
|
207
|
+
|
|
208
|
+
- `open()`:打开悬浮聊天窗
|
|
209
|
+
- `close()`:关闭悬浮聊天窗;如果当前处于最大化状态,会一并退出最大化
|
|
210
|
+
|
|
204
211
|
### `ChatBot` 示例
|
|
205
212
|
|
|
206
213
|
```vue
|
|
@@ -252,6 +259,14 @@ import { AskAiBot, type AskAiBotPublicApi } from 'langgraph-vue3-chatbot'
|
|
|
252
259
|
|
|
253
260
|
const askAiBotRef = ref<AskAiBotPublicApi | null>(null)
|
|
254
261
|
|
|
262
|
+
function openBot() {
|
|
263
|
+
askAiBotRef.value?.open()
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
function closeBot() {
|
|
267
|
+
askAiBotRef.value?.close()
|
|
268
|
+
}
|
|
269
|
+
|
|
255
270
|
function quickAsk() {
|
|
256
271
|
askAiBotRef.value?.setTextInput('帮我总结今天的待办')
|
|
257
272
|
askAiBotRef.value?.sendMessage()
|
|
@@ -259,9 +274,17 @@ function quickAsk() {
|
|
|
259
274
|
</script>
|
|
260
275
|
|
|
261
276
|
<template>
|
|
262
|
-
<
|
|
263
|
-
|
|
264
|
-
|
|
277
|
+
<div style="display: flex; gap: 8px;">
|
|
278
|
+
<button @click="openBot">
|
|
279
|
+
打开助手
|
|
280
|
+
</button>
|
|
281
|
+
<button @click="closeBot">
|
|
282
|
+
关闭助手
|
|
283
|
+
</button>
|
|
284
|
+
<button @click="quickAsk">
|
|
285
|
+
唤起并发送
|
|
286
|
+
</button>
|
|
287
|
+
</div>
|
|
265
288
|
|
|
266
289
|
<AskAiBot
|
|
267
290
|
ref="askAiBotRef"
|
|
@@ -27,6 +27,8 @@ type __VLS_Slots = {
|
|
|
27
27
|
'attachment-trigger'?: (props: AttachmentTriggerSlotProps) => any;
|
|
28
28
|
};
|
|
29
29
|
declare const __VLS_component: import("vue").DefineComponent<Props, {
|
|
30
|
+
open: () => void;
|
|
31
|
+
close: () => void;
|
|
30
32
|
setTextInput: (text: string) => void;
|
|
31
33
|
addAttachments: (attachments: import("./index.ts").PromptInputAttachment[]) => void;
|
|
32
34
|
sendMessage: (options?: import("./index.ts").AiBotVisibilityOptions) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AskAiBot.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ai-bot/AskAiBot.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AskAiBot.vue.d.ts","sourceRoot":"","sources":["../../../src/components/ai-bot/AskAiBot.vue"],"names":[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