vectorvein 0.2.4__tar.gz → 0.2.6__tar.gz

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.
Files changed (61) hide show
  1. {vectorvein-0.2.4 → vectorvein-0.2.6}/PKG-INFO +1 -1
  2. {vectorvein-0.2.4 → vectorvein-0.2.6}/pyproject.toml +1 -1
  3. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/api/client.py +180 -180
  4. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/api/exceptions.py +7 -7
  5. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/api/models.py +10 -10
  6. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/types/defaults.py +8 -0
  7. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/workflow/nodes/text_processing.py +28 -0
  8. {vectorvein-0.2.4 → vectorvein-0.2.6}/README.md +0 -0
  9. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/__init__.py +0 -0
  10. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/api/__init__.py +0 -0
  11. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/chat_clients/__init__.py +0 -0
  12. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/chat_clients/anthropic_client.py +0 -0
  13. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/chat_clients/baichuan_client.py +0 -0
  14. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/chat_clients/base_client.py +0 -0
  15. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/chat_clients/deepseek_client.py +0 -0
  16. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/chat_clients/gemini_client.py +0 -0
  17. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/chat_clients/groq_client.py +0 -0
  18. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/chat_clients/local_client.py +0 -0
  19. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/chat_clients/minimax_client.py +0 -0
  20. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/chat_clients/mistral_client.py +0 -0
  21. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/chat_clients/moonshot_client.py +0 -0
  22. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/chat_clients/openai_client.py +0 -0
  23. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/chat_clients/openai_compatible_client.py +0 -0
  24. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/chat_clients/py.typed +0 -0
  25. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/chat_clients/qwen_client.py +0 -0
  26. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/chat_clients/stepfun_client.py +0 -0
  27. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/chat_clients/utils.py +0 -0
  28. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/chat_clients/xai_client.py +0 -0
  29. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/chat_clients/yi_client.py +0 -0
  30. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/chat_clients/zhipuai_client.py +0 -0
  31. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/py.typed +0 -0
  32. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/server/token_server.py +0 -0
  33. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/settings/__init__.py +0 -0
  34. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/settings/py.typed +0 -0
  35. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/types/enums.py +0 -0
  36. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/types/exception.py +0 -0
  37. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/types/llm_parameters.py +0 -0
  38. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/types/py.typed +0 -0
  39. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/utilities/media_processing.py +0 -0
  40. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/utilities/rate_limiter.py +0 -0
  41. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/utilities/retry.py +0 -0
  42. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/workflow/graph/edge.py +0 -0
  43. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/workflow/graph/node.py +0 -0
  44. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/workflow/graph/port.py +0 -0
  45. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/workflow/graph/workflow.py +0 -0
  46. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/workflow/nodes/__init__.py +0 -0
  47. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/workflow/nodes/audio_generation.py +0 -0
  48. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/workflow/nodes/control_flows.py +0 -0
  49. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/workflow/nodes/file_processing.py +0 -0
  50. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/workflow/nodes/image_generation.py +0 -0
  51. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/workflow/nodes/llms.py +0 -0
  52. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/workflow/nodes/media_editing.py +0 -0
  53. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/workflow/nodes/media_processing.py +0 -0
  54. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/workflow/nodes/output.py +0 -0
  55. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/workflow/nodes/relational_db.py +0 -0
  56. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/workflow/nodes/tools.py +0 -0
  57. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/workflow/nodes/triggers.py +0 -0
  58. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/workflow/nodes/vector_db.py +0 -0
  59. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/workflow/nodes/video_generation.py +0 -0
  60. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/workflow/nodes/web_crawlers.py +0 -0
  61. {vectorvein-0.2.4 → vectorvein-0.2.6}/src/vectorvein/workflow/utils/json_to_code.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vectorvein
3
- Version: 0.2.4
3
+ Version: 0.2.6
4
4
  Summary: VectorVein python SDK
5
5
  Author-Email: Anderson <andersonby@163.com>
6
6
  License: MIT
@@ -18,7 +18,7 @@ description = "VectorVein python SDK"
18
18
  name = "vectorvein"
19
19
  readme = "README.md"
20
20
  requires-python = ">=3.10"
21
- version = "0.2.4"
21
+ version = "0.2.6"
22
22
 
23
23
  [project.license]
24
24
  text = "MIT"
@@ -1,4 +1,4 @@
1
- """向量脉络 API 客户端"""
1
+ """VectorVein API Client"""
2
2
 
3
3
  import time
4
4
  import base64
