vectorvein 0.1.70__py3-none-any.whl → 0.1.71__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/utils.py +28 -1
- vectorvein/types/defaults.py +18 -9
- {vectorvein-0.1.70.dist-info → vectorvein-0.1.71.dist-info}/METADATA +1 -1
- {vectorvein-0.1.70.dist-info → vectorvein-0.1.71.dist-info}/RECORD +6 -6
- {vectorvein-0.1.70.dist-info → vectorvein-0.1.71.dist-info}/WHEEL +0 -0
- {vectorvein-0.1.70.dist-info → vectorvein-0.1.71.dist-info}/entry_points.txt +0 -0
vectorvein/chat_clients/utils.py
CHANGED
@@ -173,7 +173,7 @@ def get_token_counts(text: str | dict, model: str = "", use_token_server_first:
|
|
173
173
|
return 1000
|
174
174
|
result = response.json()
|
175
175
|
return result["segments_num"]
|
176
|
-
elif model
|
176
|
+
elif model.startswith("moonshot"):
|
177
177
|
model_setting = settings.moonshot.models[model]
|
178
178
|
if len(model_setting.endpoints) == 0:
|
179
179
|
return len(get_gpt_35_encoding().encode(text))
|
@@ -294,6 +294,33 @@ def get_token_counts(text: str | dict, model: str = "", use_token_server_first:
|
|
294
294
|
return 1000
|
295
295
|
result = response.json()
|
296
296
|
return result["data"]["total_tokens"]
|
297
|
+
elif model.startswith("glm"):
|
298
|
+
model_setting = settings.zhipuai.models[model]
|
299
|
+
if len(model_setting.endpoints) == 0:
|
300
|
+
return len(get_gpt_35_encoding().encode(text))
|
301
|
+
endpoint_id = model_setting.endpoints[0]
|
302
|
+
if isinstance(endpoint_id, dict):
|
303
|
+
endpoint_id = endpoint_id["endpoint_id"]
|
304
|
+
endpoint = settings.get_endpoint(endpoint_id)
|
305
|
+
tokenize_url = f"{endpoint.api_base}/tokenizer"
|
306
|
+
headers = {"Content-Type": "application/json", "Authorization": f"Bearer {endpoint.api_key}"}
|
307
|
+
request_body = {
|
308
|
+
"model": model,
|
309
|
+
"messages": [
|
310
|
+
{"role": "user", "content": text},
|
311
|
+
],
|
312
|
+
}
|
313
|
+
_, response = (
|
314
|
+
Retry(httpx.post)
|
315
|
+
.args(url=tokenize_url, headers=headers, json=request_body, timeout=None)
|
316
|
+
.retry_times(5)
|
317
|
+
.sleep_time(10)
|
318
|
+
.run()
|
319
|
+
)
|
320
|
+
if response is None:
|
321
|
+
return 1000
|
322
|
+
result = response.json()
|
323
|
+
return result["usage"]["prompt_tokens"]
|
297
324
|
else:
|
298
325
|
return len(get_gpt_35_encoding().encode(text))
|
299
326
|
|
vectorvein/types/defaults.py
CHANGED
@@ -44,13 +44,6 @@ DEEPSEEK_MODELS: Final[Dict[str, Dict[str, Any]]] = {
|
|
44
44
|
"function_call_available": True,
|
45
45
|
"response_format_available": True,
|
46
46
|
},
|
47
|
-
"deepseek-coder": {
|
48
|
-
"id": "deepseek-chat",
|
49
|
-
"context_length": 128000,
|
50
|
-
"max_output_tokens": 4096,
|
51
|
-
"function_call_available": True,
|
52
|
-
"response_format_available": True,
|
53
|
-
},
|
54
47
|
}
|
55
48
|
DEEPSEEK_DEFAULT_MODEL: Final[str] = "deepseek-chat"
|
56
49
|
|
@@ -427,6 +420,22 @@ ZHIPUAI_MODELS: Final[Dict[str, Dict[str, Any]]] = {
|
|
427
420
|
"max_output_tokens": 1024,
|
428
421
|
"native_multimodal": True,
|
429
422
|
},
|
423
|
+
"glm-4v-flash": {
|
424
|
+
"id": "glm-4v-flash",
|
425
|
+
"context_length": 2000,
|
426
|
+
"function_call_available": False,
|
427
|
+
"response_format_available": False,
|
428
|
+
"max_output_tokens": 1024,
|
429
|
+
"native_multimodal": True,
|
430
|
+
},
|
431
|
+
"glm-zero-preview": {
|
432
|
+
"id": "glm-zero-preview",
|
433
|
+
"context_length": 16000,
|
434
|
+
"function_call_available": False,
|
435
|
+
"response_format_available": False,
|
436
|
+
"max_output_tokens": 16000,
|
437
|
+
"native_multimodal": True,
|
438
|
+
},
|
430
439
|
}
|
431
440
|
|
432
441
|
# Mistral models
|
@@ -669,7 +678,7 @@ GEMINI_MODELS: Final[Dict[str, Dict[str, Any]]] = {
|
|
669
678
|
},
|
670
679
|
"gemini-2.0-flash-thinking-exp-1219": {
|
671
680
|
"id": "gemini-2.0-flash-thinking-exp-1219",
|
672
|
-
"context_length":
|
681
|
+
"context_length": 32767,
|
673
682
|
"max_output_tokens": 8192,
|
674
683
|
"function_call_available": True,
|
675
684
|
"response_format_available": True,
|
@@ -677,7 +686,7 @@ GEMINI_MODELS: Final[Dict[str, Dict[str, Any]]] = {
|
|
677
686
|
},
|
678
687
|
"gemini-exp-1206": {
|
679
688
|
"id": "gemini-exp-1206",
|
680
|
-
"context_length":
|
689
|
+
"context_length": 2097152,
|
681
690
|
"function_call_available": True,
|
682
691
|
"response_format_available": True,
|
683
692
|
"native_multimodal": True,
|
@@ -1,6 +1,6 @@
|
|
1
|
-
vectorvein-0.1.
|
2
|
-
vectorvein-0.1.
|
3
|
-
vectorvein-0.1.
|
1
|
+
vectorvein-0.1.71.dist-info/METADATA,sha256=WluI3Kd-Gmqg3pnaGkaQRdwa6Lsc_riyp7da-vjQ2hk,641
|
2
|
+
vectorvein-0.1.71.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
|
3
|
+
vectorvein-0.1.71.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=Oev7Lv1DIEWCMD-2Pm7e2cwzX7JFQTnIK-j6o4iUuyQ,17725
|
6
6
|
vectorvein/chat_clients/anthropic_client.py,sha256=shRwgpbynExqX8l370_MTT7cGVhD4pE6VdPuf2AbI1E,40017
|
@@ -18,7 +18,7 @@ vectorvein/chat_clients/openai_compatible_client.py,sha256=h4D8dUscDcLshPcou-jWA
|
|
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
|
21
|
-
vectorvein/chat_clients/utils.py,sha256=
|
21
|
+
vectorvein/chat_clients/utils.py,sha256=sRG9habhS4ehmLntMgDCuU90_J63i8fuaBsq2UGBNvI,27918
|
22
22
|
vectorvein/chat_clients/xai_client.py,sha256=eLFJJrNRJ-ni3DpshODcr3S1EJQLbhVwxyO1E54LaqM,491
|
23
23
|
vectorvein/chat_clients/yi_client.py,sha256=RNf4CRuPJfixrwLZ3-DEc3t25QDe1mvZeb9sku2f8Bc,484
|
24
24
|
vectorvein/chat_clients/zhipuai_client.py,sha256=Ys5DSeLCuedaDXr3PfG1EW2zKXopt-awO2IylWSwY0s,519
|
@@ -26,11 +26,11 @@ vectorvein/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
26
26
|
vectorvein/server/token_server.py,sha256=36F9PKSNOX8ZtYBXY_l-76GQTpUSmQ2Y8EMy1H7wtdQ,1353
|
27
27
|
vectorvein/settings/__init__.py,sha256=g01y74x0k2JEAqNpRGG0PDs0NTULjOAZV6HRhydPX1c,3874
|
28
28
|
vectorvein/settings/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
29
|
-
vectorvein/types/defaults.py,sha256=
|
29
|
+
vectorvein/types/defaults.py,sha256=ILyDnOnonvVp7Pc52D2Ph3so19luLQgESEabwMpXJRc,25349
|
30
30
|
vectorvein/types/enums.py,sha256=7KTJSVtQueImmbr1fSwv3rQVtc0RyMWXJmoE2tDOaso,1667
|
31
31
|
vectorvein/types/exception.py,sha256=gnW4GnJ76jND6UGnodk9xmqkcbeS7Cz2rvncA2HpD5E,69
|
32
32
|
vectorvein/types/llm_parameters.py,sha256=g2Q0RKMC2vOcMI0tFpZ53xfVSfC8MLoK0YntPqce49U,5360
|
33
33
|
vectorvein/types/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
34
34
|
vectorvein/utilities/media_processing.py,sha256=CTRq-lGlFkFgP_FSRhNwF_qUgmOrXPf2_1Ok9HY42_g,5887
|
35
35
|
vectorvein/utilities/retry.py,sha256=6KFS9R2HdhqM3_9jkjD4F36ZSpEx2YNFGOVlpOsUetM,2208
|
36
|
-
vectorvein-0.1.
|
36
|
+
vectorvein-0.1.71.dist-info/RECORD,,
|
File without changes
|
File without changes
|