@shenghuabi/workflow 1.1.5 → 1.1.6
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/index.d.ts +1 -0
- package/index.js +8 -6
- package/index.js.map +2 -2
- package/index.mjs +6 -5
- package/index.mjs.map +2 -2
- package/package.json +2 -2
- package/util/serialize-text-template.d.ts +1 -1
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -67,7 +67,8 @@ __export(workflow_exports, {
|
|
|
67
67
|
createLLMData: () => createLLMData,
|
|
68
68
|
createResultData: () => createResultData,
|
|
69
69
|
flatFilterHandleList: () => flatFilterHandleList,
|
|
70
|
-
llmModelConfig: () => llmModelConfig
|
|
70
|
+
llmModelConfig: () => llmModelConfig,
|
|
71
|
+
serializeLexicalTextarea: () => serializeLexicalTextarea
|
|
71
72
|
});
|
|
72
73
|
module.exports = __toCommonJS(workflow_exports);
|
|
73
74
|
|
|
@@ -707,7 +708,7 @@ var import_static_injector5 = require("static-injector");
|
|
|
707
708
|
// packages/workflow/util/serialize-text-template.ts
|
|
708
709
|
var import_compat2 = require("es-toolkit/compat");
|
|
709
710
|
var import_variable_serialization = require("@shenghuabi/lexical-textarea/variable-serialization");
|
|
710
|
-
function
|
|
711
|
+
function serializeLexicalTextarea(input, options) {
|
|
711
712
|
const { context, environmentContext, onMetadata } = options;
|
|
712
713
|
return (0, import_variable_serialization.serializeTemplate)(input, (item) => {
|
|
713
714
|
if (item.type === "custom") {
|
|
@@ -741,13 +742,13 @@ function useChat() {
|
|
|
741
742
|
const list2 = list.map((item) => {
|
|
742
743
|
const contentList = item.content.map((contentChild) => {
|
|
743
744
|
if (contentChild.type === "text") {
|
|
744
|
-
const text =
|
|
745
|
+
const text = serializeLexicalTextarea(
|
|
745
746
|
contentChild.text,
|
|
746
747
|
serializeOptions
|
|
747
748
|
);
|
|
748
749
|
return { type: contentChild.type, text };
|
|
749
750
|
} else if (contentChild.type === "image_url") {
|
|
750
|
-
const url =
|
|
751
|
+
const url = serializeLexicalTextarea(
|
|
751
752
|
contentChild.image_url.url,
|
|
752
753
|
serializeOptions
|
|
753
754
|
);
|
|
@@ -922,7 +923,7 @@ var TextareaRunner = class extends NodeRunnerBase {
|
|
|
922
923
|
return async () => {
|
|
923
924
|
let metadataList;
|
|
924
925
|
const context = await this.context$$();
|
|
925
|
-
const value =
|
|
926
|
+
const value = serializeLexicalTextarea(this.inputs.value, {
|
|
926
927
|
context,
|
|
927
928
|
environmentContext: this.environmentContext,
|
|
928
929
|
onMetadata(metadata) {
|
|
@@ -1885,6 +1886,7 @@ var WORKFLOW_MODULE = {
|
|
|
1885
1886
|
createLLMData,
|
|
1886
1887
|
createResultData,
|
|
1887
1888
|
flatFilterHandleList,
|
|
1888
|
-
llmModelConfig
|
|
1889
|
+
llmModelConfig,
|
|
1890
|
+
serializeLexicalTextarea
|
|
1889
1891
|
});
|
|
1890
1892
|
//# sourceMappingURL=index.js.map
|