@shenghuabi/workflow 1.1.2 → 1.1.3
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.js +72 -111
- package/index.js.map +2 -2
- package/index.mjs +73 -116
- package/index.mjs.map +2 -2
- package/inline/node/chat/chat.node.define.d.ts +207 -159
- package/inline/node/chat/main/index.d.ts +205 -157
- package/package.json +2 -2
- package/webview/index.js +68 -107
- package/webview/index.js.map +2 -2
- package/webview/index.mjs +69 -112
- package/webview/index.mjs.map +2 -2
|
@@ -1,169 +1,217 @@
|
|
|
1
1
|
import { LlmRunner } from './llm.runner';
|
|
2
2
|
export declare const ChatMainConfig: {
|
|
3
3
|
readonly runner: typeof LlmRunner;
|
|
4
|
-
readonly define: import("valibot").
|
|
5
|
-
readonly
|
|
6
|
-
readonly
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
readonly
|
|
35
|
-
|
|
36
|
-
readonly format: import("valibot").SchemaWithPipe<readonly [import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, false>, import("valibot").DescriptionAction<boolean, "选中后会尝试使用yaml解析为对象,再序列化为对应的响应类型">, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", boolean, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
37
|
-
readonly value: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").TitleAction<string, "问题">, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", string, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
38
|
-
}, undefined>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", {
|
|
39
|
-
format: boolean;
|
|
40
|
-
value: string;
|
|
41
|
-
}, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
42
|
-
readonly output: import("valibot").SchemaWithPipe<readonly [import("valibot").ObjectSchema<{
|
|
43
|
-
readonly format: import("valibot").SchemaWithPipe<readonly [import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, false>, import("valibot").DescriptionAction<boolean, "是否需要格式化">, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", boolean, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
44
|
-
readonly value: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").TitleAction<string, "回答">, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", string, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
45
|
-
}, undefined>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", {
|
|
46
|
-
format: boolean;
|
|
47
|
-
value: string;
|
|
48
|
-
}, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
49
|
-
}, undefined>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", {
|
|
50
|
-
input: {
|
|
51
|
-
format: boolean;
|
|
52
|
-
value: string;
|
|
53
|
-
};
|
|
54
|
-
output: {
|
|
55
|
-
format: boolean;
|
|
56
|
-
value: string;
|
|
57
|
-
};
|
|
58
|
-
}, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>, undefined>, readonly []>, import("valibot").TitleAction<{
|
|
59
|
-
input: {
|
|
60
|
-
format: boolean;
|
|
61
|
-
value: string;
|
|
62
|
-
};
|
|
63
|
-
output: {
|
|
64
|
-
format: boolean;
|
|
65
|
-
value: string;
|
|
66
|
-
};
|
|
67
|
-
}[], "用例">, import("valibot").DescriptionAction<{
|
|
68
|
-
input: {
|
|
69
|
-
format: boolean;
|
|
70
|
-
value: string;
|
|
71
|
-
};
|
|
72
|
-
output: {
|
|
73
|
-
format: boolean;
|
|
74
|
-
value: string;
|
|
75
|
-
};
|
|
76
|
-
}[], "回答问题之前,会参考定义的用例格式进行回复,用于规范回答">]>;
|
|
4
|
+
readonly define: import("valibot").SchemaWithPipe<readonly [import("valibot").ObjectSchema<{
|
|
5
|
+
readonly llm: import("valibot").OptionalSchema<import("valibot").SchemaWithPipe<readonly [import("valibot").IntersectSchema<[import("valibot").SchemaWithPipe<readonly [import("valibot").IntersectSchema<[import("valibot").SchemaWithPipe<readonly [import("valibot").ObjectSchema<{
|
|
6
|
+
readonly name: import("valibot").SchemaWithPipe<readonly [import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>, import("valibot").TitleAction<string | undefined, "预定义模型配置">, import("@piying/valibot-visit").DefineTypeAction<string | undefined>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", string | undefined, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
7
|
+
readonly model: import("valibot").SchemaWithPipe<readonly [import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>, import("valibot").TitleAction<string | undefined, "模型">]>;
|
|
8
|
+
readonly baseURL: import("valibot").SchemaWithPipe<readonly [import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>, import("valibot").TitleAction<string | undefined, "地址">]>;
|
|
9
|
+
}, undefined>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", {
|
|
10
|
+
name?: string | undefined;
|
|
11
|
+
model?: string | undefined;
|
|
12
|
+
baseURL?: string | undefined;
|
|
13
|
+
}, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>], undefined>, import("valibot").TitleAction<{
|
|
14
|
+
name?: string | undefined;
|
|
15
|
+
model?: string | undefined;
|
|
16
|
+
baseURL?: string | undefined;
|
|
17
|
+
}, string>, import("@piying/valibot-visit").VirtualGroupAction<{
|
|
18
|
+
name?: string | undefined;
|
|
19
|
+
model?: string | undefined;
|
|
20
|
+
baseURL?: string | undefined;
|
|
21
|
+
}>]>], undefined>, import("@piying/valibot-visit").VirtualGroupAction<{
|
|
22
|
+
name?: string | undefined;
|
|
23
|
+
model?: string | undefined;
|
|
24
|
+
baseURL?: string | undefined;
|
|
25
|
+
}>, import("@piying/valibot-visit").DefineTypeAction<{
|
|
26
|
+
name?: string | undefined;
|
|
27
|
+
model?: string | undefined;
|
|
28
|
+
baseURL?: string | undefined;
|
|
29
|
+
}>]>, undefined>;
|
|
30
|
+
readonly responseFormat: import("valibot").SchemaWithPipe<readonly [import("valibot").OptionalSchema<import("valibot").PicklistSchema<readonly ["text", "json_object", "json_schema"], undefined>, undefined>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", "text" | "json_schema" | "json_object" | undefined, import("@piying/view-angular-core").AnyCoreSchemaHandle>, import("valibot").TitleAction<"text" | "json_schema" | "json_object" | undefined, "响应格式">]>;
|
|
31
|
+
readonly parseBy: import("valibot").SchemaWithPipe<readonly [import("valibot").OptionalSchema<import("valibot").PicklistSchema<readonly ["json", "markdown", "yaml"], undefined>, undefined>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", "json" | "markdown" | "yaml" | undefined, import("@piying/view-angular-core").AnyCoreSchemaHandle>, import("valibot").TitleAction<"json" | "markdown" | "yaml" | undefined, "返回解析">, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", "json" | "markdown" | "yaml" | undefined, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
32
|
+
readonly examples: import("valibot").SchemaWithPipe<readonly [import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").SchemaWithPipe<readonly [import("valibot").ObjectSchema<{
|
|
33
|
+
readonly input: import("valibot").SchemaWithPipe<readonly [import("valibot").ObjectSchema<{
|
|
34
|
+
readonly format: import("valibot").SchemaWithPipe<readonly [import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, false>, import("valibot").DescriptionAction<boolean, "选中后会尝试使用yaml解析为对象,再序列化为对应的响应类型">, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", boolean, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
35
|
+
readonly value: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").TitleAction<string, "问题">, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", string, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
77
36
|
}, undefined>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
model?: string | undefined;
|
|
81
|
-
baseURL?: string | undefined;
|
|
82
|
-
} | undefined;
|
|
83
|
-
responseFormat?: "text" | "json_schema" | "json_object" | undefined;
|
|
84
|
-
parseBy?: "json" | "markdown" | "yaml" | undefined;
|
|
85
|
-
examples: {
|
|
86
|
-
input: {
|
|
87
|
-
format: boolean;
|
|
88
|
-
value: string;
|
|
89
|
-
};
|
|
90
|
-
output: {
|
|
91
|
-
format: boolean;
|
|
92
|
-
value: string;
|
|
93
|
-
};
|
|
94
|
-
}[];
|
|
95
|
-
}, import("@piying/view-angular-core").AnyCoreSchemaHandle>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", {
|
|
96
|
-
llm?: {
|
|
97
|
-
name?: string | undefined;
|
|
98
|
-
model?: string | undefined;
|
|
99
|
-
baseURL?: string | undefined;
|
|
100
|
-
} | undefined;
|
|
101
|
-
responseFormat?: "text" | "json_schema" | "json_object" | undefined;
|
|
102
|
-
parseBy?: "json" | "markdown" | "yaml" | undefined;
|
|
103
|
-
examples: {
|
|
104
|
-
input: {
|
|
105
|
-
format: boolean;
|
|
106
|
-
value: string;
|
|
107
|
-
};
|
|
108
|
-
output: {
|
|
109
|
-
format: boolean;
|
|
110
|
-
value: string;
|
|
111
|
-
};
|
|
112
|
-
}[];
|
|
37
|
+
format: boolean;
|
|
38
|
+
value: string;
|
|
113
39
|
}, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
114
|
-
readonly
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
40
|
+
readonly output: import("valibot").SchemaWithPipe<readonly [import("valibot").ObjectSchema<{
|
|
41
|
+
readonly format: import("valibot").SchemaWithPipe<readonly [import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, false>, import("valibot").DescriptionAction<boolean, "是否需要格式化">, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", boolean, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
42
|
+
readonly value: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").TitleAction<string, "回答">, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", string, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
43
|
+
}, undefined>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", {
|
|
44
|
+
format: boolean;
|
|
45
|
+
value: string;
|
|
46
|
+
}, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
47
|
+
}, undefined>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", {
|
|
48
|
+
input: {
|
|
49
|
+
format: boolean;
|
|
50
|
+
value: string;
|
|
51
|
+
};
|
|
52
|
+
output: {
|
|
53
|
+
format: boolean;
|
|
54
|
+
value: string;
|
|
55
|
+
};
|
|
56
|
+
}, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>, undefined>, readonly []>, import("valibot").TitleAction<{
|
|
57
|
+
input: {
|
|
58
|
+
format: boolean;
|
|
59
|
+
value: string;
|
|
60
|
+
};
|
|
61
|
+
output: {
|
|
62
|
+
format: boolean;
|
|
63
|
+
value: string;
|
|
64
|
+
};
|
|
65
|
+
}[], "用例">, import("valibot").DescriptionAction<{
|
|
66
|
+
input: {
|
|
67
|
+
format: boolean;
|
|
68
|
+
value: string;
|
|
69
|
+
};
|
|
70
|
+
output: {
|
|
71
|
+
format: boolean;
|
|
72
|
+
value: string;
|
|
73
|
+
};
|
|
74
|
+
}[], "回答问题之前,会参考定义的用例格式进行回复,用于规范回答">]>;
|
|
75
|
+
readonly value: import("valibot").SchemaWithPipe<readonly [import("valibot").CustomSchema<({
|
|
76
|
+
role: "system";
|
|
77
|
+
content: {
|
|
78
|
+
text: string;
|
|
79
|
+
type: "text";
|
|
80
|
+
}[];
|
|
81
|
+
} | {
|
|
82
|
+
role: "user";
|
|
83
|
+
content: ({
|
|
84
|
+
text: string;
|
|
85
|
+
type: "text";
|
|
120
86
|
} | {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
87
|
+
image_url: {
|
|
88
|
+
url: string;
|
|
89
|
+
detail?: "auto" | "low" | "high" | undefined;
|
|
90
|
+
};
|
|
91
|
+
type: "image_url";
|
|
92
|
+
})[];
|
|
93
|
+
} | {
|
|
94
|
+
role: "assistant";
|
|
95
|
+
content: {
|
|
96
|
+
text: string;
|
|
97
|
+
type: "text";
|
|
98
|
+
}[];
|
|
99
|
+
thinkContent?: string | undefined;
|
|
100
|
+
})[], undefined>, import("@piying/valibot-visit").DefineTypeAction<({
|
|
101
|
+
role: "system";
|
|
102
|
+
content: {
|
|
103
|
+
text: string;
|
|
104
|
+
type: "text";
|
|
105
|
+
}[];
|
|
106
|
+
} | {
|
|
107
|
+
role: "user";
|
|
108
|
+
content: ({
|
|
109
|
+
text: string;
|
|
110
|
+
type: "text";
|
|
132
111
|
} | {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
112
|
+
image_url: {
|
|
113
|
+
url: string;
|
|
114
|
+
detail?: "auto" | "low" | "high" | undefined;
|
|
115
|
+
};
|
|
116
|
+
type: "image_url";
|
|
117
|
+
})[];
|
|
118
|
+
} | {
|
|
119
|
+
role: "assistant";
|
|
120
|
+
content: {
|
|
121
|
+
text: string;
|
|
122
|
+
type: "text";
|
|
123
|
+
}[];
|
|
124
|
+
thinkContent?: string | undefined;
|
|
125
|
+
})[]>]>;
|
|
126
|
+
}, undefined>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", {
|
|
127
|
+
llm?: {
|
|
128
|
+
name?: string | undefined;
|
|
129
|
+
model?: string | undefined;
|
|
130
|
+
baseURL?: string | undefined;
|
|
131
|
+
} | undefined;
|
|
132
|
+
responseFormat?: "text" | "json_schema" | "json_object" | undefined;
|
|
133
|
+
parseBy?: "json" | "markdown" | "yaml" | undefined;
|
|
134
|
+
examples: {
|
|
135
|
+
input: {
|
|
136
|
+
format: boolean;
|
|
137
|
+
value: string;
|
|
138
|
+
};
|
|
139
|
+
output: {
|
|
140
|
+
format: boolean;
|
|
141
|
+
value: string;
|
|
142
|
+
};
|
|
143
|
+
}[];
|
|
144
|
+
value: ({
|
|
145
|
+
role: "system";
|
|
146
|
+
content: {
|
|
147
|
+
text: string;
|
|
148
|
+
type: "text";
|
|
149
|
+
}[];
|
|
150
|
+
} | {
|
|
151
|
+
role: "user";
|
|
152
|
+
content: ({
|
|
153
|
+
text: string;
|
|
154
|
+
type: "text";
|
|
145
155
|
} | {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
156
|
+
image_url: {
|
|
157
|
+
url: string;
|
|
158
|
+
detail?: "auto" | "low" | "high" | undefined;
|
|
159
|
+
};
|
|
160
|
+
type: "image_url";
|
|
161
|
+
})[];
|
|
162
|
+
} | {
|
|
163
|
+
role: "assistant";
|
|
164
|
+
content: {
|
|
165
|
+
text: string;
|
|
166
|
+
type: "text";
|
|
167
|
+
}[];
|
|
168
|
+
thinkContent?: string | undefined;
|
|
169
|
+
})[];
|
|
170
|
+
}, import("@piying/view-angular-core").AnyCoreSchemaHandle>, import("@piying/valibot-visit").RawConfigAction<"viewRawConfig", {
|
|
171
|
+
llm?: {
|
|
172
|
+
name?: string | undefined;
|
|
173
|
+
model?: string | undefined;
|
|
174
|
+
baseURL?: string | undefined;
|
|
175
|
+
} | undefined;
|
|
176
|
+
responseFormat?: "text" | "json_schema" | "json_object" | undefined;
|
|
177
|
+
parseBy?: "json" | "markdown" | "yaml" | undefined;
|
|
178
|
+
examples: {
|
|
179
|
+
input: {
|
|
180
|
+
format: boolean;
|
|
181
|
+
value: string;
|
|
182
|
+
};
|
|
183
|
+
output: {
|
|
184
|
+
format: boolean;
|
|
185
|
+
value: string;
|
|
186
|
+
};
|
|
187
|
+
}[];
|
|
188
|
+
value: ({
|
|
189
|
+
role: "system";
|
|
190
|
+
content: {
|
|
191
|
+
text: string;
|
|
192
|
+
type: "text";
|
|
193
|
+
}[];
|
|
194
|
+
} | {
|
|
195
|
+
role: "user";
|
|
196
|
+
content: ({
|
|
197
|
+
text: string;
|
|
198
|
+
type: "text";
|
|
157
199
|
} | {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
200
|
+
image_url: {
|
|
201
|
+
url: string;
|
|
202
|
+
detail?: "auto" | "low" | "high" | undefined;
|
|
203
|
+
};
|
|
204
|
+
type: "image_url";
|
|
205
|
+
})[];
|
|
206
|
+
} | {
|
|
207
|
+
role: "assistant";
|
|
208
|
+
content: {
|
|
209
|
+
text: string;
|
|
210
|
+
type: "text";
|
|
211
|
+
}[];
|
|
212
|
+
thinkContent?: string | undefined;
|
|
213
|
+
})[];
|
|
214
|
+
}, import("@piying/view-angular-core").AnyCoreSchemaHandle>]>;
|
|
167
215
|
readonly afterAdd?: (node: import("../../../..").CustomNode, injector: import("static-injector").Injector) => any;
|
|
168
216
|
readonly priority?: number;
|
|
169
217
|
readonly type: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shenghuabi/workflow",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "模板",
|
|
5
5
|
"author": "wszgrcy",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"@cyia/external-call": "^1.5.2",
|
|
12
12
|
"@cyia/util": "^1.5.2",
|
|
13
13
|
"@cyia/vfs2": "^1.5.2",
|
|
14
|
-
"@shenghuabi/openai": "1.1.
|
|
14
|
+
"@shenghuabi/openai": "1.1.3",
|
|
15
15
|
"static-injector": "^6.1.2",
|
|
16
16
|
"@piying/view-angular-core": "^2.9.3",
|
|
17
17
|
"@piying/valibot-visit": "^1.3.11"
|
package/webview/index.js
CHANGED
|
@@ -152,119 +152,80 @@ var RUNNER_ORIGIN_OUTPUT_KEY = `[Origin]`;
|
|
|
152
152
|
// packages/workflow/inline/node/chat/chat.node.define.ts
|
|
153
153
|
var ResponseList = ["json", "markdown", "yaml"];
|
|
154
154
|
var ResponseFormat = ["text", "json_object", "json_schema"];
|
|
155
|
-
var CHAT_NODE_DEFINE = v3.
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
]
|
|
208
|
-
}),
|
|
209
|
-
v3.title("返回解析"),
|
|
210
|
-
(0, import_view_angular_core4.valueChange)((fn) => {
|
|
211
|
-
fn({ list: [["..", "responseFormat"]] }).subscribe(
|
|
212
|
-
({ list: [value], field }) => {
|
|
213
|
-
if ((value ?? "").startsWith("json")) {
|
|
214
|
-
if (!field.form.control.value) {
|
|
215
|
-
field.form.control.updateValue("json");
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
);
|
|
220
|
-
})
|
|
221
|
-
),
|
|
222
|
-
examples: EXAMPLES_DEFINE
|
|
155
|
+
var CHAT_NODE_DEFINE = v3.pipe(
|
|
156
|
+
v3.object({
|
|
157
|
+
llm: v3.optional(llmModelConfig()),
|
|
158
|
+
/** 处理时解析 */
|
|
159
|
+
responseFormat: v3.pipe(
|
|
160
|
+
v3.optional(v3.picklist(ResponseFormat)),
|
|
161
|
+
import_view_angular_core4.actions.inputs.patch({
|
|
162
|
+
options: [
|
|
163
|
+
// 有输入json时
|
|
164
|
+
{
|
|
165
|
+
label: "自动",
|
|
166
|
+
value: void 0,
|
|
167
|
+
description: `传入JsonSchema时为[json_schema],否则为[text]`
|
|
168
|
+
},
|
|
169
|
+
{ label: "文本", value: "text" },
|
|
170
|
+
{
|
|
171
|
+
label: "JSON对象",
|
|
172
|
+
value: "json_object",
|
|
173
|
+
description: "只限制返回类型为JSON对象,不对字段进行限制"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
label: "JSON格式定义",
|
|
177
|
+
value: "json_schema",
|
|
178
|
+
description: "限制返回类型为JSON对象,同时限制字段,不建议手动指定,传入JsonSchema后自动启用"
|
|
179
|
+
}
|
|
180
|
+
]
|
|
181
|
+
}),
|
|
182
|
+
v3.title("响应格式")
|
|
183
|
+
),
|
|
184
|
+
/** 处理后解析 */
|
|
185
|
+
parseBy: v3.pipe(
|
|
186
|
+
v3.optional(v3.picklist(ResponseList)),
|
|
187
|
+
import_view_angular_core4.actions.inputs.patch({
|
|
188
|
+
options: [
|
|
189
|
+
{ label: "直接返回", value: void 0 },
|
|
190
|
+
{
|
|
191
|
+
label: "json",
|
|
192
|
+
value: "json",
|
|
193
|
+
description: `将返回的json代码块内容或原始内容解析为对象`
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
label: "markdown",
|
|
197
|
+
value: "markdown",
|
|
198
|
+
description: `[需要提示词约束]将返回其中的markdown代码块内容或原始内容`
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
label: "yaml",
|
|
202
|
+
value: "yaml",
|
|
203
|
+
description: `[需要提示词约束]将返回的yaml代码块内容或原始内容解析为对象`
|
|
204
|
+
}
|
|
205
|
+
]
|
|
223
206
|
}),
|
|
224
|
-
|
|
225
|
-
import_view_angular_core4.
|
|
207
|
+
v3.title("返回解析"),
|
|
208
|
+
(0, import_view_angular_core4.valueChange)((fn) => {
|
|
209
|
+
fn({ list: [["..", "responseFormat"]] }).subscribe(
|
|
210
|
+
({ list: [value], field }) => {
|
|
211
|
+
if ((value ?? "").startsWith("json")) {
|
|
212
|
+
if (!field.form.control.value) {
|
|
213
|
+
field.form.control.updateValue("json");
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
);
|
|
218
|
+
})
|
|
226
219
|
),
|
|
220
|
+
examples: EXAMPLES_DEFINE,
|
|
227
221
|
value: v3.pipe(
|
|
228
222
|
v3.custom(Boolean),
|
|
229
223
|
(0, import_view_angular_core4.setComponent)("prompt-list")
|
|
230
|
-
// valueChange((fn) => {
|
|
231
|
-
// fn({ list: [undefined] }).subscribe(({ list: [value], field }) => {
|
|
232
|
-
// if (!Array.isArray(value)) {
|
|
233
|
-
// return;
|
|
234
|
-
// }
|
|
235
|
-
// const inputValue: ChatMessageListInputType = value ?? [];
|
|
236
|
-
// // field.context
|
|
237
|
-
// // .parseTemplate(
|
|
238
|
-
// // inputValue.flatMap((item) =>
|
|
239
|
-
// // item.content.map((item) =>
|
|
240
|
-
// // item.type === 'text' ? item.text : '',
|
|
241
|
-
// // ),
|
|
242
|
-
// // ),
|
|
243
|
-
// // )
|
|
244
|
-
// // .then((value: any) => {
|
|
245
|
-
// // if (!value) {
|
|
246
|
-
// // return;
|
|
247
|
-
// // }
|
|
248
|
-
// // field.context.changeHandleData(field, 'input', 1, value);
|
|
249
|
-
// // });
|
|
250
|
-
// // const list = inputValue
|
|
251
|
-
// // .flatMap((item) =>
|
|
252
|
-
// // item.content.map((item) =>
|
|
253
|
-
// // item.type === 'image_url' ? item.image_url.url : undefined,
|
|
254
|
-
// // ),
|
|
255
|
-
// // )
|
|
256
|
-
// // .filter(Boolean)
|
|
257
|
-
// // .map((item) => ({
|
|
258
|
-
// // value: `${item}`,
|
|
259
|
-
// // label: `${item}`,
|
|
260
|
-
// // inputType: `image` as const,
|
|
261
|
-
// // }));
|
|
262
|
-
// // field.context.changeHandleData(field, 'input', 3, list ?? []);
|
|
263
|
-
// });
|
|
264
|
-
// }),
|
|
265
224
|
)
|
|
266
|
-
})
|
|
267
|
-
|
|
225
|
+
}),
|
|
226
|
+
import_view_angular_core4.actions.wrappers.patch(["div"]),
|
|
227
|
+
import_view_angular_core4.actions.class.top("grid auto-rows-auto gap-2")
|
|
228
|
+
);
|
|
268
229
|
|
|
269
230
|
// packages/workflow/share/const.ts
|
|
270
231
|
var HelpObj = {
|