aient 1.2.47__tar.gz → 1.2.48__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.
Files changed (52) hide show
  1. {aient-1.2.47 → aient-1.2.48}/PKG-INFO +1 -1
  2. {aient-1.2.47 → aient-1.2.48}/aient/core/request.py +7 -7
  3. {aient-1.2.47 → aient-1.2.48}/aient/models/chatgpt.py +17 -0
  4. {aient-1.2.47 → aient-1.2.48}/aient.egg-info/PKG-INFO +1 -1
  5. {aient-1.2.47 → aient-1.2.48}/pyproject.toml +1 -1
  6. {aient-1.2.47 → aient-1.2.48}/LICENSE +0 -0
  7. {aient-1.2.47 → aient-1.2.48}/README.md +0 -0
  8. {aient-1.2.47 → aient-1.2.48}/aient/__init__.py +0 -0
  9. {aient-1.2.47 → aient-1.2.48}/aient/architext/architext/__init__.py +0 -0
  10. {aient-1.2.47 → aient-1.2.48}/aient/architext/architext/core.py +0 -0
  11. {aient-1.2.47 → aient-1.2.48}/aient/architext/test/openai_client.py +0 -0
  12. {aient-1.2.47 → aient-1.2.48}/aient/architext/test/test.py +0 -0
  13. {aient-1.2.47 → aient-1.2.48}/aient/architext/test/test_save_load.py +0 -0
  14. {aient-1.2.47 → aient-1.2.48}/aient/core/__init__.py +0 -0
  15. {aient-1.2.47 → aient-1.2.48}/aient/core/log_config.py +0 -0
  16. {aient-1.2.47 → aient-1.2.48}/aient/core/models.py +0 -0
  17. {aient-1.2.47 → aient-1.2.48}/aient/core/response.py +0 -0
  18. {aient-1.2.47 → aient-1.2.48}/aient/core/test/test_base_api.py +0 -0
  19. {aient-1.2.47 → aient-1.2.48}/aient/core/test/test_geminimask.py +0 -0
  20. {aient-1.2.47 → aient-1.2.48}/aient/core/test/test_image.py +0 -0
  21. {aient-1.2.47 → aient-1.2.48}/aient/core/test/test_payload.py +0 -0
  22. {aient-1.2.47 → aient-1.2.48}/aient/core/utils.py +0 -0
  23. {aient-1.2.47 → aient-1.2.48}/aient/models/__init__.py +0 -0
  24. {aient-1.2.47 → aient-1.2.48}/aient/models/audio.py +0 -0
  25. {aient-1.2.47 → aient-1.2.48}/aient/models/base.py +0 -0
  26. {aient-1.2.47 → aient-1.2.48}/aient/plugins/__init__.py +0 -0
  27. {aient-1.2.47 → aient-1.2.48}/aient/plugins/arXiv.py +0 -0
  28. {aient-1.2.47 → aient-1.2.48}/aient/plugins/config.py +0 -0
  29. {aient-1.2.47 → aient-1.2.48}/aient/plugins/excute_command.py +0 -0
  30. {aient-1.2.47 → aient-1.2.48}/aient/plugins/get_time.py +0 -0
  31. {aient-1.2.47 → aient-1.2.48}/aient/plugins/image.py +0 -0
  32. {aient-1.2.47 → aient-1.2.48}/aient/plugins/list_directory.py +0 -0
  33. {aient-1.2.47 → aient-1.2.48}/aient/plugins/read_image.py +0 -0
  34. {aient-1.2.47 → aient-1.2.48}/aient/plugins/readonly.py +0 -0
  35. {aient-1.2.47 → aient-1.2.48}/aient/plugins/registry.py +0 -0
  36. {aient-1.2.47 → aient-1.2.48}/aient/plugins/run_python.py +0 -0
  37. {aient-1.2.47 → aient-1.2.48}/aient/plugins/websearch.py +0 -0
  38. {aient-1.2.47 → aient-1.2.48}/aient/utils/__init__.py +0 -0
  39. {aient-1.2.47 → aient-1.2.48}/aient/utils/prompt.py +0 -0
  40. {aient-1.2.47 → aient-1.2.48}/aient/utils/scripts.py +0 -0
  41. {aient-1.2.47 → aient-1.2.48}/aient.egg-info/SOURCES.txt +0 -0
  42. {aient-1.2.47 → aient-1.2.48}/aient.egg-info/dependency_links.txt +0 -0
  43. {aient-1.2.47 → aient-1.2.48}/aient.egg-info/requires.txt +0 -0
  44. {aient-1.2.47 → aient-1.2.48}/aient.egg-info/top_level.txt +0 -0
  45. {aient-1.2.47 → aient-1.2.48}/setup.cfg +0 -0
  46. {aient-1.2.47 → aient-1.2.48}/test/test_Web_crawler.py +0 -0
  47. {aient-1.2.47 → aient-1.2.48}/test/test_ddg_search.py +0 -0
  48. {aient-1.2.47 → aient-1.2.48}/test/test_google_search.py +0 -0
  49. {aient-1.2.47 → aient-1.2.48}/test/test_ollama.py +0 -0
  50. {aient-1.2.47 → aient-1.2.48}/test/test_plugin.py +0 -0
  51. {aient-1.2.47 → aient-1.2.48}/test/test_url.py +0 -0
  52. {aient-1.2.47 → aient-1.2.48}/test/test_whisper.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aient
3
- Version: 1.2.47
3
+ Version: 1.2.48
4
4
  Summary: Aient: The Awakening of Agent.
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -295,7 +295,7 @@ async def get_gemini_payload(request, engine, provider, api_key=None):
295
295
  if key == request.model:
296
296
  for k, v in value.items():
297
297
  payload[k] = v
