vectorvein 0.2.14__py3-none-any.whl → 0.2.16__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.
@@ -1,6 +1,7 @@
1
1
  # @Author: Bi Ying
2
2
  # @Date: 2024-07-27 00:30:56
3
3
  import warnings
4
+ from copy import deepcopy
4
5
  from typing import List, Optional, Literal
5
6
 
6
7
  from pydantic import BaseModel, Field
@@ -114,6 +115,8 @@ class Settings(BaseModel):
114
115
  "xai": defs.XAI_MODELS,
115
116
  }
116
117
 
118
+ data = deepcopy(data)
119
+
117
120
  version = data.get("VERSION")
118
121
 
119
122
  if len(data) == 0:
@@ -132,8 +135,8 @@ class Settings(BaseModel):
132
135
 
133
136
  for model_type, default_models in model_types.items():
134
137
  if model_type in backends:
135
- model_settings = BackendSettings()
136
138
  user_models = backends[model_type].get("models", {})
139
+ model_settings = BackendSettings()
137
140
  model_settings.update_models(default_models, user_models)
138
141
  backends[model_type] = model_settings
139
142
  else:
@@ -149,9 +152,17 @@ class Settings(BaseModel):
149
152
 
150
153
  super().__init__(**data)
151
154
 
152
- def load(self, settings_dict: SettingsDict):
155
+ def load(self, settings: SettingsDict | "Settings"):
156
+ if isinstance(settings, Settings):
157
+ settings_dict = settings.model_dump()
158
+ else:
159
+ settings_dict = settings
153
160
  self.__init__(**settings_dict)
154
161
 
162
+ @classmethod
163
+ def load_from_dict(cls, settings_dict: SettingsDict):
164
+ return cls(**settings_dict)
165
+
155
166
  def get_endpoint(self, endpoint_id: str) -> EndpointSetting:
156
167
  for endpoint in self.endpoints:
157
168
  if endpoint.id == endpoint_id:
@@ -65,6 +65,9 @@ from .settings import (
65
65
  SettingsV2Dict,
66
66
  )
67
67
 
68
+ from anthropic.types import ThinkingConfigParam, ThinkingConfigEnabledParam
69
+ from openai.types.chat.completion_create_params import ResponseFormat
70
+
68
71
 
