aient 1.0.51__tar.gz → 1.0.53__tar.gz
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-1.0.51/src/aient.egg-info → aient-1.0.53}/PKG-INFO +1 -1
- {aient-1.0.51 → aient-1.0.53}/setup.py +1 -1
- {aient-1.0.51 → aient-1.0.53}/src/aient/plugins/excute_command.py +1 -1
- {aient-1.0.51 → aient-1.0.53}/src/aient/plugins/read_file.py +5 -2
- {aient-1.0.51 → aient-1.0.53}/src/aient/prompt/agent.py +44 -35
- {aient-1.0.51 → aient-1.0.53}/src/aient/utils/scripts.py +2 -0
- {aient-1.0.51 → aient-1.0.53/src/aient.egg-info}/PKG-INFO +1 -1
- {aient-1.0.51 → aient-1.0.53}/LICENSE +0 -0
- {aient-1.0.51 → aient-1.0.53}/MANIFEST.in +0 -0
- {aient-1.0.51 → aient-1.0.53}/README.md +0 -0
- {aient-1.0.51 → aient-1.0.53}/setup.cfg +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/__init__.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/core/.git +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/core/__init__.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/core/log_config.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/core/models.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/core/request.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/core/response.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/core/test/test_base_api.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/core/test/test_image.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/core/test/test_payload.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/core/utils.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/models/__init__.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/models/audio.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/models/base.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/models/chatgpt.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/models/claude.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/models/duckduckgo.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/models/gemini.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/models/groq.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/models/vertex.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/plugins/__init__.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/plugins/arXiv.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/plugins/config.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/plugins/get_time.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/plugins/image.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/plugins/list_directory.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/plugins/registry.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/plugins/run_python.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/plugins/websearch.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/prompt/__init__.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/utils/__init__.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient/utils/prompt.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient.egg-info/SOURCES.txt +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient.egg-info/dependency_links.txt +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient.egg-info/requires.txt +0 -0
- {aient-1.0.51 → aient-1.0.53}/src/aient.egg-info/top_level.txt +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_API.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_Deepbricks.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_Web_crawler.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_aiwaves.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_aiwaves_arxiv.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_ask_gemini.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_class.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_claude.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_claude_zh_char.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_ddg_search.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_download_pdf.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_gemini.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_get_token_dict.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_google_search.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_jieba.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_json.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_langchain_search_old.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_logging.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_ollama.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_plugin.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_py_run.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_requests.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_search.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_tikitoken.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_token.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_url.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_whisper.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_wildcard.py +0 -0
- {aient-1.0.51 → aient-1.0.53}/test/test_yjh.py +0 -0
@@ -4,7 +4,7 @@ from setuptools import setup, find_packages
|
|
4
4
|
|
5
5
|
setup(
|
6
6
|
name="aient",
|
7
|
-
version="1.0.
|
7
|
+
version="1.0.53",
|
8
8
|
description="Aient: The Awakening of Agent.",
|
9
9
|
long_description=Path.open(Path("README.md"), encoding="utf-8").read(),
|
10
10
|
long_description_content_type="text/markdown",
|
@@ -9,6 +9,9 @@ def read_file(file_path):
|
|
9
9
|
"""
|
10
10
|
Description: Request to read the contents of a file at the specified path. Use this when you need to examine the contents of an existing file you do not know the contents of, for example to analyze code, review text files, or extract information from configuration files. Automatically extracts raw text from PDF and DOCX files. May not be suitable for other types of binary files, as it returns the raw content as a string.
|
11
11
|
|
12
|
+
注意:
|
13
|
+
1. pdf 文件 必须使用 read_file 读取
|
14
|
+
|
12
15
|
参数:
|
13
16
|
file_path: 要读取的文件路径,(required) The path of the file to read (relative to the current working directory)
|
14
17
|
|
@@ -24,7 +27,7 @@ Examples:
|
|
24
27
|
|
25
28
|
1. Reading an entire file:
|
26
29
|
<read_file>
|
27
|
-
<file_path>frontend
|
30
|
+
<file_path>frontend.pdf</file_path>
|
28
31
|
</read_file>
|
29
32
|
|
30
33
|
2. Reading multiple files:
|
@@ -34,7 +37,7 @@ Examples:
|
|
34
37
|
</read_file>
|
35
38
|
|
36
39
|
<read_file>
|
37
|
-
<file_path>backend-config.
|
40
|
+
<file_path>backend-config.txt</file_path>
|
38
41
|
</read_file>
|
39
42
|
|
40
43
|
...
|
@@ -41,17 +41,11 @@ definition = """
|
|
41
41
|
system_prompt = """
|
42
42
|
<communication>
|
43
43
|
1. Format your responses in markdown. Use backticks to format file, directory, function, and class names.
|
44
|
-
2.
|
44
|
+
2. Always respond in 中文。
|
45
|
+
3. 尽力满足user的请求,如果 user 要求你使用工具,请自行根据工具的参数要求,组织参数,将工具调用组织成xml格式,即可触发工具执行流程。
|
46
|
+
4. 禁止要求user调用工具,当你需要调用工具时,请自行组织参数,将工具调用组织成xml格式,即可触发工具执行流程。
|
45
47
|
</communication>
|
46
48
|
|
47
|
-
<search_and_reading>
|
48
|
-
If you are unsure about the answer to the USER's request, you should gather more information by using additional tool calls, asking clarifying questions, etc...
|
49
|
-
|
50
|
-
For example, if you've performed a semantic search, and the results may not fully answer the USER's request or merit gathering more information, feel free to call more tools.
|
51
|
-
|
52
|
-
Bias towards not asking the user for help if you can find the answer yourself.
|
53
|
-
</search_and_reading>
|
54
|
-
|
55
49
|
<making_code_changes>
|
56
50
|
When making code changes, NEVER output code to the USER, unless requested. Instead use one of the code edit tools to implement the change. Use the code edit tools at most once per turn. Follow these instructions carefully:
|
57
51
|
|
@@ -68,12 +62,11 @@ When making code changes, NEVER output code to the USER, unless requested. Inste
|
|
68
62
|
</calling_external_apis>
|
69
63
|
|
70
64
|
<user_info>
|
71
|
-
The user's OS version is {os_name} {os_version}. The absolute path of the user's workspace is {workspace_path} which is also the project root directory. The user's shell is {shell}.
|
65
|
+
The user's OS version is {os_name} {os_version}. The absolute path of the user's workspace is {workspace_path} which is also the project root directory. 请在指令中使用绝对路径。所有操作必须基于工作目录。禁止在工作目录之外进行任何操作。 The user's shell is {shell}.
|
72
66
|
</user_info>
|
73
67
|
|
74
|
-
<
|
75
|
-
|
76
|
-
Answer the user's request using the relevant tool(s), if they are available. Check that all the required parameters for each tool call are provided or can reasonably be inferred from context. If the user provides a specific value for a parameter (for example provided in quotes), make sure to use that value EXACTLY. DO NOT make up values for or ask about optional parameters. Carefully analyze descriptive terms in the request as they may indicate required parameter values that should be included even if not explicitly quoted.
|
68
|
+
<instructions for tool use>
|
69
|
+
Answer the user's request using the relevant tool(s), if they are available. Check that all the required parameters for each tool call are provided or can reasonably be inferred from context. If the user provides a specific value for a parameter (for example provided in quotes), make sure to use that value EXACTLY. DO NOT make up values for or ask about optional parameters. Carefully analyze descriptive terms in the request as they may indicate required parameter values that should be included even if not explicitly quoted. 如果你不清楚工具的参数,请直接问user。请勿自己编造参数。
|
77
70
|
|
78
71
|
You have tools at your disposal to solve the coding task. Follow these rules regarding tool calls:
|
79
72
|
|
@@ -106,31 +99,16 @@ you can call multiple tools in one turn, for example:
|
|
106
99
|
...
|
107
100
|
</tool_name2>
|
108
101
|
|
109
|
-
When calling tools in parallel, multiple different or the same tools can be invoked simultaneously.
|
102
|
+
When calling tools in parallel, multiple different or the same tools can be invoked simultaneously. 你可以同时执行这两个或者多个操作。
|
110
103
|
|
111
104
|
Always adhere to this format for all tool uses to ensure proper parsing and execution.
|
112
105
|
|
113
106
|
# Important Rules:
|
114
107
|
|
115
|
-
1.
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
<tool_name1>
|
120
|
-
<parameter1_name>value1</parameter1_name>
|
121
|
-
...
|
122
|
-
</tool_name1>
|
123
|
-
|
124
|
-
...
|
125
|
-
<tool_name2>
|
126
|
-
<parameter1_name>value1</parameter1_name>
|
127
|
-
...
|
128
|
-
</tool_name2>
|
129
|
-
|
130
|
-
2. You must use the exact name field of the tool as the top-level XML tag. For example, if the tool name is "read_file", you must use <read_file> as the tag, not any other variant or self-created tag.
|
131
|
-
3. It is prohibited to use any self-created tags that are not tool names as top-level tags.
|
132
|
-
4. XML tags are case-sensitive, ensure they match the tool name exactly.
|
133
|
-
</Instructions for Tool Use>
|
108
|
+
1. You must use the exact name field of the tool as the top-level XML tag. For example, if the tool name is "read_file", you must use <read_file> as the tag, not any other variant or self-created tag.
|
109
|
+
2. It is prohibited to use any self-created tags that are not tool names as top-level tags.
|
110
|
+
3. XML tags are case-sensitive, ensure they match the tool name exactly.
|
111
|
+
</instructions for tool use>
|
134
112
|
|
135
113
|
You can use tools as follows:
|
136
114
|
|
@@ -139,11 +117,42 @@ You can use tools as follows:
|
|
139
117
|
</tools>
|
140
118
|
"""
|
141
119
|
|
142
|
-
instruction_system_prompt = """
|
120
|
+
instruction_system_prompt = """
|
121
|
+
|
122
|
+
你是一个指令生成器,负责指导另一个智能体完成任务。
|
143
123
|
你需要分析工作智能体的对话历史,并生成下一步指令。
|
144
124
|
根据任务目标和当前进度,提供清晰明确的指令。
|
145
125
|
持续引导工作智能体直到任务完成。
|
146
|
-
|
126
|
+
|
127
|
+
你需要称呼工作智能体为“你”,指令禁止使用疑问句,必须使用祈使句。
|
128
|
+
所有回复必须使用中文。
|
129
|
+
你的工作目录为:{workspace_path},请在指令中使用绝对路径。所有操作必须基于工作目录。禁止在工作目录之外进行任何操作。
|
130
|
+
|
131
|
+
|
132
|
+
你的输出必须符合以下步骤:
|
133
|
+
|
134
|
+
1. 首先分析当前对话历史。其中user就是你发送给工作智能体的指令。assistant就是工作智能体的回复。
|
135
|
+
2. 根据任务目标和当前进度,分析还需要哪些步骤。
|
136
|
+
3. 检查工作智能体可以使用哪些工具后,确定需要调用哪些工具。请明确要求工作智能体使用特定工具。如果工作智能体不清楚工具的参数,请直接告诉它。
|
137
|
+
4. 最后将你的指令放在<instructions>标签中。
|
138
|
+
|
139
|
+
你的回复格式如下:
|
140
|
+
|
141
|
+
{{1.分析当前对话历史}}
|
142
|
+
|
143
|
+
{{2.分析任务目标和当前进度}}
|
144
|
+
|
145
|
+
{{3.分析还需要哪些步骤}}
|
146
|
+
|
147
|
+
{{4.检查工作智能体可以使用哪些工具}}
|
148
|
+
|
149
|
+
{{5.确定需要调用哪些工具}}
|
150
|
+
|
151
|
+
<instructions>
|
152
|
+
{{work_agent_instructions}}
|
153
|
+
</instructions>
|
154
|
+
|
155
|
+
工具使用规范如下:
|
147
156
|
|
148
157
|
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:
|
149
158
|
|
@@ -716,4 +716,6 @@ if __name__ == "__main__":
|
|
716
716
|
</tool_call>
|
717
717
|
好的,我现在读取 `README.md` 文件。
|
718
718
|
"""
|
719
|
+
|
720
|
+
test_xml = """首先使用read_file工具读取论文内容,然后使用excute_command工具克隆代码仓库到本地。\n```xml\n<read_file>\n<file_path>/Users/yanyuming/Downloads/GitHub/OceanSynthesis/papers/2412.06410v1.pdf</file_path>\n</read_file>\n\n<excute_command>\n<command>git clone https://github.com/bartbussmann/BatchTopK.git</command>\n</excute_command>\n```"""
|
719
721
|
print(parse_function_xml(test_xml))
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|