aient 1.1.46__py3-none-any.whl → 1.1.47__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.
aient/core/request.py CHANGED
@@ -256,8 +256,6 @@ async def get_gemini_payload(request, engine, provider, api_key=None):
256
256
  elif val > 24576:
257
257
  val = 24576
258
258
  payload["generationConfig"]["thinkingConfig"]["thinkingBudget"] = val
259
- if val == 0:
260
- payload["generationConfig"].pop("thinkingConfig", None)
261
259
  except ValueError:
262
260
  # 如果转换为整数失败,忽略思考预算设置
263
261
  pass
@@ -554,8 +552,6 @@ async def get_vertex_gemini_payload(request, engine, provider, api_key=None):
554
552
  elif val > 24576:
555
553
  val = 24576
556
554
  payload["generationConfig"]["thinkingConfig"]["thinkingBudget"] = val
557
- if val == 0:
558
- payload["generationConfig"].pop("thinkingConfig", None)
559
555
  except ValueError:
560
556
  # 如果转换为整数失败,忽略思考预算设置
561
557
  pass
aient/core/response.py CHANGED
@@ -141,7 +141,13 @@ async def fetch_gemini_response_stream(client, url, headers, payload, model):
141
141
  sse_string = await generate_sse_response(timestamp, model, content=None, tools_id="chatcmpl-9inWv0yEtgn873CxMBzHeCeiHctTV", function_call_name=None, function_call_content=function_full_response)
142
142
  yield sse_string
143
143
 
144
- if cache_buffer == "[]":
144
+ cache_buffer_json = {}
145
+ try:
146
+ cache_buffer_json = json.loads(cache_buffer)
147
+ except json.JSONDecodeError:
148
+ cache_buffer_json = {}
149
+
150
+ if cache_buffer == "[]" or safe_get(cache_buffer_json, 0, "promptFeedback", "blockReason") == "PROHIBITED_CONTENT":
145
151
  sse_string = await generate_sse_response(timestamp, model, stop="PROHIBITED_CONTENT")
146
152
  yield sse_string
147
153
  else:
@@ -83,7 +83,7 @@ def jina_ai_Web_crawler(url: str, isSearch=False) -> str:
83
83
  from bs4 import BeautifulSoup
84
84
  requests.packages.urllib3.disable_warnings()
85
85
  url = "https://r.jina.ai/" + url
86
- response = requests.get(url, headers=headers, verify=False, timeout=5, stream=True)
86
+ response = requests.get(url, headers=headers, verify=False, timeout=20, stream=True)
87
87
  if response.status_code == 404:
88
88
  print("Page not found:", url)
89
89
  return "抱歉,网页不存在,目前无法访问该网页。@Trash@"
@@ -133,6 +133,7 @@ def get_url_content(url: str) -> str:
133
133
  # print(markdown_content)
134
134
  # print('-----------------------------')
135
135
  jina_content = jina_ai_Web_crawler(url)
136
+ # print(jina_content)
136
137
  # print('-----------------------------')
137
138
 
138
139
  # 定义评分函数
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aient
3
- Version: 1.1.46
3
+ Version: 1.1.47
4
4
  Summary: Aient: The Awakening of Agent.
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE
@@ -4,8 +4,8 @@ aient/core/.gitignore,sha256=5JRRlYYsqt_yt6iFvvzhbqh2FTUQMqwo6WwIuFzlGR8,13
4
4
  aient/core/__init__.py,sha256=NxjebTlku35S4Dzr16rdSqSTWUvvwEeACe8KvHJnjPg,34
5
5
  aient/core/log_config.py,sha256=kz2_yJv1p-o3lUQOwA3qh-LSc3wMHv13iCQclw44W9c,274
6
6
  aient/core/models.py,sha256=d4MISNezTSe0ls0-fjuToI2SoT-sk5fWqAJuKVinIlo,7502
7
- aient/core/request.py,sha256=r8IvC62GZ6NuBXx82Fd0hiPjYrtqhW3hKz2jdqVY8L0,72473
8
- aient/core/response.py,sha256=_FVvvakplKAvBMljXy8jm9hMGJ8xgHGrsU8Aio9Xk1o,35408
7
+ aient/core/request.py,sha256=8HlSFaBhWMs5thhL4C5qj-hvuDZWUXCYWwVShFR99QU,72263
8
+ aient/core/response.py,sha256=xSOmc4aBFeoT-Cx42B6GrRvsxalx-dOiGdjN1WByyXs,35673
9
9
  aient/core/utils.py,sha256=NcXdb8zBN0GE01OGaUzg8U34RaraoFf2MaLDDGFvvC4,27492
10
10
  aient/core/test/test_base_api.py,sha256=pWnycRJbuPSXKKU9AQjWrMAX1wiLC_014Qc9hh5C2Pw,524
11
11
  aient/core/test/test_geminimask.py,sha256=HFX8jDbNg_FjjgPNxfYaR-0-roUrOO-ND-FVsuxSoiw,13254
@@ -32,13 +32,13 @@ aient/plugins/read_image.py,sha256=4FbIiMNVFUQpNyiH5ApGSRvOD9ujcXGyuqlGTJMd7ac,4
32
32
  aient/plugins/readonly.py,sha256=qK5-kBM3NDH1b-otFxFHpAjV5BXEY_e7cTWBcpP7G5k,710
33
33
  aient/plugins/registry.py,sha256=YknzhieU_8nQ3oKlUSSWDB4X7t2Jx0JnqT2Jd9Xsvfk,3574
34
34
  aient/plugins/run_python.py,sha256=MohvdtZUTDLrHBDtJ9L2_Qu1pWAGrkbzsGmmn5tMN20,4614
35
- aient/plugins/websearch.py,sha256=51tNjEe3pAElXY3SIxaXFYjRrHdGiY6nkmVPU1lTWoY,15258
35
+ aient/plugins/websearch.py,sha256=LPS5NmHrY-Rc0FCPlhHrUWE90XJmXF_AvShLHTV_Zqc,15285
36
36
  aient/plugins/write_file.py,sha256=hExFLuoNPtjYxJI3pVbofZRpokvUabpXdEkd3mZJPPc,3778
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=h7EA2xBydUF_wdZLsPgjCq4Egdycx1gf2qrdrm0I7y0,40909
40
- aient-1.1.46.dist-info/licenses/LICENSE,sha256=XNdbcWldt0yaNXXWB_Bakoqnxb3OVhUft4MgMA_71ds,1051
41
- aient-1.1.46.dist-info/METADATA,sha256=nSiFGBdiODZq4uonk8nlPqbeE_LkrB5w0Tg0tR4Jmzo,4968
42
- aient-1.1.46.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
43
- aient-1.1.46.dist-info/top_level.txt,sha256=3oXzrP5sAVvyyqabpeq8A2_vfMtY554r4bVE-OHBrZk,6
44
- aient-1.1.46.dist-info/RECORD,,
40
+ aient-1.1.47.dist-info/licenses/LICENSE,sha256=XNdbcWldt0yaNXXWB_Bakoqnxb3OVhUft4MgMA_71ds,1051
41
+ aient-1.1.47.dist-info/METADATA,sha256=HRox8OdYBJaWJjcC28C7COuZ9SQfEfGSDJehFJAXk7U,4968
42
+ aient-1.1.47.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
43
+ aient-1.1.47.dist-info/top_level.txt,sha256=3oXzrP5sAVvyyqabpeq8A2_vfMtY554r4bVE-OHBrZk,6
44
+ aient-1.1.47.dist-info/RECORD,,
File without changes