aient 1.1.27__py3-none-any.whl → 1.1.29__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/response.py CHANGED
@@ -86,7 +86,7 @@ async def fetch_gemini_response_stream(client, url, headers, payload, model):
86
86
  if is_thinking:
87
87
  sse_string = await generate_sse_response(timestamp, model, reasoning_content=content)
88
88
  yield sse_string
89
- elif not image_base64:
89
+ elif not image_base64 and content:
90
90
  sse_string = await generate_sse_response(timestamp, model, content=content)
91
91
  yield sse_string
92
92
  except json.JSONDecodeError:
aient/models/chatgpt.py CHANGED
@@ -462,6 +462,10 @@ class chatgpt(BaseLLM):
462
462
  print("full_response", full_response)
463
463
  if function_parameter:
464
464
  need_function_call = True
465
+ if isinstance(self.conversation[convo_id][-1]["content"], str) and \
466
+ "<tool_error>" in self.conversation[convo_id][-1]["content"]:
467
+ need_function_call = False
468
+ full_response = "接下来我需要做什么?"
465
469
  else:
466
470
  need_function_call = False
467
471
  if self.print_log:
@@ -178,18 +178,21 @@ def excute_command(command):
178
178
  # print(f"output_lines: {len(new_output_lines)}")
179
179
 
180
180
  if process.returncode == 0:
181
- return f"执行命令成功:\n{final_output_log}"
181
+ if final_output_log.strip() == "":
182
+ return f"执行命令成功"
183
+ else:
184
+ return f"执行命令成功:\n{final_output_log.strip()}"
182
185
  else:
183
186
  # 如果是 PTY 模式,stderr 已经包含在 final_output_log 中
184
187
  if IS_UNIX:
185
- return f"执行命令失败 (退出码 {process.returncode}):\n输出/错误:\n{final_output_log}"
188
+ return f"<tool_error>执行命令失败 (退出码 {process.returncode}):\n输出/错误:\n{final_output_log}</tool_error>"
186
189
  else:
187
- return f"执行命令失败 (退出码 {process.returncode}):\n错误: {stderr_output}\n输出: {final_output_log}"
190
+ return f"<tool_error>执行命令失败 (退出码 {process.returncode}):\n错误: {stderr_output}\n输出: {final_output_log}</tool_error>"
188
191
 
189
192
  except FileNotFoundError:
190
- return f"执行命令失败: 命令或程序未找到 ({command})"
193
+ return f"<tool_error>执行命令失败: 命令或程序未找到 ({command})</tool_error>"
191
194
  except Exception as e:
192
- return f"执行命令时发生异常: {e}"
195
+ return f"<tool_error>执行命令时发生异常: {e}</tool_error>"
193
196
 
194
197
  if __name__ == "__main__":
195
198
  # print(excute_command("ls -l && echo 'Hello, World!'"))
@@ -43,8 +43,8 @@ def list_directory(path="."):
43
43
  return result
44
44
 
45
45
  except FileNotFoundError:
46
- return f"错误: 路径 '{path}' 不存在"
46
+ return f"<tool_error>路径 '{path}' 不存在</tool_error>"
47
47
  except PermissionError:
48
- return f"错误: 没有权限访问路径 '{path}'"
48
+ return f"<tool_error>没有权限访问路径 '{path}'</tool_error>"
49
49
  except Exception as e:
50
- return f"列出目录时发生错误: {e}"
50
+ return f"<tool_error>列出目录时发生错误: {e}</tool_error>"
@@ -129,7 +129,7 @@ if _result is not None:
129
129
 
130
130
  except Exception as e:
131
131
  logging.error(f"Error executing code: {str(e)}")
132
- return f"Error: {str(e)}"
132
+ return f"<tool_error>Error: {str(e)}</tool_error>"
133
133
 
134
134
  finally:
135
135
  try:
@@ -53,7 +53,7 @@ Example: Requesting to write to frontend-config.json
53
53
  with open(path, mode, encoding='utf-8') as file:
54
54
  file.write(unescape_html(content))
55
55
  except PermissionError as e:
56
- return f"写入文件失败: {e}"
56
+ return f"<tool_error>写入文件失败: {e}</tool_error>"
57
57
 
58
58
  return f"已成功写入文件:{path}"
59
59
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aient
3
- Version: 1.1.27
3
+ Version: 1.1.29
4
4
  Summary: Aient: The Awakening of Agent.
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE
@@ -5,7 +5,7 @@ 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=g6rUcNwSTHwmBzt1epsu_2Re8YRFKVCSXRUIFJZpAb4,7432
7
7
  aient/core/request.py,sha256=Zp5Q6iZp3OWZt95cZLh0VmbwvF18jXQB88UfA_3AKt8,67279
8
- aient/core/response.py,sha256=YphzhA9jtQKzWb3L4XGTp9xJZ2FOzHr1aAMTsi896FQ,33201
8
+ aient/core/response.py,sha256=WIJhvf3Th3-XW3MsDq8QdzxXcNe5q1mCKcCZx8pzm2A,33213
9
9
  aient/core/utils.py,sha256=zidsBUBd3KskzcxQcPB1y5x1RhtWcbZeWvmgb4LAadA,27318
