@blueking/bkflow-canvas-editor 0.1.0-beta.7 → 0.1.0-beta.8

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
@@ -36120,17 +36120,17 @@ const DbIcon = defineComponent({
36120
36120
  messages: [
36121
36121
  { role: "system", content: "" },
36122
36122
  { role: "user", content: "" }
36123
- ]
36123
+ ],
36124
+ chat_history: ""
36124
36125
  }), j = shallowRef([]);
36125
36126
  watch(
36126
36127
  () => $.inputData,
36127
- () => {
36128
- !("messages" in $.inputData) || !Array.isArray($.inputData.messages.value) || $.inputData.messages.value.length < 2 ? (z.value = {
36129
- messages: [
36130
- { role: "system", content: "" },
36131
- { role: "user", content: "" }
36132
- ]
36133
- }, k()) : z.value.messages = cloneDeep$1($.inputData.messages.value);
36128
+ (Ne) => {
36129
+ const xe = "messages" in Ne && Array.isArray(Ne.messages.value) && Ne.messages.value.length >= 2, _e = "chat_history" in Ne && typeof Ne.chat_history?.value == "string";
36130
+ z.value.messages = xe ? cloneDeep$1(Ne.messages.value) : [
36131
+ { role: "system", content: "" },
36132
+ { role: "user", content: "" }
36133
+ ], z.value.chat_history = _e ? Ne.chat_history.value : "", (!xe || !_e) && k();
36134
36134
  },
36135
36135
  {
36136
36136
  immediate: !0
@@ -36164,27 +36164,27 @@ const DbIcon = defineComponent({
36164
36164
  return t({
36165
36165
  validate: async () => L.value.validate().then(() => !0).catch(() => !1)
36166
36166
  }), (Ne, xe) => {
36167
- const _e = resolveComponent("bk-form-item"), oe = resolveComponent("bk-form"), he = resolveDirective("bk-tooltips");
36167
+ const _e = resolveComponent("bk-form-item"), oe = resolveComponent("bk-input"), he = resolveComponent("bk-form"), Ce = resolveDirective("bk-tooltips");
36168
36168
  return openBlock(), createElementBlock("div", _hoisted_1$n, [
36169
- createVNode(oe, {
36169
+ createVNode(he, {
36170
36170
  ref_key: "formRef",
36171
36171
  ref: L,
36172
36172
  "form-type": "vertical",
36173
36173
  model: z.value
36174
36174
  }, {
36175
36175
  default: withCtx(() => [
36176
- (openBlock(!0), createElementBlock(Fragment, null, renderList(z.value.messages, (Ce, $e) => (openBlock(), createBlock(_e, {
36177
- key: $e,
36176
+ (openBlock(!0), createElementBlock(Fragment, null, renderList(z.value.messages, ($e, Ve) => (openBlock(), createBlock(_e, {
36177
+ key: Ve,
36178
36178
  label: "Prompt",
36179
- property: `messages[${$e}]`,
36180
- required: $e > 0,
36179
+ property: `messages[${Ve}]`,
36180
+ required: Ve > 0,
36181
36181
  rules: [
36182
36182
  {
36183
- validator: (Ve) => $e === 0 || Ve.content.trim().length > 0,
36183
+ validator: (Fe) => Ve === 0 || Fe.content.trim().length > 0,
36184
36184
  message: "请输入Prompt内容"
36185
36185
  },
36186
36186
  {
36187
- validator: (Ve) => de($e, Ve.role),
36187
+ validator: (Fe) => de(Ve, Fe.role),
36188
36188
  message: "最后一个提示词必须为【用户】role"
36189
36189
  }
36190
36190
  ]
@@ -36192,27 +36192,27 @@ const DbIcon = defineComponent({
36192
36192
  default: withCtx(() => [
36193
36193
  createElementVNode("div", _hoisted_2$i, [
36194
36194
  createVNode(RoleTypeSelector, {
36195
- modelValue: Ce.role,
36196
- "onUpdate:modelValue": [(Ve) => Ce.role = Ve, k],
36197
- index: $e,
36195
+ modelValue: $e.role,
36196
+ "onUpdate:modelValue": [(Fe) => $e.role = Fe, k],
36197
+ index: Ve,
36198
36198
  disabled: !$.editable
36199
36199
  }, null, 8, ["modelValue", "onUpdate:modelValue", "index", "disabled"]),
36200
36200
  createVNode(PromptImport, {
36201
36201
  prompts: j.value,
36202
36202
  disabled: !$.editable,
36203
- onImport: (Ve) => ae($e, Ve)
36203
+ onImport: (Fe) => ae(Ve, Fe)
36204
36204
  }, null, 8, ["prompts", "disabled", "onImport"]),
36205
- $e > 0 && z.value.messages.length > 2 ? withDirectives((openBlock(), createBlock(unref(Del), {
36205
+ Ve > 0 && z.value.messages.length > 2 ? withDirectives((openBlock(), createBlock(unref(Del), {
36206
36206
  key: 0,
36207
36207
  class: normalizeClass(["delete-prompt-btn", { disabled: !$.editable }]),
36208
- onClick: (Ve) => ie($e)
36208
+ onClick: (Fe) => ie(Ve)
36209
36209
  }, null, 8, ["class", "onClick"])), [
36210
- [he, "删除"]
36210
+ [Ce, "删除"]
36211
36211
  ]) : createCommentVNode("", !0)
36212
36212
  ]),
36213
36213
  createVNode(VariableInput, {
36214
- modelValue: Ce.content,
36215
- "onUpdate:modelValue": (Ve) => Ce.content = Ve,
36214
+ modelValue: $e.content,
36215
+ "onUpdate:modelValue": (Fe) => $e.content = Fe,
36216
36216
  options: $.fullVariableList,
36217
36217
  type: "textarea",
36218
36218
  placeholder: "请输入",
@@ -36228,14 +36228,32 @@ const DbIcon = defineComponent({
36228
36228
  prompts: j.value,
36229
36229
  disabled: !$.editable,
36230
36230
  onAdd: pe
36231
- }, null, 8, ["prompts", "disabled"])
36231
+ }, null, 8, ["prompts", "disabled"]),
36232
+ createVNode(_e, {
36233
+ label: "聊天历史",
36234
+ property: "chat_history"
36235
+ }, {
36236
+ default: withCtx(() => [
36237
+ createVNode(oe, {
36238
+ modelValue: z.value.chat_history,
36239
+ "onUpdate:modelValue": xe[0] || (xe[0] = ($e) => z.value.chat_history = $e),
36240
+ type: "textarea",
36241
+ placeholder: "请输入聊天历史",
36242
+ rows: 4,
36243
+ resize: !1,
36244
+ disabled: !$.editable,
36245
+ onBlur: k
36246
+ }, null, 8, ["modelValue", "disabled"])
36247
+ ]),
36248
+ _: 1
36249
+ })
36232
36250
  ]),
36233
36251
  _: 1
36234
36252
  }, 8, ["model"])
36235
36253
  ]);
36236
36254
  };
36237
36255
  }
36238
- }), 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({
36256
+ }), 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({
36239
36257
  __name: "index",
36240
36258
  props: {
36241
36259
  inputData: {},