@blueking/bkflow-canvas-editor 0.0.37-beta.1 → 0.0.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.
package/dist/index.esm.js CHANGED
@@ -34593,17 +34593,17 @@ const DbIcon = defineComponent({
34593
34593
  messages: [
34594
34594
  { role: "system", content: "" },
34595
34595
  { role: "user", content: "" }
34596
- ]
34596
+ ],
34597
+ chat_history: ""
34597
34598
  }), j = shallowRef([]);
34598
34599
  watch(
34599
34600
  () => $.inputData,
34600
- () => {
34601
- !("messages" in $.inputData) || !Array.isArray($.inputData.messages.value) || $.inputData.messages.value.length < 2 ? (z.value = {
34602
- messages: [
34603
- { role: "system", content: "" },
34604
- { role: "user", content: "" }
34605
- ]
34606
- }, k()) : z.value.messages = cloneDeep$1($.inputData.messages.value);
34601
+ (Ne) => {
34602
+ const xe = "messages" in Ne && Array.isArray(Ne.messages.value) && Ne.messages.value.length >= 2, Ce = "chat_history" in Ne && typeof Ne.chat_history?.value == "string";
34603
+ z.value.messages = xe ? cloneDeep$1(Ne.messages.value) : [
34604
+ { role: "system", content: "" },
34605
+ { role: "user", content: "" }
34606
+ ], z.value.chat_history = Ce ? Ne.chat_history.value : "", (!xe || !Ce) && k();
34607
34607
  },
34608
34608
  {
34609
34609
  immediate: !0
@@ -34637,27 +34637,27 @@ const DbIcon = defineComponent({
34637
34637
  return t({
34638
34638
  validate: async () => L.value.validate().then(() => !0).catch(() => !1)
34639
34639
  }), (Ne, xe) => {
34640
- const Ce = resolveComponent("bk-form-item"), oe = resolveComponent("bk-form"), he = resolveDirective("bk-tooltips");
34640
+ const Ce = resolveComponent("bk-form-item"), oe = resolveComponent("bk-input"), he = resolveComponent("bk-form"), _e = resolveDirective("bk-tooltips");
34641
34641
  return openBlock(), createElementBlock("div", _hoisted_1$n, [
34642
- createVNode(oe, {
34642
+ createVNode(he, {
34643
34643
  ref_key: "formRef",
34644
34644
  ref: L,
34645
34645
  "form-type": "vertical",
34646
34646
  model: z.value
34647
34647
  }, {
34648
34648
  default: withCtx(() => [
34649
- (openBlock(!0), createElementBlock(Fragment, null, renderList(z.value.messages, (_e, $e) => (openBlock(), createBlock(Ce, {
34650
- key: $e,
34649
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(z.value.messages, ($e, Oe) => (openBlock(), createBlock(Ce, {
34650
+ key: Oe,
34651
34651
  label: "Prompt",
34652
- property: `messages[${$e}]`,
34653
- required: $e > 0,
34652
+ property: `messages[${Oe}]`,
34653
+ required: Oe > 0,
34654
34654
  rules: [
34655
34655
  {
34656
- validator: (Oe) => $e === 0 || Oe.content.trim().length > 0,
34656
+ validator: (ze) => Oe === 0 || ze.content.trim().length > 0,
34657
34657
  message: "请输入Prompt内容"
34658
34658
  },
34659
34659
  {
34660
- validator: (Oe) => ie($e, Oe.role),
34660
+ validator: (ze) => ie(Oe, ze.role),
34661
34661
  message: "最后一个提示词必须为【用户】role"
34662
34662
  }
34663
34663
  ]
@@ -34665,27 +34665,27 @@ const DbIcon = defineComponent({
34665
34665
  default: withCtx(() => [
34666
34666
  createElementVNode("div", _hoisted_2$i, [
34667
34667
  createVNode(RoleTypeSelector, {
34668
- modelValue: _e.role,
34669
- "onUpdate:modelValue": [(Oe) => _e.role = Oe, k],
34670
- index: $e,
34668
+ modelValue: $e.role,
34669
+ "onUpdate:modelValue": [(ze) => $e.role = ze, k],
34670
+ index: Oe,
34671
34671
  disabled: !$.editable
34672
34672
  }, null, 8, ["modelValue", "onUpdate:modelValue", "index", "disabled"]),
34673
34673
  createVNode(PromptImport, {
34674
34674
  prompts: j.value,
34675
34675
  disabled: !$.editable,
34676
- onImport: (Oe) => ae($e, Oe)
34676
+ onImport: (ze) => ae(Oe, ze)
34677
34677
  }, null, 8, ["prompts", "disabled", "onImport"]),
34678
- $e > 0 && z.value.messages.length > 2 ? withDirectives((openBlock(), createBlock(unref(Del), {
34678
+ Oe > 0 && z.value.messages.length > 2 ? withDirectives((openBlock(), createBlock(unref(Del), {
34679
34679
  key: 0,
34680
34680
  class: normalizeClass(["delete-prompt-btn", { disabled: !$.editable }]),
34681
- onClick: (Oe) => re($e)
34681
+ onClick: (ze) => re(Oe)
34682
34682
  }, null, 8, ["class", "onClick"])), [
34683
- [he, "删除"]
34683
+ [_e, "删除"]
34684
34684
  ]) : createCommentVNode("", !0)
34685
34685
  ]),
34686
34686
  createVNode(VariableInput, {
34687
- modelValue: _e.content,
34688
- "onUpdate:modelValue": (Oe) => _e.content = Oe,
34687
+ modelValue: $e.content,
34688
+ "onUpdate:modelValue": (ze) => $e.content = ze,
34689
34689
  options: $.fullVariableList,
34690
34690
  type: "textarea",
34691
34691
  placeholder: "请输入",
@@ -34701,14 +34701,32 @@ const DbIcon = defineComponent({
34701
34701
  prompts: j.value,
34702
34702
  disabled: !$.editable,
34703
34703
  onAdd: de
34704
- }, null, 8, ["prompts", "disabled"])
34704
+ }, null, 8, ["prompts", "disabled"]),
34705
+ createVNode(Ce, {
34706
+ label: "聊天历史",
34707
+ property: "chat_history"
34708
+ }, {
34709
+ default: withCtx(() => [
34710
+ createVNode(oe, {
34711
+ modelValue: z.value.chat_history,
34712
+ "onUpdate:modelValue": xe[0] || (xe[0] = ($e) => z.value.chat_history = $e),
34713
+ type: "textarea",
34714
+ placeholder: "请输入聊天历史",
34715
+ rows: 4,
34716
+ resize: !1,
34717
+ disabled: !$.editable,
34718
+ onBlur: k
34719
+ }, null, 8, ["modelValue", "disabled"])
34720
+ ]),
34721
+ _: 1
34722
+ })
34705
34723
  ]),
34706
34724
  _: 1
34707
34725
  }, 8, ["model"])
34708
34726
  ]);
34709
34727
  };
34710
34728
  }
34711
- }), LlmForm = /* @__PURE__ */ _export_sfc$1(_sfc_main$n, [["__scopeId", "data-v-b6484270"]]), _hoisted_1$m = { class: "knowledgebase-input-params" }, _hoisted_2$h = { class: "settings-query-param-item-slider-wrapper" }, _hoisted_3$f = { class: "resource-reject-threshold-tips" }, _sfc_main$m = /* @__PURE__ */ defineComponent({
34729
+ }), LlmForm = /* @__PURE__ */ _export_sfc$1(_sfc_main$n, [["__scopeId", "data-v-aef06045"]]), _hoisted_1$m = { class: "knowledgebase-input-params" }, _hoisted_2$h = { class: "settings-query-param-item-slider-wrapper" }, _hoisted_3$f = { class: "resource-reject-threshold-tips" }, _sfc_main$m = /* @__PURE__ */ defineComponent({
34712
34730
  __name: "index",
34713
34731
  props: {
34714
34732
  inputData: {},