aient 1.1.43__py3-none-any.whl → 1.1.45__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/request.py CHANGED
@@ -182,9 +182,15 @@ async def get_gemini_payload(request, engine, provider, api_key=None):
182
182
  processed_tools = []
183
183
  for tool in value:
184
184
  function_def = tool["function"]
185
+ # gemini不支持parameters里面的additionalProperties字段,需要删除
186
+ if safe_get(function_def, "parameters", "additionalProperties", default=None) is not None:
187
+ del function_def["parameters"]["additionalProperties"]
188
+
185
189
  # 处理 parameters.properties 中的 default 字段
186
190
  if safe_get(function_def, "parameters", "properties", default=None):
187
191
  for prop_value in function_def["parameters"]["properties"].values():
192
+ if "additionalProperties" in prop_value:
193
+ del prop_value["additionalProperties"]
188
194
  if "default" in prop_value:
189
195
  # 将 default 值添加到 description 中
190
196
  default_value = prop_value["default"]
aient/models/chatgpt.py CHANGED
@@ -570,6 +570,9 @@ class chatgpt(BaseLLM):
570
570
  elif tool_name == "read_image" and "<tool_error>" not in tool_response:
571
571
  tool_info["base64_image"] = tool_response
572
572
  all_responses.append(f"[{tool_name}({tool_args}) Result]:\n\nRead image successfully!")
573
+ elif tool_response.startswith("data:image/") and ";base64," in tool_response and "<tool_error>" not in tool_response:
574
+ tool_info["base64_image"] = tool_response
575
+ all_responses.append(f"[{tool_name}({tool_args}) Result]:\n\nRead image successfully!")
573
576
  else:
574
577
  all_responses.append(f"[{tool_name}({tool_args}) Result]:\n\n{tool_response}")
575
578
 
@@ -140,6 +140,8 @@ def excute_command(command):
140
140
  stderr=subprocess.PIPE,
141
141
  text=True,
142
142
  bufsize=1,
143
+ encoding='utf-8',
144
+ errors='replace',
143
145
  universal_newlines=True
144
146
  )
145
147
  # print(f"--- 开始执行命令 (PIPE): {command} ---")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aient
3
- Version: 1.1.43
3
+ Version: 1.1.45
4
4
  Summary: Aient: The Awakening of Agent.
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE
@@ -4,7 +4,7 @@ aient/core/.gitignore,sha256=5JRRlYYsqt_yt6iFvvzhbqh2FTUQMqwo6WwIuFzlGR8,13
4
4
  aient/core/__init__.py,sha256=NxjebTlku35S4Dzr16rdSqSTWUvvwEeACe8KvHJnjPg,34
5
5
  aient/core/log_config.py,sha256=kz2_yJv1p-o3lUQOwA3qh-LSc3wMHv13iCQclw44W9c,274
6
6
  aient/core/models.py,sha256=d4MISNezTSe0ls0-fjuToI2SoT-sk5fWqAJuKVinIlo,7502
7
- aient/core/request.py,sha256=E2fujOgR8Jxl9kWVZcs7ylz9vftwIye3cbL6HgC-Gn4,71977
7
+ aient/core/request.py,sha256=90Mit0vrwoDJYQQVJmBltQdTnMaGKSmZNBMRXsoJ19A,72406
8
8
  aient/core/response.py,sha256=mAVsCnNhWY09DXNe0lyPUJq-1ljtGjC67Az-Uh7ozIw,35166
9
9
  aient/core/utils.py,sha256=NcXdb8zBN0GE01OGaUzg8U34RaraoFf2MaLDDGFvvC4,27492
10
10
  aient/core/test/test_base_api.py,sha256=pWnycRJbuPSXKKU9AQjWrMAX1wiLC_014Qc9hh5C2Pw,524
@@ -14,7 +14,7 @@ aient/core/test/test_payload.py,sha256=8jBiJY1uidm1jzL-EiK0s6UGmW9XkdsuuKFGrwFhF
14
14
  aient/models/__init__.py,sha256=ouNDNvoBBpIFrLsk09Q_sq23HR0GbLAKfGLIFmfEuXE,219
15
15
  aient/models/audio.py,sha256=kRd-8-WXzv4vwvsTGwnstK-WR8--vr9CdfCZzu8y9LA,1934
