vectorvein 0.1.47__py3-none-any.whl → 0.1.48__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.
@@ -223,11 +223,14 @@ class OpenAICompatibleChatClient(BaseChatClient):
223
223
  prompt_tokens=chunk.usage.prompt_tokens or 0,
224
224
  total_tokens=chunk.usage.total_tokens or 0,
225
225
  )
226
- else:
227
- usage = None
226
+
228
227
  if len(chunk.choices) == 0:
228
+ if usage:
229
+ yield ChatCompletionDeltaMessage(usage=usage)
229
230
  continue
230
231
  if not chunk.choices[0].delta:
232
+ if usage:
233
+ yield ChatCompletionDeltaMessage(usage=usage)
231
234
  continue
232
235
  if self.model_setting.function_call_available:
233
236
  if chunk.choices[0].delta.tool_calls:
@@ -474,12 +477,16 @@ class AsyncOpenAICompatibleChatClient(BaseAsyncChatClient):
474
477
  prompt_tokens=chunk.usage.prompt_tokens or 0,
475
478
  total_tokens=chunk.usage.total_tokens or 0,
476
479
  )
477
- else:
478
- usage = None
480
+
479
481
  if len(chunk.choices) == 0:
482
+ if usage:
483
+ yield ChatCompletionDeltaMessage(usage=usage)
480
484
  continue
481
485
  if not chunk.choices[0].delta:
486
+ if usage:
487
+ yield ChatCompletionDeltaMessage(usage=usage)
482
488
  continue
489
+
483
490
  if self.model_setting.function_call_available:
484
491
  if chunk.choices[0].delta.tool_calls:
485
492
  for index, tool_call in enumerate(chunk.choices[0].delta.tool_calls):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vectorvein
3
- Version: 0.1.47
3
+ Version: 0.1.48
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.47.dist-info/METADATA,sha256=wHK12p2NAwLjy_gei3wiErFfYwWRSV1dVx7nEda3TQU,644
2
- vectorvein-0.1.47.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
- vectorvein-0.1.47.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
1
+ vectorvein-0.1.48.dist-info/METADATA,sha256=J6bEBBrKiwUMNvIysDT5W-V8fDFhdwIYPjWBYXmFRKM,644
2
+ vectorvein-0.1.48.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
+ vectorvein-0.1.48.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
@@ -14,7 +14,7 @@ vectorvein/chat_clients/minimax_client.py,sha256=cLpSJ5vIaDi0Kmrt7XGlbjnlFnByJiI
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
17
- vectorvein/chat_clients/openai_compatible_client.py,sha256=jsEYttMKNZmgKeOIk2MbNUz0Tri2jeQCR1iaCs_TIok,21728
17
+ vectorvein/chat_clients/openai_compatible_client.py,sha256=D2VmhpDVct4w2y58s87An7x22koOdkxSOKR2-so9lJI,22044
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
@@ -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.47.dist-info/RECORD,,
35
+ vectorvein-0.1.48.dist-info/RECORD,,