298
- elif all(_model not in request.model.lower() for _model in model_dict.keys()) and "-" not in key:
298
+ elif all(_model not in request.model.lower() for _model in model_dict.keys()) and "-" not in key and " " not in key:
299
299
  payload[key] = value
300
300
 
301
301
  return url, headers, payload
@@ -591,7 +591,7 @@ async def get_vertex_gemini_payload(request, engine, provider, api_key=None):
591
591
  if key == request.model:
592
592
  for k, v in value.items():
593
593
  payload[k] = v
594
- elif all(_model not in request.model.lower() for _model in model_dict.keys()) and "-" not in key:
594
+ elif all(_model not in request.model.lower() for _model in model_dict.keys()) and "-" not in key and " " not in key:
595
595
  payload[key] = value
596
596
 
597
597
  return url, headers, payload
@@ -1152,7 +1152,7 @@ async def get_gpt_payload(request, engine, provider, api_key=None):
1152
1152
  if key == request.model:
1153
1153
  for k, v in value.items():
1154
1154
  payload[k] = v
1155
- elif all(_model not in request.model.lower() for _model in model_dict.keys()) and "-" not in key:
1155
+ elif all(_model not in request.model.lower() for _model in model_dict.keys()) and "-" not in key and " " not in key:
1156
1156
  payload[key] = value
1157
1157
 
1158
1158
  return url, headers, payload
@@ -1250,7 +1250,7 @@ async def get_azure_payload(request, engine, provider, api_key=None):
1250
1250
  if key == request.model:
1251
1251
  for k, v in value.items():
1252
1252
  payload[k] = v
1253
- elif all(_model not in request.model.lower() for _model in model_dict.keys()) and "-" not in key:
1253
+ elif all(_model not in request.model.lower() for _model in model_dict.keys()) and "-" not in key and " " not in key:
1254
1254
  payload[key] = value
1255
1255
 
1256
1256
  return url, headers, payload
@@ -1370,7 +1370,7 @@ async def get_azure_databricks_payload(request, engine, provider, api_key=None):
1370
1370
  if key == request.model:
1371
1371
  for k, v in value.items():
1372
1372
  payload[k] = v
1373
- elif all(_model not in request.model.lower() for _model in model_dict.keys()) and "-" not in key:
1373
+ elif all(_model not in request.model.lower() for _model in model_dict.keys()) and "-" not in key and " " not in key:
1374
1374
  payload[key] = value
1375
1375
 
1376
1376
  return url, headers, payload
@@ -1457,7 +1457,7 @@ async def get_openrouter_payload(request, engine, provider, api_key=None):
1457
1457
  if key == request.model:
1458
1458
  for k, v in value.items():
1459
1459
  payload[k] = v
1460
- elif all(_model not in request.model.lower() for _model in model_dict.keys()) and "-" not in key:
1460
+ elif all(_model not in request.model.lower() for _model in model_dict.keys()) and "-" not in key and " " not in key:
1461
1461
  payload[key] = value
1462
1462
 
1463
1463
  return url, headers, payload
@@ -1823,7 +1823,7 @@ async def get_claude_payload(request, engine, provider, api_key=None):
1823
1823
  if key == request.model:
1824
1824
  for k, v in value.items():
1825
1825
  payload[k] = v
1826
- elif all(_model not in request.model.lower() for _model in model_dict.keys()) and "-" not in key:
1826
+ elif all(_model not in request.model.lower() for _model in model_dict.keys()) and "-" not in key and " " not in key:
1827
1827
  payload[key] = value
1828
1828
 
1829
1829
  return url, headers, payload
@@ -89,6 +89,13 @@ class RepetitiveResponseError(Exception):
89
89
  self.count = count
90
90
 
91
91
 
92
+ class AllToolsMissingParametersError(Exception):
93
+ """Custom exception for when all tools are missing required parameters."""
94
+ def __init__(self, message, response_text):
95
+ super().__init__(message)
96
+ self.response_text = response_text
97
+
98
+
92
99
  class chatgpt(BaseLLM):
93
100
  """
94
101
  Official ChatGPT API
@@ -500,6 +507,9 @@ class chatgpt(BaseLLM):
500
507
  missing_required_params.append(f"Error: {tool_name} missing required parameters: {missing_required_params}")
501
508
  function_parameter = valid_function_parameters
502
509
 
510
+ if not function_parameter and missing_required_params:
511
+ raise AllToolsMissingParametersError("\n\n".join(missing_required_params), response_text=full_response)
512
+
503
513
  # 删除 task_complete 跟其他工具一起调用的情况,因为 task_complete 必须单独调用
504
514
  if len(function_parameter) > 1:
505
515
  function_parameter = [tool_dict for tool_dict in function_parameter if tool_dict.get("function_name", "") != "task_complete"]
@@ -810,6 +820,13 @@ class chatgpt(BaseLLM):
810
820
  {"role": "user", "content": "你的消息没有以[done]结尾,请重新输出"}
811
821
  ]
812
822
  continue
823
+ except AllToolsMissingParametersError as e:
824
+ self.logger.warning(f"All tools are missing required parameters: {e}. Retrying with corrective prompt.")
825
+ need_done_prompt = [
826
+ {"role": "assistant", "content": e.response_text},
827
+ {"role": "user", "content": f"{e.message},请重新输出"}
828
+ ]
829
+ continue
813
830
  except EmptyResponseError as e:
814
831
  self.logger.warning(f"{e}, retrying...")
815
832
  continue
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aient
3
- Version: 1.2.47
3
+ Version: 1.2.48
4
4
  Summary: Aient: The Awakening of Agent.
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "aient"
3
- version = "1.2.47"
3
+ version = "1.2.48"
4
4
  description = "Aient: The Awakening of Agent."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.11"
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