16
16
  aient/models/base.py,sha256=z-Z0pJfTN2x0cuwfvu0BdMRY9O-RmLwHEnBIJN1x4Fg,6719
17
- aient/models/chatgpt.py,sha256=MKCdstV_gTkcf_bT2mmQVDLgK5f4PUUfEO3_WHzahpE,46665
17
+ aient/models/chatgpt.py,sha256=Yum3_-LgHmFUII0AljfNNfSc8gBhJzyPYAWZJyr4yFo,46969
18
18
  aient/models/claude.py,sha256=JezghW7y0brl4Y5qiSHvnYR5prQCFywX4RViHt39pGI,26037
19
19
  aient/models/duckduckgo.py,sha256=1l7vYCs9SG5SWPCbcl7q6pCcB5AUF_r-a4l9frz3Ogo,8115
20
20
  aient/models/gemini.py,sha256=chGLc-8G_DAOxr10HPoOhvVFW1RvMgHd6mt--VyAW98,14730
@@ -23,7 +23,7 @@ aient/models/vertex.py,sha256=qVD5l1Q538xXUPulxG4nmDjXE1VoV4yuAkTCpIeJVw0,16795
23
23
  aient/plugins/__init__.py,sha256=p3KO6Aa3Lupos4i2SjzLQw1hzQTigOAfEHngsldrsyk,986
24
24
  aient/plugins/arXiv.py,sha256=yHjb6PS3GUWazpOYRMKMzghKJlxnZ5TX8z9F6UtUVow,1461
25
25
  aient/plugins/config.py,sha256=2DXH-LP9KGl_P4467chJu3q4AAbX5nSn4DIkdI0aYH8,7105
26
- aient/plugins/excute_command.py,sha256=U2rmL0r7AxWeifXkxmOANVVmt2t4lJ_iNF4-rhgnRts,10578
26
+ aient/plugins/excute_command.py,sha256=EQe-vSlTrdd5I0reLqkSXqnPn1VoaCF1HeYZ4z0Txew,10646
27
27
  aient/plugins/get_time.py,sha256=Ih5XIW5SDAIhrZ9W4Qe5Hs1k4ieKPUc_LAd6ySNyqZk,654
28
28
  aient/plugins/image.py,sha256=ZElCIaZznE06TN9xW3DrSukS7U3A5_cjk1Jge4NzPxw,2072
29
29
  aient/plugins/list_directory.py,sha256=V_uKkLx_fQDL5z__bSDC-PqAP-o32KmQW6Pdhx0Fx0s,1433
@@ -37,8 +37,8 @@ aient/plugins/write_file.py,sha256=hExFLuoNPtjYxJI3pVbofZRpokvUabpXdEkd3mZJPPc,3
37
37
  aient/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
38
  aient/utils/prompt.py,sha256=UcSzKkFE4-h_1b6NofI6xgk3GoleqALRKY8VBaXLjmI,11311
39
39
  aient/utils/scripts.py,sha256=h7EA2xBydUF_wdZLsPgjCq4Egdycx1gf2qrdrm0I7y0,40909
40
- aient-1.1.43.dist-info/licenses/LICENSE,sha256=XNdbcWldt0yaNXXWB_Bakoqnxb3OVhUft4MgMA_71ds,1051
41
- aient-1.1.43.dist-info/METADATA,sha256=6WRDFRezelsI5Kxn3CLIoTSILq3HhnBtzsmkAt9oSC8,4968
42
- aient-1.1.43.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
43
- aient-1.1.43.dist-info/top_level.txt,sha256=3oXzrP5sAVvyyqabpeq8A2_vfMtY554r4bVE-OHBrZk,6
44
- aient-1.1.43.dist-info/RECORD,,
40
+ aient-1.1.45.dist-info/licenses/LICENSE,sha256=XNdbcWldt0yaNXXWB_Bakoqnxb3OVhUft4MgMA_71ds,1051
41
+ aient-1.1.45.dist-info/METADATA,sha256=odZHF3piyTukdpJhM9WWX4Cn37vEfllSBI2uf5bHlpA,4968
42
+ aient-1.1.45.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
43
+ aient-1.1.45.dist-info/top_level.txt,sha256=3oXzrP5sAVvyyqabpeq8A2_vfMtY554r4bVE-OHBrZk,6
44
+ aient-1.1.45.dist-info/RECORD,,
File without changes