@@ -28,23 +28,23 @@ from .models import (
28
28
 
29
29
 
30
30
  class VectorVeinClient:
31
- """向量脉络 API 客户端类"""
31
+ """VectorVein API Sync Client"""
32
32
 
33
33
  API_VERSION = "20240508"
34
34
  BASE_URL = "https://vectorvein.com/api/v1/open-api"
35
35
 
36
36
  def __init__(self, api_key: str, base_url: Optional[str] = None):
37
- """初始化客户端
37
+ """Initialize the client
38
38
 
39
39
  Args:
40
- api_key: API密钥
41
- base_url: API基础URL,默认为https://vectorvein.com/api/v1/open-api
40
+ api_key: API key
41
+ base_url: API base URL, default is https://vectorvein.com/api/v1/open-api
42
42
 
43
43
  Raises:
44
- APIKeyError: API密钥为空或格式不正确
44
+ APIKeyError: API key is empty or not a string
45
45
  """
46
46
  if not api_key or not isinstance(api_key, str):
47
- raise APIKeyError("API密钥不能为空且必须是字符串类型")
47
+ raise APIKeyError("API key cannot be empty and must be a string type")
48
48
 
49
49
  self.api_key = api_key
50
50
  self.base_url = base_url or self.BASE_URL
@@ -69,22 +69,22 @@ class VectorVeinClient:
69
69
  api_key_type: Literal["WORKFLOW", "VAPP"] = "WORKFLOW",
70
70
  **kwargs,
71
71
  ) -> Dict[str, Any]:
72
- """发送HTTP请求
72
+ """Send HTTP request
73
73
 
74
74
  Args:
75
- method: HTTP方法
76
- endpoint: API端点
77
- params: URL参数
78
- json: JSON请求体
79
- **kwargs: 其他请求参数
75
+ method: HTTP method
76
+ endpoint: API endpoint
77
+ params: URL parameters
78
+ json: JSON request body
79
+ **kwargs: Other request parameters
80
80
 
81
81
  Returns:
82
- Dict[str, Any]: API响应
82
+ Dict[str, Any]: API response
83
83
 
84
84
  Raises:
85
- RequestError: 请求错误
86
- VectorVeinAPIError: API错误
87
- APIKeyError: API密钥无效或已过期
85
+ RequestError: Request error
86
+ VectorVeinAPIError: API error
87
+ APIKeyError: API key is invalid or expired
88
88
  """
89
89
  url = f"{self.base_url}/{endpoint}"
90
90
  headers = self.default_headers.copy()
@@ -102,7 +102,7 @@ class VectorVeinClient:
102
102
  result = response.json()
103
103
 
104
104
  if result["status"] in [401, 403]:
105
- raise APIKeyError("API密钥无效或已过期")
105
+ raise APIKeyError("API key is invalid or expired")
106
106
  if result["status"] != 200 and result["status"] != 202:
107
107
  raise VectorVeinAPIError(message=result.get("msg", "Unknown error"), status_code=result["status"])
108
108
  return result
@@ -140,22 +140,22 @@ class VectorVeinClient:
140
140
  api_key_type: Literal["WORKFLOW", "VAPP"] = "WORKFLOW",
141
141
  timeout: int = 30,
142
142
  ) -> Union[str, WorkflowRunResult]:
143
- """运行工作流
143
+ """Run workflow
144
144
 
145
145
  Args:
146
- wid: 工作流ID
147
- input_fields: 输入字段列表
148
- output_scope: 输出范围,可选值:'all' 'output_fields_only'
149
- wait_for_completion: 是否等待完成
150
- api_key_type: 密钥类型,可选值:'WORKFLOW' 'VAPP'
151
- timeout: 超时时间(秒)
146
+ wid: Workflow ID
147
+ input_fields: Input fields list
148
+ output_scope: Output scope, optional values: 'all' or 'output_fields_only'
149
+ wait_for_completion: Whether to wait for completion
150
+ api_key_type: Key type, optional values: 'WORKFLOW' or 'VAPP'
151
+ timeout: Timeout (seconds)
152
152
 
153
153
  Returns:
154
- Union[str, WorkflowRunResult]: 工作流运行ID或运行结果
154
+ Union[str, WorkflowRunResult]: Workflow run ID or run result
155
155
 
156
156
  Raises:
157
- WorkflowError: 工作流运行错误
158
- TimeoutError: 超时错误
157
+ WorkflowError: Workflow run error
158
+ TimeoutError: Timeout error
159
159
  """
160
160
  payload = {
161
161
  "wid": wid,
@@ -203,22 +203,22 @@ class VectorVeinClient:
203
203
  def check_workflow_status(
204
204
  self, rid: str, wid: Optional[str] = None, api_key_type: Literal["WORKFLOW", "VAPP"] = "WORKFLOW"
205
205
  ) -> WorkflowRunResult:
206
- """检查工作流运行状态
206
+ """Check workflow run status
207
207
 
208
208
  Args:
209
- rid: 工作流运行记录ID
210
- wid: 工作流ID,非必填,api_key_type 'VAPP' 时必填
211
- api_key_type: 密钥类型,可选值:'WORKFLOW' 'VAPP'
209
+ rid: Workflow run record ID
210
+ wid: Workflow ID, not required, required when api_key_type is 'VAPP'
211
+ api_key_type: Key type, optional values: 'WORKFLOW' or 'VAPP'
212
212
 
213
213
  Returns:
214
- WorkflowRunResult: 工作流运行结果
214
+ WorkflowRunResult: Workflow run result
215
215
 
216
216
  Raises:
217
- VectorVeinAPIError: 工作流错误
217
+ VectorVeinAPIError: Workflow error
218
218
  """
219
219
  payload = {"rid": rid}
220
220
  if api_key_type == "VAPP" and not wid:
221
- raise VectorVeinAPIError("api_key_type 'VAPP' 时工作流 ID 不能为空")
221
+ raise VectorVeinAPIError("Workflow ID cannot be empty when api_key_type is 'VAPP'")
222
222
  if wid:
