aient 1.0.94__py3-none-any.whl → 1.0.96__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.
@@ -5,8 +5,6 @@ import requests
5
5
  import threading
6
6
  import time as record_time
7
7
  from itertools import islice
8
- from bs4 import BeautifulSoup
9
- from duckduckgo_search import DDGS
10
8
  from .registry import register_tool
11
9
 
12
10
  class ThreadWithReturnValue(threading.Thread):
@@ -18,11 +16,7 @@ class ThreadWithReturnValue(threading.Thread):
18
16
  super().join()
19
17
  return self._return
20
18
 
21
- import re
22
19
  import httpx
23
- import lxml.html
24
- from lxml_html_clean import Cleaner
25
- from html2text import HTML2Text
26
20
  from textwrap import dedent
27
21
 
28
22
  def url_to_markdown(url):
@@ -34,6 +28,7 @@ def url_to_markdown(url):
34
28
  return "抱歉,目前无法访问该网页。"
35
29
  # body = lxml.html.fromstring(text).xpath('//body')
36
30
 
31
+ import lxml.html
37
32
  doc = lxml.html.fromstring(text)
38
33
  # 检查是否是GitHub raw文件格式(body > pre)
39
34
  if doc.xpath('//body/pre'):
@@ -45,6 +40,7 @@ def url_to_markdown(url):
45
40
  return f'<pre>{body}</pre>'
46
41
  # return body
47
42
  else:
43
+ from lxml_html_clean import Cleaner
48
44
  body = body[0]
49
45
  body = Cleaner(javascript=True, style=True).clean_html(body)
50
46
  return ''.join(lxml.html.tostring(c, encoding='unicode') for c in body)
@@ -57,6 +53,7 @@ def url_to_markdown(url):
57
53
 
58
54
  # 将HTML转换为Markdown
59
55
  def get_md(cts):
56
+ from html2text import HTML2Text
60
57
  h2t = HTML2Text(bodywidth=5000)
61
58
  h2t.ignore_links = True
62
59
  h2t.mark_code = True
@@ -83,6 +80,7 @@ def jina_ai_Web_crawler(url: str, isSearch=False) -> str:
83
80
  }
84
81
  result = ''
85
82
  try:
83
+ from bs4 import BeautifulSoup
86
84
  requests.packages.urllib3.disable_warnings()
87
85
  url = "https://r.jina.ai/" + url
88
86
  response = requests.get(url, headers=headers, verify=False, timeout=5, stream=True)
@@ -178,6 +176,7 @@ def get_url_content(url: str) -> str:
178
176
 
179
177
  def getddgsearchurl(query, max_results=4):
180
178
  try:
179
+ from duckduckgo_search import DDGS
181
180
  results = []
182
181
  with DDGS() as ddgs:
183
182
  ddgs_gen = ddgs.text(query, safesearch='Off', timelimit='y', backend="lite")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aient
3
- Version: 1.0.94
3
+ Version: 1.0.96
4
4
  Summary: Aient: The Awakening of Agent.
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE
@@ -9,7 +9,6 @@ Requires-Dist: httpx
9
9
  Requires-Dist: pillow
10
10
  Requires-Dist: msgspec
11
11
  Requires-Dist: fastapi
12
- Requires-Dist: PyExecJS
13
12
  Requires-Dist: requests
14
13
  Requires-Dist: html2text
15
14
  Requires-Dist: httpx-socks
@@ -30,15 +30,15 @@ aient/plugins/list_directory.py,sha256=5ubm-mfrj-tanGSDp4M_Tmb6vQb3dx2-XVfQ2yL2G
30
30
  aient/plugins/read_file.py,sha256=cJxGnhcz1_gjkgeemVyixLUiCvf-dWm-UtDfrbFdlLE,4857
31
31
  aient/plugins/registry.py,sha256=YknzhieU_8nQ3oKlUSSWDB4X7t2Jx0JnqT2Jd9Xsvfk,3574
32
32
  aient/plugins/run_python.py,sha256=dgcUwBunMuDkaSKR5bToudVzSdrXVewktDDFUz_iIOQ,4589
33
- aient/plugins/websearch.py,sha256=yiBzqXK5X220ibR-zko3VDsn4QOnLu1k6E2YOygCeTQ,15185
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
36
  aient/prompt/agent.py,sha256=3VycHGnUq9OdR5pd_RM0AeLESlpAgBcmzrsesfq82X0,23856
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.94.dist-info/licenses/LICENSE,sha256=XNdbcWldt0yaNXXWB_Bakoqnxb3OVhUft4MgMA_71ds,1051
41
- aient-1.0.94.dist-info/METADATA,sha256=tTyW2ICb7VYVE7cOdOixBiA9Fj3qFw3-lVGxmRLCHT4,4969
42
- aient-1.0.94.dist-info/WHEEL,sha256=0CuiUZ_p9E4cD6NyLD6UG80LBXYyiSYZOKDm5lp32xk,91
43
- aient-1.0.94.dist-info/top_level.txt,sha256=3oXzrP5sAVvyyqabpeq8A2_vfMtY554r4bVE-OHBrZk,6
44
- aient-1.0.94.dist-info/RECORD,,
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,,
File without changes