10
10
  aient/core/test/test_base_api.py,sha256=pWnycRJbuPSXKKU9AQjWrMAX1wiLC_014Qc9hh5C2Pw,524
11
11
  aient/core/test/test_geminimask.py,sha256=HFX8jDbNg_FjjgPNxfYaR-0-roUrOO-ND-FVsuxSoiw,13254
@@ -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=sfXqmYAiTTAa_dH2h49BZnVvjebEl99LJdQGepD2sCQ,46244
17
+ aient/models/chatgpt.py,sha256=9l6_7QCF4VuOWPGZiroTT-0dg1h_qze5RUQwauDw_A4,46539
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,24 +23,24 @@ 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=QGyI9LlNaU36GUpY531o7UbTFBB39u7LfS6rrx_RTWw,7103
26
- aient/plugins/excute_command.py,sha256=ybkgoMlrXxfeRLA8gizxNL1KuVda0s9xSKTSzC8CKyU,10021
26
+ aient/plugins/excute_command.py,sha256=XEGg1AX8U8iUBaHBqoCmZHLCpI_wQiDSmHDFvqG6ONE,10243
27
27
  aient/plugins/get_time.py,sha256=Ih5XIW5SDAIhrZ9W4Qe5Hs1k4ieKPUc_LAd6ySNyqZk,654
28
28
  aient/plugins/image.py,sha256=ZElCIaZznE06TN9xW3DrSukS7U3A5_cjk1Jge4NzPxw,2072
29
- aient/plugins/list_directory.py,sha256=JZVuImecMSfEv6jLqii-0uQJ1UCsrpMNmYlwW3PEDg4,1374
29
+ aient/plugins/list_directory.py,sha256=V_uKkLx_fQDL5z__bSDC-PqAP-o32KmQW6Pdhx0Fx0s,1433
30
30
  aient/plugins/read_file.py,sha256=Lv03AW-gWGzM2esos2vLTXHcceczdTqEO7_vqFT4yoY,8302
31
31
  aient/plugins/read_image.py,sha256=4FbIiMNVFUQpNyiH5ApGSRvOD9ujcXGyuqlGTJMd7ac,4017
32
32
  aient/plugins/readonly.py,sha256=qK5-kBM3NDH1b-otFxFHpAjV5BXEY_e7cTWBcpP7G5k,710
33
33
  aient/plugins/registry.py,sha256=YknzhieU_8nQ3oKlUSSWDB4X7t2Jx0JnqT2Jd9Xsvfk,3574
34
- aient/plugins/run_python.py,sha256=dgcUwBunMuDkaSKR5bToudVzSdrXVewktDDFUz_iIOQ,4589
34
+ aient/plugins/run_python.py,sha256=MohvdtZUTDLrHBDtJ9L2_Qu1pWAGrkbzsGmmn5tMN20,4614
35
35
  aient/plugins/websearch.py,sha256=llxy1U0vJiNMiKvamMr4p7IruLb3nnDR4YErz8TYimc,15215
36
- aient/plugins/write_file.py,sha256=aWOCuKjtpzjl2JiJV9W6YBmPg_WivxyXD509xUHiuCc,3631
36
+ aient/plugins/write_file.py,sha256=7spYxloI_aUbeANEQK-oXrGPoBqSfsD7sdfMAWlNxhU,3656
37
37
  aient/prompt/__init__.py,sha256=GBtn6-JDT8KHFCcuPpfSNE_aGddg5p4FEyMCy4BfwGs,20
38
38
  aient/prompt/agent.py,sha256=ebHYebxbgL-WEAKUs1NPNwxlUMucF3GNNoy3eNZrtIo,29737
39
39
  aient/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
40
40
  aient/utils/prompt.py,sha256=UcSzKkFE4-h_1b6NofI6xgk3GoleqALRKY8VBaXLjmI,11311
41
41
  aient/utils/scripts.py,sha256=JVR6oNxYc9NnfQL0PGsL8QuhG43dwg0-rPS8NR_pyBM,36461
42
- aient-1.1.27.dist-info/licenses/LICENSE,sha256=XNdbcWldt0yaNXXWB_Bakoqnxb3OVhUft4MgMA_71ds,1051
43
- aient-1.1.27.dist-info/METADATA,sha256=a3i0FAh-ilxdSvPFbnnxhH0WxVTIWQGfBRlQtryTi-g,4968
44
- aient-1.1.27.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
45
- aient-1.1.27.dist-info/top_level.txt,sha256=3oXzrP5sAVvyyqabpeq8A2_vfMtY554r4bVE-OHBrZk,6
46
- aient-1.1.27.dist-info/RECORD,,
42
+ aient-1.1.29.dist-info/licenses/LICENSE,sha256=XNdbcWldt0yaNXXWB_Bakoqnxb3OVhUft4MgMA_71ds,1051
43
+ aient-1.1.29.dist-info/METADATA,sha256=6HyFaEgRBMmTjLQQ2zVwvN0tLzbAqe5jHVm7Gg4WSjE,4968
44
+ aient-1.1.29.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
45
+ aient-1.1.29.dist-info/top_level.txt,sha256=3oXzrP5sAVvyyqabpeq8A2_vfMtY554r4bVE-OHBrZk,6
46
+ aient-1.1.29.dist-info/RECORD,,
File without changes