aient 1.1.47__py3-none-any.whl → 1.1.49__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/response.py +2 -2
- aient/plugins/read_file.py +8 -0
- {aient-1.1.47.dist-info → aient-1.1.49.dist-info}/METADATA +1 -1
- {aient-1.1.47.dist-info → aient-1.1.49.dist-info}/RECORD +7 -7
- {aient-1.1.47.dist-info → aient-1.1.49.dist-info}/WHEEL +0 -0
- {aient-1.1.47.dist-info → aient-1.1.49.dist-info}/licenses/LICENSE +0 -0
- {aient-1.1.47.dist-info → aient-1.1.49.dist-info}/top_level.txt +0 -0
aient/core/response.py
CHANGED
@@ -247,7 +247,7 @@ async def fetch_gpt_response_stream(client, url, headers, payload):
|
|
247
247
|
while "\n" in buffer:
|
248
248
|
line, buffer = buffer.split("\n", 1)
|
249
249
|
# logger.info("line: %s", repr(line))
|
250
|
-
if line and not line.startswith(":
|
250
|
+
if line and not line.startswith(":") and (result:=line.lstrip("data: ").strip()):
|
251
251
|
if result.strip() == "[DONE]":
|
252
252
|
break
|
253
253
|
line = json.loads(result)
|
@@ -361,7 +361,7 @@ async def fetch_azure_response_stream(client, url, headers, payload):
|
|
361
361
|
while "\n" in buffer:
|
362
362
|
line, buffer = buffer.split("\n", 1)
|
363
363
|
# logger.info("line: %s", repr(line))
|
364
|
-
if line and not line.startswith(":
|
364
|
+
if line and not line.startswith(":") and (result:=line.lstrip("data: ").strip()):
|
365
365
|
if result.strip() == "[DONE]":
|
366
366
|
break
|
367
367
|
line = json.loads(result)
|
aient/plugins/read_file.py
CHANGED
@@ -161,6 +161,14 @@ Examples:
|
|
161
161
|
# 捕获在此块中可能发生的其他错误,例如未被早期检查捕获的文件读取问题
|
162
162
|
return f"<tool_error>处理通用文件 '{file_path}' 时发生错误: {e}</tool_error>"
|
163
163
|
|
164
|
+
if file_path.lower().endswith('.csv'):
|
165
|
+
lines = text_content.splitlines(True)
|
166
|
+
if len(lines) > 500:
|
167
|
+
top_lines = lines[:250]
|
168
|
+
bottom_lines = lines[-250:]
|
169
|
+
omitted_count = len(lines) - 500
|
170
|
+
text_content = "".join(top_lines) + f"\n... (中间省略了 {omitted_count} 行) ...\n" + "".join(bottom_lines)
|
171
|
+
|
164
172
|
# 返回文件内容
|
165
173
|
return text_content
|
166
174
|
|
@@ -5,7 +5,7 @@ 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
7
|
aient/core/request.py,sha256=8HlSFaBhWMs5thhL4C5qj-hvuDZWUXCYWwVShFR99QU,72263
|
8
|
-
aient/core/response.py,sha256
|
8
|
+
aient/core/response.py,sha256=-28HYKuzgfC1y7VOrYLk75_QH5yh6c1IS024yoQM0mg,35671
|
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
|
@@ -27,7 +27,7 @@ aient/plugins/excute_command.py,sha256=EQe-vSlTrdd5I0reLqkSXqnPn1VoaCF1HeYZ4z0Tx
|
|
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
|
30
|
-
aient/plugins/read_file.py,sha256=
|
30
|
+
aient/plugins/read_file.py,sha256=ifG9J499oHqm7wXqGb2ye7YTYHFtwB1Mf4JYyWae7ig,8695
|
31
31
|
aient/plugins/read_image.py,sha256=4FbIiMNVFUQpNyiH5ApGSRvOD9ujcXGyuqlGTJMd7ac,4017
|
32
32
|
aient/plugins/readonly.py,sha256=qK5-kBM3NDH1b-otFxFHpAjV5BXEY_e7cTWBcpP7G5k,710
|
33
33
|
aient/plugins/registry.py,sha256=YknzhieU_8nQ3oKlUSSWDB4X7t2Jx0JnqT2Jd9Xsvfk,3574
|
@@ -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.
|
41
|
-
aient-1.1.
|
42
|
-
aient-1.1.
|
43
|
-
aient-1.1.
|
44
|
-
aient-1.1.
|
40
|
+
aient-1.1.49.dist-info/licenses/LICENSE,sha256=XNdbcWldt0yaNXXWB_Bakoqnxb3OVhUft4MgMA_71ds,1051
|
41
|
+
aient-1.1.49.dist-info/METADATA,sha256=Rh9kejUXQzYWIdZ5WkPCWUeeXP8CJdf-U_sbzHVBzVk,4968
|
42
|
+
aient-1.1.49.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
43
|
+
aient-1.1.49.dist-info/top_level.txt,sha256=3oXzrP5sAVvyyqabpeq8A2_vfMtY554r4bVE-OHBrZk,6
|
44
|
+
aient-1.1.49.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|