vectorvein 0.2.21__tar.gz → 0.2.23__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 (64) hide show
  1. {vectorvein-0.2.21 → vectorvein-0.2.23}/PKG-INFO +1 -1
  2. {vectorvein-0.2.21 → vectorvein-0.2.23}/pyproject.toml +1 -1
  3. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/chat_clients/anthropic_client.py +4 -4
  4. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/chat_clients/openai_compatible_client.py +2 -2
  5. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/chat_clients/utils.py +7 -2
  6. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/settings/__init__.py +7 -1
  7. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/types/llm_parameters.py +15 -2
  8. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/types/settings.py +17 -1
  9. {vectorvein-0.2.21 → vectorvein-0.2.23}/README.md +0 -0
  10. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/__init__.py +0 -0
  11. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/api/__init__.py +0 -0
  12. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/api/client.py +0 -0
  13. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/api/exceptions.py +0 -0
  14. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/api/models.py +0 -0
  15. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/chat_clients/__init__.py +0 -0
  16. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/chat_clients/baichuan_client.py +0 -0
  17. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/chat_clients/base_client.py +0 -0
  18. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/chat_clients/deepseek_client.py +0 -0
  19. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/chat_clients/ernie_client.py +0 -0
  20. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/chat_clients/gemini_client.py +0 -0
  21. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/chat_clients/groq_client.py +0 -0
  22. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/chat_clients/local_client.py +0 -0
  23. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/chat_clients/minimax_client.py +0 -0
  24. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/chat_clients/mistral_client.py +0 -0
  25. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/chat_clients/moonshot_client.py +0 -0
  26. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/chat_clients/openai_client.py +0 -0
  27. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/chat_clients/py.typed +0 -0
  28. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/chat_clients/qwen_client.py +0 -0
  29. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/chat_clients/stepfun_client.py +0 -0
  30. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/chat_clients/xai_client.py +0 -0
  31. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/chat_clients/yi_client.py +0 -0
  32. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/chat_clients/zhipuai_client.py +0 -0
  33. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/py.typed +0 -0
  34. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/server/token_server.py +0 -0
  35. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/settings/py.typed +0 -0
  36. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/types/__init__.py +0 -0
  37. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/types/defaults.py +0 -0
  38. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/types/enums.py +0 -0
  39. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/types/exception.py +0 -0
  40. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/types/py.typed +0 -0
  41. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/utilities/media_processing.py +0 -0
  42. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/utilities/rate_limiter.py +0 -0
  43. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/utilities/retry.py +0 -0
  44. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/workflow/graph/edge.py +0 -0
  45. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/workflow/graph/node.py +0 -0
  46. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/workflow/graph/port.py +0 -0
  47. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/workflow/graph/workflow.py +0 -0
  48. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/workflow/nodes/__init__.py +0 -0
  49. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/workflow/nodes/audio_generation.py +0 -0
  50. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/workflow/nodes/control_flows.py +0 -0
  51. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/workflow/nodes/file_processing.py +0 -0
  52. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/workflow/nodes/image_generation.py +0 -0
  53. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/workflow/nodes/llms.py +0 -0
  54. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/workflow/nodes/media_editing.py +0 -0
  55. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/workflow/nodes/media_processing.py +0 -0
  56. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/workflow/nodes/output.py +0 -0
  57. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/workflow/nodes/relational_db.py +0 -0
  58. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/workflow/nodes/text_processing.py +0 -0
  59. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/workflow/nodes/tools.py +0 -0
  60. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/workflow/nodes/triggers.py +0 -0
  61. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/workflow/nodes/vector_db.py +0 -0
  62. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/workflow/nodes/video_generation.py +0 -0
  63. {vectorvein-0.2.21 → vectorvein-0.2.23}/src/vectorvein/workflow/nodes/web_crawlers.py +0 -0
  64. {vectorvein-0.2.21 → vectorvein-0.2.23}/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.21
3
+ Version: 0.2.23
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.21"
21
+ version = "0.2.23"
22
22
 
23
23
  [project.license]
24
24
  text = "MIT"