223
223
  payload["wid"] = wid
224
224
  response = self._request("POST", "workflow/check-status", json=payload, api_key_type=api_key_type)
@@ -235,17 +235,17 @@ class VectorVeinClient:
235
235
  def get_access_keys(
236
236
  self, access_keys: Optional[List[str]] = None, get_type: Literal["selected", "all"] = "selected"
237
237
  ) -> List[AccessKey]:
238
- """获取访问密钥信息
238
+ """Get access key information
239
239
 
240
240
  Args:
241
- access_keys: 访问密钥列表
242
- get_type: 获取类型,可选值:'selected' 'all'
241
+ access_keys: Access key list
242
+ get_type: Get type, optional values: 'selected' or 'all'
243
243
 
244
244
  Returns:
245
- List[AccessKey]: 访问密钥信息列表
245
+ List[AccessKey]: Access key information list
246
246
 
247
247
  Raises:
248
- AccessKeyError: 访问密钥不存在或已失效
248
+ AccessKeyError: Access key does not exist or has expired
249
249
  """
250
250
  params = {"get_type": get_type}
251
251
  if access_keys:
@@ -256,9 +256,9 @@ class VectorVeinClient:
256
256
  return [AccessKey(**key) for key in result["data"]]
257
257
  except VectorVeinAPIError as e:
258
258
  if e.status_code == 404:
259
- raise AccessKeyError("访问密钥不存在")
259
+ raise AccessKeyError("Access key does not exist")
260
260
  elif e.status_code == 403:
261
- raise AccessKeyError("访问密钥已失效")
261
+ raise AccessKeyError("Access key has expired")
262
262
  raise
263
263
 
264
264
  def create_access_keys(
@@ -272,29 +272,29 @@ class VectorVeinClient:
272
272
  max_use_count: Optional[int] = None,
273
273
  description: Optional[str] = None,
274
274
  ) -> List[AccessKey]:
275
- """创建访问密钥
275
+ """Create access key
276
276
 
277
277
  Args:
278
- access_key_type: 密钥类型,可选值:'O'(一次性)、'M'(多次)、'L'(长期)
279
- app_id: 单个应用ID
280
- app_ids: 多个应用ID列表
281
- count: 创建数量
282
- expire_time: 过期时间
283
- max_credits: 最大积分限制
284
- max_use_count: 最大使用次数
285
- description: 描述信息
278
+ access_key_type: Key type, optional values: 'O'(one-time)、'M'(multiple)、'L'(long-term)
279
+ app_id: Single application ID
280
+ app_ids: Multiple application ID list
281
+ count: Create quantity
282
+ expire_time: Expiration time
283
+ max_credits: Maximum credit limit
284
+ max_use_count: Maximum use count
285
+ description: Description information
286
286
 
287
287
  Returns:
288
- List[AccessKey]: 创建的访问密钥列表
288
+ List[AccessKey]: Created access key list
289
289
 
290
290
  Raises:
291
- AccessKeyError: 创建访问密钥失败,如类型无效、应用不存在等
291
+ AccessKeyError: Failed to create access key, such as invalid type, application does not exist, etc.
292
292
  """
293
293
  if access_key_type not in ["O", "M", "L"]:
294
- raise AccessKeyError("无效的访问密钥类型,必须是 'O'(一次性)、'M'(多次) 'L'(长期)")
294
+ raise AccessKeyError("Invalid access key type, must be 'O'(one-time)、'M'(multiple) or 'L'(long-term)")
295
295
 
296
296
  if app_id and app_ids:
297
- raise AccessKeyError("不能同时指定 app_id app_ids")
297
+ raise AccessKeyError("Cannot specify both app_id and app_ids")
298
298
 
299
299
  payload = {"access_key_type": access_key_type, "count": count}
300
300
 
@@ -316,9 +316,9 @@ class VectorVeinClient:
316
316
  return [AccessKey(**key) for key in result["data"]]
317
317
  except VectorVeinAPIError as e:
318
318
  if e.status_code == 404:
319
- raise AccessKeyError("指定的应用不存在")
319
+ raise AccessKeyError("The specified application does not exist")
320
320
  elif e.status_code == 403:
321
- raise AccessKeyError("没有权限创建访问密钥")
321
+ raise AccessKeyError("No permission to create access key")
322
322
  raise
323
323
 
324
324
  def list_access_keys(
@@ -331,19 +331,19 @@ class VectorVeinClient:
331
331
  status: Optional[List[str]] = None,
332
332
  access_key_type: Optional[Literal["O", "M", "L"]] = None,
333
333
  ) -> AccessKeyListResponse:
334
- """列出访问密钥
334
+ """List access keys
335
335
 
336
336
  Args:
337
- page: 页码
338
- page_size: 每页数量
339
- sort_field: 排序字段
340
- sort_order: 排序顺序
341
- app_id: 应用ID
342
- status: 状态列表
343
- access_key_type: 密钥类型列表,可选值:'O'(一次性)、'M'(多次)、'L'(长期)
337
+ page: Page number
338
+ page_size: Number of items per page
339
+ sort_field: Sort field
340
+ sort_order: Sort order
341
+ app_id: Application ID
342
+ status: Status list
343
+ access_key_type: Key type list, optional values: 'O'(one-time)、'M'(multiple)、'L'(long-term)
344
344
 
