vectorvein 0.1.36__py3-none-any.whl → 0.1.37__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.
@@ -270,18 +270,24 @@ class AnthropicChatClient(BaseChatClient):
270
270
 
271
271
  if self.endpoint.api_schema_type == "openai":
272
272
  if self.stream:
273
- return OpenAICompatibleChatClient(
274
- model=self.model,
275
- stream=True,
276
- temperature=self.temperature,
277
- context_length_control=self.context_length_control,
278
- random_endpoint=self.random_endpoint,
279
- endpoint_id=self.endpoint_id,
280
- http_client=self.http_client,
281
- backend_name=self.BACKEND_NAME,
282
- ).create_completion(
283
- messages, model, True, temperature, max_tokens, tools, tool_choice, response_format, **kwargs
284
- )
273
+
274
+ def _generator():
275
+ response = OpenAICompatibleChatClient(
276
+ model=self.model,
277
+ stream=True,
278
+ temperature=self.temperature,
279
+ context_length_control=self.context_length_control,
280
+ random_endpoint=self.random_endpoint,
281
+ endpoint_id=self.endpoint_id,
282
+ http_client=self.http_client,
283
+ backend_name=self.BACKEND_NAME,
284
+ ).create_completion(
285
+ messages, model, True, temperature, max_tokens, tools, tool_choice, response_format, **kwargs
286
+ )
287
+ for chunk in response:
288
+ yield chunk
289
+
290
+ return _generator()
285
291
  else:
286
292
  return OpenAICompatibleChatClient(
287
293
  model=self.model,
@@ -586,20 +592,27 @@ class AsyncAnthropicChatClient(BaseAsyncChatClient):
586
592
 
587
593
  if self.endpoint.api_schema_type == "openai":
588
594
  if self.stream:
589
- return AsyncOpenAICompatibleChatClient(
590
- model=self.model,
591
- stream=True,
592
- temperature=self.temperature,
593
- context_length_control=self.context_length_control,
594
- random_endpoint=self.random_endpoint,
595
- endpoint_id=self.endpoint_id,
596
- http_client=self.http_client,
597
- backend_name=self.BACKEND_NAME,
598
- ).create_completion(
599
- messages, model, True, temperature, max_tokens, tools, tool_choice, response_format, **kwargs
600
- )
595
+
596
+ async def _generator():
597
+ client = AsyncOpenAICompatibleChatClient(
598
+ model=self.model,
599
+ stream=True,
600
+ temperature=self.temperature,
601
+ context_length_control=self.context_length_control,
602
+ random_endpoint=self.random_endpoint,
603
+ endpoint_id=self.endpoint_id,
604
+ http_client=self.http_client,
605
+ backend_name=self.BACKEND_NAME,
606
+ )
607
+ response = await client.create_completion(
608
+ messages, model, True, temperature, max_tokens, tools, tool_choice, response_format, **kwargs
609
+ )
610
+ async for chunk in response:
611
+ yield chunk
612
+
613
+ return _generator()
601
614
  else:
602
- return AsyncOpenAICompatibleChatClient(
615
+ client = AsyncOpenAICompatibleChatClient(
603
616
  model=self.model,
604
617
  stream=False,
605
618
  temperature=self.temperature,
@@ -608,7 +621,8 @@ class AsyncAnthropicChatClient(BaseAsyncChatClient):
608
621
  endpoint_id=self.endpoint_id,
609
622
  http_client=self.http_client,
610
623
  backend_name=self.BACKEND_NAME,
611
- ).create_completion(
624
+ )
625
+ return await client.create_completion(
612
626
  messages, model, False, temperature, max_tokens, tools, tool_choice, response_format, **kwargs
613
627
  )
614
628
 
@@ -25,7 +25,6 @@ from ..types.llm_parameters import (
25
25
  NOT_GIVEN,
26
26
  ToolParam,
27
27
  ToolChoice,
28
- BackendSettings,
29
28
  ChatCompletionMessage,
30
29
  ChatCompletionDeltaMessage,
31
30
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: vectorvein
3
- Version: 0.1.36
3
+ Version: 0.1.37
4
4
  Summary: Default template for PDM package
5
5
  Author-Email: Anderson <andersonby@163.com>
6
6
  License: MIT
@@ -1,9 +1,9 @@
1
- vectorvein-0.1.36.dist-info/METADATA,sha256=gRwf2-Irb4TOVXjFue0Vb4ofR_zIM6AS0q4IRv4eIl0,502
2
- vectorvein-0.1.36.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
- vectorvein-0.1.36.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
1
+ vectorvein-0.1.37.dist-info/METADATA,sha256=a6dST0w8XT0n9IOLJsanwGQVc383RUhaJfnk_0_pWbg,502
2
+ vectorvein-0.1.37.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
+ vectorvein-0.1.37.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
- vectorvein/chat_clients/anthropic_client.py,sha256=FsiAe4NAP7tC6EPrAqSorc5eaHkOfGKJjE6pEmuQAaw,30619
6
+ vectorvein/chat_clients/anthropic_client.py,sha256=kJWSplijhBbCvDX_VkPcMNcehJSjZ9zFjq_Ja8hAUkg,31117
7
7
  vectorvein/chat_clients/baichuan_client.py,sha256=CVMvpgjdrZGv0BWnTOBD-f2ufZ3wq3496wqukumsAr4,526
8
8
  vectorvein/chat_clients/base_client.py,sha256=7i456Yn-tqY0oPeIj_wHWNGGzCKPAbX5Ufxy2wWGMNY,8653
9
9
  vectorvein/chat_clients/deepseek_client.py,sha256=3qWu01NlJAP2N-Ff62d5-CZXZitlizE1fzb20LNetig,526
@@ -14,7 +14,7 @@ vectorvein/chat_clients/minimax_client.py,sha256=0MVMb4g0K_VKnPGHYX81jHiBaQUGWFG
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=H7W7BEA71Dh6N42cFuH-nXN9en6oU14OU6RyMmefbnM,18899
17
+ vectorvein/chat_clients/openai_compatible_client.py,sha256=auaKGXvwOhLu9JUxFyOq--yJ5Wrpijf7o6i8FKq0_jQ,18877
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
@@ -31,4 +31,4 @@ vectorvein/types/llm_parameters.py,sha256=uvVS3dqqvGMJoiz79LxdKjGj3YSmGD3U_yA0f7
31
31
  vectorvein/types/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
32
  vectorvein/utilities/media_processing.py,sha256=BujciRmw1GMmc3ELRvafL8STcy6r5b2rVnh27-uA7so,2256
33
33
  vectorvein/utilities/retry.py,sha256=9ePuJdeUUGx-qMWfaFxmlOvG_lQPwCQ4UB1z3Edlo34,993
34
- vectorvein-0.1.36.dist-info/RECORD,,
34
+ vectorvein-0.1.37.dist-info/RECORD,,