vectorvein 0.1.80__py3-none-any.whl → 0.1.81__py3-none-any.whl

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.
@@ -0,0 +1,218 @@
1
+ from typing import Optional
2
+
3
+ from ..graph.node import Node
4
+ from ..graph.port import PortType, InputPort, OutputPort
5
+
6
+
7
+ class TextInOut(Node):
8
+ def __init__(self, id: Optional[str] = None):
9
+ super().__init__(
10
+ node_type="TextInOut",
11
+ category="text_processing",
12
+ task_name="text_processing.text_in_out",
13
+ node_id=id,
14
+ ports={
15
+ "text": InputPort(
16
+ name="text",
17
+ port_type=PortType.TEXTAREA,
18
+ value="",
19
+ ),
20
+ "input_type": InputPort(
21
+ name="input_type",
22
+ port_type=PortType.SELECT,
23
+ value="text",
24
+ options=[
25
+ {"value": "text", "label": "text"},
26
+ {"value": "number", "label": "number"},
27
+ ],
28
+ ),
29
+ "output": OutputPort(
30
+ name="output",
31
+ port_type=PortType.TEXT,
32
+ ),
33
+ },
34
+ )
35
+
36
+
37
+ class TextReplace(Node):
38
+ def __init__(self, id: Optional[str] = None):
39
+ super().__init__(
40
+ node_type="TextReplace",
41
+ category="text_processing",
42
+ task_name="text_processing.text_replace",
43
+ node_id=id,
44
+ ports={
45
+ "text": InputPort(
46
+ name="text",
47
+ port_type=PortType.TEXTAREA,
48
+ value="",
49
+ ),
50
+ "replace_items": InputPort(
51
+ name="replace_items",
52
+ port_type=PortType.INPUT,
53
+ value=[],
54
+ ),
55
+ "output": OutputPort(
56
+ name="output",
57
+ port_type=PortType.TEXT,
58
+ ),
59
+ },
60
+ )
61
+
62
+
63
+ class TextSplitters(Node):
64
+ def __init__(self, id: Optional[str] = None):
65
+ super().__init__(
66
+ node_type="TextSplitters",
67
+ category="text_processing",
68
+ task_name="text_processing.text_splitters",
69
+ node_id=id,
70
+ ports={
71
+ "text": InputPort(
72
+ name="text",
73
+ port_type=PortType.TEXTAREA,
74
+ value="",
75
+ ),
76
+ "split_method": InputPort(
77
+ name="split_method",
78
+ port_type=PortType.SELECT,
79
+ value="general",
80
+ options=[
81
+ {"value": "general", "label": "general"},
82
+ {"value": "delimiter", "label": "delimiter"},
83
+ {"value": "markdown", "label": "markdown"},
84
+ ],
85
+ ),
86
+ "chunk_length": InputPort(
87
+ name="chunk_length",
88
+ port_type=PortType.NUMBER,
89
+ value=500,
90
+ condition="return ['general', 'markdown'].includes(fieldsData.split_method.value)",
91
+ ),
92
+ "chunk_overlap": InputPort(
93
+ name="chunk_overlap",
94
+ port_type=PortType.NUMBER,
95
+ value=30,
96
+ condition="return ['general', 'markdown'].includes(fieldsData.split_method.value)",
97
+ ),
98
+ "delimiter": InputPort(
99
+ name="delimiter",
100
+ port_type=PortType.INPUT,
101
+ value="\\n",
102
+ condition="return fieldsData.split_method.value == 'delimiter'",
103
+ ),
104
+ "output": OutputPort(
105
+ name="output",
106
+ port_type=PortType.TEXT,
107
+ ),
108
+ },
109
+ )
110
+
111
+
112
+ class TextTruncation(Node):
113
+ def __init__(self, id: Optional[str] = None):
114
+ super().__init__(
115
+ node_type="TextTruncation",
116
+ category="text_processing",
117
+ task_name="text_processing.text_truncation",
118
+ node_id=id,
119
+ ports={
120
+ "text": InputPort(
121
+ name="text",
122
+ port_type=PortType.TEXTAREA,
123
+ value="",
124
+ ),
125
+ "truncate_method": InputPort(
126
+ name="truncate_method",
127
+ port_type=PortType.SELECT,
128
+ value="general",
129
+ options=[
130
+ {"value": "general", "label": "general"},
131
+ {"value": "markdown", "label": "markdown"},
132
+ ],
133
+ ),
134
+ "truncate_length": InputPort(
135
+ name="truncate_length",
136
+ port_type=PortType.NUMBER,
137
+ value=2000,
138
+ ),
139
+ "floating_range": InputPort(
140
+ name="floating_range",
141
+ port_type=PortType.NUMBER,
142
+ value=100,
143
+ ),
144
+ "output": OutputPort(),
145
+ },
146
+ )
147
+
148
+
149
+ class MarkdownToHtml(Node):
150
+ def __init__(self, id: Optional[str] = None):
151
+ super().__init__(
152
+ node_type="MarkdownToHtml",
153
+ category="text_processing",
154
+ task_name="text_processing.markdown_to_html",
155
+ node_id=id,
156
+ ports={
157
+ "markdown": InputPort(
158
+ name="markdown",
159
+ port_type=PortType.TEXTAREA,
160
+ value="",
161
+ ),
162
+ "html": OutputPort(
163
+ name="html",
164
+ port_type=PortType.TEXT,
165
+ ),
166
+ },
167
+ )
168
+
169
+
170
+ class ListRender(Node):
171
+ def __init__(self, id: Optional[str] = None):
172
+ super().__init__(
173
+ node_type="ListRender",
174
+ category="text_processing",
175
+ task_name="text_processing.list_render",
176
+ node_id=id,
177
+ ports={
178
+ "list": InputPort(
179
+ name="list",
180
+ port_type=PortType.INPUT,
181
+ value=[],
182
+ ),
183
+ "separator": InputPort(
184
+ name="separator",
185
+ port_type=PortType.INPUT,
186
+ value="\\n\\n",
187
+ condition="return fieldsData.output_type.value == 'text'",
188
+ ),
189
+ "output_type": InputPort(
190
+ name="output_type",
191
+ port_type=PortType.SELECT,
192
+ value="text",
193
+ options=[
194
+ {"value": "text", "label": "Text"},
195
+ {"value": "list", "label": "List"},
196
+ ],
197
+ ),
198
+ "output": OutputPort(),
199
+ },
200
+ )
201
+
202
+
203
+ class TemplateCompose(Node):
204
+ def __init__(self, id: Optional[str] = None):
205
+ super().__init__(
206
+ node_type="TemplateCompose",
207
+ category="text_processing",
208
+ task_name="text_processing.template_compose",
209
+ node_id=id,
210
+ ports={
211
+ "template": InputPort(
212
+ name="template",
213
+ port_type=PortType.TEXTAREA,
214
+ value="",
215
+ ),
216
+ "output": OutputPort(),
217
+ },
218
+ )
@@ -0,0 +1,331 @@
1
+ from typing import Optional
2
+
3
+ from ..graph.node import Node
4
+ from ..graph.port import PortType, InputPort, OutputPort
5
+
6
+
7
+ class CodebaseAnalysis(Node):
8
+ def __init__(self, id: Optional[str] = None):
9
+ super().__init__(
10
+ node_type="CodebaseAnalysis",
11
+ category="tools",
12
+ task_name="tools.codebase_analysis",
13
+ node_id=id,
14
+ ports={
15
+ "input_type": InputPort(
16
+ name="input_type",
17
+ port_type=PortType.SELECT,
18
+ value="file",
19
+ options=[
20
+ {"value": "file", "label": "file"},
21
+ {"value": "git_url", "label": "git_url"},
22
+ ],
23
+ ),
24
+ "codebase_file": InputPort(
25
+ name="codebase_file",
26
+ port_type=PortType.FILE,
27
+ value=list(),
28
+ support_file_types=[".zip"],
29
+ multiple=False,
30
+ condition="return fieldsData.input_type.value === 'file'",
31
+ ),
32
+ "git_url": InputPort(
33
+ name="git_url",
34
+ port_type=PortType.INPUT,
35
+ value="",
36
+ condition="return fieldsData.input_type.value === 'git_url'",
37
+ ),
38
+ "output_style": InputPort(
39
+ name="output_style",
40
+ port_type=PortType.SELECT,
41
+ value="markdown",
42
+ options=[
43
+ {"value": "plain", "label": "Plain Text"},
44
+ {"value": "xml", "label": "XML"},
45
+ {"value": "markdown", "label": "Markdown"},
46
+ ],
47
+ ),
48
+ "show_line_numbers": InputPort(
49
+ name="show_line_numbers",
50
+ port_type=PortType.CHECKBOX,
51
+ value=False,
52
+ ),
53
+ "remove_comments": InputPort(
54
+ name="remove_comments",
55
+ port_type=PortType.CHECKBOX,
56
+ value=False,
57
+ ),
58
+ "remove_empty_lines": InputPort(
59
+ name="remove_empty_lines",
60
+ port_type=PortType.CHECKBOX,
61
+ value=False,
62
+ ),
63
+ "ignore_patterns": InputPort(
64
+ name="ignore_patterns",
65
+ port_type=PortType.INPUT,
66
+ value=list(),
67
+ multiple=True,
68
+ ),
69
+ "output": OutputPort(),
70
+ },
71
+ )
72
+
73
+
74
+ class TextTranslation(Node):
75
+ def __init__(self, id: Optional[str] = None):
76
+ super().__init__(
77
+ node_type="TextTranslation",
78
+ category="tools",
79
+ task_name="tools.text_translation",
80
+ node_id=id,
81
+ ports={
82
+ "text": InputPort(
83
+ name="text",
84
+ port_type=PortType.INPUT,
85
+ value="",
86
+ field_type="textarea",
87
+ ),
88
+ "from_language": InputPort(
89
+ name="from_language",
90
+ port_type=PortType.SELECT,
91
+ value="auto",
92
+ options=[
93
+ {"value": "ar", "label": "ar"},
94
+ {"value": "de", "label": "de"},
95
+ {"value": "en", "label": "en"},
96
+ {"value": "es", "label": "es"},
97
+ {"value": "fr", "label": "fr"},
98
+ {"value": "hi", "label": "hi"},
99
+ {"value": "id", "label": "id"},
100
+ {"value": "it", "label": "it"},
101
+ {"value": "ja", "label": "ja"},
102
+ {"value": "ko", "label": "ko"},
103
+ {"value": "nl", "label": "nl"},
104
+ {"value": "pt", "label": "pt"},
105
+ {"value": "ru", "label": "ru"},
106
+ {"value": "th", "label": "th"},
107
+ {"value": "vi", "label": "vi"},
108
+ {"value": "zh-CHS", "label": "zh-CHS"},
109
+ {"value": "zh-CHT", "label": "zh-CHT"},
110
+ {"value": "auto", "label": "auto"},
111
+ ],
112
+ ),
113
+ "to_language": InputPort(
114
+ name="to_language",
115
+ port_type=PortType.SELECT,
116
+ value="en",
117
+ options=[
118
+ {"value": "ar", "label": "ar"},
119
+ {"value": "de", "label": "de"},
120
+ {"value": "en", "label": "en"},
121
+ {"value": "es", "label": "es"},
122
+ {"value": "fr", "label": "fr"},
123
+ {"value": "hi", "label": "hi"},
124
+ {"value": "id", "label": "id"},
125
+ {"value": "it", "label": "it"},
126
+ {"value": "ja", "label": "ja"},
127
+ {"value": "ko", "label": "ko"},
128
+ {"value": "nl", "label": "nl"},
129
+ {"value": "pt", "label": "pt"},
130
+ {"value": "ru", "label": "ru"},
131
+ {"value": "th", "label": "th"},
132
+ {"value": "vi", "label": "vi"},
133
+ {"value": "zh-CHS", "label": "zh-CHS"},
134
+ {"value": "zh-CHT", "label": "zh-CHT"},
135
+ ],
136
+ ),
137
+ "output": OutputPort(),
138
+ },
139
+ )
140
+
141
+
142
+ class TextSearch(Node):
143
+ def __init__(self, id: Optional[str] = None):
144
+ super().__init__(
145
+ node_type="TextSearch",
146
+ category="tools",
147
+ task_name="tools.text_search",
148
+ node_id=id,
149
+ ports={
150
+ "search_text": InputPort(
151
+ name="search_text",
152
+ port_type=PortType.INPUT,
153
+ value="",
154
+ ),
155
+ "search_engine": InputPort(
156
+ name="search_engine",
157
+ port_type=PortType.SELECT,
158
+ value="bing",
159
+ options=[
160
+ {"value": "bing", "label": "bing"},
161
+ {"value": "bochaai", "label": "bochaai"},
162
+ {"value": "jina.ai", "label": "jina.ai"},
163
+ {"value": "zhipuai", "label": "zhipuai"},
164
+ {"value": "duckduckgo", "label": "duckduckgo"},
165
+ ],
166
+ ),
167
+ "count": InputPort(
168
+ name="count",
169
+ port_type=PortType.NUMBER,
170
+ value=10,
171
+ ),
172
+ "combine_result_in_text": InputPort(
173
+ name="combine_result_in_text",
174
+ port_type=PortType.CHECKBOX,
175
+ value=True,
176
+ ),
177
+ "max_snippet_length": InputPort(
178
+ name="max_snippet_length",
179
+ port_type=PortType.NUMBER,
180
+ value=300,
181
+ ),
182
+ "output_type": InputPort(
183
+ name="output_type",
184
+ port_type=PortType.SELECT,
185
+ value="markdown",
186
+ options=[
187
+ {"value": "text", "label": "text"},
188
+ {"value": "markdown", "label": "markdown"},
189
+ ],
190
+ ),
191
+ "output_page_title": OutputPort(
192
+ name="output_page_title",
193
+ port_type=PortType.LIST,
194
+ ),
195
+ "output_page_url": OutputPort(
196
+ name="output_page_url",
197
+ port_type=PortType.LIST,
198
+ ),
199
+ "output_page_snippet": OutputPort(
200
+ name="output_page_snippet",
201
+ port_type=PortType.LIST,
202
+ ),
203
+ },
204
+ )
205
+
206
+
207
+ class ProgrammingFunction(Node):
208
+ def __init__(self, id: Optional[str] = None):
209
+ super().__init__(
210
+ node_type="ProgrammingFunction",
211
+ category="tools",
212
+ task_name="tools.programming_function",
213
+ node_id=id,
214
+ ports={
215
+ "language": InputPort(
216
+ name="language",
217
+ port_type=PortType.SELECT,
218
+ value="python",
219
+ options=[
220
+ {"value": "python", "label": "Python"},
221
+ ],
222
+ ),
223
+ "code": InputPort(
224
+ name="code",
225
+ port_type=PortType.INPUT,
226
+ value="",
227
+ field_type="textarea",
228
+ ),
229
+ "use_oversea_node": InputPort(
230
+ name="use_oversea_node",
231
+ port_type=PortType.CHECKBOX,
232
+ value=False,
233
+ ),
234
+ "list_input": InputPort(
235
+ name="list_input",
236
+ port_type=PortType.CHECKBOX,
237
+ value=False,
238
+ ),
239
+ "instance_type": InputPort(
240
+ name="instance_type",
241
+ port_type=PortType.SELECT,
242
+ value="light",
243
+ options=[
244
+ {"value": "light", "label": "light"},
245
+ {"value": "large", "label": "large"},
246
+ ],
247
+ ),
248
+ "output": OutputPort(
249
+ name="output",
250
+ port_type=PortType.INPUT,
251
+ field_type="textarea",
252
+ ),
253
+ "console_msg": OutputPort(
254
+ name="console_msg",
255
+ port_type=PortType.INPUT,
256
+ field_type="textarea",
257
+ ),
258
+ "error_msg": OutputPort(
259
+ name="error_msg",
260
+ port_type=PortType.INPUT,
261
+ field_type="textarea",
262
+ ),
263
+ "files": OutputPort(
264
+ name="files",
265
+ port_type=PortType.INPUT,
266
+ field_type="textarea",
267
+ ),
268
+ },
269
+ )
270
+
271
+
272
+ class ImageSearch(Node):
273
+ def __init__(self, id: Optional[str] = None):
274
+ super().__init__(
275
+ node_type="ImageSearch",
276
+ category="tools",
277
+ task_name="tools.image_search",
278
+ node_id=id,
279
+ ports={
280
+ "search_text": InputPort(
281
+ name="search_text",
282
+ port_type=PortType.INPUT,
283
+ value="",
284
+ ),
285
+ "search_engine": InputPort(
286
+ name="search_engine",
287
+ port_type=PortType.SELECT,
288
+ value="bing",
289
+ options=[
290
+ {"value": "bing", "label": "bing"},
291
+ {"value": "pexels", "label": "pexels"},
292
+ {"value": "unsplash", "label": "unsplash"},
293
+ ],
294
+ ),
295
+ "count": InputPort(
296
+ name="count",
297
+ port_type=PortType.NUMBER,
298
+ value=5,
299
+ ),
300
+ "output_type": InputPort(
301
+ name="output_type",
302
+ port_type=PortType.SELECT,
303
+ value="markdown",
304
+ options=[
305
+ {"value": "text", "label": "text"},
306
+ {"value": "markdown", "label": "markdown"},
307
+ ],
308
+ ),
309
+ "output": OutputPort(
310
+ name="output",
311
+ port_type=PortType.LIST,
312
+ ),
313
+ },
314
+ )
315
+
316
+
317
+ class WorkflowInvoke(Node):
318
+ def __init__(self, id: Optional[str] = None):
319
+ super().__init__(
320
+ node_type="WorkflowInvoke",
321
+ category="tools",
322
+ task_name="tools.workflow_invoke",
323
+ node_id=id,
324
+ ports={
325
+ "workflow_id": InputPort(
326
+ name="workflow_id",
327
+ port_type=PortType.INPUT,
328
+ value="",
329
+ ),
330
+ },
331
+ )
File without changes