345
345
  Returns:
346
- AccessKeyListResponse: 访问密钥列表响应
346
+ AccessKeyListResponse: Access key list response
347
347
  """
348
348
  payload = {"page": page, "page_size": page_size, "sort_field": sort_field, "sort_order": sort_order}
349
349
 
@@ -358,11 +358,11 @@ class VectorVeinClient:
358
358
  return AccessKeyListResponse(**result["data"])
359
359
 
360
360
  def delete_access_keys(self, app_id: str, access_keys: List[str]) -> None:
361
- """删除访问密钥
361
+ """Delete access key
362
362
 
363
363
  Args:
364
- app_id: 应用ID
365
- access_keys: 要删除的访问密钥列表
364
+ app_id: Application ID
365
+ access_keys: List of access keys to delete
366
366
  """
367
367
  payload = {"app_id": app_id, "access_keys": access_keys}
368
368
  self._request("POST", "vapp/access-key/delete", json=payload)
@@ -379,18 +379,18 @@ class VectorVeinClient:
379
379
  description: Optional[str] = None,
380
380
  access_key_type: Optional[Literal["O", "M", "L"]] = None,
381
381
  ) -> None:
382
- """更新访问密钥
382
+ """Update access key
383
383
 
384
384
  Args:
385
- access_key: 单个访问密钥
386
- access_keys: 多个访问密钥列表
387
- app_id: 单个应用ID
388
- app_ids: 多个应用ID列表
389
- expire_time: 过期时间
390
- max_use_count: 最大使用次数
391
- max_credits: 最大积分限制
392
- description: 描述信息
393
- access_key_type: 密钥类型,可选值:'O'(一次性)、'M'(多次)、'L'(长期)
385
+ access_key: Single access key
386
+ access_keys: Multiple access key list
387
+ app_id: Single application ID
388
+ app_ids: Multiple application ID list
389
+ expire_time: Expiration time
390
+ max_use_count: Maximum use count
391
+ max_credits: Maximum credit limit
392
+ description: Description information
393
+ access_key_type: Key type, optional values: 'O'(one-time)、'M'(multiple)、'L'(long-term)
394
394
  """
395
395
  payload = {}
396
396
  if access_key:
@@ -415,21 +415,21 @@ class VectorVeinClient:
415
415
  self._request("POST", "vapp/access-key/update", json=payload)
416
416
 
417
417
  def add_apps_to_access_keys(self, access_keys: List[str], app_ids: List[str]) -> None:
418
- """向访问密钥添加应用
418
+ """Add applications to access keys
419
419
 
420
420
  Args:
421
- access_keys: 访问密钥列表
422
- app_ids: 要添加的应用ID列表
421
+ access_keys: Access key list
422
+ app_ids: List of application IDs to add
423
423
  """
424
424
  payload = {"access_keys": access_keys, "app_ids": app_ids}
425
425
  self._request("POST", "vapp/access-key/add-apps", json=payload)
426
426
 
427
427
  def remove_apps_from_access_keys(self, access_keys: List[str], app_ids: List[str]) -> None:
428
- """从访问密钥移除应用
428
+ """Remove applications from access keys
429
429
 
430
430
  Args:
431
- access_keys: 访问密钥列表
432
- app_ids: 要移除的应用ID列表
431
+ access_keys: Access key list
432
+ app_ids: List of application IDs to remove
433
433
  """
434
434
  payload = {"access_keys": access_keys, "app_ids": app_ids}
435
435
  self._request("POST", "vapp/access-key/remove-apps", json=payload)
@@ -442,17 +442,17 @@ class VectorVeinClient:
442
442
  timeout: int = 15 * 60,
443
443
  base_url: str = "https://vectorvein.com",
444
444
  ) -> str:
445
- """生成VApp访问链接
445
+ """Generate VApp access link
446
446
 
447
447
  Args:
448
448
  app_id: VApp ID
449
- access_key: 访问密钥
450
- key_id: 密钥ID
451
- timeout: 超时时间(秒)
452
- base_url: 基础URL
449
+ access_key: Access key
450
+ key_id: Key ID
451
+ timeout: Timeout (seconds)
452
+ base_url: Base URL
453
453
 
454
454
  Returns:
455
- str: VApp访问链接
455
+ str: VApp access link
456
456
  """
457
457
  timestamp = int(time.time())
458
458
  message = f"{app_id}:{access_key}:{timestamp}:{timeout}"
@@ -469,23 +469,23 @@ class VectorVeinClient:
469
469
 
470
470
 
471
471
  class AsyncVectorVeinClient:
472
- """向量脉络 API 异步客户端类"""
472
+ """VectorVein API Async Client"""
473
473
 
474
474
  API_VERSION = "20240508"
475
475
  BASE_URL = "https://vectorvein.com/api/v1/open-api"
476
476
 
477
477
  def __init__(self, api_key: str, base_url: Optional[str] = None):
478
- """初始化异步客户端
478
+ """Initialize the async client
479
479
 
480
480
  Args:
481
- api_key: API密钥
482
- base_url: API基础URL,默认为https://vectorvein.com/api/v1/open-api
481
+ api_key: API key
482
+ base_url: API base URL, default is https://vectorvein.com/api/v1/open-api
483
483
 