69
72
  __all__ = [
70
73
  "CONTEXT_LENGTH_CONTROL",
@@ -130,4 +133,7 @@ __all__ = [
130
133
  "SettingsDict",
131
134
  "SettingsV1Dict",
132
135
  "SettingsV2Dict",
136
+ "ThinkingConfigParam",
137
+ "ThinkingConfigEnabledParam",
138
+ "ResponseFormat",
133
139
  ]
@@ -176,62 +176,6 @@ GROQ_MODELS: Final[Dict[str, Dict[str, Any]]] = {
176
176
  # Qwen models
177
177
  QWEN_DEFAULT_MODEL: Final[str] = "qwen2.5-72b-instruct"
178
178
  QWEN_MODELS: Final[Dict[str, Dict[str, Any]]] = {
179
- "qwen1.5-1.8b-chat": {
180
- "id": "qwen1.5-1.8b-chat",
181
- "context_length": 30000,
182
- "max_output_tokens": 4096,
183
- "function_call_available": False,
184
- "response_format_available": True,
185
- },
186
- "qwen1.5-4b-chat": {
187
- "id": "qwen1.5-4b-chat",
188
- "context_length": 30000,
189
- "max_output_tokens": 4096,
190
- "function_call_available": False,
191
- "response_format_available": True,
192
- },
193
- "qwen1.5-7b-chat": {
194
- "id": "qwen1.5-7b-chat",
195
- "context_length": 30000,
196
- "max_output_tokens": 4096,
197
- "function_call_available": False,
198
- "response_format_available": True,
199
- },
200
- "qwen1.5-14b-chat": {
201
- "id": "qwen1.5-14b-chat",
202
- "context_length": 30000,
203
- "max_output_tokens": 4096,
204
- "function_call_available": False,
205
- "response_format_available": True,
206
- },
207
- "qwen1.5-32b-chat": {
208
- "id": "qwen1.5-32b-chat",
209
- "context_length": 30000,
210
- "max_output_tokens": 4096,
211
- "function_call_available": False,
212
- "response_format_available": True,
213
- },
214
- "qwen1.5-72b-chat": {
215
- "id": "qwen1.5-72b-chat",
216
- "context_length": 30000,
217
- "max_output_tokens": 4096,
218
- "function_call_available": False,
219
- "response_format_available": True,
220
- },
221
- "qwen1.5-110b-chat": {
222
- "id": "qwen1.5-110b-chat",
223
- "context_length": 30000,
224
- "max_output_tokens": 4096,
225
- "function_call_available": False,
226
- "response_format_available": True,
227
- },
228
- "qwen2-72b-instruct": {
229
- "id": "qwen2-72b-instruct",
230
- "context_length": 30000,
231
- "max_output_tokens": 4096,
232
- "function_call_available": False,
233
- "response_format_available": True,
234
- },
235
179
  "qwen2.5-7b-instruct": {
236
180
  "id": "qwen2.5-7b-instruct",
237
181
  "context_length": 131072,
@@ -282,6 +226,30 @@ QWEN_MODELS: Final[Dict[str, Dict[str, Any]]] = {
282
226
  "response_format_available": False,
283
227
  "native_multimodal": True,
284
228
  },
229
+ "qwen2.5-vl-72b-instruct": {
230
+ "id": "qwen2.5-vl-72b-instruct",
231
+ "context_length": 131072,
232
+ "max_output_tokens": 8192,
233
+ "function_call_available": False,
234
+ "response_format_available": False,
235
+ "native_multimodal": True,
236
+ },
237
+ "qwen2.5-vl-7b-instruct": {
238
+ "id": "qwen2.5-vl-7b-instruct",
239
+ "context_length": 131072,
240
+ "max_output_tokens": 8192,
241
+ "function_call_available": False,
242
+ "response_format_available": False,
243
+ "native_multimodal": True,
244
+ },
245
+ "qwen2.5-vl-3b-instruct": {
246
+ "id": "qwen2.5-vl-3b-instruct",
247
+ "context_length": 131072,
248
+ "max_output_tokens": 8192,
249
+ "function_call_available": False,
250
+ "response_format_available": False,
251
+ "native_multimodal": True,
252
+ },
285
253
  "qwen-max": {
286
254
  "id": "qwen-max",
287
255
  "context_length": 8096,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vectorvein
3
- Version: 0.2.14
3
+ Version: 0.2.16
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.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
1
+ vectorvein-0.2.16.dist-info/METADATA,sha256=yNfcGUDOatRR5w7DgvcGo9ekmy5LZjGfjkFZ6AqnYso,4414
2
+ vectorvein-0.2.16.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
+ vectorvein-0.2.16.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,10 +28,10 @@ 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=Ctunz8dVj_cHhBEjOfnmDjP3V4lZ662NMUTqffuY_1g,8854
31
+ vectorvein/settings/__init__.py,sha256=hjmUFb3Jcvli4JedOqV_eyp8sTBMR59yUhLr4tOuWXs,9186
32
32
  vectorvein/settings/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
- vectorvein/types/__init__.py,sha256=J0VG3Vc45-ojjMgf95kDlCichZr01KiQcRn6gRmgXrQ,3093
34
- vectorvein/types/defaults.py,sha256=VrkQoyHqC_eK3g1b6egpPYLLo0ltwMHqxDscCX4y-N0,27417
33
+ vectorvein/types/__init__.py,sha256=DJYGhlshgUQgzXPfMfKW5sTpBClZUCLhqmCqF44lVuU,3329
34
+ vectorvein/types/defaults.py,sha256=hdCEY1bEPmPbsh335bXd4LWMeJXLWD3_EulURaWs4EU,26430
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
@@ -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.14.dist-info/RECORD,,
64
+ vectorvein-0.2.16.dist-info/RECORD,,