aient 1.0.90__tar.gz → 1.0.91__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.90/src/aient.egg-info → aient-1.0.91}/PKG-INFO +1 -1
- {aient-1.0.90 → aient-1.0.91}/setup.py +1 -1
- {aient-1.0.90 → aient-1.0.91}/src/aient/models/chatgpt.py +20 -19
- {aient-1.0.90 → aient-1.0.91/src/aient.egg-info}/PKG-INFO +1 -1
- {aient-1.0.90 → aient-1.0.91}/LICENSE +0 -0
- {aient-1.0.90 → aient-1.0.91}/MANIFEST.in +0 -0
- {aient-1.0.90 → aient-1.0.91}/README.md +0 -0
- {aient-1.0.90 → aient-1.0.91}/setup.cfg +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/__init__.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/core/.git +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/core/.gitignore +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/core/__init__.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/core/log_config.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/core/models.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/core/request.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/core/response.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/core/test/test_base_api.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/core/test/test_image.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/core/test/test_payload.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/core/utils.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/models/__init__.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/models/audio.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/models/base.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/models/claude.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/models/duckduckgo.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/models/gemini.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/models/groq.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/models/vertex.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/plugins/__init__.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/plugins/arXiv.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/plugins/config.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/plugins/excute_command.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/plugins/get_time.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/plugins/image.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/plugins/list_directory.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/plugins/read_file.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/plugins/registry.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/plugins/run_python.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/plugins/websearch.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/plugins/write_file.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/prompt/__init__.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/prompt/agent.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/utils/__init__.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/utils/prompt.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient/utils/scripts.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient.egg-info/SOURCES.txt +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient.egg-info/dependency_links.txt +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient.egg-info/requires.txt +0 -0
- {aient-1.0.90 → aient-1.0.91}/src/aient.egg-info/top_level.txt +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test_API.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test_Deepbricks.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test_Web_crawler.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test_aiwaves.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test_aiwaves_arxiv.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test_ask_gemini.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test_class.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test_claude.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test_claude_zh_char.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test_ddg_search.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test_download_pdf.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test_gemini.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test_get_token_dict.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test_google_search.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test_jieba.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test_json.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test_langchain_search_old.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test_logging.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test_ollama.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test_plugin.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test_py_run.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test_requests.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test_search.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test_tikitoken.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test_token.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test_url.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test_whisper.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/test/test_wildcard.py +0 -0
- {aient-1.0.90 → aient-1.0.91}/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.91",
|
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",
|
@@ -125,9 +125,9 @@ class chatgpt(BaseLLM):
|
|
125
125
|
# print("role", role, "function_name", function_name, "message", message)
|
126
126
|
if convo_id not in self.conversation:
|
127
127
|
self.reset(convo_id=convo_id)
|
128
|
-
if function_name == "" and message
|
128
|
+
if function_name == "" and message:
|
129
129
|
self.conversation[convo_id].append({"role": role, "content": message})
|
130
|
-
elif function_name != "" and message
|
130
|
+
elif function_name != "" and message:
|
131
131
|
# 删除从 cut_history_by_function_name 以后的所有历史记录
|
132
132
|
if function_name == self.cut_history_by_function_name:
|
133
133
|
matching_message = next(filter(lambda x: safe_get(x, "tool_calls", 0, "function", "name", default="") == 'get_next_pdf', self.conversation[convo_id]), None)
|
@@ -429,26 +429,27 @@ class chatgpt(BaseLLM):
|
|
429
429
|
if response_role is None:
|
430
430
|
response_role = "assistant"
|
431
431
|
|
432
|
-
|
433
|
-
|
434
|
-
invalid_tools = [tool_dict for tool_dict in function_parameter if tool_dict.get("function_name", "") not in self.plugins.keys()]
|
435
|
-
function_parameter = [tool_dict for tool_dict in function_parameter if tool_dict.get("function_name", "") in self.plugins.keys()]
|
436
|
-
for tool_dict in invalid_tools:
|
437
|
-
full_response = full_response + f"\n\nFunction: {tool_dict.get('function_name', '')} does not exist! I must use existing functions. I need to try again."
|
438
|
-
if self.print_log and invalid_tools:
|
439
|
-
print("invalid_tools", invalid_tools)
|
440
|
-
print("function_parameter", function_parameter)
|
441
|
-
print("full_response", full_response)
|
432
|
+
if self.use_plugins == True:
|
433
|
+
function_parameter = parse_function_xml(full_response)
|
442
434
|
if function_parameter:
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
435
|
+
invalid_tools = [tool_dict for tool_dict in function_parameter if tool_dict.get("function_name", "") not in self.plugins.keys()]
|
436
|
+
function_parameter = [tool_dict for tool_dict in function_parameter if tool_dict.get("function_name", "") in self.plugins.keys()]
|
437
|
+
for tool_dict in invalid_tools:
|
438
|
+
full_response = full_response + f"\n\nFunction: {tool_dict.get('function_name', '')} does not exist! I must use existing functions. I need to try again."
|
439
|
+
if self.print_log and invalid_tools:
|
440
|
+
print("invalid_tools", invalid_tools)
|
441
|
+
print("function_parameter", function_parameter)
|
442
|
+
print("full_response", full_response)
|
443
|
+
if function_parameter:
|
444
|
+
need_function_call = True
|
445
|
+
else:
|
446
|
+
need_function_call = False
|
447
|
+
if self.print_log:
|
448
|
+
print("Failed to parse function_parameter full_response", full_response)
|
449
|
+
full_response = ""
|
449
450
|
|
450
451
|
# 处理函数调用
|
451
|
-
if need_function_call and self.use_plugins
|
452
|
+
if need_function_call and self.use_plugins == True:
|
452
453
|
if self.print_log:
|
453
454
|
print("function_parameter", function_parameter)
|
454
455
|
print("function_full_response", function_full_response)
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|