484
484
  Raises:
485
- APIKeyError: API密钥为空或格式不正确
485
+ APIKeyError: API key is empty or not a string
486
486
  """
487
487
  if not api_key or not isinstance(api_key, str):
488
- raise APIKeyError("API密钥不能为空且必须是字符串类型")
488
+ raise APIKeyError("API key cannot be empty and must be a string type")
489
489
 
490
490
  self.api_key = api_key
491
491
  self.base_url = base_url or self.BASE_URL
@@ -510,22 +510,22 @@ class AsyncVectorVeinClient:
510
510
  api_key_type: Literal["WORKFLOW", "VAPP"] = "WORKFLOW",
511
511
  **kwargs,
512
512
  ) -> Dict[str, Any]:
513
- """发送异步HTTP请求
513
+ """Send asynchronous HTTP request
514
514
 
515
515
  Args:
516
- method: HTTP方法
517
- endpoint: API端点
518
- params: URL参数
519
- json: JSON请求体
520
- **kwargs: 其他请求参数
516
+ method: HTTP method
517
+ endpoint: API endpoint
518
+ params: URL parameters
519
+ json: JSON request body
520
+ **kwargs: Other request parameters
521
521
 
522
522
  Returns:
523
- Dict[str, Any]: API响应
523
+ Dict[str, Any]: API response
524
524
 
525
525
  Raises:
526
- RequestError: 请求错误
527
- VectorVeinAPIError: API错误
528
- APIKeyError: API密钥无效或已过期
526
+ RequestError: Request error
527
+ VectorVeinAPIError: API error
528
+ APIKeyError: API key is invalid or expired
529
529
  """
530
530
  url = f"{self.base_url}/{endpoint}"
531
531
  headers = self.default_headers.copy()
@@ -543,7 +543,7 @@ class AsyncVectorVeinClient:
543
543
  result = response.json()
544
544
 
545
545
  if result["status"] in [401, 403]:
546
- raise APIKeyError("API密钥无效或已过期")
546
+ raise APIKeyError("API key is invalid or expired")
547
547
  if result["status"] != 200 and result["status"] != 202:
548
548
  raise VectorVeinAPIError(message=result.get("msg", "Unknown error"), status_code=result["status"])
549
549
  return result
@@ -581,22 +581,22 @@ class AsyncVectorVeinClient:
581
581
  api_key_type: Literal["WORKFLOW", "VAPP"] = "WORKFLOW",
582
582
  timeout: int = 30,
583
583
  ) -> Union[str, WorkflowRunResult]:
584
- """异步运行工作流
584
+ """Async run workflow
585
585
 
586
586
  Args:
587
- wid: 工作流ID
588
- input_fields: 输入字段列表
589
- output_scope: 输出范围,可选值:'all' 'output_fields_only'
590
- wait_for_completion: 是否等待完成
591
- api_key_type: 密钥类型,可选值:'WORKFLOW' 'VAPP'
592
- timeout: 超时时间(秒)
587
+ wid: Workflow ID
588
+ input_fields: Input field list
589
+ output_scope: Output scope, optional values: 'all' or 'output_fields_only'
590
+ wait_for_completion: Whether to wait for completion
591
+ api_key_type: Key type, optional values: 'WORKFLOW' or 'VAPP'
592
+ timeout: Timeout (seconds)
593
593
 
594
594
  Returns:
595
- Union[str, WorkflowRunResult]: 工作流运行ID或运行结果
595
+ Union[str, WorkflowRunResult]: Workflow run ID or run result
596
596
 
597
597
  Raises:
598
- WorkflowError: 工作流运行错误
599
- TimeoutError: 超时错误
598
+ WorkflowError: Workflow run error
599
+ TimeoutError: Timeout error
600
600
  """
601
601
  payload = {
602
602
  "wid": wid,
@@ -644,19 +644,19 @@ class AsyncVectorVeinClient:
644
644
  async def check_workflow_status(
645
645
  self, rid: str, wid: Optional[str] = None, api_key_type: Literal["WORKFLOW", "VAPP"] = "WORKFLOW"
646
646
  ) -> WorkflowRunResult:
647
- """异步检查工作流运行状态
647
+ """Async check workflow run status
648
648
 
649
649
  Args:
650
- rid: 工作流运行记录ID
651
- wid: 工作流ID,非必填,api_key_type 'VAPP' 时必填
652
- api_key_type: 密钥类型,可选值:'WORKFLOW' 'VAPP'
650
+ rid: Workflow run record ID
651
+ wid: Workflow ID, required when api_key_type is 'VAPP'
652
+ api_key_type: Key type, optional values: 'WORKFLOW' or 'VAPP'
653
653
 
654
654
  Raises:
655
- VectorVeinAPIError: 工作流错误
655
+ VectorVeinAPIError: Workflow error
656
656
  """
657
657
  payload = {"rid": rid}
658
658
  if api_key_type == "VAPP" and not wid:
659
- raise VectorVeinAPIError("api_key_type 'VAPP' 时工作流 ID 不能为空")
659
+ raise VectorVeinAPIError("Workflow ID cannot be empty when api_key_type is 'VAPP'")
660
660
  if wid:
661
661
  payload["wid"] = wid
