aient 1.0.96__py3-none-any.whl → 1.0.98__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/models/chatgpt.py CHANGED
@@ -150,8 +150,12 @@ class chatgpt(BaseLLM):
150
150
  })
151
151
  self.conversation[convo_id].append({"role": role, "tool_call_id": function_call_id, "content": message})
152
152
  else:
153
- self.conversation[convo_id].append({"role": "assistant", "content": convert_functions_to_xml(function_arguments)})
154
- self.conversation[convo_id].append({"role": "user", "content": message})
153
+ last_user_message = self.conversation[convo_id][-1]["content"]
154
+ if last_user_message != message:
155
+ self.conversation[convo_id].append({"role": "assistant", "content": convert_functions_to_xml(function_arguments)})
156
+ self.conversation[convo_id].append({"role": "user", "content": message})
157
+ else:
158
+ self.conversation[convo_id].append({"role": "assistant", "content": "我已经执行过这个工具了,接下来我需要做什么?"})
155
159
 
156
160
  else:
157
161
  print('\033[31m')
@@ -430,6 +434,7 @@ class chatgpt(BaseLLM):
430
434
  response_role = "assistant"
431
435
 
432
436
  if self.use_plugins == True:
437
+ full_response = full_response.replace("<tool_code>", "").replace("</tool_code>", "")
433
438
  function_parameter = parse_function_xml(full_response)
434
439
  if function_parameter:
435
440
  invalid_tools = [tool_dict for tool_dict in function_parameter if tool_dict.get("function_name", "") not in self.plugins.keys()]
aient/prompt/agent.py CHANGED
@@ -71,15 +71,19 @@ Answer the user's request using the relevant tool(s), if they are available. Che
71
71
 
72
72
  You have tools at your disposal to solve the coding task. Follow these rules regarding tool calls:
73
73
 
74
- Tool uses are formatted using XML-style tags. The tool name is enclosed in opening and closing tags, and each parameter is similarly enclosed within its own set of tags. Here's the structure:
74
+ Tool uses are formatted using XML-style tags.
75
+ The **actual name of the tool** (e.g., `read_file`, `edit_file`) must be used as the main XML tag.
76
+ Do **NOT** use literal placeholder strings like `<tool_name>`, `<parameter1_name>`, or `<tool_name1>` as actual XML tags. These are for illustration only. Always use the specific tool name and its defined parameter names.
75
77
 
76
- <tool_name>
77
- <parameter1_name>value1</parameter1_name>
78
- <parameter2_name>value2</parameter2_name>
78
+ Here's how to structure a single tool call. Replace `actual_tool_name_here` with the specific tool's name, and `parameter_name` with actual parameter names for that tool:
79
+
80
+ <actual_tool_name_here>
81
+ <parameter_name>value</parameter_name>
82
+ <another_parameter_name>another_value</another_parameter_name>
79
83
  ...
80
- </tool_name>
84
+ </actual_tool_name_here>
81
85
 
82
- For example:
86
+ For example, to use the `read_file` tool:
83
87
 
84
88
  <read_file>
85
89
  <file_path>
@@ -87,18 +91,18 @@ For example:
87
91
  </file_path>
88
92
  </read_file>
89
93
 
90
- you can call multiple tools in one turn, for example:
94
+ If you need to call multiple tools in one turn, list each tool call's XML structure sequentially. For example:
91
95
 
92
- <tool_name1>
96
+ <actual_tool_name1_here>
93
97
  <parameter1_name>value1</parameter1_name>
94
98
  ...
95
- </tool_name1>
99
+ </actual_tool_name1_here>
96
100
 
97
101
  ...
98
- <tool_name2>
102
+ <actual_tool_name2_here>
99
103
  <parameter1_name>value1</parameter1_name>
100
104
  ...
101
- </tool_name2>
105
+ </actual_tool_name2_here>
102
106
 
103
107
  When calling tools in parallel, multiple different or the same tools can be invoked simultaneously. 你可以同时执行这两个或者多个操作。
104
108
 
