vectorvein 0.1.50__py3-none-any.whl → 0.1.51__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.
@@ -193,11 +193,19 @@ class MiniMaxChatClient(BaseChatClient):
193
193
  if max_tokens is None:
194
194
  max_output_tokens = self.model_setting.max_output_tokens
195
195
  if max_output_tokens is not None:
196
- token_counts = get_token_counts({"messages": messages, "tools_params": tools_params})
196
+ token_counts = get_token_counts(
197
+ text={"messages": messages, "tools_params": tools_params},
198
+ model=self.model,
199
+ use_token_server_first=True,
200
+ )
197
201
  max_tokens = self.model_setting.context_length - token_counts
198
202
  max_tokens = min(max(max_tokens, 1), max_output_tokens)
199
203
  else:
200
- token_counts = get_token_counts({"messages": messages, "tools_params": tools_params})
204
+ token_counts = get_token_counts(
205
+ text={"messages": messages, "tools_params": tools_params},
206
+ model=self.model,
207
+ use_token_server_first=True,
208
+ )
201
209
  max_tokens = self.model_setting.context_length - token_counts
202
210
 
203
211
  self.url = self.endpoint.api_base
@@ -418,11 +426,19 @@ class AsyncMiniMaxChatClient(BaseAsyncChatClient):
418
426
  if max_tokens is None:
419
427
  max_output_tokens = self.model_setting.max_output_tokens
420
428
  if max_output_tokens is not None:
421
- token_counts = get_token_counts({"messages": messages, "tools_params": tools_params})
429
+ token_counts = get_token_counts(
430
+ text={"messages": messages, "tools_params": tools_params},
431
+ model=self.model,
432
+ use_token_server_first=True,
433
+ )
422
434
  max_tokens = self.model_setting.context_length - token_counts
423
435
  max_tokens = min(max(max_tokens, 1), max_output_tokens)
424
436
  else:
425
- token_counts = get_token_counts({"messages": messages, "tools_params": tools_params})
437
+ token_counts = get_token_counts(
438
+ text={"messages": messages, "tools_params": tools_params},
439
+ model=self.model,
440
+ use_token_server_first=True,
441
+ )
426
442
  max_tokens = self.model_setting.context_length - token_counts
427
443
 
428
444
  self.url = self.endpoint.api_base
@@ -114,7 +114,7 @@ def convert_type(value, value_type):
114
114
  return value # 如果类型未知,返回原始值
115
115
 
116
116
 
117
- def get_token_counts(text: str | dict, model: str = "", use_token_server_first: bool = False) -> int:
117
+ def get_token_counts(text: str | dict, model: str = "", use_token_server_first: bool = True) -> int:
118
118
  if use_token_server_first and settings.token_server is not None:
119
119
  base_url = (
120
120
  settings.token_server.url
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vectorvein
3
- Version: 0.1.50
3
+ Version: 0.1.51
4
4
  Summary: Default template for PDM package
5
5
  Author-Email: Anderson <andersonby@163.com>
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
- vectorvein-0.1.50.dist-info/METADATA,sha256=pYWzduRY5TFzHsTwCq5AJ0QKWoyFkzs1VYgSqWEzCx0,644
2
- vectorvein-0.1.50.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
- vectorvein-0.1.50.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
1
+ vectorvein-0.1.51.dist-info/METADATA,sha256=Z6zB6JLQZR-jyMfrG8gldHY6DQSdC3hjEDJKoWnDUOc,644
2
+ vectorvein-0.1.51.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
+ vectorvein-0.1.51.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
4
4
  vectorvein/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  vectorvein/chat_clients/__init__.py,sha256=dW169oK1n3v8Z0uD8itghzlCP72rxiaS-XYn6fvI2xM,16788
6
6
  vectorvein/chat_clients/anthropic_client.py,sha256=i1fMYSkUovd-Lc9B64bWMgzSTUFw4S3fj3AJ_pDokT4,34029
@@ -10,7 +10,7 @@ vectorvein/chat_clients/deepseek_client.py,sha256=3qWu01NlJAP2N-Ff62d5-CZXZitliz
10
10
  vectorvein/chat_clients/gemini_client.py,sha256=TJZUP8dbufuDnqkRI_gxIDDCYHrIhMPCqKGI6sSwqZo,19860
11
11
  vectorvein/chat_clients/groq_client.py,sha256=Uow4pgdmFi93ZQSoOol2-0PhhqkW-S0XuSldvppz5U4,498
12
12
  vectorvein/chat_clients/local_client.py,sha256=55nOsxzqUf79q3Y14MKROA71zxhsT7p7FsDZ89rts2M,422
13
- vectorvein/chat_clients/minimax_client.py,sha256=cLpSJ5vIaDi0Kmrt7XGlbjnlFnByJiI0YWY3gw1y1Qs,18592
13
+ vectorvein/chat_clients/minimax_client.py,sha256=3HetFZbmgvEzWFaH_Gbj99lsh9DmIOhfpVdbV4HxrSI,19116
14
14
  vectorvein/chat_clients/mistral_client.py,sha256=1aKSylzBDaLYcFnaBIL4-sXSzWmXfBeON9Q0rq-ziWw,534
15
15
  vectorvein/chat_clients/moonshot_client.py,sha256=gbu-6nGxx8uM_U2WlI4Wus881rFRotzHtMSoYOcruGU,526
16
16
  vectorvein/chat_clients/openai_client.py,sha256=Nz6tV45pWcsOupxjnsRsGTicbQNJWIZyxuJoJ5DGMpg,527
@@ -18,7 +18,7 @@ vectorvein/chat_clients/openai_compatible_client.py,sha256=D2VmhpDVct4w2y58s87An
18
18
  vectorvein/chat_clients/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
19
  vectorvein/chat_clients/qwen_client.py,sha256=-ryh-m9PgsO0fc4ulcCmPTy1155J8YUy15uPoJQOHA0,513
20
20
  vectorvein/chat_clients/stepfun_client.py,sha256=zsD2W5ahmR4DD9cqQTXmJr3txrGuvxbRWhFlRdwNijI,519
21
- vectorvein/chat_clients/utils.py,sha256=pLkIrTz4tQszgQIeegc_RTFh1oeNKR4DW-G3hKKEv6w,25605
21
+ vectorvein/chat_clients/utils.py,sha256=gL2B_q3FeCqLGml8rpfKfXkTHcBQlxP5U3jH9eUEsa8,25604
22
22
  vectorvein/chat_clients/yi_client.py,sha256=RNf4CRuPJfixrwLZ3-DEc3t25QDe1mvZeb9sku2f8Bc,484
23
23
  vectorvein/chat_clients/zhipuai_client.py,sha256=Ys5DSeLCuedaDXr3PfG1EW2zKXopt-awO2IylWSwY0s,519
24
24
  vectorvein/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -32,4 +32,4 @@ vectorvein/types/llm_parameters.py,sha256=5o-C_yXxxQWZy_e8OWowB2107GTS-Eawx4Mvb1
32
32
  vectorvein/types/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
33
33
  vectorvein/utilities/media_processing.py,sha256=cnzLrU1OaJvSv87IOnc36FrDXtmGMDStPbxtIJ33YN4,5880
34
34
  vectorvein/utilities/retry.py,sha256=6KFS9R2HdhqM3_9jkjD4F36ZSpEx2YNFGOVlpOsUetM,2208
35
- vectorvein-0.1.50.dist-info/RECORD,,
35
+ vectorvein-0.1.51.dist-info/RECORD,,