aient 1.1.44__py3-none-any.whl → 1.1.46__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
@@ -70,9 +70,11 @@ async def get_gemini_payload(request, engine, provider, api_key=None):
70
70
  elif item.type == "image_url" and provider.get("image", True):
71
71
  image_message = await get_image_message(item.image_url.url, engine)
72
72
  content.append(image_message)
73
- else:
73
+ elif msg.content:
74
74
  content = [{"text": msg.content}]
75
75
  tool_calls = msg.tool_calls
76
+ elif msg.content is None:
77
+ continue
76
78
 
77
79
  if tool_calls:
78
80
  tool_call = tool_calls[0]
aient/core/response.py CHANGED
@@ -28,6 +28,7 @@ async def fetch_gemini_response_stream(client, url, headers, payload, model):
28
28
  yield error_message
29
29
  return
30
30
  buffer = ""
31
+ cache_buffer = ""
31
32
  revicing_function_call = False
32
33
  function_full_response = "{"
33
34
  need_function_call = False
@@ -45,6 +46,7 @@ async def fetch_gemini_response_stream(client, url, headers, payload, model):
45
46
  # is_thinking = False
46
47
  async for chunk in response.aiter_text():
47
48
  buffer += chunk
49
+ cache_buffer += chunk
48
50
 
49
51
  while "\n" in buffer:
50
52
  line, buffer = buffer.split("\n", 1)
@@ -139,8 +141,12 @@ async def fetch_gemini_response_stream(client, url, headers, payload, model):
139
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)
140
142
  yield sse_string
141
143
 
142
- sse_string = await generate_sse_response(timestamp, model, stop="stop")
143
- yield sse_string
144
+ if cache_buffer == "[]":
145
+ sse_string = await generate_sse_response(timestamp, model, stop="PROHIBITED_CONTENT")
146
+ yield sse_string
147
+ else:
148
+ sse_string = await generate_sse_response(timestamp, model, stop="stop")
149
+ yield sse_string
144
150
 
145
151
  sse_string = await generate_sse_response(timestamp, model, None, None, None, None, None, totalTokenCount, promptTokenCount, candidatesTokenCount)
146
152
  yield sse_string
@@ -140,6 +140,8 @@ def excute_command(command):
140
140
  stderr=subprocess.PIPE,
141
141
  text=True,
142
142
  bufsize=1,
143
+ encoding='utf-8',
144
+ errors='replace',
143
145
  universal_newlines=True
144
146
  )
145
147
  # print(f"--- 开始执行命令 (PIPE): {command} ---")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aient
3
- Version: 1.1.44
3
+ Version: 1.1.46
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=90Mit0vrwoDJYQQVJmBltQdTnMaGKSmZNBMRXsoJ19A,72406
8
- aient/core/response.py,sha256=mAVsCnNhWY09DXNe0lyPUJq-1ljtGjC67Az-Uh7ozIw,35166
7
+ aient/core/request.py,sha256=r8IvC62GZ6NuBXx82Fd0hiPjYrtqhW3hKz2jdqVY8L0,72473
8
+ aient/core/response.py,sha256=_FVvvakplKAvBMljXy8jm9hMGJ8xgHGrsU8Aio9Xk1o,35408
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
@@ -23,7 +23,7 @@ aient/models/vertex.py,sha256=qVD5l1Q538xXUPulxG4nmDjXE1VoV4yuAkTCpIeJVw0,16795
23
23
  aient/plugins/__init__.py,sha256=p3KO6Aa3Lupos4i2SjzLQw1hzQTigOAfEHngsldrsyk,986
24
24
  aient/plugins/arXiv.py,sha256=yHjb6PS3GUWazpOYRMKMzghKJlxnZ5TX8z9F6UtUVow,1461
25
25
  aient/plugins/config.py,sha256=2DXH-LP9KGl_P4467chJu3q4AAbX5nSn4DIkdI0aYH8,7105
26
- aient/plugins/excute_command.py,sha256=U2rmL0r7AxWeifXkxmOANVVmt2t4lJ_iNF4-rhgnRts,10578
26
+ aient/plugins/excute_command.py,sha256=EQe-vSlTrdd5I0reLqkSXqnPn1VoaCF1HeYZ4z0Txew,10646
27
27
  aient/plugins/get_time.py,sha256=Ih5XIW5SDAIhrZ9W4Qe5Hs1k4ieKPUc_LAd6ySNyqZk,654
28
28
  aient/plugins/image.py,sha256=ZElCIaZznE06TN9xW3DrSukS7U3A5_cjk1Jge4NzPxw,2072
29
29
  aient/plugins/list_directory.py,sha256=V_uKkLx_fQDL5z__bSDC-PqAP-o32KmQW6Pdhx0Fx0s,1433
@@ -37,8 +37,8 @@ aient/plugins/write_file.py,sha256=hExFLuoNPtjYxJI3pVbofZRpokvUabpXdEkd3mZJPPc,3
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.44.dist-info/licenses/LICENSE,sha256=XNdbcWldt0yaNXXWB_Bakoqnxb3OVhUft4MgMA_71ds,1051
41
- aient-1.1.44.dist-info/METADATA,sha256=bSGcfygihGgS13WzrgiM_-WrFepIRVyIpN_tTiJEYjY,4968
42
- aient-1.1.44.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
43
- aient-1.1.44.dist-info/top_level.txt,sha256=3oXzrP5sAVvyyqabpeq8A2_vfMtY554r4bVE-OHBrZk,6
44
- aient-1.1.44.dist-info/RECORD,,
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,,
File without changes