aient 1.1.81__py3-none-any.whl → 1.1.82__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/utils.py +8 -8
- {aient-1.1.81.dist-info → aient-1.1.82.dist-info}/METADATA +1 -1
- {aient-1.1.81.dist-info → aient-1.1.82.dist-info}/RECORD +6 -6
- {aient-1.1.81.dist-info → aient-1.1.82.dist-info}/WHEEL +0 -0
- {aient-1.1.81.dist-info → aient-1.1.82.dist-info}/licenses/LICENSE +0 -0
- {aient-1.1.81.dist-info → aient-1.1.82.dist-info}/top_level.txt +0 -0
aient/core/utils.py
CHANGED
@@ -169,7 +169,7 @@ def get_proxy(proxy, client_config = {}):
|
|
169
169
|
}
|
170
170
|
return client_config
|
171
171
|
|
172
|
-
def update_initial_model(provider):
|
172
|
+
async def update_initial_model(provider):
|
173
173
|
try:
|
174
174
|
engine, stream_mode = get_engine(provider, endpoint=None, original_model="")
|
175
175
|
# print("engine", engine, provider)
|
@@ -181,8 +181,8 @@ def update_initial_model(provider):
|
|
181
181
|
before_v1 = api_url.split("/v1beta")[0]
|
182
182
|
url = before_v1 + "/v1beta/models"
|
183
183
|
params = {"key": api}
|
184
|
-
with httpx.
|
185
|
-
response = client.get(url, params=params)
|
184
|
+
async with httpx.AsyncClient(**client_config) as client:
|
185
|
+
response = await client.get(url, params=params)
|
186
186
|
|
187
187
|
original_models = response.json()
|
188
188
|
if original_models.get("error"):
|
@@ -202,11 +202,11 @@ def update_initial_model(provider):
|
|
202
202
|
headers = {"x-api-key": api, "anthropic-version": "2023-06-01"}
|
203
203
|
else:
|
204
204
|
headers = {"Authorization": f"Bearer {api}"}
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
205
|
+
async with httpx.AsyncClient(**client_config) as client:
|
206
|
+
response = await client.get(
|
207
|
+
endpoint_models_url,
|
208
|
+
headers=headers,
|
209
|
+
)
|
210
210
|
models = response.json()
|
211
211
|
if models.get("error"):
|
212
212
|
logger.error({"error": models.get("error"), "endpoint": endpoint_models_url, "api": api})
|
@@ -4,7 +4,7 @@ aient/core/log_config.py,sha256=kz2_yJv1p-o3lUQOwA3qh-LSc3wMHv13iCQclw44W9c,274
|
|
4
4
|
aient/core/models.py,sha256=KMlCRLjtq1wQHZTJGqnbWhPS2cHq6eLdnk7peKDrzR8,7490
|
5
5
|
aient/core/request.py,sha256=QnDhyrjzcJOEQU2oauMQi_HHMRR5NxdkrX7nn5JMwTc,76675
|
6
6
|
aient/core/response.py,sha256=ye6Ie5HevXVcH3X5V5BoOC5yDJMBKTKopWQzsCNs008,34977
|
7
|
-
aient/core/utils.py,sha256=
|
7
|
+
aient/core/utils.py,sha256=BwC23v1i__-HxF5vHOxZUfDOIIOsnqsiIW1HhKyBVbk,28934
|
8
8
|
aient/core/test/test_base_api.py,sha256=pWnycRJbuPSXKKU9AQjWrMAX1wiLC_014Qc9hh5C2Pw,524
|
9
9
|
aient/core/test/test_geminimask.py,sha256=HFX8jDbNg_FjjgPNxfYaR-0-roUrOO-ND-FVsuxSoiw,13254
|
10
10
|
aient/core/test/test_image.py,sha256=_T4peNGdXKBHHxyQNx12u-NTyFE8TlYI6NvvagsG2LE,319
|
@@ -30,8 +30,8 @@ aient/plugins/write_file.py,sha256=Jt8fOEwqhYiSWpCbwfAr1xoi_BmFnx3076GMhuL06uI,3
|
|
30
30
|
aient/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
31
31
|
aient/utils/prompt.py,sha256=UcSzKkFE4-h_1b6NofI6xgk3GoleqALRKY8VBaXLjmI,11311
|
32
32
|
aient/utils/scripts.py,sha256=VqtK4RFEx7KxkmcqG3lFDS1DxoNlFFGErEjopVcc8IE,40974
|
33
|
-
aient-1.1.
|
34
|
-
aient-1.1.
|
35
|
-
aient-1.1.
|
36
|
-
aient-1.1.
|
37
|
-
aient-1.1.
|
33
|
+
aient-1.1.82.dist-info/licenses/LICENSE,sha256=XNdbcWldt0yaNXXWB_Bakoqnxb3OVhUft4MgMA_71ds,1051
|
34
|
+
aient-1.1.82.dist-info/METADATA,sha256=WU1r-B44ZrSmBLiMxqvvltgSpGMxUFn9TEVWvfeZeI0,4842
|
35
|
+
aient-1.1.82.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
36
|
+
aient-1.1.82.dist-info/top_level.txt,sha256=3oXzrP5sAVvyyqabpeq8A2_vfMtY554r4bVE-OHBrZk,6
|
37
|
+
aient-1.1.82.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|