aient 1.1.84__tar.gz → 1.1.85__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 (51) hide show
  1. {aient-1.1.84 → aient-1.1.85}/PKG-INFO +1 -1
  2. {aient-1.1.84 → aient-1.1.85}/aient/core/response.py +5 -6
  3. {aient-1.1.84 → aient-1.1.85}/aient/models/chatgpt.py +1 -1
  4. {aient-1.1.84 → aient-1.1.85}/aient.egg-info/PKG-INFO +1 -1
  5. {aient-1.1.84 → aient-1.1.85}/pyproject.toml +1 -1
  6. {aient-1.1.84 → aient-1.1.85}/LICENSE +0 -0
  7. {aient-1.1.84 → aient-1.1.85}/README.md +0 -0
  8. {aient-1.1.84 → aient-1.1.85}/aient/__init__.py +0 -0
  9. {aient-1.1.84 → aient-1.1.85}/aient/core/__init__.py +0 -0
  10. {aient-1.1.84 → aient-1.1.85}/aient/core/log_config.py +0 -0
  11. {aient-1.1.84 → aient-1.1.85}/aient/core/models.py +0 -0
  12. {aient-1.1.84 → aient-1.1.85}/aient/core/request.py +0 -0
  13. {aient-1.1.84 → aient-1.1.85}/aient/core/test/test_base_api.py +0 -0
  14. {aient-1.1.84 → aient-1.1.85}/aient/core/test/test_geminimask.py +0 -0
  15. {aient-1.1.84 → aient-1.1.85}/aient/core/test/test_image.py +0 -0
  16. {aient-1.1.84 → aient-1.1.85}/aient/core/test/test_payload.py +0 -0
  17. {aient-1.1.84 → aient-1.1.85}/aient/core/utils.py +0 -0
  18. {aient-1.1.84 → aient-1.1.85}/aient/models/__init__.py +0 -0
  19. {aient-1.1.84 → aient-1.1.85}/aient/models/audio.py +0 -0
  20. {aient-1.1.84 → aient-1.1.85}/aient/models/base.py +0 -0
  21. {aient-1.1.84 → aient-1.1.85}/aient/plugins/__init__.py +0 -0
  22. {aient-1.1.84 → aient-1.1.85}/aient/plugins/arXiv.py +0 -0
  23. {aient-1.1.84 → aient-1.1.85}/aient/plugins/config.py +0 -0
  24. {aient-1.1.84 → aient-1.1.85}/aient/plugins/excute_command.py +0 -0
  25. {aient-1.1.84 → aient-1.1.85}/aient/plugins/get_time.py +0 -0
  26. {aient-1.1.84 → aient-1.1.85}/aient/plugins/image.py +0 -0
  27. {aient-1.1.84 → aient-1.1.85}/aient/plugins/list_directory.py +0 -0
  28. {aient-1.1.84 → aient-1.1.85}/aient/plugins/read_file.py +0 -0
  29. {aient-1.1.84 → aient-1.1.85}/aient/plugins/read_image.py +0 -0
  30. {aient-1.1.84 → aient-1.1.85}/aient/plugins/readonly.py +0 -0
  31. {aient-1.1.84 → aient-1.1.85}/aient/plugins/registry.py +0 -0
  32. {aient-1.1.84 → aient-1.1.85}/aient/plugins/run_python.py +0 -0
  33. {aient-1.1.84 → aient-1.1.85}/aient/plugins/websearch.py +0 -0
  34. {aient-1.1.84 → aient-1.1.85}/aient/plugins/write_file.py +0 -0
  35. {aient-1.1.84 → aient-1.1.85}/aient/utils/__init__.py +0 -0
  36. {aient-1.1.84 → aient-1.1.85}/aient/utils/prompt.py +0 -0
  37. {aient-1.1.84 → aient-1.1.85}/aient/utils/scripts.py +0 -0
  38. {aient-1.1.84 → aient-1.1.85}/aient.egg-info/SOURCES.txt +0 -0
  39. {aient-1.1.84 → aient-1.1.85}/aient.egg-info/dependency_links.txt +0 -0
  40. {aient-1.1.84 → aient-1.1.85}/aient.egg-info/requires.txt +0 -0
  41. {aient-1.1.84 → aient-1.1.85}/aient.egg-info/top_level.txt +0 -0
  42. {aient-1.1.84 → aient-1.1.85}/setup.cfg +0 -0
  43. {aient-1.1.84 → aient-1.1.85}/test/test_Web_crawler.py +0 -0
  44. {aient-1.1.84 → aient-1.1.85}/test/test_ddg_search.py +0 -0
  45. {aient-1.1.84 → aient-1.1.85}/test/test_google_search.py +0 -0
  46. {aient-1.1.84 → aient-1.1.85}/test/test_ollama.py +0 -0
  47. {aient-1.1.84 → aient-1.1.85}/test/test_plugin.py +0 -0
  48. {aient-1.1.84 → aient-1.1.85}/test/test_search.py +0 -0
  49. {aient-1.1.84 → aient-1.1.85}/test/test_url.py +0 -0
  50. {aient-1.1.84 → aient-1.1.85}/test/test_whisper.py +0 -0
  51. {aient-1.1.84 → aient-1.1.85}/test/test_yjh.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aient
