aient 1.1.17__py3-none-any.whl → 1.1.19__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
@@ -12,6 +12,7 @@ from .utils import (
12
12
  c35s,
13
13
  gemini1,
14
14
  gemini2,
15
+ gemini2_5_pro_exp,
15
16
  BaseAPI,
16
17
  safe_get,
17
18
  get_engine,
@@ -112,7 +113,7 @@ async def get_gemini_payload(request, engine, provider, api_key=None):
112
113
  if system_prompt.strip():
113
114
  systemInstruction = {"parts": [{"text": system_prompt}]}
114
115
 
115
- if any(off_model in original_model for off_model in gemini_max_token_65k_models) or original_model == "gemini-2.0-flash-preview-image-generation":
116
+ if any(off_model in original_model for off_model in gemini_max_token_65k_models) or original_model.endswith("-image-generation"):
116
117
  safety_settings = "OFF"
117
118
  else:
118
119
  safety_settings = "BLOCK_NONE"
@@ -167,6 +168,7 @@ async def get_gemini_payload(request, engine, provider, api_key=None):
167
168
  'response_format',
168
169
  'stream_options',
169
170
  'prompt',
171
+ 'size',
170
172
  ]
171
173
  generation_config = {}
172
174
 
@@ -221,7 +223,7 @@ async def get_gemini_payload(request, engine, provider, api_key=None):
221
223
  else:
222
224
  payload["generationConfig"]["maxOutputTokens"] = 8192
223
225
 
