vectorvein 0.2.1__py3-none-any.whl → 0.2.2__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/api/client.py +34 -26
- {vectorvein-0.2.1.dist-info → vectorvein-0.2.2.dist-info}/METADATA +1 -1
- {vectorvein-0.2.1.dist-info → vectorvein-0.2.2.dist-info}/RECORD +5 -5
- {vectorvein-0.2.1.dist-info → vectorvein-0.2.2.dist-info}/WHEEL +0 -0
- {vectorvein-0.2.1.dist-info → vectorvein-0.2.2.dist-info}/entry_points.txt +0 -0
vectorvein/api/client.py
CHANGED
@@ -166,30 +166,34 @@ class VectorVeinClient:
|
|
166
166
|
if time.time() - start_time > timeout:
|
167
167
|
raise TimeoutError(f"Workflow execution timed out after {timeout} seconds")
|
168
168
|
|
169
|
-
|
170
|
-
if status
|
171
|
-
return
|
172
|
-
|
173
|
-
|
174
|
-
msg=status["msg"],
|
175
|
-
data=[WorkflowOutput(**output) for output in status["data"]],
|
176
|
-
)
|
177
|
-
elif status["status"] == 500:
|
178
|
-
raise WorkflowError(f"Workflow execution failed: {status['msg']}")
|
169
|
+
result = self.check_workflow_status(rid)
|
170
|
+
if result.status == 200:
|
171
|
+
return result
|
172
|
+
elif result.status == 500:
|
173
|
+
raise WorkflowError(f"Workflow execution failed: {result.msg}")
|
179
174
|
|
180
175
|
time.sleep(5)
|
181
176
|
|
182
|
-
def check_workflow_status(self, rid: str) ->
|
177
|
+
def check_workflow_status(self, rid: str) -> WorkflowRunResult:
|
183
178
|
"""检查工作流运行状态
|
184
179
|
|
185
180
|
Args:
|
186
181
|
rid: 工作流运行记录ID
|
187
182
|
|
188
183
|
Returns:
|
189
|
-
|
184
|
+
WorkflowRunResult: 工作流运行结果
|
190
185
|
"""
|
191
186
|
payload = {"rid": rid}
|
192
|
-
|
187
|
+
response = self._request("POST", "workflow/check-status", json=payload)
|
188
|
+
if response["status"] in [200, 202]:
|
189
|
+
return WorkflowRunResult(
|
190
|
+
rid=rid,
|
191
|
+
status=response["status"],
|
192
|
+
msg=response["msg"],
|
193
|
+
data=[WorkflowOutput(**output) for output in response["data"]],
|
194
|
+
)
|
195
|
+
else:
|
196
|
+
raise WorkflowError(f"Workflow execution failed: {response['msg']}")
|
193
197
|
|
194
198
|
def get_access_keys(
|
195
199
|
self, access_keys: Optional[List[str]] = None, get_type: Literal["selected", "all"] = "selected"
|
@@ -566,30 +570,34 @@ class AsyncVectorVeinClient:
|
|
566
570
|
if time.time() - start_time > timeout:
|
567
571
|
raise TimeoutError(f"Workflow execution timed out after {timeout} seconds")
|
568
572
|
|
569
|
-
|
570
|
-
if status
|
571
|
-
return
|
572
|
-
|
573
|
-
|
574
|
-
msg=status["msg"],
|
575
|
-
data=[WorkflowOutput(**output) for output in status["data"]],
|
576
|
-
)
|
577
|
-
elif status["status"] == 500:
|
578
|
-
raise WorkflowError(f"Workflow execution failed: {status['msg']}")
|
573
|
+
result = await self.check_workflow_status(rid)
|
574
|
+
if result.status == 200:
|
575
|
+
return result
|
576
|
+
elif result.status == 500:
|
577
|
+
raise WorkflowError(f"Workflow execution failed: {result.msg}")
|
579
578
|
|
580
579
|
await asyncio.sleep(5)
|
581
580
|
|
582
|
-
async def check_workflow_status(self, rid: str) ->
|
581
|
+
async def check_workflow_status(self, rid: str) -> WorkflowRunResult:
|
583
582
|
"""异步检查工作流运行状态
|
584
583
|
|
585
584
|
Args:
|
586
585
|
rid: 工作流运行记录ID
|
587
586
|
|
588
587
|
Returns:
|
589
|
-
|
588
|
+
WorkflowRunResult: 工作流运行结果
|
590
589
|
"""
|
591
590
|
payload = {"rid": rid}
|
592
|
-
|
591
|
+
response = await self._request("POST", "workflow/check-status", json=payload)
|
592
|
+
if response["status"] in [200, 202]:
|
593
|
+
return WorkflowRunResult(
|
594
|
+
rid=rid,
|
595
|
+
status=response["status"],
|
596
|
+
msg=response["msg"],
|
597
|
+
data=[WorkflowOutput(**output) for output in response["data"]],
|
598
|
+
)
|
599
|
+
else:
|
600
|
+
raise WorkflowError(f"Workflow execution failed: {response['msg']}")
|
593
601
|
|
594
602
|
async def get_access_keys(
|
595
603
|
self, access_keys: Optional[List[str]] = None, get_type: Literal["selected", "all"] = "selected"
|
@@ -1,9 +1,9 @@
|
|
1
|
-
vectorvein-0.2.
|
2
|
-
vectorvein-0.2.
|
3
|
-
vectorvein-0.2.
|
1
|
+
vectorvein-0.2.2.dist-info/METADATA,sha256=wS-CyMabwgi8OjyI4c9bcTRekuY2fmfOvekZB6Dh_PQ,4413
|
2
|
+
vectorvein-0.2.2.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
|
3
|
+
vectorvein-0.2.2.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
|
-
vectorvein/api/client.py,sha256=
|
6
|
+
vectorvein/api/client.py,sha256=bym9p462CxtY3pkOyZb28EmjLUYaQQn9_eTWJSKS8mk,29464
|
7
7
|
vectorvein/api/exceptions.py,sha256=btfeXfNfc7zLykMKklpJePLnmJie5YSxCYHyMReCC9s,751
|
8
8
|
vectorvein/api/models.py,sha256=z5MeXMxWFHlNkP5vjVz6gEn5cxD1FbQ8pQvbx9KtgkE,1422
|
9
9
|
vectorvein/chat_clients/__init__.py,sha256=omQuG4PRRPNflSAgtdU--rwsWG6vMpwMEyIGZyFVHVQ,18596
|
@@ -59,4 +59,4 @@ vectorvein/workflow/nodes/vector_db.py,sha256=t6I17q6iR3yQreiDHpRrksMdWDPIvgqJs0
|
|
59
59
|
vectorvein/workflow/nodes/video_generation.py,sha256=qmdg-t_idpxq1veukd-jv_ChICMOoInKxprV9Z4Vi2w,4118
|
60
60
|
vectorvein/workflow/nodes/web_crawlers.py,sha256=LsqomfXfqrXfHJDO1cl0Ox48f4St7X_SL12DSbAMSOw,5415
|
61
61
|
vectorvein/workflow/utils/json_to_code.py,sha256=F7dhDy8kGc8ndOeihGLRLGFGlquoxVlb02ENtxnQ0C8,5914
|
62
|
-
vectorvein-0.2.
|
62
|
+
vectorvein-0.2.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|