vectorvein 0.1.2__tar.gz → 0.1.3__tar.gz
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-0.1.2 → vectorvein-0.1.3}/PKG-INFO +1 -1
- {vectorvein-0.1.2 → vectorvein-0.1.3}/pyproject.toml +1 -1
- {vectorvein-0.1.2 → vectorvein-0.1.3}/src/vectorvein/chat_clients/utils.py +6 -4
- vectorvein-0.1.3/tests/sample_settings.py +467 -0
- {vectorvein-0.1.2 → vectorvein-0.1.3}/tests/test_create_chat_client.py +4 -2
- vectorvein-0.1.3/tests/test_tool_use_multi_turns.py +160 -0
- vectorvein-0.1.2/tests/sample_settings.py +0 -88
- {vectorvein-0.1.2 → vectorvein-0.1.3}/README.md +0 -0
- {vectorvein-0.1.2 → vectorvein-0.1.3}/src/vectorvein/__init__.py +0 -0
- {vectorvein-0.1.2 → vectorvein-0.1.3}/src/vectorvein/chat_clients/__init__.py +0 -0
- {vectorvein-0.1.2 → vectorvein-0.1.3}/src/vectorvein/chat_clients/anthropic_client.py +0 -0
- {vectorvein-0.1.2 → vectorvein-0.1.3}/src/vectorvein/chat_clients/base_client.py +0 -0
- {vectorvein-0.1.2 → vectorvein-0.1.3}/src/vectorvein/chat_clients/deepseek_client.py +0 -0
- {vectorvein-0.1.2 → vectorvein-0.1.3}/src/vectorvein/chat_clients/gemini_client.py +0 -0
- {vectorvein-0.1.2 → vectorvein-0.1.3}/src/vectorvein/chat_clients/groq_client.py +0 -0
- {vectorvein-0.1.2 → vectorvein-0.1.3}/src/vectorvein/chat_clients/local_client.py +0 -0
- {vectorvein-0.1.2 → vectorvein-0.1.3}/src/vectorvein/chat_clients/minimax_client.py +0 -0
- {vectorvein-0.1.2 → vectorvein-0.1.3}/src/vectorvein/chat_clients/mistral_client.py +0 -0
- {vectorvein-0.1.2 → vectorvein-0.1.3}/src/vectorvein/chat_clients/moonshot_client.py +0 -0
- {vectorvein-0.1.2 → vectorvein-0.1.3}/src/vectorvein/chat_clients/openai_client.py +0 -0
- {vectorvein-0.1.2 → vectorvein-0.1.3}/src/vectorvein/chat_clients/openai_compatible_client.py +0 -0
- {vectorvein-0.1.2 → vectorvein-0.1.3}/src/vectorvein/chat_clients/qwen_client.py +0 -0
- {vectorvein-0.1.2 → vectorvein-0.1.3}/src/vectorvein/chat_clients/yi_client.py +0 -0
- {vectorvein-0.1.2 → vectorvein-0.1.3}/src/vectorvein/chat_clients/zhipuai_client.py +0 -0
- {vectorvein-0.1.2 → vectorvein-0.1.3}/src/vectorvein/settings/__init__.py +0 -0
- {vectorvein-0.1.2 → vectorvein-0.1.3}/src/vectorvein/types/defaults.py +0 -0
- {vectorvein-0.1.2 → vectorvein-0.1.3}/src/vectorvein/types/enums.py +0 -0
- {vectorvein-0.1.2 → vectorvein-0.1.3}/src/vectorvein/types/llm_parameters.py +0 -0
- {vectorvein-0.1.2 → vectorvein-0.1.3}/src/vectorvein/utilities/media_processing.py +0 -0
- {vectorvein-0.1.2 → vectorvein-0.1.3}/tests/__init__.py +0 -0
- {vectorvein-0.1.2 → vectorvein-0.1.3}/tests/cat.png +0 -0
- {vectorvein-0.1.2 → vectorvein-0.1.3}/tests/test_format_messages.py +0 -0
- {vectorvein-0.1.2 → vectorvein-0.1.3}/tests/test_image_input_chat_client.py +0 -0
@@ -220,7 +220,7 @@ def format_workflow_messages(message, content, backend):
|
|
220
220
|
formatted_messages = []
|
221
221
|
|
222
222
|
# 工具调用消息
|
223
|
-
if backend in (BackendType.OpenAI, BackendType.ZhiPuAI, BackendType.Mistral):
|
223
|
+
if backend in (BackendType.OpenAI, BackendType.ZhiPuAI, BackendType.Mistral, BackendType.Yi):
|
224
224
|
tool_call_message = {
|
225
225
|
"content": None,
|
226
226
|
"role": "assistant",
|
@@ -277,7 +277,7 @@ def format_workflow_messages(message, content, backend):
|
|
277
277
|
formatted_messages.append(tool_call_message)
|
278
278
|
|
279
279
|
# 工具调用结果消息
|
280
|
-
if backend in (BackendType.OpenAI, BackendType.ZhiPuAI, BackendType.Mistral):
|
280
|
+
if backend in (BackendType.OpenAI, BackendType.ZhiPuAI, BackendType.Mistral, BackendType.Yi):
|
281
281
|
tool_call_result_message = {
|
282
282
|
"role": "tool",
|
283
283
|
"tool_call_id": message["metadata"]["selected_workflow"]["tool_call_id"],
|
@@ -363,12 +363,14 @@ def format_openai_message(message, backend):
|
|
363
363
|
|
364
364
|
|
365
365
|
def format_messages(
|
366
|
-
messages: list,
|
366
|
+
messages: list,
|
367
|
+
backend: BackendType = BackendType.OpenAI,
|
368
|
+
native_multimodal: bool = False,
|
367
369
|
) -> list:
|
368
370
|
"""将 VectorVein 和 OpenAI 的 Message 序列化后的格式转换为不同模型支持的格式
|
369
371
|
|
370
372
|
Args:
|
371
|
-
messages (list): VectorVein
|
373
|
+
messages (list): VectorVein Or OpenAI messages list.
|
372
374
|
backend (str, optional): Messages format target backend. Defaults to BackendType.OpenAI.
|
373
375
|
native_multimodal (bool, optional): Use native multimodal ability. Defaults to False.
|
374
376
|
|
@@ -0,0 +1,467 @@
|
|
1
|
+
# @Author: Bi Ying
|
2
|
+
# @Date: 2024-07-27 18:26:05
|
3
|
+
sample_settings = {
|
4
|
+
"endpoints": [
|
5
|
+
{
|
6
|
+
"id": "moonshot-default",
|
7
|
+
"api_base": "https://api.moonshot.cn/v1",
|
8
|
+
"api_key": "",
|
9
|
+
"rpm": 30,
|
10
|
+
"tpm": 3000000,
|
11
|
+
"concurrent_requests": 30,
|
12
|
+
},
|
13
|
+
{
|
14
|
+
"id": "azure-openai",
|
15
|
+
"region": "East US",
|
16
|
+
"api_base": "",
|
17
|
+
"endpoint_name": "",
|
18
|
+
"api_key": "",
|
19
|
+
"rpm": 900,
|
20
|
+
"tpm": 150000,
|
21
|
+
"is_azure": True,
|
22
|
+
},
|
23
|
+
{
|
24
|
+
"id": "vertex-anthropic",
|
25
|
+
"region": "europe-west1",
|
26
|
+
"api_base": "",
|
27
|
+
"credentials": {},
|
28
|
+
"is_vertex": True,
|
29
|
+
},
|
30
|
+
{
|
31
|
+
"id": "minimax-default",
|
32
|
+
"api_base": "https://api.minimax.chat/v1/text/chatcompletion_v2",
|
33
|
+
"api_key": "",
|
34
|
+
},
|
35
|
+
{
|
36
|
+
"id": "gemini-default",
|
37
|
+
"api_base": "",
|
38
|
+
"api_key": "",
|
39
|
+
},
|
40
|
+
{
|
41
|
+
"id": "deepseek-default",
|
42
|
+
"api_base": "https://api.deepseek.com/v1",
|
43
|
+
"api_key": "",
|
44
|
+
},
|
45
|
+
{
|
46
|
+
"id": "groq-default",
|
47
|
+
"api_base": "",
|
48
|
+
"api_key": "",
|
49
|
+
},
|
50
|
+
{
|
51
|
+
"id": "mistral-default",
|
52
|
+
"api_base": "https://api.mistral.ai/v1",
|
53
|
+
"api_key": "",
|
54
|
+
},
|
55
|
+
{
|
56
|
+
"id": "lingyiwanwu-default",
|
57
|
+
"api_base": "https://api.lingyiwanwu.com/v1",
|
58
|
+
"api_key": "",
|
59
|
+
},
|
60
|
+
{
|
61
|
+
"id": "zhipuai-default",
|
62
|
+
"api_base": "https://open.bigmodel.cn/api/paas/v4",
|
63
|
+
"api_key": "",
|
64
|
+
},
|
65
|
+
],
|
66
|
+
"moonshot_models": {
|
67
|
+
"moonshot-custom": {
|
68
|
+
"id": "moonshot-v1-8k",
|
69
|
+
"endpoints": ["moonshot-default"],
|
70
|
+
"function_call_available": True,
|
71
|
+
"response_format_available": True,
|
72
|
+
"context_length": 8000,
|
73
|
+
"max_output_tokens": 4000,
|
74
|
+
},
|
75
|
+
"moonshot-v1-8k": {"endpoints": ["moonshot-default"]},
|
76
|
+
"moonshot-v1-32k": {"endpoints": ["moonshot-default"]},
|
77
|
+
"moonshot-v1-128k": {"endpoints": ["moonshot-default"]},
|
78
|
+
},
|
79
|
+
"openai_models": {
|
80
|
+
"gpt-4o": {
|
81
|
+
"id": "gpt-4o",
|
82
|
+
"endpoints": ["azure-openai"],
|
83
|
+
},
|
84
|
+
"gpt-4": {
|
85
|
+
"id": "gpt-4",
|
86
|
+
"endpoints": ["azure-openai"],
|
87
|
+
},
|
88
|
+
"gpt-35-turbo": {
|
89
|
+
"id": "gpt-35-turbo",
|
90
|
+
"endpoints": ["azure-openai"],
|
91
|
+
},
|
92
|
+
},
|
93
|
+
"anthropic_models": {
|
94
|
+
"claude-3-5-sonnet-20240620": {
|
95
|
+
"id": "claude-3-5-sonnet@20240620",
|
96
|
+
"endpoints": ["vertex-anthropic"],
|
97
|
+
}
|
98
|
+
},
|
99
|
+
"minimax_models": {"abab6.5s-chat": {"id": "abab6.5s-chat", "endpoints": ["minimax-default"]}},
|
100
|
+
"gemini_models": {
|
101
|
+
"gemini-1.5-pro": {"id": "gemini-1.5-pro", "endpoints": ["gemini-default"]},
|
102
|
+
"gemini-1.5-flash": {"id": "gemini-1.5-flash", "endpoints": ["gemini-default"]},
|
103
|
+
},
|
104
|
+
"deepseek_models": {
|
105
|
+
"deepseek-chat": {"id": "deepseek-chat", "endpoints": ["deepseek-default"]},
|
106
|
+
"deepseek-coder": {"id": "deepseek-coder", "endpoints": ["deepseek-default"]},
|
107
|
+
},
|
108
|
+
"groq_models": {
|
109
|
+
"mixtral-8x7b-32768": {"id": "mixtral-8x7b-32768", "endpoints": ["groq-default"]},
|
110
|
+
"llama3-70b-8192": {"id": "llama3-70b-8192", "endpoints": ["groq-default"]},
|
111
|
+
"llama3-8b-8192": {"id": "llama3-8b-8192", "endpoints": ["groq-default"]},
|
112
|
+
"gemma-7b-it": {"id": "gemma-7b-it", "endpoints": ["groq-default"]},
|
113
|
+
},
|
114
|
+
"mistral_models": {
|
115
|
+
"mistral-small-latest": {
|
116
|
+
"id": "mistral-small-latest",
|
117
|
+
"context_length": 30000,
|
118
|
+
"function_call_available": True,
|
119
|
+
"response_format_available": True,
|
120
|
+
"endpoints": ["mistral-default"],
|
121
|
+
},
|
122
|
+
"mistral-medium-latest": {
|
123
|
+
"id": "mistral-medium-latest",
|
124
|
+
"context_length": 30000,
|
125
|
+
"function_call_available": False,
|
126
|
+
"response_format_available": True,
|
127
|
+
"endpoints": ["mistral-default"],
|
128
|
+
},
|
129
|
+
"mistral-large-latest": {
|
130
|
+
"id": "mistral-large-latest",
|
131
|
+
"context_length": 128000,
|
132
|
+
"function_call_available": True,
|
133
|
+
"response_format_available": True,
|
134
|
+
"endpoints": ["mistral-default"],
|
135
|
+
},
|
136
|
+
},
|
137
|
+
"yi_models": {
|
138
|
+
"yi-large": {
|
139
|
+
"id": "yi-large",
|
140
|
+
"endpoints": ["lingyiwanwu-default"],
|
141
|
+
},
|
142
|
+
"yi-large-turbo": {
|
143
|
+
"id": "yi-large-turbo",
|
144
|
+
"endpoints": ["lingyiwanwu-default"],
|
145
|
+
},
|
146
|
+
"yi-large-fc": {
|
147
|
+
"id": "yi-large-fc",
|
148
|
+
"endpoints": ["lingyiwanwu-default"],
|
149
|
+
},
|
150
|
+
"yi-medium": {
|
151
|
+
"id": "yi-medium",
|
152
|
+
"endpoints": ["lingyiwanwu-default"],
|
153
|
+
},
|
154
|
+
"yi-medium-200k": {
|
155
|
+
"id": "yi-medium-200k",
|
156
|
+
"endpoints": ["lingyiwanwu-default"],
|
157
|
+
},
|
158
|
+
"yi-spark": {
|
159
|
+
"id": "yi-spark",
|
160
|
+
"endpoints": ["lingyiwanwu-default"],
|
161
|
+
},
|
162
|
+
"yi-vision": {
|
163
|
+
"id": "yi-vision",
|
164
|
+
"endpoints": ["lingyiwanwu-default"],
|
165
|
+
},
|
166
|
+
},
|
167
|
+
"zhipuai_models": {
|
168
|
+
"glm-3-turbo": {
|
169
|
+
"id": "glm-3-turbo",
|
170
|
+
"endpoints": ["zhipuai-default"],
|
171
|
+
},
|
172
|
+
"glm-4": {
|
173
|
+
"id": "glm-4",
|
174
|
+
"endpoints": ["zhipuai-default"],
|
175
|
+
},
|
176
|
+
"glm-4-0520": {
|
177
|
+
"id": "glm-4-0520",
|
178
|
+
"endpoints": ["zhipuai-default"],
|
179
|
+
},
|
180
|
+
"glm-4-air": {
|
181
|
+
"id": "glm-4-air",
|
182
|
+
"endpoints": ["zhipuai-default"],
|
183
|
+
},
|
184
|
+
"glm-4-airx": {
|
185
|
+
"id": "glm-4-airx",
|
186
|
+
"endpoints": ["zhipuai-default"],
|
187
|
+
},
|
188
|
+
"glm-4-flash": {
|
189
|
+
"id": "glm-4-flash",
|
190
|
+
"endpoints": ["zhipuai-default"],
|
191
|
+
},
|
192
|
+
"glm-4v": {
|
193
|
+
"id": "glm-4v",
|
194
|
+
"endpoints": ["zhipuai-default"],
|
195
|
+
},
|
196
|
+
},
|
197
|
+
}
|
198
|
+
|
199
|
+
sample_settings = {
|
200
|
+
"endpoints": [
|
201
|
+
{
|
202
|
+
"id": "moonshot-default",
|
203
|
+
"api_base": "https://api.moonshot.cn/v1",
|
204
|
+
"api_key": "Y2xwbG9jNTB0YzEwYmc0MHRrNmc6bXNrLXN6OFBZZ2NicEZCZ2hUMlRJU2NQeVNTd1FEeVI=",
|
205
|
+
"rpm": 30,
|
206
|
+
"tpm": 3000000,
|
207
|
+
"concurrent_requests": 30,
|
208
|
+
},
|
209
|
+
{
|
210
|
+
"id": "azure-openai-vectorvein-east-us",
|
211
|
+
"region": "East US",
|
212
|
+
"api_base": "https://vectorvein-east-us.openai.azure.com/",
|
213
|
+
"endpoint_name": "vectorvein-east-us",
|
214
|
+
"api_key": "57f4af89bb744d44be407aaea3ee2a88",
|
215
|
+
"rpm": 900,
|
216
|
+
"tpm": 150000,
|
217
|
+
"is_azure": True,
|
218
|
+
},
|
219
|
+
{
|
220
|
+
"id": "azure-openai-vectorvein-noth-central-us",
|
221
|
+
"region": "North Central US",
|
222
|
+
"api_base": "https://vectorvein-north-central-us.openai.azure.com/",
|
223
|
+
"endpoint_name": "vectorvein-north-central-us",
|
224
|
+
"api_key": "e260ed4195dc415bafad14e9463a82a5",
|
225
|
+
"rpm": 900,
|
226
|
+
"tpm": 150000,
|
227
|
+
"is_azure": True,
|
228
|
+
},
|
229
|
+
{
|
230
|
+
"id": "azure-openai-vectorvein-west-us",
|
231
|
+
"region": "West US",
|
232
|
+
"api_base": "https://vectorvein-west-us.openai.azure.com/",
|
233
|
+
"endpoint_name": "vectorvein-west-us",
|
234
|
+
"api_key": "5934e58d0637456ab644960fe5506ca8",
|
235
|
+
"rpm": 900,
|
236
|
+
"tpm": 150000,
|
237
|
+
"is_azure": True,
|
238
|
+
},
|
239
|
+
{
|
240
|
+
"id": "azure-openai-vectorvein-east-us-2",
|
241
|
+
"region": "East US 2",
|
242
|
+
"api_base": "https://vectorvein-east-us-2.openai.azure.com/",
|
243
|
+
"endpoint_name": "vectorvein-east-us-2",
|
244
|
+
"api_key": "363e5d12b3824090b66115a7d4214c89",
|
245
|
+
"rpm": 900,
|
246
|
+
"tpm": 150000,
|
247
|
+
"is_azure": True,
|
248
|
+
},
|
249
|
+
{
|
250
|
+
"id": "azure-openai-vectorvein-au-east",
|
251
|
+
"region": "Australia East",
|
252
|
+
"api_base": "https://vectorvein-au-east.openai.azure.com",
|
253
|
+
"endpoint_name": "vectorvein-au-east",
|
254
|
+
"api_key": "726c05228236484a91496be6e1c704eb",
|
255
|
+
"rpm": 480,
|
256
|
+
"tpm": 80000,
|
257
|
+
"is_azure": True,
|
258
|
+
},
|
259
|
+
{
|
260
|
+
"id": "vertex-anthropic-vectorvein",
|
261
|
+
"region": "europe-west1",
|
262
|
+
"api_base": "https://googleapis-subdomain.pages.dev/",
|
263
|
+
"credentials": {
|
264
|
+
"account": "",
|
265
|
+
"token_uri": "https://vectorvein-oauth2-googleapis.pages.dev/token",
|
266
|
+
"client_id": "764086051850-6qr4p6gpi6hn506pt8ejuq83di341hur.apps.googleusercontent.com",
|
267
|
+
"client_secret": "d-FL95Q19q7MQmFpd7hHD0Ty",
|
268
|
+
"quota_project_id": "claude-420106",
|
269
|
+
"refresh_token": "1//0g7B8-kg6qgXyCgYIARAAGBASNwF-L9Irnn4WxFpE9__nMKcF4AbyIOi84ZXBMcsG48w99rw1vywbEUI9L6z2YQiyt3KOySnexTo",
|
270
|
+
"type": "authorized_user",
|
271
|
+
"universe_domain": "googleapis.com",
|
272
|
+
},
|
273
|
+
"is_vertex": True,
|
274
|
+
},
|
275
|
+
{
|
276
|
+
"id": "minimax-default",
|
277
|
+
"api_base": "https://api.minimax.chat/v1/text/chatcompletion_v2",
|
278
|
+
"api_key": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJOYW1lIjoidmVjdG9ydmVpbiIsIlN1YmplY3RJRCI6IjE2ODczMzQ1NTQ4NzMxNjkiLCJQaG9uZSI6Ik1UVXlNVEExT1RBNE16ST0iLCJHcm91cElEIjoiMTY4NzMzNDU1NDQxOTE4NyIsIlBhZ2VOYW1lIjoiIiwiTWFpbCI6ImJpeWluZ0B0aW5ndGFsa3MuY29tIiwiQ3JlYXRlVGltZSI6IjIwMjMtMDYtMjEgMTY6MjI6MDkiLCJpc3MiOiJtaW5pbWF4In0.jeptv5f2GSB6UrYZF-DBS9t0F4-is2d4Z3wqe2iA-cWto3VNholf1xCWOU61uNkzbvNEX7QhhGvyed_u7W6Z94t5XdIDIZpVnhmKS2El0FGDoaC63XF5dTtXgrFg5R3hUxMqbC6af8V-FR-AdIvhtW_vQmlNNO2NCSyCTpR1hSnETAdq1JErV7mjwEhi0QJevm_LVXcWJ0-2By3eIvc4cP0oZ2XDXBTtNj1kMC72W7HfqcNbXpcWsOgVOldOhTV2Yag_77dWaPlFwvz3b8ySK6CrNyhNgk2OFmj556R4VT7AlDL5IkTPz2iRsvB6x8sAzOxspZbUfAY8c5Hn13Hh-Q",
|
279
|
+
},
|
280
|
+
{
|
281
|
+
"id": "gemini-default",
|
282
|
+
"api_base": "https://vectorvein-gemini.pages.dev/v1beta",
|
283
|
+
"api_key": "AIzaSyAmMpIYtRsQqulOVJvfQ0ctKMSMXAdY5xw",
|
284
|
+
},
|
285
|
+
{
|
286
|
+
"id": "deepseek-default",
|
287
|
+
"api_base": "https://api.deepseek.com/v1",
|
288
|
+
"api_key": "sk-6dad42e7154743cd80b77dff5d0ecaaa",
|
289
|
+
},
|
290
|
+
{
|
291
|
+
"id": "groq-default",
|
292
|
+
"api_base": "https://vectorvein-groq.pages.dev/openai/v1",
|
293
|
+
"api_key": "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",
|
294
|
+
},
|
295
|
+
{
|
296
|
+
"id": "mistral-default",
|
297
|
+
"api_base": "https://api.mistral.ai/v1",
|
298
|
+
"api_key": "7fIGcygGYHjiEyCiijWgB3CNWvepOFjb",
|
299
|
+
},
|
300
|
+
{
|
301
|
+
"id": "together-default",
|
302
|
+
"api_base": "https://api.together.xyz/v1",
|
303
|
+
"api_key": "bb028183093cd22c9c9e7aa108b43a1eeb103e1954e3be8c06665756ca0d76cc",
|
304
|
+
},
|
305
|
+
{
|
306
|
+
"id": "lingyiwanwu-default",
|
307
|
+
"api_base": "https://api.lingyiwanwu.com/v1",
|
308
|
+
"api_key": "15eb1320966748518702ee7167f87429",
|
309
|
+
},
|
310
|
+
{
|
311
|
+
"id": "zhipuai-default",
|
312
|
+
"api_base": "https://open.bigmodel.cn/api/paas/v4",
|
313
|
+
"api_key": "6bc7b05100ca83d062d4af2dd0331e7a.u2U0kz1Ip2MilIDQ",
|
314
|
+
},
|
315
|
+
],
|
316
|
+
"moonshot_models": {
|
317
|
+
"moonshot-custom": {
|
318
|
+
"id": "moonshot-v1-8k",
|
319
|
+
"endpoints": ["moonshot-default"],
|
320
|
+
"function_call_available": True,
|
321
|
+
"response_format_available": True,
|
322
|
+
"context_length": 8000,
|
323
|
+
"max_output_tokens": 4000,
|
324
|
+
},
|
325
|
+
"moonshot-v1-8k": {"endpoints": ["moonshot-default"]},
|
326
|
+
"moonshot-v1-32k": {"endpoints": ["moonshot-default"]},
|
327
|
+
"moonshot-v1-128k": {"endpoints": ["moonshot-default"]},
|
328
|
+
},
|
329
|
+
"openai_models": {
|
330
|
+
"gpt-4o": {
|
331
|
+
"id": "gpt-4o",
|
332
|
+
"endpoints": [
|
333
|
+
"azure-openai-vectorvein-east-us",
|
334
|
+
"azure-openai-vectorvein-noth-central-us",
|
335
|
+
"azure-openai-vectorvein-west-us",
|
336
|
+
"azure-openai-vectorvein-east-us-2",
|
337
|
+
],
|
338
|
+
},
|
339
|
+
"gpt-4": {
|
340
|
+
"id": "gpt-4",
|
341
|
+
"endpoints": [
|
342
|
+
"azure-openai-vectorvein-east-us",
|
343
|
+
"azure-openai-vectorvein-east-us-2",
|
344
|
+
"azure-openai-vectorvein-au-east",
|
345
|
+
],
|
346
|
+
},
|
347
|
+
"gpt-35-turbo": {
|
348
|
+
"id": "gpt-35-turbo",
|
349
|
+
"endpoints": [
|
350
|
+
"azure-openai-vectorvein-east-us",
|
351
|
+
"azure-openai-vectorvein-east-us-2",
|
352
|
+
"azure-openai-vectorvein-au-east",
|
353
|
+
],
|
354
|
+
},
|
355
|
+
},
|
356
|
+
"anthropic_models": {
|
357
|
+
"claude-3-5-sonnet-20240620": {
|
358
|
+
"id": "claude-3-5-sonnet@20240620",
|
359
|
+
"endpoints": ["vertex-anthropic-vectorvein"],
|
360
|
+
}
|
361
|
+
},
|
362
|
+
"minimax_models": {"abab6.5s-chat": {"id": "abab6.5s-chat", "endpoints": ["minimax-default"]}},
|
363
|
+
"gemini_models": {
|
364
|
+
"gemini-1.5-pro": {"id": "gemini-1.5-pro", "endpoints": ["gemini-default"]},
|
365
|
+
"gemini-1.5-flash": {"id": "gemini-1.5-flash", "endpoints": ["gemini-default"]},
|
366
|
+
},
|
367
|
+
"deepseek_models": {
|
368
|
+
"deepseek-chat": {"id": "deepseek-chat", "endpoints": ["deepseek-default"]},
|
369
|
+
"deepseek-coder": {"id": "deepseek-coder", "endpoints": ["deepseek-default"]},
|
370
|
+
},
|
371
|
+
"groq_models": {
|
372
|
+
"mixtral-8x7b-32768": {"id": "mixtral-8x7b-32768", "endpoints": ["groq-default"]},
|
373
|
+
"llama3-70b-8192": {"id": "llama3-70b-8192", "endpoints": ["groq-default"]},
|
374
|
+
"llama3-8b-8192": {"id": "llama3-8b-8192", "endpoints": ["groq-default"]},
|
375
|
+
"gemma-7b-it": {"id": "gemma-7b-it", "endpoints": ["groq-default"]},
|
376
|
+
},
|
377
|
+
"mistral_models": {
|
378
|
+
"mixtral-8x7b": {
|
379
|
+
"id": "mistralai/Mixtral-8x7B-Instruct-v0.1",
|
380
|
+
"context_length": 32000,
|
381
|
+
"function_call_available": False,
|
382
|
+
"response_format_available": True,
|
383
|
+
"endpoints": ["together-default"],
|
384
|
+
},
|
385
|
+
"mistral-small": {
|
386
|
+
"id": "mistral-small-latest",
|
387
|
+
"context_length": 30000,
|
388
|
+
"function_call_available": True,
|
389
|
+
"response_format_available": True,
|
390
|
+
"endpoints": ["mistral-default"],
|
391
|
+
},
|
392
|
+
"mistral-medium": {
|
393
|
+
"id": "mistral-medium-latest",
|
394
|
+
"context_length": 30000,
|
395
|
+
"function_call_available": False,
|
396
|
+
"response_format_available": True,
|
397
|
+
"endpoints": ["mistral-default"],
|
398
|
+
},
|
399
|
+
"mistral-large": {
|
400
|
+
"id": "mistral-large-latest",
|
401
|
+
"context_length": 128000,
|
402
|
+
"function_call_available": True,
|
403
|
+
"response_format_available": True,
|
404
|
+
"endpoints": ["mistral-default"],
|
405
|
+
},
|
406
|
+
},
|
407
|
+
"yi_models": {
|
408
|
+
"yi-large": {
|
409
|
+
"id": "yi-large",
|
410
|
+
"endpoints": ["lingyiwanwu-default"],
|
411
|
+
},
|
412
|
+
"yi-large-turbo": {
|
413
|
+
"id": "yi-large-turbo",
|
414
|
+
"endpoints": ["lingyiwanwu-default"],
|
415
|
+
},
|
416
|
+
"yi-large-fc": {
|
417
|
+
"id": "yi-large-fc",
|
418
|
+
"endpoints": ["lingyiwanwu-default"],
|
419
|
+
},
|
420
|
+
"yi-medium": {
|
421
|
+
"id": "yi-medium",
|
422
|
+
"endpoints": ["lingyiwanwu-default"],
|
423
|
+
},
|
424
|
+
"yi-medium-200k": {
|
425
|
+
"id": "yi-medium-200k",
|
426
|
+
"endpoints": ["lingyiwanwu-default"],
|
427
|
+
},
|
428
|
+
"yi-spark": {
|
429
|
+
"id": "yi-spark",
|
430
|
+
"endpoints": ["lingyiwanwu-default"],
|
431
|
+
},
|
432
|
+
"yi-vision": {
|
433
|
+
"id": "yi-vision",
|
434
|
+
"endpoints": ["lingyiwanwu-default"],
|
435
|
+
},
|
436
|
+
},
|
437
|
+
"zhipuai_models": {
|
438
|
+
"glm-3-turbo": {
|
439
|
+
"id": "glm-3-turbo",
|
440
|
+
"endpoints": ["zhipuai-default"],
|
441
|
+
},
|
442
|
+
"glm-4": {
|
443
|
+
"id": "glm-4",
|
444
|
+
"endpoints": ["zhipuai-default"],
|
445
|
+
},
|
446
|
+
"glm-4-0520": {
|
447
|
+
"id": "glm-4-0520",
|
448
|
+
"endpoints": ["zhipuai-default"],
|
449
|
+
},
|
450
|
+
"glm-4-air": {
|
451
|
+
"id": "glm-4-air",
|
452
|
+
"endpoints": ["zhipuai-default"],
|
453
|
+
},
|
454
|
+
"glm-4-airx": {
|
455
|
+
"id": "glm-4-airx",
|
456
|
+
"endpoints": ["zhipuai-default"],
|
457
|
+
},
|
458
|
+
"glm-4-flash": {
|
459
|
+
"id": "glm-4-flash",
|
460
|
+
"endpoints": ["zhipuai-default"],
|
461
|
+
},
|
462
|
+
"glm-4v": {
|
463
|
+
"id": "glm-4v",
|
464
|
+
"endpoints": ["zhipuai-default"],
|
465
|
+
},
|
466
|
+
},
|
467
|
+
}
|
@@ -183,14 +183,16 @@ backend = BackendType.Gemini
|
|
183
183
|
model = "gemini-1.5-flash"
|
184
184
|
backend = BackendType.OpenAI
|
185
185
|
model = "gpt-35-turbo"
|
186
|
+
backend = BackendType.Yi
|
187
|
+
model = "yi-large-fc"
|
186
188
|
start_time = time.perf_counter()
|
187
189
|
# test_sync(backend=backend, model=model, stream=False, use_tool=False)
|
188
|
-
|
190
|
+
test_sync(backend=backend, model=model, stream=False, use_tool=True)
|
189
191
|
# test_sync(backend=backend, model=model, stream=True, use_tool=False)
|
190
192
|
# test_sync(backend=backend, model=model, stream=True, use_tool=True)
|
191
193
|
# asyncio.run(test_async(backend=backend, model=model, stream=False, use_tool=False))
|
192
194
|
# asyncio.run(test_async(backend=backend, model=model, stream=False, use_tool=True))
|
193
|
-
asyncio.run(test_async(backend=backend, model=model, stream=True, use_tool=False))
|
195
|
+
# asyncio.run(test_async(backend=backend, model=model, stream=True, use_tool=False))
|
194
196
|
# asyncio.run(test_async(backend=backend, model=model, stream=True, use_tool=True))
|
195
197
|
end_time = time.perf_counter()
|
196
198
|
print(f"Stream time elapsed: {end_time - start_time} seconds")
|
@@ -0,0 +1,160 @@
|
|
1
|
+
# @Author: Bi Ying
|
2
|
+
# @Date: 2024-07-27 11:51:28
|
3
|
+
import time
|
4
|
+
import json
|
5
|
+
|
6
|
+
from vectorvein.settings import settings
|
7
|
+
from vectorvein.chat_clients import (
|
8
|
+
BackendType,
|
9
|
+
format_messages,
|
10
|
+
create_chat_client,
|
11
|
+
)
|
12
|
+
|
13
|
+
from sample_settings import sample_settings
|
14
|
+
|
15
|
+
|
16
|
+
settings.load(sample_settings)
|
17
|
+
|
18
|
+
system_prompt = "# 角色\n你是播客制作人,你的主要任务是帮助用户整理各类新闻、报告、文档等信息,将其最终呈现为播客的形式。\n\n# 工作流程\n1. 用户会向你提出了解不同的信息需求(如 Bilibili 视频内容、科技新闻、Arxiv 论文等),你需要根据用户需求决定调用的工作流。\n 1.1 论文检索优先使用工作流【search_arxiv_papers】\n2. 在用户了解某个信息后你需要向用户明确是否要将该信息加入到最终的播客内容里。\n3. 每轮对话完成后都需要向用户提问是否还需要了解更多信息还是可以开始制作播客。\n4. 当用户决定制作播客时,向用户询问最终播客稿件的风格,如严谨、幽默等。\n5. 当用户已经明确稿件风格后先根据要求生成一份文字版的稿件,然后询问用户是否满意,如果用户回复满意则调用工作流【text_to_speech_conversion】进行音频生成。\n\n# 要求\n- 调用工作流时参数名称务必准确不能写错\n- 生成回复时必须始终和用户的语言一致!\n- 如果工作流的运行结果与用户语言不一致,则务必翻译后回复用户。"
|
19
|
+
|
20
|
+
messages = [
|
21
|
+
{
|
22
|
+
"mid": "cea20838433f486dab6f17831b0df084",
|
23
|
+
"author_type": "U",
|
24
|
+
"content_type": "TXT",
|
25
|
+
"status": "S",
|
26
|
+
"create_time": 1722415381031,
|
27
|
+
"update_time": 1722415381031,
|
28
|
+
"metadata": {},
|
29
|
+
"content": {"text": "Arxiv 上关于 AI Agent的论文总结成一个播客"},
|
30
|
+
"attachments": [],
|
31
|
+
},
|
32
|
+
{
|
33
|
+
"mid": "1749e50508ed483d9d8f5ef17ecd4fa8",
|
34
|
+
"author_type": "A",
|
35
|
+
"content_type": "WKF",
|
36
|
+
"status": "S",
|
37
|
+
"create_time": 1722415381031,
|
38
|
+
"update_time": 1722415398031,
|
39
|
+
"metadata": {
|
40
|
+
"record_id": "2c92432544114dc4ab218dd3709a0585",
|
41
|
+
"workflow_result": "[{'Title': 'A Tutorial on the Use of Physics-Informed Neural Networks to Compute the Spectrum of Quantum Systems', 'arXiv Link': 'https://arxiv.org/abs/2407.20669', 'arXiv ID': 'arXiv:2407.20669[pdf,other]', 'Abstract': 'Quantum many-body systems are of great interest for many research areas, including physics, biology and chemistry. However, their simulation is extremely challenging, due to the exponential growth of the Hilbert space with the system size, making it exceedingly difficult to parameterize the wave functions of large systems by using exact methods. Neural networks and machine learning in general are a way to face this challenge. For instance, methods like Tensor networks and Neural Quantum States are being investigated as promising tools to obtain the wave function of a quantum mechanical system. In this tutorial, we focus on a particularly promising class of deep learning algorithms. We explain how to construct a Physics-Informed Neural Network (PINN) able to solve the Schrödinger equation for a given potential, by finding its eigenvalues and eigenfunctions. This technique is unsupervised, and utilizes a novel computational method in a manner that is barely explored. PINNs are a deep learning method that exploits Automatic Differentiation to solve Integro-Differential Equations in a mesh-free way. We show how to find both the ground and the excited states. The method discovers the states progressively by starting from the ground state. We explain how to introduce inductive biases in the loss to exploit further knowledge of the physical system. Such additional constraints allow for a faster and more accurate convergence. This technique can then be enhanced by a smart choice of collocation points in order to take advantage of the mesh-free nature of the PINN. The methods are made explicit by applying them to the infinite potential well and the particle in a ring, a challenging problem to be learned by anAIagentdue to the presence of complex-valued eigenfunctions and degenerate states.△ Less'}, {'Title': 'Domain Adaptable PrescriptiveAIAgentfor Enterprise', 'arXiv Link': 'https://arxiv.org/abs/2407.20447', 'arXiv ID': 'arXiv:2407.20447[pdf,other]', 'Abstract': 'Despite advancements in causal inference and prescriptiveAI, its adoption in enterprise settings remains hindered primarily due to its technical complexity. Many users lack the necessary knowledge and appropriate tools to effectively leverage these technologies. This work at the MIT-IBM WatsonAILab focuses on developing the proof-of-conceptagent, PrecAIse, a domain-adaptable conversationalagentequipped with a suite of causal and prescriptive tools to help enterprise users make better business decisions. The objective is to make advanced, novel causal inference and prescriptive tools widely accessible through natural language interactions. The presented Natural Language User Interface (NLUI) enables users with limited expertise in machine learning and data science to harness prescriptive analytics in their decision-making processes without requiring intensive computing resources. We present anagentcapable of function calling, maintaining faithful, interactive, and dynamic conversations, and supporting new domains.△ Less'}, {'Title': 'Appraisal-Guided Proximal Policy Optimization: Modeling Psychological Disorders in Dynamic Grid World', 'arXiv Link': 'https://arxiv.org/abs/2407.20383', 'arXiv ID': 'arXiv:2407.20383[pdf]', 'Abstract': \"The integration of artificial intelligence across multiple domains has emphasized the importance of replicating human-like cognitive processes inAI. By incorporating emotional intelligence intoAIagents, their emotional stability can be evaluated to enhance their resilience and dependability in critical decision-making tasks. In this work, we develop a methodology for modeling psychological disorders using Reinforcement Learning (RL)agents. We utilized Appraisal theory to train RLagentsin a dynamic grid world environment with an Appraisal-Guided Proximal Policy Optimization (AG-PPO) algorithm. Additionally, we investigated numerous reward-shaping strategies to simulate psychological disorders and regulate the behavior of theagents. A comparison of various configurations of the modified PPO algorithm identified variants that simulate Anxiety disorder and Obsessive-Compulsive Disorder (OCD)-like behavior inagents. Furthermore, we compared standard PPO with AG-PPO and its configurations, highlighting the performance improvement in terms of generalization capabilities. Finally, we conducted an analysis of theagents' behavioral patterns in complex test environments to evaluate the associated symptoms corresponding to the psychological disorders. Overall, our work showcases the benefits of the appraisal-guided PPO algorithm over the standard PPO algorithm and the potential to simulate psychological disorders in a controlled artificial environment and evaluate them on RLagents.△ Less\"}, {'Title': 'MindSearch: Mimicking Human Minds Elicits DeepAISearcher', 'arXiv Link': 'https://arxiv.org/abs/2407.20183', 'arXiv ID': 'arXiv:2407.20183[pdf,other]', 'Abstract': 'Information seeking and integration is a complex cognitive task that consumes enormous time and effort. Inspired by the remarkable progress of Large Language Models, recent works attempt to solve this task by combining LLMs and search engines. However, these methods still obtain unsatisfying performance due to three challenges: (1) complex requests often cannot be accurately and completely retrieved by the search engine once (2) corresponding information to be integrated is spread over multiple web pages along with massive noise, and (3) a large number of web pages with long contents may quickly exceed the maximum context length of LLMs. Inspired by the cognitive process when humans solve these problems, we introduce MindSearch to mimic the human minds in web information seeking and integration, which can be instantiated by a simple yet effective LLM-based multi-agentframework. The WebPlanner models the human mind of multi-step information seeking as a dynamic graph construction process: it decomposes the user query into atomic sub-questions as nodes in the graph and progressively extends the graph based on the search result from WebSearcher. Tasked with each sub-question, WebSearcher performs hierarchical information retrieval with search engines and collects valuable information for WebPlanner. The multi-agentdesign of MindSearch enables the whole framework to seek and integrate information parallelly from larger-scale (e.g., more than 300) web pages in 3 minutes, which is worth 3 hours of human effort. MindSearch demonstrates significant improvement in the response quality in terms of depth and breadth, on both close-set and open-set QA problems. Besides, responses from MindSearch based on InternLM2.5-7B are preferable by humans to ChatGPT-Web and Perplexity.ai applications, which implies that MindSearch can already deliver a competitive solution to the proprietaryAIsearch engine.△ Less'}, {'Title': 'Quantum Machine Learning Architecture Search via Deep Reinforcement Learning', 'arXiv Link': 'https://arxiv.org/abs/2407.20147', 'arXiv ID': 'arXiv:2407.20147[pdf,other]', 'Abstract': \"The rapid advancement of quantum computing (QC) and machine learning (ML) has given rise to the burgeoning field of quantum machine learning (QML), aiming to capitalize on the strengths of quantum computing to propel ML forward. Despite its promise, crafting effective QML models necessitates profound expertise to strike a delicate balance between model intricacy and feasibility on Noisy Intermediate-Scale Quantum (NISQ) devices. While complex models offer robust representation capabilities, their extensive circuit depth may impede seamless execution on extant noisy quantum platforms. In this paper, we address this quandary of QML model design by employing deep reinforcement learning to explore proficient QML model architectures tailored for designated supervised learning tasks. Specifically, our methodology involves training an RLagentto devise policies that facilitate the discovery of QML models without predetermined ansatz. Furthermore, we integrate an adaptive mechanism to dynamically adjust the learning objectives, fostering continuous improvement in theagent'slearning process. Through extensive numerical simulations, we illustrate the efficacy of our approach within the realm of classification tasks. Our proposed method successfully identifies VQC architectures capable of achieving high classification accuracy while minimizing gate depth. This pioneering approach not only advances the study ofAI-driven quantum circuit design but also holds significant promise for enhancing performance in the NISQ era.△ Less\"}]",
|
42
|
+
"selected_workflow": {
|
43
|
+
"tid": "3b0ba398b5de4439b8a22fda7d0d35b4",
|
44
|
+
"type": "WorkflowTemplate",
|
45
|
+
"brief": '输入搜索关键词和数量,返回在 Arxiv 上检索到的论文基本信息。\n返回一个列表,列表里每个元素结构如下:\n```json\n{\n "Title": "",\n "arXiv Link": "",\n "arXiv ID": "",\n "Abstract": "",\n}\n```',
|
46
|
+
"title": "搜索 Arxiv 论文",
|
47
|
+
"params": {"count": 5, "search_text": "AI Agent"},
|
48
|
+
"tool_call_id": "call_bF6aM6ChQ1-irt2DLY5Idw",
|
49
|
+
"function_name": "search_arxiv_papers",
|
50
|
+
},
|
51
|
+
},
|
52
|
+
"content": {"text": ""},
|
53
|
+
"attachments": [],
|
54
|
+
},
|
55
|
+
{
|
56
|
+
"mid": "fe89a143be9e482587e36ca309e25794",
|
57
|
+
"author_type": "A",
|
58
|
+
"content_type": "TXT",
|
59
|
+
"status": "S",
|
60
|
+
"create_time": 1722415401031,
|
61
|
+
"update_time": 1722415404031,
|
62
|
+
"metadata": {"selected_workflow": {}},
|
63
|
+
"content": {"text": "好的,我找到了关于AI Agent的一些论文。您希望将哪篇论文的内容加入到最终的播客中呢?"},
|
64
|
+
"attachments": [],
|
65
|
+
},
|
66
|
+
{
|
67
|
+
"mid": "c223b530a53b4ef68662afb69018a59b",
|
68
|
+
"author_type": "U",
|
69
|
+
"content_type": "TXT",
|
70
|
+
"status": "S",
|
71
|
+
"create_time": 1722415560031,
|
72
|
+
"update_time": 1722415560031,
|
73
|
+
"metadata": {},
|
74
|
+
"content": {"text": "都加入到播客里吧,然后画一个播客封面图吧我看看"},
|
75
|
+
"attachments": [],
|
76
|
+
},
|
77
|
+
]
|
78
|
+
|
79
|
+
|
80
|
+
tools = [
|
81
|
+
{
|
82
|
+
"type": "function",
|
83
|
+
"function": {
|
84
|
+
"name": "read_web_content",
|
85
|
+
"description": "给定网址,输出这个网址的网页正文内容",
|
86
|
+
"parameters": {
|
87
|
+
"type": "object",
|
88
|
+
"required": ["url"],
|
89
|
+
"properties": {"url": {"type": "string"}, "use_oversea_crawler": {"type": "boolean"}},
|
90
|
+
},
|
91
|
+
},
|
92
|
+
},
|
93
|
+
{
|
94
|
+
"type": "function",
|
95
|
+
"function": {
|
96
|
+
"name": "fetch_latest_tech_news",
|
97
|
+
"description": "输入要抓取的科技新闻要求,输出相关的科技新闻标题、链接、总结等信息。",
|
98
|
+
"parameters": {
|
99
|
+
"type": "object",
|
100
|
+
"required": ["user_requirements"],
|
101
|
+
"properties": {"user_requirements": {"type": "string", "description": "检索新闻的要求"}},
|
102
|
+
},
|
103
|
+
},
|
104
|
+
},
|
105
|
+
{
|
106
|
+
"type": "function",
|
107
|
+
"function": {
|
108
|
+
"name": "search_arxiv_papers",
|
109
|
+
"description": '输入搜索关键词和数量,返回在 Arxiv 上检索到的论文基本信息。\n返回一个列表,列表里每个元素结构如下:\n```json\n{\n "Title": "",\n "arXiv Link": "",\n "arXiv ID": "",\n "Abstract": "",\n}\n```\n参数1:count\n参数2:search_text',
|
110
|
+
"parameters": {
|
111
|
+
"type": "object",
|
112
|
+
"required": ["search_text"],
|
113
|
+
"properties": {"count": {"type": "integer"}, "search_text": {"type": "string"}},
|
114
|
+
},
|
115
|
+
},
|
116
|
+
},
|
117
|
+
{
|
118
|
+
"type": "function",
|
119
|
+
"function": {
|
120
|
+
"name": "dall_e_image_generation",
|
121
|
+
"description": "输入一段文字,Dall-E 根据文字内容生成一张图片。",
|
122
|
+
"parameters": {
|
123
|
+
"type": "object",
|
124
|
+
"required": ["prompt"],
|
125
|
+
"properties": {"prompt": {"type": "string", "description": "简洁的画面描述词组、语句"}},
|
126
|
+
},
|
127
|
+
},
|
128
|
+
},
|
129
|
+
{
|
130
|
+
"type": "function",
|
131
|
+
"function": {
|
132
|
+
"name": "text_to_speech_conversion",
|
133
|
+
"description": "输入文字,生成合成的音频。",
|
134
|
+
"parameters": {"type": "object", "required": ["text"], "properties": {"text": {"type": "string"}}},
|
135
|
+
},
|
136
|
+
},
|
137
|
+
]
|
138
|
+
|
139
|
+
|
140
|
+
backend = BackendType.Moonshot
|
141
|
+
model = "moonshot-v1-8k"
|
142
|
+
backend = BackendType.OpenAI
|
143
|
+
model = "gpt-4o"
|
144
|
+
backend = BackendType.Anthropic
|
145
|
+
model = "claude-3-5-sonnet-20240620"
|
146
|
+
backend = BackendType.MiniMax
|
147
|
+
model = "abab6.5s-chat"
|
148
|
+
backend = BackendType.Gemini
|
149
|
+
model = "gemini-1.5-flash"
|
150
|
+
backend = BackendType.OpenAI
|
151
|
+
model = "gpt-35-turbo"
|
152
|
+
backend = BackendType.Yi
|
153
|
+
model = "yi-large-fc"
|
154
|
+
start_time = time.perf_counter()
|
155
|
+
|
156
|
+
client = create_chat_client(backend=backend, model=model, stream=False)
|
157
|
+
response = client.create_completion(messages=format_messages(messages, backend=backend), tools=tools)
|
158
|
+
print(response)
|
159
|
+
end_time = time.perf_counter()
|
160
|
+
print(f"Stream time elapsed: {end_time - start_time} seconds")
|
@@ -1,88 +0,0 @@
|
|
1
|
-
# @Author: Bi Ying
|
2
|
-
# @Date: 2024-07-27 18:26:05
|
3
|
-
sample_settings = {
|
4
|
-
"endpoints": [
|
5
|
-
{
|
6
|
-
"id": "moonshot-default",
|
7
|
-
"api_base": "https://api.moonshot.cn/v1",
|
8
|
-
"api_key": "",
|
9
|
-
"rpm": 30,
|
10
|
-
"tpm": 3000000,
|
11
|
-
"concurrent_requests": 30,
|
12
|
-
},
|
13
|
-
{
|
14
|
-
"id": "azure-openai",
|
15
|
-
"region": "East US",
|
16
|
-
"api_base": "",
|
17
|
-
"endpoint_name": "",
|
18
|
-
"api_key": "",
|
19
|
-
"rpm": 900,
|
20
|
-
"tpm": 150000,
|
21
|
-
"is_azure": True,
|
22
|
-
},
|
23
|
-
{
|
24
|
-
"id": "vertex-anthropic",
|
25
|
-
"region": "europe-west1",
|
26
|
-
"api_base": "",
|
27
|
-
"credentials": {},
|
28
|
-
"is_vertex": True,
|
29
|
-
},
|
30
|
-
{
|
31
|
-
"id": "minimax-default",
|
32
|
-
"api_base": "https://api.minimax.chat/v1/text/chatcompletion_v2",
|
33
|
-
"api_key": "",
|
34
|
-
},
|
35
|
-
{
|
36
|
-
"id": "gemini-default",
|
37
|
-
"api_base": "",
|
38
|
-
"api_key": "",
|
39
|
-
},
|
40
|
-
],
|
41
|
-
"moonshot_models": {
|
42
|
-
"moonshot-custom": {
|
43
|
-
"id": "moonshot-v1-8k",
|
44
|
-
"endpoints": ["moonshot-default"],
|
45
|
-
"function_call_available": True,
|
46
|
-
"response_format_available": True,
|
47
|
-
"context_length": 8000,
|
48
|
-
"max_output_tokens": 4000,
|
49
|
-
},
|
50
|
-
"moonshot-v1-8k": {
|
51
|
-
"endpoints": ["moonshot-default"],
|
52
|
-
},
|
53
|
-
"moonshot-v1-32k": {
|
54
|
-
"endpoints": ["moonshot-default"],
|
55
|
-
},
|
56
|
-
"moonshot-v1-128k": {
|
57
|
-
"endpoints": ["moonshot-default"],
|
58
|
-
},
|
59
|
-
},
|
60
|
-
"openai_models": {
|
61
|
-
"gpt-4o": {
|
62
|
-
"id": "gpt-4o",
|
63
|
-
"endpoints": ["azure-openai"],
|
64
|
-
}
|
65
|
-
},
|
66
|
-
"anthropic_models": {
|
67
|
-
"claude-3-5-sonnet-20240620": {
|
68
|
-
"id": "claude-3-5-sonnet@20240620",
|
69
|
-
"endpoints": ["vertex-anthropic"],
|
70
|
-
}
|
71
|
-
},
|
72
|
-
"minimax_models": {
|
73
|
-
"abab6.5s-chat": {
|
74
|
-
"id": "abab6.5s-chat",
|
75
|
-
"endpoints": ["minimax-default"],
|
76
|
-
}
|
77
|
-
},
|
78
|
-
"gemini_models": {
|
79
|
-
"gemini-1.5-pro": {
|
80
|
-
"id": "gemini-1.5-pro",
|
81
|
-
"endpoints": ["gemini-default"],
|
82
|
-
},
|
83
|
-
"gemini-1.5-flash": {
|
84
|
-
"id": "gemini-1.5-flash",
|
85
|
-
"endpoints": ["gemini-default"],
|
86
|
-
},
|
87
|
-
},
|
88
|
-
}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{vectorvein-0.1.2 → vectorvein-0.1.3}/src/vectorvein/chat_clients/openai_compatible_client.py
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|