224
- if original_model == "gemini-2.0-flash-preview-image-generation":
226
+ if original_model.endswith("-image-generation"):
225
227
  payload["generationConfig"]["response_modalities"] = [
226
228
  "Text",
227
229
  "Image",
@@ -336,10 +338,11 @@ async def get_vertex_gemini_payload(request, engine, provider, api_key=None):
336
338
  pro_models = ["gemini-2.5", "gemini-2.0"]
337
339
  if any(pro_model in original_model for pro_model in pro_models):
338
340
  location = gemini2
339
- # search_tool = {"googleSearch": {}}
340
341
  else:
341
342
  location = gemini1
342
- # search_tool = {"googleSearchRetrieval": {}}
343
+
344
+ if "gemini-2.5-pro-exp-03-25" == original_model:
345
+ location = gemini2_5_pro_exp
343
346
 
344
347
  if "google-vertex-ai" in provider.get("base_url", ""):
345
348
  url = provider.get("base_url").rstrip('/') + "/v1/projects/{PROJECT_ID}/locations/{LOCATION}/publishers/google/models/{MODEL_ID}:{stream}".format(
@@ -351,6 +354,13 @@ async def get_vertex_gemini_payload(request, engine, provider, api_key=None):
351
354
  elif api_key is not None and api_key[2] == ".":
352
355
  url = f"https://aiplatform.googleapis.com/v1/publishers/google/models/{original_model}:{gemini_stream}?key={api_key}"
353
356
  headers.pop("Authorization", None)
357
+ elif "gemini-2.5-pro-exp-03-25" == original_model:
358
+ url = "https://aiplatform.googleapis.com/v1/projects/{PROJECT_ID}/locations/{LOCATION}/publishers/google/models/{MODEL_ID}:{stream}".format(
359
+ LOCATION=await location.next(),
360
+ PROJECT_ID=project_id,
361
+ MODEL_ID=original_model,
362
+ stream=gemini_stream
363
+ )
354
364
  else:
355
365
  url = "https://{LOCATION}-aiplatform.googleapis.com/v1/projects/{PROJECT_ID}/locations/{LOCATION}/publishers/google/models/{MODEL_ID}:{stream}".format(
356
366
  LOCATION=await location.next(),
@@ -464,6 +474,8 @@ async def get_vertex_gemini_payload(request, engine, provider, api_key=None):
464
474
  'logprobs',
465
475
  'top_logprobs',
466
476
  'stream_options',
477
+ 'prompt',
478
+ 'size',
467
479
  ]
468
480
  generation_config = {}
469
481
 
aient/core/response.py CHANGED
@@ -54,8 +54,6 @@ async def fetch_gemini_response_stream(client, url, headers, payload, model):
54
54
  if line and '\"finishReason\": \"' in line:
55
55
  if "stop" not in line.lower():
56
56
  logger.error(f"finishReason: {line}")
57
- sse_string = await generate_sse_response(timestamp, model, stop="stop")
58
- yield sse_string
59
57
  is_finish = True
60
58
  if is_finish and '\"promptTokenCount\": ' in line:
61
59
  json_data = parse_json_safely( "{" + line + "}")
@@ -117,6 +115,9 @@ async def fetch_gemini_response_stream(client, url, headers, payload, model):
117
115
  sse_string = await generate_sse_response(timestamp, model, content=None, tools_id="chatcmpl-9inWv0yEtgn873CxMBzHeCeiHctTV", function_call_name=None, function_call_content=function_full_response)
118
116
  yield sse_string
119
117
 
118
+ sse_string = await generate_sse_response(timestamp, model, stop="stop")
119
+ yield sse_string
120
+
120
121
  sse_string = await generate_sse_response(timestamp, model, None, None, None, None, None, totalTokenCount, promptTokenCount, candidatesTokenCount)
121
122
  yield sse_string
122
123
 
aient/core/utils.py CHANGED
@@ -437,6 +437,7 @@ c3o = ThreadSafeCircularList(["us-east5"])
437
437
  c3h = ThreadSafeCircularList(["us-east5", "us-central1", "europe-west1", "europe-west4"])
438
438
  gemini1 = ThreadSafeCircularList(["us-central1", "us-east4", "us-west1", "us-west4", "europe-west1", "europe-west2"])
439
439
  gemini2 = ThreadSafeCircularList(["us-central1"])
440
+ gemini2_5_pro_exp = ThreadSafeCircularList(["global"])
440
441
 
441
442
 
442
443
 
@@ -185,6 +185,9 @@ def excute_command(command):
185
185
  # print(f"is_same: {is_same}", flush=True)
186
186
  # print(f"\n\n\n", flush=True)
187
187
  new_output_lines.append(line)
188
+ # 限制输出行数
189
+ if len(new_output_lines) > 500:
190
+ new_output_lines = new_output_lines[:250] + new_output_lines[-250:]
188
191
  final_output_log = "\n".join(new_output_lines)
189
192
  # print(f"output_lines: {len(new_output_lines)}")
190
193
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aient
3
- Version: 1.1.17
3
+ Version: 1.1.19
4
4
  Summary: Aient: The Awakening of Agent.
5
5
  Description-Content-Type: text/markdown
6
6
  License-File: LICENSE
@@ -4,9 +4,9 @@ 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=kF-HLi1I2k_G5r153ZHuiGH8_NmpTlFMfK0_myB28YQ,7366
7
- aient/core/request.py,sha256=nvF_V71svezQ0-UbnC9RB_pXo_wV6QC7WE_SANwQzxE,66195
8
- aient/core/response.py,sha256=3OASBI-Y_8VlAusY-ch3oPwBHhn1rMDhhMyDBsK1FcY,33224
9
- aient/core/utils.py,sha256=VQ9uutGRR_JOvECOrjeoRBO2aA6w-pGwoXnnS2UvfPU,27263
7
+ aient/core/request.py,sha256=qKj_w9UpXZePCGhhMuE-rX7rCPUdCx8GJ-HUXiurBho,66589
8
+ aient/core/response.py,sha256=YphzhA9jtQKzWb3L4XGTp9xJZ2FOzHr1aAMTsi896FQ,33201
9
+ aient/core/utils.py,sha256=zidsBUBd3KskzcxQcPB1y5x1RhtWcbZeWvmgb4LAadA,27318
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
12
12
  aient/core/test/test_image.py,sha256=_T4peNGdXKBHHxyQNx12u-NTyFE8TlYI6NvvagsG2LE,319
@@ -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=Vp6CG9ocdC_FAlCMEGtKj45xamir76DFxdJVvURNtog,6539
26
- aient/plugins/excute_command.py,sha256=huQSbNbeImV8BUIsQKE13BIhCAMr7aYRyXO4saE1dTI,10534
26
+ aient/plugins/excute_command.py,sha256=9t7RB8ikltZZRv8NcjoxfaD8FkPuWbJTZ2Vwk7hEwTA,10683
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=JZVuImecMSfEv6jLqii-0uQJ1UCsrpMNmYlwW3PEDg4,1374
@@ -38,8 +38,8 @@ aient/prompt/agent.py,sha256=ZNsbgXRyvYzAFTRRziAnNVqcTyAnxrGcsGfGrt72j6k,25427
38
38
  aient/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
39
  aient/utils/prompt.py,sha256=UcSzKkFE4-h_1b6NofI6xgk3GoleqALRKY8VBaXLjmI,11311
40
40
  aient/utils/scripts.py,sha256=LD8adnfuRrJoY2tWKseXOPJXaxbrUmz4czsnUvHswNY,29096
41
- aient-1.1.17.dist-info/licenses/LICENSE,sha256=XNdbcWldt0yaNXXWB_Bakoqnxb3OVhUft4MgMA_71ds,1051
42
- aient-1.1.17.dist-info/METADATA,sha256=4rxyF7eATHamHyS_kV-HyEtyw1vtn5BE5cKMVsgDHKg,4968
43
- aient-1.1.17.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
44
- aient-1.1.17.dist-info/top_level.txt,sha256=3oXzrP5sAVvyyqabpeq8A2_vfMtY554r4bVE-OHBrZk,6
45
- aient-1.1.17.dist-info/RECORD,,
41
+ aient-1.1.19.dist-info/licenses/LICENSE,sha256=XNdbcWldt0yaNXXWB_Bakoqnxb3OVhUft4MgMA_71ds,1051
42
+ aient-1.1.19.dist-info/METADATA,sha256=e_l0AXWug1BtZt95VknjeRfXA0FQcKgZ3LQ8yL_uIFw,4968
43
+ aient-1.1.19.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
44
+ aient-1.1.19.dist-info/top_level.txt,sha256=3oXzrP5sAVvyyqabpeq8A2_vfMtY554r4bVE-OHBrZk,6
45
+ aient-1.1.19.dist-info/RECORD,,
File without changes