3
- Version: 1.1.84
3
+ Version: 1.1.85
4
4
  Summary: Aient: The Awakening of Agent.
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -21,13 +21,12 @@ async def check_response(response, error_log):
21
21
  return {"error": f"{error_log} HTTP Error", "status_code": response.status_code, "details": error_json}
22
22
  return None
23
23
 
24
- async def gemini_json_poccess(response_str):
24
+ async def gemini_json_poccess(response_json):
25
25
  promptTokenCount = 0
26
26
  candidatesTokenCount = 0
27
27
  totalTokenCount = 0
28
28
  image_base64 = None
29
29
 
30
- response_json = await asyncio.to_thread(json.loads, response_str)
31
30
  json_data = safe_get(response_json, "candidates", 0, "content", default=None)
32
31
  finishReason = safe_get(response_json, "candidates", 0 , "finishReason", default=None)
33
32
  if finishReason:
@@ -48,7 +47,7 @@ async def gemini_json_poccess(response_str):
48
47
 
49
48
  function_call_name = safe_get(json_data, "functionCall", "name", default=None)
50
49
  function_full_response = safe_get(json_data, "functionCall", "args", default="")
51
- function_full_response = json.dumps(function_full_response) if function_full_response else None
50
+ function_full_response = await asyncio.to_thread(json.dumps, function_full_response) if function_full_response else None
52
51
 
53
52
  blockReason = safe_get(json_data, 0, "promptFeedback", "blockReason", default=None)
54
53
 
@@ -77,7 +76,7 @@ async def fetch_gemini_response_stream(client, url, headers, payload, model, tim
77
76
  if line.startswith("data: "):
78
77
  parts_json = line.lstrip("data: ").strip()
79
78
  try:
80
- await asyncio.to_thread(json.loads, parts_json)
79
+ response_json = await asyncio.to_thread(json.loads, parts_json)
81
80
  except json.JSONDecodeError:
82
81
  logger.error(f"JSON decode error: {parts_json}")
83
82
  continue
@@ -85,12 +84,12 @@ async def fetch_gemini_response_stream(client, url, headers, payload, model, tim
85
84
  parts_json += line
86
85
  parts_json = parts_json.lstrip("[,")
87
86
  try:
88
- await asyncio.to_thread(json.loads, parts_json)
87
+ response_json = await asyncio.to_thread(json.loads, parts_json)
89
88
  except json.JSONDecodeError:
90
89
  continue
91
90
 
92
91
  # https://ai.google.dev/api/generate-content?hl=zh-cn#FinishReason
93
- is_thinking, reasoning_content, content, image_base64, function_call_name, function_full_response, finishReason, blockReason, promptTokenCount, candidatesTokenCount, totalTokenCount = await gemini_json_poccess(parts_json)
92
+ is_thinking, reasoning_content, content, image_base64, function_call_name, function_full_response, finishReason, blockReason, promptTokenCount, candidatesTokenCount, totalTokenCount = await gemini_json_poccess(response_json)
94
93
 
95
94
  if is_thinking:
96
95
  sse_string = await generate_sse_response(timestamp, model, reasoning_content=reasoning_content)
@@ -814,7 +814,7 @@ class chatgpt(BaseLLM):
814
814
  return # Stop iteration
815
815
  except httpx.RemoteProtocolError:
816
816
  continue
817
- except httpx.ReadError:
817
+ except httpx.ReadError as e:
818
818
  self.logger.warning(f"{e}, retrying...")
819
819
  continue
820
820
  except APITimeoutError:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aient
3
- Version: 1.1.84
3
+ Version: 1.1.85
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.1.84"
3
+ version = "1.1.85"
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
File without changes
File without changes