@@ -161,34 +165,36 @@ instruction_system_prompt = """
161
165
 
162
166
  工具使用规范如下:
163
167
 
164
- Tool uses are formatted using XML-style tags. The tool name is enclosed in opening and closing tags, and each parameter is similarly enclosed within its own set of tags. Here's the structure:
168
+ Tool uses are formatted using XML-style tags.
169
+ The **actual name of the tool** (e.g., `read_file`, `edit_file`) must be used as the main XML tag.
170
+ Do **NOT** use literal placeholder strings like `<tool_name>`, `<parameter1_name>`, or `<tool_name1>` as actual XML tags. These are for illustration only. Always use the specific tool name and its defined parameter names.
165
171
 
166
- <tool_name>
167
- <parameter1_name>value1</parameter1_name>
168
- <parameter2_name>value2</parameter2_name>
172
+ Here's how to structure a single tool call. Replace `actual_tool_name_here` with the specific tool's name, and `parameter_name` with actual parameter names for that tool:
173
+
174
+ <actual_tool_name_here>
175
+ <parameter_name>value</parameter_name>
176
+ <another_parameter_name>another_value</another_parameter_name>
169
177
  ...
170
- </tool_name>
178
+ </actual_tool_name_here>
171
179
 
172
- For example:
180
+ For example, to use the `read_file` tool:
173
181
 
174
182
  <read_file>
175
- <file_path>
176
- /path/to/file.txt
177
- </file_path>
183
+ <file_path>/path/to/file.txt</file_path>
178
184
  </read_file>
179
185
 
180
- you can call multiple tools in one turn, for example:
186
+ If you need to call multiple tools in one turn, list each tool call's XML structure sequentially. For example:
181
187
 
182
- <tool_name1>
188
+ <actual_tool_name1_here>
183
189
  <parameter1_name>value1</parameter1_name>
184
190
  ...
185
- </tool_name1>
191
+ </actual_tool_name1_here>
186
192
 
187
193
  ...
188
- <tool_name2>
194
+ <actual_tool_name2_here>
189
195
  <parameter1_name>value1</parameter1_name>
190
196
  ...
191
- </tool_name2>
197
+ </actual_tool_name2_here>
192
198
 
193
199
  When calling tools in parallel, multiple different or the same tools can be invoked simultaneously.
194
200
 
@@ -211,7 +217,9 @@ git clone https://github.com/username/project-name.git
211
217
  </excute_command>
212
218
 
213
219
  工作智能体仅可以使用如下工具:
220
+ <tools>
214
221
  {tools_list}
222
+ </tools>
215
223
  """
216
224
 
217
225
  cursor_prompt = """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aient
3
- Version: 1.0.96
3
+ Version: 1.0.98
4
4
  Summary: Aient: The Awakening of Agent.
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE
@@ -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=-NWkkKxTCyraPYT0YN37NA2rUfOaDNXtvFSQmIE5tS8,45066
17
+ aient/models/chatgpt.py,sha256=q8dx4PD57m4a3gJHrzJr7v_Pl8X0RKDBCZHZEtIMxkk,45480
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
@@ -33,12 +33,12 @@ aient/plugins/run_python.py,sha256=dgcUwBunMuDkaSKR5bToudVzSdrXVewktDDFUz_iIOQ,4
33
33
  aient/plugins/websearch.py,sha256=I4tYU7CGLdyG6Hd3yK19V-PoG5IbFI9FEEVggyrshRg,15227
34
34
  aient/plugins/write_file.py,sha256=qmT6iQ3mDyVAa9Sld1jfJq0KPZj0w2kRIHq0JyjpGeA,1853
35
35
  aient/prompt/__init__.py,sha256=GBtn6-JDT8KHFCcuPpfSNE_aGddg5p4FEyMCy4BfwGs,20
36
- aient/prompt/agent.py,sha256=3VycHGnUq9OdR5pd_RM0AeLESlpAgBcmzrsesfq82X0,23856
36
+ aient/prompt/agent.py,sha256=6f5ZB66Rb8y0iQScHMRhvXZ1qMM3YsKpCBPCTAAw2rg,24917
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=JbYHsU3LLtxBcuO_2MWbSgpHpCgtVQe9FGEFJpUyejc,25926
40
- aient-1.0.96.dist-info/licenses/LICENSE,sha256=XNdbcWldt0yaNXXWB_Bakoqnxb3OVhUft4MgMA_71ds,1051
41
- aient-1.0.96.dist-info/METADATA,sha256=tUjeMs8W1DrH8grCIG-jn7zTnWoX9QDTGLuMo2TdLAo,4945
42
- aient-1.0.96.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
43
- aient-1.0.96.dist-info/top_level.txt,sha256=3oXzrP5sAVvyyqabpeq8A2_vfMtY554r4bVE-OHBrZk,6
44
- aient-1.0.96.dist-info/RECORD,,
40
+ aient-1.0.98.dist-info/licenses/LICENSE,sha256=XNdbcWldt0yaNXXWB_Bakoqnxb3OVhUft4MgMA_71ds,1051
41
+ aient-1.0.98.dist-info/METADATA,sha256=GdOJCIW3xQrHk1tnVMoPunfvOB6pWHGPC-KLUlUOnF8,4945
42
+ aient-1.0.98.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
43
+ aient-1.0.98.dist-info/top_level.txt,sha256=3oXzrP5sAVvyyqabpeq8A2_vfMtY554r4bVE-OHBrZk,6
44
+ aient-1.0.98.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.3.1)
2
+ Generator: setuptools (80.4.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5