vectorvein 0.1.12__py3-none-any.whl → 0.1.14__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/__init__.py +3 -0
- vectorvein/chat_clients/baichuan_client.py +15 -0
- vectorvein/chat_clients/base_client.py +6 -0
- vectorvein/settings/__init__.py +2 -0
- vectorvein/types/defaults.py +40 -0
- vectorvein/types/enums.py +3 -0
- {vectorvein-0.1.12.dist-info → vectorvein-0.1.14.dist-info}/METADATA +1 -1
- {vectorvein-0.1.12.dist-info → vectorvein-0.1.14.dist-info}/RECORD +9 -8
- {vectorvein-0.1.12.dist-info → vectorvein-0.1.14.dist-info}/WHEEL +0 -0
@@ -13,6 +13,7 @@ from .openai_client import OpenAIChatClient, AsyncOpenAIChatClient
|
|
13
13
|
from .zhipuai_client import ZhiPuAIChatClient, AsyncZhiPuAIChatClient
|
14
14
|
from .minimax_client import MiniMaxChatClient, AsyncMiniMaxChatClient
|
15
15
|
from .mistral_client import MistralChatClient, AsyncMistralChatClient
|
16
|
+
from .baichuan_client import BaichuanChatClient, AsyncBaichuanChatClient
|
16
17
|
from .moonshot_client import MoonshotChatClient, AsyncMoonshotChatClient
|
17
18
|
from .deepseek_client import DeepSeekChatClient, AsyncDeepSeekChatClient
|
18
19
|
|
@@ -36,6 +37,7 @@ BackendMap = {
|
|
36
37
|
BackendType.Qwen: QwenChatClient,
|
37
38
|
BackendType.Yi: YiChatClient,
|
38
39
|
BackendType.ZhiPuAI: ZhiPuAIChatClient,
|
40
|
+
BackendType.Baichuan: BaichuanChatClient,
|
39
41
|
},
|
40
42
|
"async": {
|
41
43
|
BackendType.Anthropic: AsyncAnthropicChatClient,
|
@@ -50,6 +52,7 @@ BackendMap = {
|
|
50
52
|
BackendType.Qwen: AsyncQwenChatClient,
|
51
53
|
BackendType.Yi: AsyncYiChatClient,
|
52
54
|
BackendType.ZhiPuAI: AsyncZhiPuAIChatClient,
|
55
|
+
BackendType.Baichuan: AsyncBaichuanChatClient,
|
53
56
|
},
|
54
57
|
}
|
55
58
|
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# @Author: Bi Ying
|
2
|
+
# @Date: 2024-07-26 14:48:55
|
3
|
+
from ..types.enums import BackendType
|
4
|
+
from ..types.defaults import BAICHUAN_DEFAULT_MODEL
|
5
|
+
from .openai_compatible_client import OpenAICompatibleChatClient, AsyncOpenAICompatibleChatClient
|
6
|
+
|
7
|
+
|
8
|
+
class BaichuanChatClient(OpenAICompatibleChatClient):
|
9
|
+
DEFAULT_MODEL = BAICHUAN_DEFAULT_MODEL
|
10
|
+
BACKEND_NAME = BackendType.Baichuan
|
11
|
+
|
12
|
+
|
13
|
+
class AsyncBaichuanChatClient(AsyncOpenAICompatibleChatClient):
|
14
|
+
DEFAULT_MODEL = BAICHUAN_DEFAULT_MODEL
|
15
|
+
BACKEND_NAME = BackendType.Baichuan
|
@@ -52,6 +52,7 @@ class BaseChatClient(ABC):
|
|
52
52
|
max_tokens: int | None = None,
|
53
53
|
tools: list | NotGiven = NOT_GIVEN,
|
54
54
|
tool_choice: str | NotGiven = NOT_GIVEN,
|
55
|
+
**kwargs,
|
55
56
|
) -> ChatCompletionMessage | Generator[ChatCompletionDeltaMessage, Any, None]:
|
56
57
|
pass
|
57
58
|
|
@@ -63,6 +64,7 @@ class BaseChatClient(ABC):
|
|
63
64
|
max_tokens: int | None = None,
|
64
65
|
tools: list | NotGiven = NOT_GIVEN,
|
65
66
|
tool_choice: str | NotGiven = NOT_GIVEN,
|
67
|
+
**kwargs,
|
66
68
|
) -> Generator[ChatCompletionDeltaMessage, Any, None]:
|
67
69
|
return self.create_completion(
|
68
70
|
messages=messages,
|
@@ -72,6 +74,7 @@ class BaseChatClient(ABC):
|
|
72
74
|
max_tokens=max_tokens,
|
73
75
|
tools=tools,
|
74
76
|
tool_choice=tool_choice,
|
77
|
+
**kwargs,
|
75
78
|
)
|
76
79
|
|
77
80
|
|
@@ -115,6 +118,7 @@ class BaseAsyncChatClient(ABC):
|
|
115
118
|
max_tokens: int | None = None,
|
116
119
|
tools: list | NotGiven = NOT_GIVEN,
|
117
120
|
tool_choice: str | NotGiven = NOT_GIVEN,
|
121
|
+
**kwargs,
|
118
122
|
) -> ChatCompletionMessage | AsyncGenerator[ChatCompletionDeltaMessage, None]:
|
119
123
|
pass
|
120
124
|
|
@@ -126,6 +130,7 @@ class BaseAsyncChatClient(ABC):
|
|
126
130
|
max_tokens: int | None = None,
|
127
131
|
tools: list | NotGiven = NOT_GIVEN,
|
128
132
|
tool_choice: str | NotGiven = NOT_GIVEN,
|
133
|
+
**kwargs,
|
129
134
|
) -> AsyncGenerator[ChatCompletionDeltaMessage, None]:
|
130
135
|
return await self.create_completion(
|
131
136
|
messages=messages,
|
@@ -135,4 +140,5 @@ class BaseAsyncChatClient(ABC):
|
|
135
140
|
max_tokens=max_tokens,
|
136
141
|
tools=tools,
|
137
142
|
tool_choice=tool_choice,
|
143
|
+
**kwargs,
|
138
144
|
)
|
vectorvein/settings/__init__.py
CHANGED
@@ -26,6 +26,7 @@ class Settings(BaseModel):
|
|
26
26
|
qwen: BackendSettings = Field(default_factory=BackendSettings, description="Qwen models settings.")
|
27
27
|
yi: BackendSettings = Field(default_factory=BackendSettings, description="Yi models settings.")
|
28
28
|
zhipuai: BackendSettings = Field(default_factory=BackendSettings, description="Zhipuai models settings.")
|
29
|
+
baichuan: BackendSettings = Field(default_factory=BackendSettings, description="Baichuan models settings.")
|
29
30
|
|
30
31
|
def __init__(self, **data):
|
31
32
|
model_types = {
|
@@ -41,6 +42,7 @@ class Settings(BaseModel):
|
|
41
42
|
"qwen": defs.QWEN_MODELS,
|
42
43
|
"yi": defs.YI_MODELS,
|
43
44
|
"zhipuai": defs.ZHIPUAI_MODELS,
|
45
|
+
"baichuan": defs.BAICHUAN_MODELS,
|
44
46
|
}
|
45
47
|
|
46
48
|
for model_type, default_models in model_types.items():
|
vectorvein/types/defaults.py
CHANGED
@@ -52,6 +52,46 @@ DEEPSEEK_MODELS = {
|
|
52
52
|
}
|
53
53
|
DEEPSEEK_DEFAULT_MODEL = "deepseek-chat"
|
54
54
|
|
55
|
+
# Baichuan models
|
56
|
+
BAICHUAN_MODELS = {
|
57
|
+
"Baichuan4": {
|
58
|
+
"id": "Baichuan4",
|
59
|
+
"context_length": 32768,
|
60
|
+
"max_output_tokens": 2048,
|
61
|
+
"function_call_available": True,
|
62
|
+
"response_format_available": True,
|
63
|
+
},
|
64
|
+
"Baichuan3-Turbo": {
|
65
|
+
"id": "Baichuan3-Turbo",
|
66
|
+
"context_length": 32768,
|
67
|
+
"max_output_tokens": 2048,
|
68
|
+
"function_call_available": True,
|
69
|
+
"response_format_available": True,
|
70
|
+
},
|
71
|
+
"Baichuan3-Turbo-128k": {
|
72
|
+
"id": "Baichuan3-Turbo-128k",
|
73
|
+
"context_length": 128000,
|
74
|
+
"max_output_tokens": 2048,
|
75
|
+
"function_call_available": True,
|
76
|
+
"response_format_available": True,
|
77
|
+
},
|
78
|
+
"Baichuan2-Turbo": {
|
79
|
+
"id": "Baichuan2-Turbo",
|
80
|
+
"context_length": 32768,
|
81
|
+
"max_output_tokens": 2048,
|
82
|
+
"function_call_available": True,
|
83
|
+
"response_format_available": False,
|
84
|
+
},
|
85
|
+
"Baichuan2-53B": {
|
86
|
+
"id": "Baichuan2-53B",
|
87
|
+
"context_length": 32768,
|
88
|
+
"max_output_tokens": 2048,
|
89
|
+
"function_call_available": False,
|
90
|
+
"response_format_available": False,
|
91
|
+
},
|
92
|
+
}
|
93
|
+
BAICHUAN_DEFAULT_MODEL = "Baichuan3-Turbo"
|
94
|
+
|
55
95
|
# Groq models
|
56
96
|
GROQ_DEFAULT_MODEL = "llama3-70b-8192"
|
57
97
|
GROQ_MODELS = {
|
vectorvein/types/enums.py
CHANGED
@@ -1,9 +1,10 @@
|
|
1
|
-
vectorvein-0.1.
|
2
|
-
vectorvein-0.1.
|
1
|
+
vectorvein-0.1.14.dist-info/METADATA,sha256=Xm4rgWhrckl6Jik4gaGQDx6KC85l4lDFcy2UToEj5no,502
|
2
|
+
vectorvein-0.1.14.dist-info/WHEEL,sha256=rSwsxJWe3vzyR5HCwjWXQruDgschpei4h_giTm0dJVE,90
|
3
3
|
vectorvein/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
-
vectorvein/chat_clients/__init__.py,sha256=
|
4
|
+
vectorvein/chat_clients/__init__.py,sha256=oaEcDx5MM89oBOqmvWWDGAkMoaHihh892cA0tJU2u4g,4599
|
5
5
|
vectorvein/chat_clients/anthropic_client.py,sha256=sECXynbReJs1xixFEHSlfEQo9Q1zGf5uCJ-V8emdoAM,20438
|
6
|
-
vectorvein/chat_clients/
|
6
|
+
vectorvein/chat_clients/baichuan_client.py,sha256=CVMvpgjdrZGv0BWnTOBD-f2ufZ3wq3496wqukumsAr4,526
|
7
|
+
vectorvein/chat_clients/base_client.py,sha256=4nGY5A7s7Ubgqb7XqFGkYwM6RNYDTuWkHZrH5KTJZiE,4585
|
7
8
|
vectorvein/chat_clients/deepseek_client.py,sha256=3qWu01NlJAP2N-Ff62d5-CZXZitlizE1fzb20LNetig,526
|
8
9
|
vectorvein/chat_clients/gemini_client.py,sha256=W-9Vu-GTE9wxStPznyNR0rBEgDG3LYBu2uQXd4sh1YQ,14425
|
9
10
|
vectorvein/chat_clients/groq_client.py,sha256=Uow4pgdmFi93ZQSoOol2-0PhhqkW-S0XuSldvppz5U4,498
|
@@ -17,10 +18,10 @@ vectorvein/chat_clients/qwen_client.py,sha256=-ryh-m9PgsO0fc4ulcCmPTy1155J8YUy15
|
|
17
18
|
vectorvein/chat_clients/utils.py,sha256=mnAew2Ie3nQHdEyDLKuJvXkQ5QdcSAJ6SpYk5JPbR1Q,20888
|
18
19
|
vectorvein/chat_clients/yi_client.py,sha256=RNf4CRuPJfixrwLZ3-DEc3t25QDe1mvZeb9sku2f8Bc,484
|
19
20
|
vectorvein/chat_clients/zhipuai_client.py,sha256=Ys5DSeLCuedaDXr3PfG1EW2zKXopt-awO2IylWSwY0s,519
|
20
|
-
vectorvein/settings/__init__.py,sha256=
|
21
|
-
vectorvein/types/defaults.py,sha256=
|
22
|
-
vectorvein/types/enums.py,sha256=
|
21
|
+
vectorvein/settings/__init__.py,sha256=jVHbhHn1BuMcyfZGXrxWKiI4NdY9wzvYyGMvKYmUtqg,3378
|
22
|
+
vectorvein/types/defaults.py,sha256=bwE-MLIuiDqMiOGsstacaUTGD-bN5pKL6lGP-gS-Kmg,14667
|
23
|
+
vectorvein/types/enums.py,sha256=PNK_pTIyjJFy-yAG2PHaMIO1ey3W6fReMCkH8M8VRW4,1595
|
23
24
|
vectorvein/types/llm_parameters.py,sha256=PWN18dDGrCTP4Bz7pX0XxO-wDUA7qTngppzEELrROmc,3496
|
24
25
|
vectorvein/utilities/media_processing.py,sha256=BujciRmw1GMmc3ELRvafL8STcy6r5b2rVnh27-uA7so,2256
|
25
26
|
vectorvein/utilities/retry.py,sha256=9ePuJdeUUGx-qMWfaFxmlOvG_lQPwCQ4UB1z3Edlo34,993
|
26
|
-
vectorvein-0.1.
|
27
|
+
vectorvein-0.1.14.dist-info/RECORD,,
|
File without changes
|