@@ -214,7 +214,7 @@ class AnthropicChatClient(BaseChatClient):
214
214
  if self.endpoint.proxy is not None and self.http_client is None:
215
215
  self.http_client = httpx.Client(proxy=self.endpoint.proxy)
216
216
 
217
- if self.endpoint.is_vertex:
217
+ if self.endpoint.is_vertex or self.endpoint.endpoint_type == "anthropic_vertex":
218
218
  if self.endpoint.credentials is None:
219
219
  raise ValueError("Anthropic Vertex endpoint requires credentials")
220
220
  self.creds = Credentials(
@@ -248,7 +248,7 @@ class AnthropicChatClient(BaseChatClient):
248
248
  access_token=self.creds.token,
249
249
  http_client=self.http_client,
250
250
  )
251
- elif self.endpoint.is_bedrock:
251
+ elif self.endpoint.is_bedrock or self.endpoint.endpoint_type == "anthropic_bedrock":
252
252
  if self.endpoint.credentials is None:
253
253
  raise ValueError("Anthropic Bedrock endpoint requires credentials")
254
254
  return AnthropicBedrock(
@@ -747,7 +747,7 @@ class AsyncAnthropicChatClient(BaseAsyncChatClient):
747
747
  if self.endpoint.proxy is not None and self.http_client is None:
748
748
  self.http_client = httpx.AsyncClient(proxy=self.endpoint.proxy)
749
749
 
750
- if self.endpoint.is_vertex:
750
+ if self.endpoint.is_vertex or self.endpoint.endpoint_type == "anthropic_vertex":
751
751
  if self.endpoint.credentials is None:
752
752
  raise ValueError("Anthropic Vertex endpoint requires credentials")
753
753
  self.creds = Credentials(
@@ -781,7 +781,7 @@ class AsyncAnthropicChatClient(BaseAsyncChatClient):
781
781
  access_token=self.creds.token,
782
782
  http_client=self.http_client,
783
783
  )
784
- elif self.endpoint.is_bedrock:
784
+ elif self.endpoint.is_bedrock or self.endpoint.endpoint_type == "anthropic_bedrock":
785
785
  if self.endpoint.credentials is None:
786
786
  raise ValueError("Anthropic Bedrock endpoint requires credentials")
787
787
  return AsyncAnthropicBedrock(
@@ -93,7 +93,7 @@ class OpenAICompatibleChatClient(BaseChatClient):
93
93
  if self.endpoint.proxy is not None and self.http_client is None:
94
94
  self.http_client = httpx.Client(proxy=self.endpoint.proxy)
95
95
 
96
- if self.endpoint.is_azure:
96
+ if self.endpoint.is_azure or self.endpoint.endpoint_type == "openai_azure":
97
97
  if self.endpoint.api_base is None:
98
98
  raise ValueError("Azure endpoint is not set")
99
99
  return AzureOpenAI(
@@ -568,7 +568,7 @@ class AsyncOpenAICompatibleChatClient(BaseAsyncChatClient):
568
568
  if self.endpoint.proxy is not None and self.http_client is None:
569
569
  self.http_client = httpx.AsyncClient(proxy=self.endpoint.proxy)
570
570
 
571
- if self.endpoint.is_azure:
571
+ if self.endpoint.is_azure or self.endpoint.endpoint_type == "openai_azure":
572
572
  if self.endpoint.api_base is None:
573
573
  raise ValueError("Azure endpoint is not set")
574
574
  return AsyncAzureOpenAI(
@@ -230,7 +230,12 @@ def get_token_counts(text: str | dict, model: str = "", use_token_server_first:
230
230
  endpoint_id = endpoint_choice
231
231
  endpoint = settings.get_endpoint(endpoint_id)
232
232
 
233
- if endpoint.is_vertex or endpoint.is_bedrock:
233
+ if (
234
+ endpoint.is_vertex
235
+ or endpoint.is_bedrock
236
+ or endpoint.endpoint_type == "anthropic_vertex"
237
+ or endpoint.endpoint_type == "anthropic_bedrock"
238
+ ):
234
239
  continue
235
240
  elif endpoint.api_schema_type == "default":
236
241
  return (
@@ -243,7 +248,7 @@ def get_token_counts(text: str | dict, model: str = "", use_token_server_first:
243
248
  )
244
249
 
245
250
  # TODO: Use anthropic token counting
246
- warnings.warn("Anthropic token counting is not implemented yet")
251
+ warnings.warn("Anthropic token counting is not implemented in Vertex or Bedrock yet")
247
252
  return len(get_gpt_4o_encoding().encode(text))
248
253
  elif model.startswith("deepseek"):
249
254
  from deepseek_tokenizer import deepseek_tokenizer
@@ -148,6 +148,12 @@ class Settings(BaseModel):
148
148
  backends[model_type] = BackendSettings(models=default_models)
149
149
 
150
150
  for endpoint in data.get("endpoints", []):
151
+ if endpoint.get("is_azure"):
152
+ endpoint["endpoint_type"] = "openai_azure"
153
+ if endpoint.get("is_vertex"):
154
+ endpoint["endpoint_type"] = "anthropic_vertex"
155
+ if endpoint.get("is_bedrock"):
156
+ endpoint["endpoint_type"] = "anthropic_bedrock"
151
157
  if not endpoint.get("api_base"):
152
158
  continue
153
159
  api_base = endpoint["api_base"]
@@ -159,7 +165,7 @@ class Settings(BaseModel):
159
165
 
160
166
  def load(self, settings: SettingsDict | "Settings"):
161
167
  if isinstance(settings, Settings):
162
- settings_dict = settings.model_dump()
168
+ settings_dict = settings.export()
163
169
  else:
164
170
  settings_dict = settings
165
171
  self.__init__(**settings_dict)
@@ -1,6 +1,6 @@
1
1
  # @Author: Bi Ying
2
2
  # @Date: 2024-07-26 23:48:04
3
- from typing import List, Dict, Optional, Union, Iterable
3
+ from typing import List, Dict, Optional, Union, Iterable, Literal
4
4
 
5
5
  import httpx
6
6
  from pydantic import BaseModel, Field
@@ -31,7 +31,20 @@ class EndpointSetting(BaseModel):
31
31
  region: Optional[str] = Field(None, description="The region for the endpoint.")
32
32
  api_base: Optional[str] = Field(None, description="The base URL for the API.")
33
33
  api_key: Optional[str] = Field(None, description="The API key for authentication.")
34
- api_schema_type: Optional[str] = Field(
34
+ endpoint_type: Optional[
35
+ Literal[
36
+ "default",
37
+ "openai",
38
+ "openai_azure",
39
+ "anthropic",
40
+ "anthropic_vertex",
41
+ "anthropic_bedrock",
42
+ ]
43
+ ] = Field(
44
+ "default",
45
+ description="The type of endpoint. Set to 'default' will determine the type automatically.",
46
+ )
47
+ api_schema_type: Optional[Literal["default", "openai", "anthropic"]] = Field(
35
48
  "default",
36
49
  description="The type of client for the endpoint. Set to 'default' will determine the type automatically.",
37
50
  )
@@ -70,7 +70,23 @@ class EndpointSettingDict(TypedDict):
70
70
  api_base: NotRequired[Optional[str]]
71
71
  api_key: NotRequired[str]
72
72
  region: NotRequired[str]
73
- api_schema_type: NotRequired[str]
73
+ endpoint_type: NotRequired[
74
+ Literal[
75
+ "default",
76
+ "openai",
77
+ "openai_azure",
78
+ "anthropic",
79
+ "anthropic_vertex",
80
+ "anthropic_bedrock",
81
+ ]
82
+ ]
83
+ api_schema_type: NotRequired[
84
+ Literal[
85
+ "default",
86
+ "openai",
87
+ "anthropic",
88
+ ]
89
+ ]
74
90
  credentials: NotRequired[dict]
75
91
  is_azure: NotRequired[bool]
76
92
  is_vertex: NotRequired[bool]
File without changes