@fv-ui/ai-chat 0.12.1 → 0.12.2
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/es/index.mjs +27 -8
- package/lib/index.js +27 -8
- package/package.json +1 -1
package/es/index.mjs
CHANGED
|
@@ -4913,7 +4913,10 @@ var _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
4913
4913
|
}
|
|
4914
4914
|
let lastFlushAt = 0;
|
|
4915
4915
|
let lastFlushChars = 0;
|
|
4916
|
+
let orchestrated = false;
|
|
4916
4917
|
watch(() => props.items, (items) => {
|
|
4918
|
+
const firstRun = !orchestrated;
|
|
4919
|
+
orchestrated = true;
|
|
4917
4920
|
const now = Date.now();
|
|
4918
4921
|
let flushedChars = 0;
|
|
4919
4922
|
const flushCounting = (it) => {
|
|
@@ -4937,7 +4940,7 @@ var _sfc_main$9 = /* @__PURE__ */ defineComponent({
|
|
|
4937
4940
|
}
|
|
4938
4941
|
}
|
|
4939
4942
|
for (const it of items) {
|
|
4940
|
-
if (it.
|
|
4943
|
+
if (it.closed && (preRegistered.has(it.key) || !firstRun)) flushCounting(it);
|
|
4941
4944
|
}
|
|
4942
4945
|
if (flushedChars > 0) {
|
|
4943
4946
|
lastFlushAt = now;
|
|
@@ -6751,6 +6754,14 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
6751
6754
|
{ immediate: true }
|
|
6752
6755
|
);
|
|
6753
6756
|
const useTypewriter = computed(() => !isUser.value && !!props.typing && wasStreaming.value);
|
|
6757
|
+
const reasoningFlushed = ref(false);
|
|
6758
|
+
watch(
|
|
6759
|
+
() => [props.message.content, props.message.status],
|
|
6760
|
+
([content, status]) => {
|
|
6761
|
+
if (content || status === "done" || status === "error") reasoningFlushed.value = true;
|
|
6762
|
+
},
|
|
6763
|
+
{ immediate: true }
|
|
6764
|
+
);
|
|
6754
6765
|
const textStepIcon = markRaw(ChatLineRound);
|
|
6755
6766
|
const toolStepIcon = markRaw(Search);
|
|
6756
6767
|
const toolChainItems = computed(() => {
|
|
@@ -6899,13 +6910,21 @@ var _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
6899
6910
|
items: toolChainItems.value,
|
|
6900
6911
|
collapsible: __props.collapsible,
|
|
6901
6912
|
onTyping: _cache[0] || (_cache[0] = ($event) => emit("typing"))
|
|
6902
|
-
}, null, 8, ["items", "collapsible"])) : hasReasoning.value && useTypewriter.value ? (openBlock(),
|
|
6903
|
-
|
|
6904
|
-
|
|
6905
|
-
|
|
6906
|
-
|
|
6907
|
-
|
|
6908
|
-
|
|
6913
|
+
}, null, 8, ["items", "collapsible"])) : hasReasoning.value && useTypewriter.value && !reasoningFlushed.value ? (openBlock(), createElementBlock(
|
|
6914
|
+
Fragment,
|
|
6915
|
+
{ key: 1 },
|
|
6916
|
+
[
|
|
6917
|
+
createCommentVNode(" \u7EAF\u601D\u8003\u6D88\u606F(reasoning \u65E0 toolSteps)\u56DE\u843D\u94FE\u4E0B\u6E32\u67D3:\u6D41\u5F0F\u671F\u95F4 Typewriter \u9010\u5B57,\r\n \u6B63\u6587\u51FA\u73B0/\u601D\u8003\u6536\u53E3\u5373\u51B2\u5237\u56DE\u843D\u9759\u6001 Markdown(\u540C ThoughtChain \u5C01\u53E3\u51B2\u5237\u8BED\u4E49) "),
|
|
6918
|
+
createVNode(_sfc_main$h, {
|
|
6919
|
+
content: __props.message.reasoning ?? "",
|
|
6920
|
+
"is-markdown": "",
|
|
6921
|
+
typing: __props.typing,
|
|
6922
|
+
onWriting: _cache[1] || (_cache[1] = ($event) => emit("typing"))
|
|
6923
|
+
}, null, 8, ["content", "typing"])
|
|
6924
|
+
],
|
|
6925
|
+
2112
|
|
6926
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
6927
|
+
)) : hasReasoning.value ? (openBlock(), createBlock(_sfc_main$i, {
|
|
6909
6928
|
key: 2,
|
|
6910
6929
|
content: __props.message.reasoning ?? ""
|
|
6911
6930
|
}, null, 8, ["content"])) : createCommentVNode("v-if", true)
|
package/lib/index.js
CHANGED
|
@@ -4929,7 +4929,10 @@
|
|
|
4929
4929
|
}
|
|
4930
4930
|
let lastFlushAt = 0;
|
|
4931
4931
|
let lastFlushChars = 0;
|
|
4932
|
+
let orchestrated = false;
|
|
4932
4933
|
vue.watch(() => props.items, (items) => {
|
|
4934
|
+
const firstRun = !orchestrated;
|
|
4935
|
+
orchestrated = true;
|
|
4933
4936
|
const now = Date.now();
|
|
4934
4937
|
let flushedChars = 0;
|
|
4935
4938
|
const flushCounting = (it) => {
|
|
@@ -4953,7 +4956,7 @@
|
|
|
4953
4956
|
}
|
|
4954
4957
|
}
|
|
4955
4958
|
for (const it of items) {
|
|
4956
|
-
if (it.
|
|
4959
|
+
if (it.closed && (preRegistered.has(it.key) || !firstRun)) flushCounting(it);
|
|
4957
4960
|
}
|
|
4958
4961
|
if (flushedChars > 0) {
|
|
4959
4962
|
lastFlushAt = now;
|
|
@@ -6767,6 +6770,14 @@
|
|
|
6767
6770
|
{ immediate: true }
|
|
6768
6771
|
);
|
|
6769
6772
|
const useTypewriter = vue.computed(() => !isUser.value && !!props.typing && wasStreaming.value);
|
|
6773
|
+
const reasoningFlushed = vue.ref(false);
|
|
6774
|
+
vue.watch(
|
|
6775
|
+
() => [props.message.content, props.message.status],
|
|
6776
|
+
([content, status]) => {
|
|
6777
|
+
if (content || status === "done" || status === "error") reasoningFlushed.value = true;
|
|
6778
|
+
},
|
|
6779
|
+
{ immediate: true }
|
|
6780
|
+
);
|
|
6770
6781
|
const textStepIcon = vue.markRaw(ElementPlusIconsVue.ChatLineRound);
|
|
6771
6782
|
const toolStepIcon = vue.markRaw(ElementPlusIconsVue.Search);
|
|
6772
6783
|
const toolChainItems = vue.computed(() => {
|
|
@@ -6915,13 +6926,21 @@
|
|
|
6915
6926
|
items: toolChainItems.value,
|
|
6916
6927
|
collapsible: __props.collapsible,
|
|
6917
6928
|
onTyping: _cache[0] || (_cache[0] = ($event) => emit("typing"))
|
|
6918
|
-
}, null, 8, ["items", "collapsible"])) : hasReasoning.value && useTypewriter.value ? (vue.openBlock(), vue.
|
|
6919
|
-
|
|
6920
|
-
|
|
6921
|
-
|
|
6922
|
-
|
|
6923
|
-
|
|
6924
|
-
|
|
6929
|
+
}, null, 8, ["items", "collapsible"])) : hasReasoning.value && useTypewriter.value && !reasoningFlushed.value ? (vue.openBlock(), vue.createElementBlock(
|
|
6930
|
+
vue.Fragment,
|
|
6931
|
+
{ key: 1 },
|
|
6932
|
+
[
|
|
6933
|
+
vue.createCommentVNode(" \u7EAF\u601D\u8003\u6D88\u606F(reasoning \u65E0 toolSteps)\u56DE\u843D\u94FE\u4E0B\u6E32\u67D3:\u6D41\u5F0F\u671F\u95F4 Typewriter \u9010\u5B57,\r\n \u6B63\u6587\u51FA\u73B0/\u601D\u8003\u6536\u53E3\u5373\u51B2\u5237\u56DE\u843D\u9759\u6001 Markdown(\u540C ThoughtChain \u5C01\u53E3\u51B2\u5237\u8BED\u4E49) "),
|
|
6934
|
+
vue.createVNode(_sfc_main$h, {
|
|
6935
|
+
content: __props.message.reasoning ?? "",
|
|
6936
|
+
"is-markdown": "",
|
|
6937
|
+
typing: __props.typing,
|
|
6938
|
+
onWriting: _cache[1] || (_cache[1] = ($event) => emit("typing"))
|
|
6939
|
+
}, null, 8, ["content", "typing"])
|
|
6940
|
+
],
|
|
6941
|
+
2112
|
|
6942
|
+
/* STABLE_FRAGMENT, DEV_ROOT_FRAGMENT */
|
|
6943
|
+
)) : hasReasoning.value ? (vue.openBlock(), vue.createBlock(_sfc_main$i, {
|
|
6925
6944
|
key: 2,
|
|
6926
6945
|
content: __props.message.reasoning ?? ""
|
|
6927
6946
|
}, null, 8, ["content"])) : vue.createCommentVNode("v-if", true)
|