vectorvein 0.2.73__py3-none-any.whl → 0.2.75__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.
- vectorvein/chat_clients/openai_compatible_client.py +7 -0
- vectorvein/workflow/graph/node.py +6 -0
- vectorvein/workflow/graph/workflow.py +26 -2
- {vectorvein-0.2.73.dist-info → vectorvein-0.2.75.dist-info}/METADATA +1 -1
- {vectorvein-0.2.73.dist-info → vectorvein-0.2.75.dist-info}/RECORD +7 -7
- {vectorvein-0.2.73.dist-info → vectorvein-0.2.75.dist-info}/WHEEL +0 -0
- {vectorvein-0.2.73.dist-info → vectorvein-0.2.75.dist-info}/entry_points.txt +0 -0
@@ -504,6 +504,9 @@ class OpenAICompatibleChatClient(BaseChatClient):
|
|
504
504
|
**tools_params, # type: ignore
|
505
505
|
)
|
506
506
|
|
507
|
+
if not response.choices:
|
508
|
+
raise ValueError(f"No response choices: {response}")
|
509
|
+
|
507
510
|
result = {
|
508
511
|
"content": response.choices[0].message.content,
|
509
512
|
"reasoning_content": getattr(response.choices[0].message, "reasoning_content", None),
|
@@ -979,6 +982,10 @@ class AsyncOpenAICompatibleChatClient(BaseAsyncChatClient):
|
|
979
982
|
else OPENAI_NOT_GIVEN,
|
980
983
|
**tools_params, # type: ignore
|
981
984
|
)
|
985
|
+
|
986
|
+
if not response.choices:
|
987
|
+
raise ValueError(f"No response choices: {response}")
|
988
|
+
|
982
989
|
result = {
|
983
990
|
"content": response.choices[0].message.content,
|
984
991
|
"reasoning_content": getattr(response.choices[0].message, "reasoning_content", None),
|
@@ -88,12 +88,18 @@ class Node:
|
|
88
88
|
if is_output:
|
89
89
|
if not self.can_add_output_ports:
|
90
90
|
raise ValueError(f"Node<{self.id}> '{self.type}' does not allow adding output ports")
|
91
|
+
|
92
|
+
if self.has_port(name):
|
93
|
+
raise ValueError(f"Node<{self.id}> '{self.type}' already has a port named '{name}'")
|
91
94
|
self.ports[name] = OutputPort(
|
92
95
|
name=name, port_type=port_type, show=show, value=value, options=options, **kwargs
|
93
96
|
)
|
94
97
|
else:
|
95
98
|
if not self.can_add_input_ports:
|
96
99
|
raise ValueError(f"Node<{self.id}> '{self.type}' does not allow adding input ports")
|
100
|
+
|
101
|
+
if self.has_port(name):
|
102
|
+
raise ValueError(f"Node<{self.id}> '{self.type}' already has a port named '{name}'")
|
97
103
|
self.ports[name] = InputPort(
|
98
104
|
name=name, port_type=port_type, show=show, value=value, options=options, **kwargs
|
99
105
|
)
|
@@ -69,6 +69,13 @@ class Workflow:
|
|
69
69
|
if not target_node_obj.has_input_port(target_port):
|
70
70
|
raise ValueError(f"Target node {target_node_id} has no input port: {target_port}")
|
71
71
|
|
72
|
+
# 确保目标端口是InputPort而不是OutputPort
|
73
|
+
target_port_obj = target_node_obj.ports[target_port]
|
74
|
+
if isinstance(target_port_obj, OutputPort):
|
75
|
+
raise ValueError(
|
76
|
+
f"The target port {target_port} of node {target_node_id} is an output port. OutputPort cannot be a connection target."
|
77
|
+
)
|
78
|
+
|
72
79
|
# 检查目标端口是否已有被连接的线
|
73
80
|
for edge in self.edges:
|
74
81
|
if edge.target == target_node_id and edge.target_handle == target_port:
|
@@ -328,12 +335,29 @@ class Workflow:
|
|
328
335
|
|
329
336
|
# 创建边
|
330
337
|
for edge_data in data.get("edges", []):
|
338
|
+
# 获取目标节点和端口
|
339
|
+
target_node_id = edge_data["target"]
|
340
|
+
target_port_name = edge_data["targetHandle"]
|
341
|
+
|
342
|
+
# 查找目标节点
|
343
|
+
target_node = next((node for node in workflow.nodes if node.id == target_node_id), None)
|
344
|
+
if target_node is None:
|
345
|
+
raise ValueError(f"Target node not found: {target_node_id}")
|
346
|
+
|
347
|
+
# 检查目标端口是否是OutputPort
|
348
|
+
if target_node.has_port(target_port_name):
|
349
|
+
target_port = target_node.ports[target_port_name]
|
350
|
+
if isinstance(target_port, OutputPort):
|
351
|
+
raise ValueError(
|
352
|
+
f"The target port {target_port_name} of node {target_node_id} is an output port. OutputPort cannot be a connection target."
|
353
|
+
)
|
354
|
+
|
331
355
|
edge = Edge(
|
332
356
|
id=edge_data["id"],
|
333
357
|
source=edge_data["source"],
|
334
358
|
source_handle=edge_data["sourceHandle"],
|
335
|
-
target=
|
336
|
-
target_handle=
|
359
|
+
target=target_node_id,
|
360
|
+
target_handle=target_port_name,
|
337
361
|
animated=edge_data.get("animated", True),
|
338
362
|
type=edge_data.get("type", "default"),
|
339
363
|
)
|
@@ -1,6 +1,6 @@
|
|
1
|
-
vectorvein-0.2.
|
2
|
-
vectorvein-0.2.
|
3
|
-
vectorvein-0.2.
|
1
|
+
vectorvein-0.2.75.dist-info/METADATA,sha256=0XmvjphnKcmaW1y4pAIMFOYkeF5nihc8xCOmLsDoT38,4567
|
2
|
+
vectorvein-0.2.75.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
|
3
|
+
vectorvein-0.2.75.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
|
4
4
|
vectorvein/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
5
|
vectorvein/api/__init__.py,sha256=lfY-XA46fgD2iIZTU0VYP8i07AwA03Egj4Qua0vUKrQ,738
|
6
6
|
vectorvein/api/client.py,sha256=xF-leKDQzVyyy9FnIRaz0k4eElYW1XbbzeRLcpnyk90,33047
|
@@ -19,7 +19,7 @@ vectorvein/chat_clients/minimax_client.py,sha256=YOILWcsHsN5tihLTMbKJIyJr9TJREMI
|
|
19
19
|
vectorvein/chat_clients/mistral_client.py,sha256=1aKSylzBDaLYcFnaBIL4-sXSzWmXfBeON9Q0rq-ziWw,534
|
20
20
|
vectorvein/chat_clients/moonshot_client.py,sha256=gbu-6nGxx8uM_U2WlI4Wus881rFRotzHtMSoYOcruGU,526
|
21
21
|
vectorvein/chat_clients/openai_client.py,sha256=Nz6tV45pWcsOupxjnsRsGTicbQNJWIZyxuJoJ5DGMpg,527
|
22
|
-
vectorvein/chat_clients/openai_compatible_client.py,sha256=
|
22
|
+
vectorvein/chat_clients/openai_compatible_client.py,sha256=4WYtgnjFzLCgv6EK_9wvolv_ayg1mj9tmUxm_eByeZ0,48835
|
23
23
|
vectorvein/chat_clients/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
24
24
|
vectorvein/chat_clients/qwen_client.py,sha256=-ryh-m9PgsO0fc4ulcCmPTy1155J8YUy15uPoJQOHA0,513
|
25
25
|
vectorvein/chat_clients/stepfun_client.py,sha256=zsD2W5ahmR4DD9cqQTXmJr3txrGuvxbRWhFlRdwNijI,519
|
@@ -42,9 +42,9 @@ vectorvein/utilities/media_processing.py,sha256=7KtbLFzOYIn1e9QTN9G6C76NH8CBlV9k
|
|
42
42
|
vectorvein/utilities/rate_limiter.py,sha256=dwolIUVw2wP83Odqpx0AAaE77de1GzxkYDGH4tM_u_4,10300
|
43
43
|
vectorvein/utilities/retry.py,sha256=6KFS9R2HdhqM3_9jkjD4F36ZSpEx2YNFGOVlpOsUetM,2208
|
44
44
|
vectorvein/workflow/graph/edge.py,sha256=1ckyyjCue_PLm7P1ItUfKOy6AKkemOpZ9m1WJ8UXIHQ,1072
|
45
|
-
vectorvein/workflow/graph/node.py,sha256=
|
45
|
+
vectorvein/workflow/graph/node.py,sha256=YdUL69ZIThqtELxnNdDTCiaONVPp5ZR76391Impy8SA,5910
|
46
46
|
vectorvein/workflow/graph/port.py,sha256=HcinzQqNP7ysTvBmi3c4iaWne8nV6m-BpFFX0jTrMIE,7122
|
47
|
-
vectorvein/workflow/graph/workflow.py,sha256=
|
47
|
+
vectorvein/workflow/graph/workflow.py,sha256=wK_A8YNjqaOu63xhHtnATBGnLzJim9MGlkjc1wgMpx4,15990
|
48
48
|
vectorvein/workflow/nodes/__init__.py,sha256=dWrWtL3q0Vsn-MLgJ7gNgLCrwZ5BrqjrN2QFPNeBMuc,3240
|
49
49
|
vectorvein/workflow/nodes/audio_generation.py,sha256=ZRFZ_ycMTSJ2LKmekctagQdJYTl-3q4TNOIKETpS9AM,5870
|
50
50
|
vectorvein/workflow/nodes/control_flows.py,sha256=fDySWek8Isbfznwn0thmbTwTP4c99w68Up9dlASAtIo,6805
|
@@ -65,4 +65,4 @@ vectorvein/workflow/utils/analyse.py,sha256=msmvyz35UTYTwqQR5sg9H0sm1vxmGDSmep9X
|
|
65
65
|
vectorvein/workflow/utils/check.py,sha256=B_NdwqIqnc7Ko2HHqFpfOmWVaAu21tPITe0szKfiZKc,11414
|
66
66
|
vectorvein/workflow/utils/json_to_code.py,sha256=P8dhhSNgKhTnW17qXNjLO2aLdb0rA8qMAWxhObol2TU,7295
|
67
67
|
vectorvein/workflow/utils/layout.py,sha256=j0bRD3uaXu40xCS6U6BGahBI8FrHa5MiF55GbTrZ1LM,4565
|
68
|
-
vectorvein-0.2.
|
68
|
+
vectorvein-0.2.75.dist-info/RECORD,,
|
File without changes
|
File without changes
|