662
662
  response = await self._request("POST", "workflow/check-status", json=payload, api_key_type=api_key_type)
@@ -673,17 +673,17 @@ class AsyncVectorVeinClient:
673
673
  async def get_access_keys(
674
674
  self, access_keys: Optional[List[str]] = None, get_type: Literal["selected", "all"] = "selected"
675
675
  ) -> List[AccessKey]:
676
- """异步获取访问密钥信息
676
+ """Async get access key information
677
677
 
678
678
  Args:
679
- access_keys: 访问密钥列表
680
- get_type: 获取类型,可选值:'selected' 'all'
679
+ access_keys: Access key list
680
+ get_type: Get type, optional values: 'selected' or 'all'
681
681
 
682
682
  Returns:
683
- List[AccessKey]: 访问密钥信息列表
683
+ List[AccessKey]: Access key information list
684
684
 
685
685
  Raises:
686
- AccessKeyError: 访问密钥不存在或已失效
686
+ AccessKeyError: Access key does not exist or has expired
687
687
  """
688
688
  params = {"get_type": get_type}
689
689
  if access_keys:
@@ -694,9 +694,9 @@ class AsyncVectorVeinClient:
694
694
  return [AccessKey(**key) for key in result["data"]]
695
695
  except VectorVeinAPIError as e:
696
696
  if e.status_code == 404:
697
- raise AccessKeyError("访问密钥不存在")
697
+ raise AccessKeyError("Access key does not exist")
698
698
  elif e.status_code == 403:
699
- raise AccessKeyError("访问密钥已失效")
699
+ raise AccessKeyError("Access key has expired")
700
700
  raise
701
701
 
702
702
  async def create_access_keys(
@@ -710,29 +710,29 @@ class AsyncVectorVeinClient:
710
710
  max_use_count: Optional[int] = None,
711
711
  description: Optional[str] = None,
712
712
  ) -> List[AccessKey]:
713
- """异步创建访问密钥
713
+ """Async create access key
714
714
 
715
715
  Args:
716
- access_key_type: 密钥类型,可选值:'O'(一次性)、'M'(多次)、'L'(长期)
717
- app_id: 单个应用ID
718
- app_ids: 多个应用ID列表
719
- count: 创建数量
720
- expire_time: 过期时间
721
- max_credits: 最大积分限制
722
- max_use_count: 最大使用次数
723
- description: 描述信息
716
+ access_key_type: Key type, optional values: 'O'(one-time)、'M'(multiple)、'L'(long-term)
717
+ app_id: Single application ID
718
+ app_ids: Multiple application ID list
719
+ count: Create quantity
720
+ expire_time: Expiration time
721
+ max_credits: Maximum credit limit
722
+ max_use_count: Maximum use count
723
+ description: Description
724
724
 
725
725
  Returns:
726
- List[AccessKey]: 创建的访问密钥列表
726
+ List[AccessKey]: Created access key list
727
727
 
728
728
  Raises:
729
- AccessKeyError: 创建访问密钥失败,如类型无效、应用不存在等
729
+ AccessKeyError: Failed to create access key, such as invalid type, application does not exist, etc.
730
730
  """
731
731
  if access_key_type not in ["O", "M", "L"]:
732
- raise AccessKeyError("无效的访问密钥类型,必须是 'O'(一次性)'M'(多次) 'L'(长期)")
732
+ raise AccessKeyError("Invalid access key type, must be 'O'(one-time) or 'M'(multiple) or 'L'(long-term)")
733
733
 
734
734
  if app_id and app_ids:
735
- raise AccessKeyError("不能同时指定 app_id app_ids")
735
+ raise AccessKeyError("Cannot specify both app_id and app_ids")
736
736
 
737
737
  payload = {"access_key_type": access_key_type, "count": count}
738
738
 
@@ -754,9 +754,9 @@ class AsyncVectorVeinClient:
754
754
  return [AccessKey(**key) for key in result["data"]]
755
755
  except VectorVeinAPIError as e:
756
756
  if e.status_code == 404:
757
- raise AccessKeyError("指定的应用不存在")
757
+ raise AccessKeyError("The specified application does not exist")
758
758
  elif e.status_code == 403:
759
- raise AccessKeyError("没有权限创建访问密钥")
759
+ raise AccessKeyError("No permission to create access key")
760
760
  raise
761
761
 
762
762
  async def list_access_keys(
@@ -769,19 +769,19 @@ class AsyncVectorVeinClient:
769
769
  status: Optional[List[str]] = None,
770
770
  access_key_type: Optional[Literal["O", "M", "L"]] = None,
771
771
  ) -> AccessKeyListResponse:
772
- """异步列出访问密钥
772
+ """Async list access keys
773
773
 
774
774
  Args:
775
- page: 页码
776
- page_size: 每页数量
777
- sort_field: 排序字段
778
- sort_order: 排序顺序
779
- app_id: 应用ID
780
- status: 状态列表
781
- access_key_type: 密钥类型列表,可选值:'O'(一次性)、'M'(多次)、'L'(长期)
775
+ page: Page number
776
+ page_size: Number of items per page
777
+ sort_field: Sort field
778
+ sort_order: Sort order
779
+ app_id: Application ID
780
+ status: Status list
781
+ access_key_type: Key type list, optional values: 'O'(one-time)、'M'(multiple)、'L'(long-term)
782
782
 
