vectorvein 0.1.83__py3-none-any.whl → 0.1.85__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.
@@ -47,7 +47,7 @@ from .text_processing import (
47
47
  TemplateCompose,
48
48
  )
49
49
  from .tools import CodebaseAnalysis, TextTranslation, TextSearch, ProgrammingFunction, ImageSearch, WorkflowInvoke
50
- from .vector_db import VectorDbAddData, VectorDbDeleteData, VectorDbSearchData
50
+ from .vector_db import AddData, DeleteData, Search
51
51
  from .video_generation import KlingVideo, CogVideoX
52
52
  from .web_crawlers import TextCrawler, BilibiliCrawler, DouyinCrawler, YoutubeCrawler
53
53
 
@@ -125,9 +125,9 @@ __all__ = [
125
125
  "TextTranslation",
126
126
  "TextTruncation",
127
127
  "Tts",
128
- "VectorDbAddData",
129
- "VectorDbDeleteData",
130
- "VectorDbSearchData",
128
+ "AddData",
129
+ "DeleteData",
130
+ "Search",
131
131
  "VideoEditing",
132
132
  "VideoScreenshot",
133
133
  "WorkflowInvoke",
@@ -65,6 +65,94 @@ class AliyunQwen(Node):
65
65
  )
66
66
 
67
67
 
68
+ class Baichuan(Node):
69
+ def __init__(self, id: Optional[str] = None):
70
+ super().__init__(
71
+ node_type="Baichuan",
72
+ category="llms",
73
+ task_name="llms.baichuan",
74
+ node_id=id,
75
+ ports={
76
+ "prompt": InputPort(
77
+ name="prompt",
78
+ port_type=PortType.TEXTAREA,
79
+ value="",
80
+ ),
81
+ "llm_model": InputPort(
82
+ name="llm_model",
83
+ port_type=PortType.SELECT,
84
+ value="Baichuan3-Turbo",
85
+ options=[
86
+ {"value": "Baichuan4", "label": "Baichuan4"},
87
+ {"value": "Baichuan3-Turbo", "label": "Baichuan3-Turbo"},
88
+ {"value": "Baichuan3-Turbo-128k", "label": "Baichuan3-Turbo-128k"},
89
+ {"value": "Baichuan2-Turbo", "label": "Baichuan2-Turbo"},
90
+ {"value": "Baichuan2-53B", "label": "Baichuan2-53B"},
91
+ ],
92
+ ),
93
+ "temperature": InputPort(
94
+ name="temperature",
95
+ port_type=PortType.TEMPERATURE,
96
+ value=0.7,
97
+ ),
98
+ "top_p": InputPort(
99
+ name="top_p",
100
+ port_type=PortType.NUMBER,
101
+ value=0.95,
102
+ ),
103
+ "stream": InputPort(
104
+ name="stream",
105
+ port_type=PortType.CHECKBOX,
106
+ value=False,
107
+ ),
108
+ "system_prompt": InputPort(
109
+ name="system_prompt",
110
+ port_type=PortType.TEXTAREA,
111
+ value="",
112
+ ),
113
+ "response_format": InputPort(
114
+ name="response_format",
115
+ port_type=PortType.SELECT,
116
+ value="text",
117
+ options=[
118
+ {"value": "text", "label": "Text"},
119
+ {"value": "json_object", "label": "JSON"},
120
+ ],
121
+ ),
122
+ "use_function_call": InputPort(
123
+ name="use_function_call",
124
+ port_type=PortType.CHECKBOX,
125
+ value=False,
126
+ ),
127
+ "functions": InputPort(
128
+ name="functions",
129
+ port_type=PortType.SELECT,
130
+ value=[],
131
+ ),
132
+ "function_call_mode": InputPort(
133
+ name="function_call_mode",
134
+ port_type=PortType.SELECT,
135
+ value="auto",
136
+ options=[
137
+ {"value": "auto", "label": "auto"},
138
+ {"value": "none", "label": "none"},
139
+ ],
140
+ ),
141
+ "output": OutputPort(
142
+ name="output",
143
+ ),
144
+ "function_call_output": OutputPort(
145
+ name="function_call_output",
146
+ condition="return fieldsData.use_function_call.value",
147
+ ),
148
+ "function_call_arguments": OutputPort(
149
+ name="function_call_arguments",
150
+ condition="return fieldsData.use_function_call.value",
151
+ ),
152
+ },
153
+ )
154
+
155
+
68
156
  class BaiduWenxin(Node):
