aient 1.1.81__py3-none-any.whl → 1.1.83__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 CHANGED
@@ -64,7 +64,6 @@ class BaseAPI:
64
64
  self.audio_speech: str = urlunparse(parsed_url[:2] + (before_v1 + "audio/speech",) + ("",) * 3)
65
65
 
66
66
  if parsed_url.path.endswith("/v1beta") or \
67
- parsed_url.path.endswith("/v1") or \
68
67
  (parsed_url.netloc == 'generativelanguage.googleapis.com' and "openai/chat/completions" not in parsed_url.path):
69
68
  before_v1 = parsed_url.path.split("/v1")[0]
70
69
  self.base_url = api_url
@@ -78,7 +77,6 @@ def get_engine(provider, endpoint=None, original_model=""):
78
77
  engine = None
79
78
  stream = None
80
79
  if parsed_url.path.endswith("/v1beta") or \
81
- parsed_url.path.endswith("/v1") or \
82
80
  (parsed_url.netloc == 'generativelanguage.googleapis.com' and "openai/chat/completions" not in parsed_url.path):
83
81
  engine = "gemini"
84
82
  elif parsed_url.netloc.rstrip('/').endswith('aiplatform.googleapis.com') or \
@@ -169,7 +167,7 @@ def get_proxy(proxy, client_config = {}):
169
167
  }
170
168
  return client_config
171
169
 
172
- def update_initial_model(provider):
170
+ async def update_initial_model(provider):
173
171
  try:
174
172
  engine, stream_mode = get_engine(provider, endpoint=None, original_model="")
175
173
  # print("engine", engine, provider)
@@ -181,8 +179,8 @@ def update_initial_model(provider):
181
179
  before_v1 = api_url.split("/v1beta")[0]
182
180
  url = before_v1 + "/v1beta/models"
183
181
  params = {"key": api}
184
- with httpx.Client(**client_config) as client:
185
- response = client.get(url, params=params)
182
+ async with httpx.AsyncClient(**client_config) as client:
183
+ response = await client.get(url, params=params)
186
184
 
187
185
  original_models = response.json()
188
186
  if original_models.get("error"):
@@ -202,11 +200,11 @@ def update_initial_model(provider):
202
200
  headers = {"x-api-key": api, "anthropic-version": "2023-06-01"}
203
201
  else:
204
202
  headers = {"Authorization": f"Bearer {api}"}
205
- response = httpx.get(
206
- endpoint_models_url,
207
- headers=headers,
208
- **client_config
209
- )
203
+ async with httpx.AsyncClient(**client_config) as client:
204
+ response = await client.get(
205
+ endpoint_models_url,
206
+ headers=headers,
207
+ )
210
208
  models = response.json()
211
209
  if models.get("error"):
212
210
  logger.error({"error": models.get("error"), "endpoint": endpoint_models_url, "api": api})
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aient
3
- Version: 1.1.81
3
+ Version: 1.1.83
4
4
  Summary: Aient: The Awakening of Agent.
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -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=9r-Z4KqZXXBm7bUkPx-vOYqgn4CEkG-cRRYz_tl0QUg,28851
7
+ aient/core/utils.py,sha256=okDFj8S4r71vnkEBYxiOqoKee63UzNyk2y_p4uhWBvY,28848
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.81.dist-info/licenses/LICENSE,sha256=XNdbcWldt0yaNXXWB_Bakoqnxb3OVhUft4MgMA_71ds,1051
34
- aient-1.1.81.dist-info/METADATA,sha256=EhWleC1wNEH3zGSYyqd6yliP2Zb_ANww70H37uCwhCU,4842
35
- aient-1.1.81.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
36
- aient-1.1.81.dist-info/top_level.txt,sha256=3oXzrP5sAVvyyqabpeq8A2_vfMtY554r4bVE-OHBrZk,6
37
- aient-1.1.81.dist-info/RECORD,,
33
+ aient-1.1.83.dist-info/licenses/LICENSE,sha256=XNdbcWldt0yaNXXWB_Bakoqnxb3OVhUft4MgMA_71ds,1051
34
+ aient-1.1.83.dist-info/METADATA,sha256=djB0cSoRmV_HSI4Fzp2FUyZJ4d0Ob1JnJyr6K_mQGDU,4842
35
+ aient-1.1.83.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
36
+ aient-1.1.83.dist-info/top_level.txt,sha256=3oXzrP5sAVvyyqabpeq8A2_vfMtY554r4bVE-OHBrZk,6
37
+ aient-1.1.83.dist-info/RECORD,,
File without changes