783
783
  Returns:
784
- AccessKeyListResponse: 访问密钥列表响应
784
+ AccessKeyListResponse: Access key list response
785
785
  """
786
786
  payload = {"page": page, "page_size": page_size, "sort_field": sort_field, "sort_order": sort_order}
787
787
 
@@ -796,11 +796,11 @@ class AsyncVectorVeinClient:
796
796
  return AccessKeyListResponse(**result["data"])
797
797
 
798
798
  async def delete_access_keys(self, app_id: str, access_keys: List[str]) -> None:
799
- """异步删除访问密钥
799
+ """Async delete access key
800
800
 
801
801
  Args:
802
- app_id: 应用ID
803
- access_keys: 要删除的访问密钥列表
802
+ app_id: Application ID
803
+ access_keys: List of access keys to delete
804
804
  """
805
805
  payload = {"app_id": app_id, "access_keys": access_keys}
806
806
  await self._request("POST", "vapp/access-key/delete", json=payload)
@@ -817,18 +817,18 @@ class AsyncVectorVeinClient:
817
817
  description: Optional[str] = None,
818
818
  access_key_type: Optional[Literal["O", "M", "L"]] = None,
819
819
  ) -> None:
820
- """异步更新访问密钥
820
+ """Async update access key
821
821
 
822
822
  Args:
823
- access_key: 单个访问密钥
824
- access_keys: 多个访问密钥列表
825
- app_id: 单个应用ID
826
- app_ids: 多个应用ID列表
827
- expire_time: 过期时间
828
- max_use_count: 最大使用次数
829
- max_credits: 最大积分限制
830
- description: 描述信息
831
- access_key_type: 密钥类型,可选值:'O'(一次性)、'M'(多次)、'L'(长期)
823
+ access_key: Single access key
824
+ access_keys: Multiple access key list
825
+ app_id: Single application ID
826
+ app_ids: Multiple application ID list
827
+ expire_time: Expiration time
828
+ max_use_count: Maximum use count
829
+ max_credits: Maximum credit limit
830
+ description: Description
831
+ access_key_type: Key type, optional values: 'O'(one-time)、'M'(multiple)、'L'(long-term)
832
832
  """
833
833
  payload = {}
834
834
  if access_key:
@@ -853,21 +853,21 @@ class AsyncVectorVeinClient:
853
853
  await self._request("POST", "vapp/access-key/update", json=payload)
854
854
 
855
855
  async def add_apps_to_access_keys(self, access_keys: List[str], app_ids: List[str]) -> None:
856
- """异步向访问密钥添加应用
856
+ """Async add applications to access keys
857
857
 
858
858
  Args:
859
- access_keys: 访问密钥列表
860
- app_ids: 要添加的应用ID列表
859
+ access_keys: Access key list
860
+ app_ids: List of application IDs to add
861
861
  """
862
862
  payload = {"access_keys": access_keys, "app_ids": app_ids}
863
863
  await self._request("POST", "vapp/access-key/add-apps", json=payload)
864
864
 
865
865
  async def remove_apps_from_access_keys(self, access_keys: List[str], app_ids: List[str]) -> None:
866
- """异步从访问密钥移除应用
866
+ """Async remove applications from access keys
867
867
 
868
868
  Args:
869
- access_keys: 访问密钥列表
870
- app_ids: 要移除的应用ID列表
869
+ access_keys: Access key list
870
+ app_ids: List of application IDs to remove
871
871
  """
872
872
  payload = {"access_keys": access_keys, "app_ids": app_ids}
873
873
  await self._request("POST", "vapp/access-key/remove-apps", json=payload)
@@ -880,17 +880,17 @@ class AsyncVectorVeinClient:
880
880
  timeout: int = 15 * 60,
881
881
  base_url: str = "https://vectorvein.com",
882
882
  ) -> str:
883
- """异步生成VApp访问链接
883
+ """Async generate VApp access link
884
884
 
885
885
  Args:
886
886
  app_id: VApp ID
887
- access_key: 访问密钥
888
- key_id: 密钥ID
889
- timeout: 超时时间(秒)
890
- base_url: 基础URL
887
+ access_key: Access key
888
+ key_id: Key ID
889
+ timeout: Timeout (seconds)
890
+ base_url: Base URL
891
891
 
892
892
  Returns:
893
- str: VApp访问链接
893
+ str: VApp access link
894
894
  """
895
895
  timestamp = int(time.time())
896
896
  message = f"{app_id}:{access_key}:{timestamp}:{timeout}"
@@ -1,10 +1,10 @@
1
- """向量脉络 API 异常类定义"""
1
+ """VectorVein API Exception Definitions"""
2
2
 
3
3
  from typing import Optional
4
4
 
5
5
 
6
6
  class VectorVeinAPIError(Exception):
7
- """向量脉络 API 基础异常类"""
7
+ """Base exception class for VectorVein API"""
8
8
 
9
9
  def __init__(self, message: str, status_code: Optional[int] = None):
10
10
  super().__init__(message)
@@ -12,30 +12,30 @@ class VectorVeinAPIError(Exception):
12
12
 
13
13
 
14
14
  class APIKeyError(VectorVeinAPIError):