69
157
  def __init__(self, id: Optional[str] = None):
70
158
  super().__init__(
@@ -4,7 +4,7 @@ from ..graph.node import Node
4
4
  from ..graph.port import PortType, InputPort, OutputPort
5
5
 
6
6
 
7
- class VectorDbAddData(Node):
7
+ class AddData(Node):
8
8
  def __init__(self, id: Optional[str] = None):
9
9
  super().__init__(
10
10
  node_type="AddData",
@@ -86,7 +86,7 @@ class VectorDbAddData(Node):
86
86
  )
87
87
 
88
88
 
89
- class VectorDbDeleteData(Node):
89
+ class DeleteData(Node):
90
90
  def __init__(self, id: Optional[str] = None):
91
91
  super().__init__(
92
92
  node_type="DeleteData",
@@ -110,10 +110,10 @@ class VectorDbDeleteData(Node):
110
110
  )
111
111
 
112
112
 
113
- class VectorDbSearchData(Node):
113
+ class Search(Node):
114
114
  def __init__(self, id: Optional[str] = None):
115
115
  super().__init__(
116
- node_type="SearchData",
116
+ node_type="Search",
117
117
  category="vector_db",
118
118
  task_name="vector_db.search_data",
119
119
  node_id=id,
@@ -45,8 +45,8 @@ def _safe_import_node_class(category: str, node_type: str):
45
45
 
46
46
  def to_python_str(value):
47
47
  if isinstance(value, str):
48
- value = value.replace("\n", "\\n")
49
- value = f'"{value}"'
48
+ # 使用repr()来正确处理字符串的转义
49
+ return repr(value)
50
50
  return value
51
51
 
52
52
 
@@ -158,11 +158,11 @@ def generate_python_code(
158
158
  f"port_type={to_python_str(port['field_type'])}",
159
159
  f"value={to_python_str(port['value'])}",
160
160
  ]
161
- if port["show"]:
161
+ if port.get("show"):
162
162
  params.append(f"show={port['show']}")
163
- if port["options"]:
163
+ if port.get("options"):
164
164
  params.append(f"options={port['options']}")
165
- if port["is_output"]:
165
+ if port.get("is_output"):
166
166
  params.append(f"is_output={bool(port['is_output'])}")
167
167
  code.append(f"{info['var_name']}.add_port({', '.join(params)})")
168
168
 
@@ -183,9 +183,3 @@ def generate_python_code(
183
183
  code.append(f'workflow.connect({source_var}, "{source_handle}", {target_var}, "{target_handle}")')
184
184
 
185
185
  return "\n".join(code)
186
-
187
-
188
- if __name__ == "__main__":
189
- # 使用示例
190
- code = generate_python_code(json_file="workflow.json")
191
- print(code)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vectorvein
3
- Version: 0.1.83
3
+ Version: 0.1.85
4
4
  Summary: VectorVein python SDK
5
5
  Author-Email: Anderson <andersonby@163.com>
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
- vectorvein-0.1.83.dist-info/METADATA,sha256=nZNyusAUeCZkpQhZIAUYMq2p8dBckiLKMC0hcqeXtE4,641
2
- vectorvein-0.1.83.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
- vectorvein-0.1.83.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
1
+ vectorvein-0.1.85.dist-info/METADATA,sha256=liaNevO0Gdtzyor4mS1Wuo5Ma6LmkgexsYSKNNhWf3M,641
2
+ vectorvein-0.1.85.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
+ vectorvein-0.1.85.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
4
4
  vectorvein/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  vectorvein/chat_clients/__init__.py,sha256=omQuG4PRRPNflSAgtdU--rwsWG6vMpwMEyIGZyFVHVQ,18596
6
6
  vectorvein/chat_clients/anthropic_client.py,sha256=PGIKldH4FnGrqozoY_FZ6LqhDHC-jY7NF5J1F1zT2Ok,38257
@@ -37,12 +37,12 @@ vectorvein/workflow/graph/edge.py,sha256=xLZEJmBjAfVB53cd7CuRcKhgE6QqXv9nz32wJn8
37
37
  vectorvein/workflow/graph/node.py,sha256=nxDq4pTFcsm2x9MmNmZxghhc-HduSLRwH3Ct2i8bZ3o,2871
38
38
  vectorvein/workflow/graph/port.py,sha256=kv0YbAPqe9Hh9QPSoiB2PUTTWQT1xIdNeVD50OkWTzA,5684
39
39
  vectorvein/workflow/graph/workflow.py,sha256=BmS351-WSeHQ02Kh0jOQpxJbNgZ-AHwW0mSQLXcKceU,2805
40
- vectorvein/workflow/nodes/__init__.py,sha256=AB8YCjkK3xdpk1_jfzsBkDtsSp48RcS_N4631MyEJXU,3159
40
+ vectorvein/workflow/nodes/__init__.py,sha256=jd4O27kIJdOtkij1FYZ6aJnJy2OQa7xtL1r-Yv8ylO0,3103
41
41
  vectorvein/workflow/nodes/audio_generation.py,sha256=ht2S0vnd0mIAt6FBaSWlADGbb7f_1DAySYrgYnvZT1Q,5726
42
42
  vectorvein/workflow/nodes/control_flows.py,sha256=Zc_uWuroYznLrU-BZCncyzvejC-zFl6EuN_VP8oq5mY,6573
43
43
  vectorvein/workflow/nodes/file_processing.py,sha256=Rsjc8al0z-2KuweO0nIybWvceqxbqOPQyTs0-pgy5m4,3980
44
44
  vectorvein/workflow/nodes/image_generation.py,sha256=fXOhLGodJ3OdKBPXO5a3rq4wN2GMJ0jwqKO_gJFdocU,32852
45
- vectorvein/workflow/nodes/llms.py,sha256=MU0tmCOcPUcN4uVI9t5RlQeCuKgiXzVNxpdtgMzLV2U,31077
45
+ vectorvein/workflow/nodes/llms.py,sha256=lCq5MVv6k4sEbRfnImQVM1Zzzsyuud-1XuapezIjfQc,34557
46
46
  vectorvein/workflow/nodes/media_editing.py,sha256=Od0X0SdcyRhcJckWpDM4WvgWEKxaIsgMXpMifN8Sc5M,29405
47
47
  vectorvein/workflow/nodes/media_processing.py,sha256=t-azYDphXmLRdOyHDfXFTS1tsEOyKqKskDyD0y232j8,19043
48
48
  vectorvein/workflow/nodes/output.py,sha256=_UQxiddHtGv2rkjhUFE-KDgrjnh0AGJQJyq9-4Aji5A,12567
@@ -50,8 +50,8 @@ vectorvein/workflow/nodes/relational_db.py,sha256=zfzUhV25TpZGhkIzO18PmAT5xhcsJC
50
50
  vectorvein/workflow/nodes/text_processing.py,sha256=cfepHoy8JaFDqWLUzl6lmlDlKaH0vk1gWQSm7T0wmn8,7503
51
51
  vectorvein/workflow/nodes/tools.py,sha256=Vw7yPdPqENqQ-MwbPcz5LQ-5036UGApCPX6ZspPOw40,12739
52
52
  vectorvein/workflow/nodes/triggers.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
- vectorvein/workflow/nodes/vector_db.py,sha256=FG0fDc99wYLrxqchcbnTKyyFPrVjw710pld--F_j9Oo,5744
53
+ vectorvein/workflow/nodes/vector_db.py,sha256=t6I17q6iR3yQreiDHpRrksMdWDPIvgqJs076z-7dlQQ,5712
54
54
  vectorvein/workflow/nodes/video_generation.py,sha256=qmdg-t_idpxq1veukd-jv_ChICMOoInKxprV9Z4Vi2w,4118
55
55
  vectorvein/workflow/nodes/web_crawlers.py,sha256=LsqomfXfqrXfHJDO1cl0Ox48f4St7X_SL12DSbAMSOw,5415
56
- vectorvein/workflow/utils/json_to_code.py,sha256=8e08bThiXTGXXI0GuBde6lMSp4-CHt7B5S_6rQ3hkg0,6020
57
- vectorvein-0.1.83.dist-info/RECORD,,
56
+ vectorvein/workflow/utils/json_to_code.py,sha256=F7dhDy8kGc8ndOeihGLRLGFGlquoxVlb02ENtxnQ0C8,5914
57
+ vectorvein-0.1.85.dist-info/RECORD,,