aient 1.0.64__py3-none-any.whl → 1.0.65__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.
- aient/core/test/test_base_api.py +4 -3
- aient/core/utils.py +1 -1
- aient/models/base.py +0 -5
- aient/models/chatgpt.py +3 -3
- {aient-1.0.64.dist-info → aient-1.0.65.dist-info}/METADATA +1 -1
- {aient-1.0.64.dist-info → aient-1.0.65.dist-info}/RECORD +9 -9
- {aient-1.0.64.dist-info → aient-1.0.65.dist-info}/WHEEL +0 -0
- {aient-1.0.64.dist-info → aient-1.0.65.dist-info}/licenses/LICENSE +0 -0
- {aient-1.0.64.dist-info → aient-1.0.65.dist-info}/top_level.txt +0 -0
aient/core/test/test_base_api.py
CHANGED
@@ -1,7 +1,5 @@
|
|
1
1
|
from ..utils import BaseAPI
|
2
2
|
|
3
|
-
import os
|
4
|
-
|
5
3
|
# GOOGLE_AI_API_KEY = os.environ.get('GOOGLE_AI_API_KEY', None)
|
6
4
|
|
7
5
|
# base_api = BaseAPI("https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:streamGenerateContent?key=" + GOOGLE_AI_API_KEY)
|
@@ -9,9 +7,12 @@ import os
|
|
9
7
|
# print(base_api.chat_url)
|
10
8
|
|
11
9
|
base_api = BaseAPI("http://127.0.0.1:8000/v1")
|
12
|
-
|
13
10
|
print(base_api.chat_url)
|
14
11
|
|
12
|
+
base_api = BaseAPI("http://127.0.0.1:8000/v1/images/generations")
|
13
|
+
print(base_api.image_url)
|
14
|
+
|
15
15
|
"""
|
16
16
|
python -m core.test.test_base_api
|
17
|
+
python -m aient.src.aient.core.test.test_base_api
|
17
18
|
"""
|
aient/core/utils.py
CHANGED
@@ -124,6 +124,7 @@ def get_engine(provider, endpoint=None, original_model=""):
|
|
124
124
|
|
125
125
|
return engine, stream
|
126
126
|
|
127
|
+
from httpx_socks import AsyncProxyTransport
|
127
128
|
def get_proxy(proxy, client_config = {}):
|
128
129
|
if proxy:
|
129
130
|
# 解析代理URL
|
@@ -132,7 +133,6 @@ def get_proxy(proxy, client_config = {}):
|
|
132
133
|
|
133
134
|
if scheme == 'socks5':
|
134
135
|
try:
|
135
|
-
from httpx_socks import AsyncProxyTransport
|
136
136
|
proxy = proxy.replace('socks5h://', 'socks5://')
|
137
137
|
transport = AsyncProxyTransport.from_url(proxy)
|
138
138
|
client_config["transport"] = transport
|
aient/models/base.py
CHANGED
@@ -37,11 +37,6 @@ class BaseLLM:
|
|
37
37
|
self.presence_penalty: float = presence_penalty
|
38
38
|
self.frequency_penalty: float = frequency_penalty
|
39
39
|
self.reply_count: int = reply_count
|
40
|
-
self.max_tokens: int = max_tokens or (
|
41
|
-
4096
|
42
|
-
if "gpt-4" or "claude" in engine
|
43
|
-
else 4000
|
44
|
-
)
|
45
40
|
self.truncate_limit: int = truncate_limit or (
|
46
41
|
198000
|
47
42
|
if "claude" in engine
|
aient/models/chatgpt.py
CHANGED
@@ -83,8 +83,6 @@ class chatgpt(BaseLLM):
|
|
83
83
|
# 注册和处理传入的工具
|
84
84
|
self._register_tools(tools)
|
85
85
|
|
86
|
-
if self.tokens_usage["default"] > self.max_tokens:
|
87
|
-
raise Exception("System prompt is too long")
|
88
86
|
|
89
87
|
def _register_tools(self, tools):
|
90
88
|
"""动态注册工具函数并更新配置"""
|
@@ -255,7 +253,6 @@ class chatgpt(BaseLLM):
|
|
255
253
|
{"role": "system","content": self.system_prompt},
|
256
254
|
{"role": role, "content": prompt}
|
257
255
|
],
|
258
|
-
"max_tokens": kwargs.get("max_tokens", self.max_tokens),
|
259
256
|
"stream": True,
|
260
257
|
"stream_options": {
|
261
258
|
"include_usage": True
|
@@ -263,6 +260,9 @@ class chatgpt(BaseLLM):
|
|
263
260
|
"temperature": kwargs.get("temperature", self.temperature)
|
264
261
|
}
|
265
262
|
|
263
|
+
if kwargs.get("max_tokens", self.max_tokens):
|
264
|
+
request_data["max_tokens"] = kwargs.get("max_tokens", self.max_tokens)
|
265
|
+
|
266
266
|
# 添加工具相关信息
|
267
267
|
if kwargs.get("plugins", None):
|
268
268
|
self.plugins = kwargs.get("plugins")
|
@@ -5,14 +5,14 @@ aient/core/log_config.py,sha256=kz2_yJv1p-o3lUQOwA3qh-LSc3wMHv13iCQclw44W9c,274
|
|
5
5
|
aient/core/models.py,sha256=_1wYZg_n9kb2A3C8xCboyqleH2iHc9scwOvtx9DPeok,7582
|
6
6
|
aient/core/request.py,sha256=sXAZwek-JtuCYheuaQiLizBSJRij_xZmTdf0-91N0AE,49986
|
7
7
|
aient/core/response.py,sha256=6Fq-EIL7ua1zeT6GMc1fgQeRs_MCP6UST_pL0tM3f3I,27879
|
8
|
-
aient/core/utils.py,sha256=
|
9
|
-
aient/core/test/test_base_api.py,sha256=
|
8
|
+
aient/core/utils.py,sha256=zhvIvJjyX6B2OJFUY4ONp_VArrozjbiITjpoJ35LrdY,26134
|
9
|
+
aient/core/test/test_base_api.py,sha256=pWnycRJbuPSXKKU9AQjWrMAX1wiLC_014Qc9hh5C2Pw,524
|
10
10
|
aient/core/test/test_image.py,sha256=_T4peNGdXKBHHxyQNx12u-NTyFE8TlYI6NvvagsG2LE,319
|
11
11
|
aient/core/test/test_payload.py,sha256=8jBiJY1uidm1jzL-EiK0s6UGmW9XkdsuuKFGrwFhFkw,2755
|
12
12
|
aient/models/__init__.py,sha256=ouNDNvoBBpIFrLsk09Q_sq23HR0GbLAKfGLIFmfEuXE,219
|
13
13
|
aient/models/audio.py,sha256=kRd-8-WXzv4vwvsTGwnstK-WR8--vr9CdfCZzu8y9LA,1934
|
14
|
-
aient/models/base.py,sha256=
|
15
|
-
aient/models/chatgpt.py,sha256=
|
14
|
+
aient/models/base.py,sha256=z-Z0pJfTN2x0cuwfvu0BdMRY9O-RmLwHEnBIJN1x4Fg,6719
|
15
|
+
aient/models/chatgpt.py,sha256=aFzp25JFGHP4pW1g6jNZN__haggpUWy50KkvvzzMrrM,42170
|
16
16
|
aient/models/claude.py,sha256=thK9P8qkaaoUN3OOJ9Shw4KDs-pAGKPoX4FOPGFXva8,28597
|
17
17
|
aient/models/duckduckgo.py,sha256=1l7vYCs9SG5SWPCbcl7q6pCcB5AUF_r-a4l9frz3Ogo,8115
|
18
18
|
aient/models/gemini.py,sha256=chGLc-8G_DAOxr10HPoOhvVFW1RvMgHd6mt--VyAW98,14730
|
@@ -35,8 +35,8 @@ aient/prompt/agent.py,sha256=h39WOoafv0_lh2coBCiG9k-VWa3Yi9HRZV0hnvsc4gs,23598
|
|
35
35
|
aient/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
36
36
|
aient/utils/prompt.py,sha256=UcSzKkFE4-h_1b6NofI6xgk3GoleqALRKY8VBaXLjmI,11311
|
37
37
|
aient/utils/scripts.py,sha256=n0jR5eXCBIK12W4bIx-xU1FVl1hZ4zDC7hq_BWQHYJU,27537
|
38
|
-
aient-1.0.
|
39
|
-
aient-1.0.
|
40
|
-
aient-1.0.
|
41
|
-
aient-1.0.
|
42
|
-
aient-1.0.
|
38
|
+
aient-1.0.65.dist-info/licenses/LICENSE,sha256=XNdbcWldt0yaNXXWB_Bakoqnxb3OVhUft4MgMA_71ds,1051
|
39
|
+
aient-1.0.65.dist-info/METADATA,sha256=hGhGglTJamhnv3kAoVOs65JCRWofgJMp7KBxQb79imk,4973
|
40
|
+
aient-1.0.65.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
41
|
+
aient-1.0.65.dist-info/top_level.txt,sha256=3oXzrP5sAVvyyqabpeq8A2_vfMtY554r4bVE-OHBrZk,6
|
42
|
+
aient-1.0.65.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|