vectorvein 0.2.13__py3-none-any.whl → 0.2.14__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.
@@ -59,7 +59,7 @@ class Backends(BaseModel):
59
59
 
60
60
  class Settings(BaseModel):
61
61
  VERSION: Optional[str] = Field(
62
- default=None, description="Configuration version. If provided, will use the corresponding format."
62
+ default="2", description="Configuration version. If provided, will use the corresponding format."
63
63
  )
64
64
  endpoints: List[EndpointSetting] = Field(
65
65
  default_factory=list, description="Available endpoints for the LLM service."
@@ -116,6 +116,10 @@ class Settings(BaseModel):
116
116
 
117
117
  version = data.get("VERSION")
118
118
 
119
+ if len(data) == 0:
120
+ version = "2"
121
+ data["backends"] = {}
122
+
119
123
  # If V2 format, model configs are in the backends dictionary
120
124
  if version == "2":
121
125
  if "backends" not in data:
@@ -124,8 +128,7 @@ class Settings(BaseModel):
124
128
  backends = data["backends"]
125
129
  else:
126
130
  backends = data
127
- if len(data) > 0:
128
- warnings.warn("You're using vectorvein's deprecated V1 format. Please use V2 format.")
131
+ warnings.warn("You're using vectorvein's deprecated V1 format. Please use V2 format.")
129
132
 
130
133
  for model_type, default_models in model_types.items():
131
134
  if model_type in backends:
@@ -165,5 +168,29 @@ class Settings(BaseModel):
165
168
  # Compatible with VERSION 1 format
166
169
  return getattr(self, backend_name)
167
170
 
171
+ def export(self):
172
+ if self.VERSION == "2":
173
+ return super().model_dump(
174
+ exclude={
175
+ "anthropic",
176
+ "deepseek",
177
+ "gemini",
178
+ "groq",
179
+ "local",
180
+ "minimax",
181
+ "mistral",
182
+ "moonshot",
183
+ "openai",
184
+ "qwen",
185
+ "yi",
186
+ "zhipuai",
187
+ "baichuan",
188
+ "stepfun",
189
+ "xai",
190
+ }
191
+ )
192
+ else:
193
+ return super().model_dump(exclude={"backends"})
194
+
168
195
 
169
196
  settings = Settings()
@@ -61,6 +61,8 @@ from .settings import (
61
61
  BackendSettingsDict,
62
62
  EndpointSettingDict,
63
63
  SettingsDict,
64
+ SettingsV1Dict,
65
+ SettingsV2Dict,
64
66
  )
65
67
 
66
68
 
@@ -126,4 +128,6 @@ __all__ = [
126
128
  "BackendSettingsDict",
127
129
  "EndpointSettingDict",
128
130
  "SettingsDict",
131
+ "SettingsV1Dict",
132
+ "SettingsV2Dict",
129
133
  ]
@@ -101,17 +101,13 @@ class BackendsDict(TypedDict):
101
101
  xai: NotRequired[BackendSettingsDict]
102
102
 
103
103
 
104
- class SettingsDict(TypedDict):
104
+ class SettingsV1Dict(TypedDict):
105
105
  """TypedDict representing the expected structure of the settings dictionary."""
106
106
 
107
- VERSION: NotRequired[str]
108
107
  endpoints: List[EndpointSettingDict]
109
108
  token_server: NotRequired[ServerDict]
110
109
  rate_limit: NotRequired[RateLimitConfigDict]
111
110
 
112
- # V2 format: all model backend configs in a single dictionary
113
- backends: NotRequired[BackendsDict]
114
-
115
111
  # V1 format: each model backend config
116
112
  anthropic: NotRequired[BackendSettingsDict]
117
113
  deepseek: NotRequired[BackendSettingsDict]
@@ -128,3 +124,18 @@ class SettingsDict(TypedDict):
128
124
  baichuan: NotRequired[BackendSettingsDict]
129
125
  stepfun: NotRequired[BackendSettingsDict]
130
126
  xai: NotRequired[BackendSettingsDict]
127
+
128
+
129
+ class SettingsV2Dict(TypedDict):
130
+ """TypedDict representing the expected structure of the settings dictionary."""
131
+
132
+ VERSION: NotRequired[str]
133
+ endpoints: List[EndpointSettingDict]
134
+ token_server: NotRequired[ServerDict]
135
+ rate_limit: NotRequired[RateLimitConfigDict]
136
+
137
+ # V2 format: all model backend configs in a single dictionary
138
+ backends: NotRequired[BackendsDict]
139
+
140
+
141
+ SettingsDict = Union[SettingsV1Dict, SettingsV2Dict]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vectorvein
3
- Version: 0.2.13
3
+ Version: 0.2.14
4
4
  Summary: VectorVein python SDK
5
5
  Author-Email: Anderson <andersonby@163.com>
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
- vectorvein-0.2.13.dist-info/METADATA,sha256=sEZT2h2XwDUIkIvdKzXomeSuniLUSr-HWlj88MmHRew,4414
2
- vectorvein-0.2.13.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
- vectorvein-0.2.13.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
1
+ vectorvein-0.2.14.dist-info/METADATA,sha256=wwlfZ9Lw99_k9njtZDoMABWOsoG8OmbSLszqPHa0304,4414
2
+ vectorvein-0.2.14.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
+ vectorvein-0.2.14.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
@@ -28,15 +28,15 @@ vectorvein/chat_clients/yi_client.py,sha256=RNf4CRuPJfixrwLZ3-DEc3t25QDe1mvZeb9s
28
28
  vectorvein/chat_clients/zhipuai_client.py,sha256=Ys5DSeLCuedaDXr3PfG1EW2zKXopt-awO2IylWSwY0s,519
29
29
  vectorvein/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
30
  vectorvein/server/token_server.py,sha256=36F9PKSNOX8ZtYBXY_l-76GQTpUSmQ2Y8EMy1H7wtdQ,1353
31
- vectorvein/settings/__init__.py,sha256=oBOLwG61RN9dq012Bgq3OfZyxyrJ5j0BYNmHbThhpjo,8097
31
+ vectorvein/settings/__init__.py,sha256=Ctunz8dVj_cHhBEjOfnmDjP3V4lZ662NMUTqffuY_1g,8854
32
32
  vectorvein/settings/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
- vectorvein/types/__init__.py,sha256=ie7H3rTMq_Fg836vOmy96m3wzjDkqfekQecPXXEDbcM,3005
33
+ vectorvein/types/__init__.py,sha256=J0VG3Vc45-ojjMgf95kDlCichZr01KiQcRn6gRmgXrQ,3093
34
34
  vectorvein/types/defaults.py,sha256=VrkQoyHqC_eK3g1b6egpPYLLo0ltwMHqxDscCX4y-N0,27417
35
35
  vectorvein/types/enums.py,sha256=7KTJSVtQueImmbr1fSwv3rQVtc0RyMWXJmoE2tDOaso,1667
36
36
  vectorvein/types/exception.py,sha256=gnW4GnJ76jND6UGnodk9xmqkcbeS7Cz2rvncA2HpD5E,69
37
37
  vectorvein/types/llm_parameters.py,sha256=4SxDbJKVb9oGYymyxQtNZ66YZmUQd9_CpYYg81_Inkk,7650
38
38
  vectorvein/types/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
- vectorvein/types/settings.py,sha256=096mcaqtuZYCeJQYzF4ILqrLp_z5-upJAxwLrRZ5WQk,4165
39
+ vectorvein/types/settings.py,sha256=B8eVJsJRrv-op8Enn-Rbour2b9vD01TLXz3xlXEF9vo,4485
40
40
  vectorvein/utilities/media_processing.py,sha256=7KtbLFzOYIn1e9QTN9G6C76NH8CBlV9kfAgiRKEIeXY,6263
41
41
  vectorvein/utilities/rate_limiter.py,sha256=dwolIUVw2wP83Odqpx0AAaE77de1GzxkYDGH4tM_u_4,10300
42
42
  vectorvein/utilities/retry.py,sha256=6KFS9R2HdhqM3_9jkjD4F36ZSpEx2YNFGOVlpOsUetM,2208
@@ -61,4 +61,4 @@ vectorvein/workflow/nodes/vector_db.py,sha256=t6I17q6iR3yQreiDHpRrksMdWDPIvgqJs0
61
61
  vectorvein/workflow/nodes/video_generation.py,sha256=qmdg-t_idpxq1veukd-jv_ChICMOoInKxprV9Z4Vi2w,4118
62
62
  vectorvein/workflow/nodes/web_crawlers.py,sha256=LsqomfXfqrXfHJDO1cl0Ox48f4St7X_SL12DSbAMSOw,5415
63
63
  vectorvein/workflow/utils/json_to_code.py,sha256=F7dhDy8kGc8ndOeihGLRLGFGlquoxVlb02ENtxnQ0C8,5914
64
- vectorvein-0.2.13.dist-info/RECORD,,
64
+ vectorvein-0.2.14.dist-info/RECORD,,