15
- """API密钥相关错误"""
15
+ """API key related errors"""
16
16
 
17
17
  pass
18
18
 
19
19
 
20
20
  class WorkflowError(VectorVeinAPIError):
21
- """工作流相关错误"""
21
+ """Workflow related errors"""
22
22
 
23
23
  pass
24
24
 
25
25
 
26
26
  class AccessKeyError(VectorVeinAPIError):
27
- """访问密钥相关错误"""
27
+ """Access key related errors"""
28
28
 
29
29
  pass
30
30
 
31
31
 
32
32
  class RequestError(VectorVeinAPIError):
33
- """请求相关错误"""
33
+ """Request related errors"""
34
34
 
35
35
  pass
36
36
 
37
37
 
38
38
  class TimeoutError(VectorVeinAPIError):
39
- """超时错误"""
39
+ """Timeout errors"""
40
40
 
41
41
  pass
@@ -1,4 +1,4 @@
1
- """向量脉络 API 数据模型定义"""
1
+ """VectorVein API data model definitions"""
2
2
 
3
3
  from dataclasses import dataclass
4
4
  from typing import List, Dict, Optional, Any
@@ -6,7 +6,7 @@ from typing import List, Dict, Optional, Any
6
6
 
7
7
  @dataclass
8
8
  class VApp:
9
- """VApp 信息"""
9
+ """VApp information"""
10
10
 
11
11
  app_id: str
12
12
  title: str
@@ -17,10 +17,10 @@ class VApp:
17
17
 
18
18
  @dataclass
19
19
  class AccessKey:
20
- """访问密钥信息"""
20
+ """Access key information"""
21
21
 
22
22
  access_key: str
23
- access_key_type: str # O: 一次性, M: 多次, L: 长期
23
+ access_key_type: str # O: one-time, M: multiple, L: long-term
24
24
  use_count: int
25
25
  max_use_count: Optional[int]
26
26
  max_credits: Optional[int]
@@ -28,8 +28,8 @@ class AccessKey:
28
28
  v_app: Optional[VApp]
29
29
  v_apps: List[VApp]
30
30
  records: List[Any]
31
- status: str # AC: 有效, IN: 无效, EX: 已过期, US: 已使用
32
- access_scope: str # S: 单应用, M: 多应用
31
+ status: str # AC: valid, IN: invalid, EX: expired, US: used
32
+ access_scope: str # S: single application, M: multiple applications
33
33
  description: str
34
34
  create_time: str
35
35
  expire_time: str
@@ -38,7 +38,7 @@ class AccessKey:
38
38
 
39
39
  @dataclass
40
40
  class WorkflowInputField:
41
- """工作流输入字段"""
41
+ """Workflow input field"""
42
42
 
43
43
  node_id: str
44
44
  field_name: str
@@ -47,7 +47,7 @@ class WorkflowInputField:
47
47
 
48
48
  @dataclass
49
49
  class WorkflowOutput:
50
- """工作流输出结果"""
50
+ """Workflow output result"""
51
51
 
52
52
  type: str
53
53
  title: str
@@ -56,7 +56,7 @@ class WorkflowOutput:
56
56
 
57
57
  @dataclass
58
58
  class WorkflowRunResult:
59
- """工作流运行结果"""
59
+ """Workflow run result"""
60
60
 
61
61
  rid: str
62
62
  status: int
@@ -66,7 +66,7 @@ class WorkflowRunResult:
66
66
 
67
67
  @dataclass
68
68
  class AccessKeyListResponse:
69
- """访问密钥列表响应"""
69
+ """Access key list response"""
70
70
 
71
71
  access_keys: List[AccessKey]
72
72
  total: int
@@ -594,6 +594,14 @@ ANTHROPIC_MODELS: Final[Dict[str, Dict[str, Any]]] = {
594
594
  "response_format_available": False,
595
595
  "native_multimodal": True,
596
596
  },
597
+ "claude-3-7-sonnet-20250219": {
598
+ "id": "claude-3-7-sonnet-20250219",
599
+ "context_length": 128000,
600
+ "max_output_tokens": 8192,
601
+ "function_call_available": True,
602
+ "response_format_available": False,
603
+ "native_multimodal": True,
604
+ },
597
605
  }
598
606
 
599
607
  # Minimax models
@@ -216,3 +216,31 @@ class TemplateCompose(Node):
216
216
  "output": OutputPort(),
217
217
  },
218
218
  )
219
+
220
+
221
+ class RegexExtract(Node):
222
+ def __init__(self, id: Optional[str] = None):
223
+ super().__init__(
224
+ node_type="RegexExtract",
225
+ category="text_processing",
226
+ task_name="text_processing.regex_extract",
227
+ node_id=id,
228
+ ports={
229
+ "text": InputPort(
230
+ name="text",
231
+ port_type=PortType.TEXTAREA,
232
+ value="",
233
+ ),
234
+ "pattern": InputPort(
235
+ name="pattern",
236
+ port_type=PortType.INPUT,
237
+ value="```.*?\\n(.*?)\\n```",
238
+ ),
239
+ "first_match": InputPort(
240
+ name="first_match",
241
+ port_type=PortType.CHECKBOX,
242
+ value=True,
243
+ ),
244
+ "output": OutputPort(),
245
+ },
246
+ )
File without changes