vectorvein 0.1.43__py3-none-any.whl → 0.1.45__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.
- vectorvein/chat_clients/anthropic_client.py +9 -4
- vectorvein/types/defaults.py +8 -0
- {vectorvein-0.1.43.dist-info → vectorvein-0.1.45.dist-info}/METADATA +1 -1
- {vectorvein-0.1.43.dist-info → vectorvein-0.1.45.dist-info}/RECORD +6 -6
- {vectorvein-0.1.43.dist-info → vectorvein-0.1.45.dist-info}/WHEEL +0 -0
- {vectorvein-0.1.43.dist-info → vectorvein-0.1.45.dist-info}/entry_points.txt +0 -0
@@ -7,6 +7,7 @@ from typing import overload, Generator, AsyncGenerator, Any, Literal, Iterable
|
|
7
7
|
|
8
8
|
import httpx
|
9
9
|
from openai._types import NotGiven as OpenAINotGiven
|
10
|
+
from openai._types import NOT_GIVEN as OPENAI_NOT_GIVEN
|
10
11
|
from anthropic import Anthropic, AnthropicVertex, AsyncAnthropic, AsyncAnthropicVertex
|
11
12
|
from anthropic._types import NOT_GIVEN
|
12
13
|
from anthropic.types import (
|
@@ -282,6 +283,8 @@ class AnthropicChatClient(BaseChatClient):
|
|
282
283
|
self.endpoint = settings.get_endpoint(self.endpoint_id)
|
283
284
|
|
284
285
|
if self.endpoint.api_schema_type == "openai":
|
286
|
+
_tools = OPENAI_NOT_GIVEN if tools is NOT_GIVEN else tools
|
287
|
+
_tool_choice = OPENAI_NOT_GIVEN if tool_choice is NOT_GIVEN else tool_choice
|
285
288
|
if self.stream:
|
286
289
|
|
287
290
|
def _generator():
|
@@ -295,7 +298,7 @@ class AnthropicChatClient(BaseChatClient):
|
|
295
298
|
http_client=self.http_client,
|
296
299
|
backend_name=self.BACKEND_NAME,
|
297
300
|
).create_completion(
|
298
|
-
messages, model, True, temperature, max_tokens,
|
301
|
+
messages, model, True, temperature, max_tokens, _tools, _tool_choice, response_format, **kwargs
|
299
302
|
)
|
300
303
|
for chunk in response:
|
301
304
|
yield chunk
|
@@ -312,7 +315,7 @@ class AnthropicChatClient(BaseChatClient):
|
|
312
315
|
http_client=self.http_client,
|
313
316
|
backend_name=self.BACKEND_NAME,
|
314
317
|
).create_completion(
|
315
|
-
messages, model, False, temperature, max_tokens,
|
318
|
+
messages, model, False, temperature, max_tokens, _tools, _tool_choice, response_format, **kwargs
|
316
319
|
)
|
317
320
|
|
318
321
|
assert isinstance(self.raw_client, Anthropic | AnthropicVertex)
|
@@ -620,6 +623,8 @@ class AsyncAnthropicChatClient(BaseAsyncChatClient):
|
|
620
623
|
self.endpoint = settings.get_endpoint(self.endpoint_id)
|
621
624
|
|
622
625
|
if self.endpoint.api_schema_type == "openai":
|
626
|
+
_tools = OPENAI_NOT_GIVEN if tools is NOT_GIVEN else tools
|
627
|
+
_tool_choice = OPENAI_NOT_GIVEN if tool_choice is NOT_GIVEN else tool_choice
|
623
628
|
if self.stream:
|
624
629
|
|
625
630
|
async def _generator():
|
@@ -634,7 +639,7 @@ class AsyncAnthropicChatClient(BaseAsyncChatClient):
|
|
634
639
|
backend_name=self.BACKEND_NAME,
|
635
640
|
)
|
636
641
|
response = await client.create_completion(
|
637
|
-
messages, model, True, temperature, max_tokens,
|
642
|
+
messages, model, True, temperature, max_tokens, _tools, _tool_choice, response_format, **kwargs
|
638
643
|
)
|
639
644
|
async for chunk in response:
|
640
645
|
yield chunk
|
@@ -652,7 +657,7 @@ class AsyncAnthropicChatClient(BaseAsyncChatClient):
|
|
652
657
|
backend_name=self.BACKEND_NAME,
|
653
658
|
)
|
654
659
|
return await client.create_completion(
|
655
|
-
messages, model, False, temperature, max_tokens,
|
660
|
+
messages, model, False, temperature, max_tokens, _tools, _tool_choice, response_format, **kwargs
|
656
661
|
)
|
657
662
|
|
658
663
|
assert isinstance(self.raw_client, AsyncAnthropic | AsyncAnthropicVertex)
|
vectorvein/types/defaults.py
CHANGED
@@ -560,6 +560,14 @@ ANTHROPIC_MODELS: Final[Dict[str, Dict[str, Any]]] = {
|
|
560
560
|
"response_format_available": False,
|
561
561
|
"native_multimodal": True,
|
562
562
|
},
|
563
|
+
"claude-3-5-sonnet-20241022": {
|
564
|
+
"id": "claude-3-5-sonnet-20241022",
|
565
|
+
"context_length": 200000,
|
566
|
+
"max_output_tokens": 4096,
|
567
|
+
"function_call_available": True,
|
568
|
+
"response_format_available": False,
|
569
|
+
"native_multimodal": True,
|
570
|
+
},
|
563
571
|
}
|
564
572
|
|
565
573
|
# Minimax models
|
@@ -1,9 +1,9 @@
|
|
1
|
-
vectorvein-0.1.
|
2
|
-
vectorvein-0.1.
|
3
|
-
vectorvein-0.1.
|
1
|
+
vectorvein-0.1.45.dist-info/METADATA,sha256=Er7GHrx6wrxhlRAT_xJ2oKWVVHUyFT4BD4aqVBL8I7s,644
|
2
|
+
vectorvein-0.1.45.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
|
3
|
+
vectorvein-0.1.45.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=
|
6
|
+
vectorvein/chat_clients/anthropic_client.py,sha256=leEA9DqXe0cerwgRJ8UciENGl_7l7cyMa64htAkBeAc,32797
|
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
|
@@ -25,11 +25,11 @@ vectorvein/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
25
25
|
vectorvein/server/token_server.py,sha256=36F9PKSNOX8ZtYBXY_l-76GQTpUSmQ2Y8EMy1H7wtdQ,1353
|
26
26
|
vectorvein/settings/__init__.py,sha256=dyTCLhevXiKVJhOb1tjgZGMH38Indy4dkWVdDX543g0,3771
|
27
27
|
vectorvein/settings/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
28
|
-
vectorvein/types/defaults.py,sha256=
|
28
|
+
vectorvein/types/defaults.py,sha256=3sAC8NtNfPOG3Jz-d7Mjt-7JyTgfJingwpp9f76cbF0,22379
|
29
29
|
vectorvein/types/enums.py,sha256=x_S0IJiEWijOAEiMNdiGDGEWGtmt7TwMriJVDqrDmTo,1637
|
30
30
|
vectorvein/types/exception.py,sha256=gnW4GnJ76jND6UGnodk9xmqkcbeS7Cz2rvncA2HpD5E,69
|
31
31
|
vectorvein/types/llm_parameters.py,sha256=vhleSgCHzDl7EULYJ3dUYlu9KLbfs9y6dcPD0BkaRdg,5114
|
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.
|
35
|
+
vectorvein-0.1.45.dist-info/RECORD,,
|
File without changes
|
File without changes
|