vectorvein 0.2.3__py3-none-any.whl → 0.2.4__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 CHANGED
@@ -99,7 +99,6 @@ class VectorVeinClient:
99
99
  headers=headers,
100
100
  **kwargs,
101
101
  )
102
- response.raise_for_status()
103
102
  result = response.json()
104
103
 
105
104
  if result["status"] in [401, 403]:
@@ -191,6 +190,16 @@ class VectorVeinClient:
191
190
 
192
191
  time.sleep(5)
193
192
 
193
+ @overload
194
+ def check_workflow_status(
195
+ self, rid: str, wid: Optional[str] = None, api_key_type: Literal["WORKFLOW"] = "WORKFLOW"
196
+ ) -> WorkflowRunResult: ...
197
+
198
+ @overload
199
+ def check_workflow_status(
200
+ self, rid: str, wid: str, api_key_type: Literal["VAPP"] = "VAPP"
201
+ ) -> WorkflowRunResult: ...
202
+
194
203
  def check_workflow_status(
195
204
  self, rid: str, wid: Optional[str] = None, api_key_type: Literal["WORKFLOW", "VAPP"] = "WORKFLOW"
196
205
  ) -> WorkflowRunResult:
@@ -198,13 +207,18 @@ class VectorVeinClient:
198
207
 
199
208
  Args:
200
209
  rid: 工作流运行记录ID
201
- wid: 工作流ID,非必填
210
+ wid: 工作流ID,非必填,api_key_type 为 'VAPP' 时必填
202
211
  api_key_type: 密钥类型,可选值:'WORKFLOW' 或 'VAPP'
203
212
 
204
213
  Returns:
205
214
  WorkflowRunResult: 工作流运行结果
215
+
216
+ Raises:
217
+ VectorVeinAPIError: 工作流错误
206
218
  """
207
219
  payload = {"rid": rid}
220
+ if api_key_type == "VAPP" and not wid:
221
+ raise VectorVeinAPIError("api_key_type 为 'VAPP' 时工作流 ID 不能为空")
208
222
  if wid:
209
223
  payload["wid"] = wid
210
224
  response = self._request("POST", "workflow/check-status", json=payload, api_key_type=api_key_type)
@@ -526,7 +540,6 @@ class AsyncVectorVeinClient:
526
540
  headers=headers,
527
541
  **kwargs,
528
542
  )
529
- response.raise_for_status()
530
543
  result = response.json()
531
544
 
532
545
  if result["status"] in [401, 403]:
@@ -618,6 +631,16 @@ class AsyncVectorVeinClient:
618
631
 
619
632
  await asyncio.sleep(5)
620
633
 
634
+ @overload
635
+ async def check_workflow_status(
636
+ self, rid: str, wid: Optional[str] = None, api_key_type: Literal["WORKFLOW"] = "WORKFLOW"
637
+ ) -> WorkflowRunResult: ...
638
+
639
+ @overload
640
+ async def check_workflow_status(
641
+ self, rid: str, wid: str, api_key_type: Literal["VAPP"] = "VAPP"
642
+ ) -> WorkflowRunResult: ...
643
+
621
644
  async def check_workflow_status(
622
645
  self, rid: str, wid: Optional[str] = None, api_key_type: Literal["WORKFLOW", "VAPP"] = "WORKFLOW"
623
646
  ) -> WorkflowRunResult:
@@ -625,13 +648,15 @@ class AsyncVectorVeinClient:
625
648
 
626
649
  Args:
627
650
  rid: 工作流运行记录ID
628
- wid: 工作流ID,非必填
651
+ wid: 工作流ID,非必填,api_key_type 为 'VAPP' 时必填
629
652
  api_key_type: 密钥类型,可选值:'WORKFLOW' 或 'VAPP'
630
653
 
631
- Returns:
632
- WorkflowRunResult: 工作流运行结果
654
+ Raises:
655
+ VectorVeinAPIError: 工作流错误
633
656
  """
634
657
  payload = {"rid": rid}
658
+ if api_key_type == "VAPP" and not wid:
659
+ raise VectorVeinAPIError("api_key_type 为 'VAPP' 时工作流 ID 不能为空")
635
660
  if wid:
636
661
  payload["wid"] = wid
637
662
  response = await self._request("POST", "workflow/check-status", json=payload, api_key_type=api_key_type)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vectorvein
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: VectorVein python SDK
5
5
  Author-Email: Anderson <andersonby@163.com>
6
6
  License: MIT
@@ -1,9 +1,9 @@
1
- vectorvein-0.2.3.dist-info/METADATA,sha256=c-trHoS2s_Hz1zCnciGNk6AdPwlNWZp0PBxzNaRCdhg,4413
2
- vectorvein-0.2.3.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
- vectorvein-0.2.3.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
1
+ vectorvein-0.2.4.dist-info/METADATA,sha256=TFMh4mGtTFrgaRTpXSj5wa9HMcVJ2j74Z1AwTockagI,4413
2
+ vectorvein-0.2.4.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
+ vectorvein-0.2.4.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=C0TvmjzvZjYz9IpvDwGx5nMQzR9GyTJEU7aav4epeBc,31710
6
+ vectorvein/api/client.py,sha256=K93a-EvmBqh6sz_iFkMK1VlM54mgZsjOabnRzJJnbWM,32732
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.3.dist-info/RECORD,,
62
+ vectorvein-0.2.4.dist-info/RECORD,,