aient 1.1.67__py3-none-any.whl → 1.1.68__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 CHANGED
@@ -390,7 +390,7 @@ async def fetch_cloudflare_response_stream(client, url, headers, payload, model)
390
390
  async def fetch_cohere_response_stream(client, url, headers, payload, model):
391
391
  timestamp = int(datetime.timestamp(datetime.now()))
392
392
  async with client.stream('POST', url, headers=headers, json=payload) as response:
393
- error_message = await check_response(response, "fetch_gpt_response_stream")
393
+ error_message = await check_response(response, "fetch_cohere_response_stream")
394
394
  if error_message:
395
395
  yield error_message
396
396
  return
aient/models/chatgpt.py CHANGED
@@ -471,6 +471,8 @@ class chatgpt(BaseLLM):
471
471
  # self.logger.info(f"worker Response: {full_response}")
472
472
  if not full_response.strip().endswith('[done]'):
473
473
  raise Exception(f"Response is not ended with [done]: {full_response}")
474
+ elif not full_response.strip():
475
+ raise Exception(f"Response is empty")
474
476
  else:
475
477
  full_response = full_response.strip().rstrip('[done]')
476
478
  full_response = full_response.replace("<tool_code>", "").replace("</tool_code>", "")
@@ -719,7 +721,7 @@ class chatgpt(BaseLLM):
719
721
  self.logger.info(f"api_key: {kwargs.get('api_key', self.api_key)}")
720
722
 
721
723
  # 发送请求并处理响应
722
- for i in range(10):
724
+ for i in range(30):
723
725
  if self.print_log:
724
726
  replaced_text = json.loads(re.sub(r';base64,([A-Za-z0-9+/=]+)', ';base64,***', json.dumps(json_post)))
725
727
  replaced_text_str = json.dumps(replaced_text, indent=4, ensure_ascii=False)
@@ -771,8 +773,8 @@ class chatgpt(BaseLLM):
771
773
  except httpx.RemoteProtocolError:
772
774
  continue
773
775
  except Exception as e:
774
- if "Response is not ended with [done]:" in str(e):
775
- self.logger.error(f"Response is not ended with [done]: {e}")
776
+ if "Response is" in str(e):
777
+ self.logger.error(f"{e}")
776
778
  continue
777
779
  self.logger.error(f"发生了未预料的错误:{e}")
778
780
  import traceback
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aient
3
- Version: 1.1.67
3
+ Version: 1.1.68
4
4
  Summary: Aient: The Awakening of Agent.
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -3,7 +3,7 @@ aient/core/__init__.py,sha256=NxjebTlku35S4Dzr16rdSqSTWUvvwEeACe8KvHJnjPg,34
3
3
  aient/core/log_config.py,sha256=kz2_yJv1p-o3lUQOwA3qh-LSc3wMHv13iCQclw44W9c,274
4
4
  aient/core/models.py,sha256=d4MISNezTSe0ls0-fjuToI2SoT-sk5fWqAJuKVinIlo,7502
5
5
  aient/core/request.py,sha256=4FFCwQ7h7b6bqtrA8qw-DPJVXZTj2i1CkYccFeEwUPw,76552
6
- aient/core/response.py,sha256=sPcNV9qLosj3lIXElezUZEjIyglspdkBg-EsIUhr9bQ,33203
6
+ aient/core/response.py,sha256=tYKWOeexYEhWK4napIAfYjCn2rQ1zpxRvknsBBWrv2M,33206
7
7
  aient/core/utils.py,sha256=D98d5Cy1h4ejKtuxS0EEDtL4YqpaZLB5tuXoVP0IBWQ,28462
8
8
  aient/core/test/test_base_api.py,sha256=pWnycRJbuPSXKKU9AQjWrMAX1wiLC_014Qc9hh5C2Pw,524
9
9
  aient/core/test/test_geminimask.py,sha256=HFX8jDbNg_FjjgPNxfYaR-0-roUrOO-ND-FVsuxSoiw,13254
@@ -12,7 +12,7 @@ aient/core/test/test_payload.py,sha256=8jBiJY1uidm1jzL-EiK0s6UGmW9XkdsuuKFGrwFhF
12
12
  aient/models/__init__.py,sha256=ZTiZgbfBPTjIPSKURE7t6hlFBVLRS9lluGbmqc1WjxQ,43
13
13
  aient/models/audio.py,sha256=kRd-8-WXzv4vwvsTGwnstK-WR8--vr9CdfCZzu8y9LA,1934
14
14
  aient/models/base.py,sha256=-nnihYnx-vHZMqeVO9ljjt3k4FcD3n-iMk4tT-10nRQ,7232
15
- aient/models/chatgpt.py,sha256=LnbWADil5oNmdBaAtXb1XcQwoaERqanO7Or9wzsg82w,49348
15
+ aient/models/chatgpt.py,sha256=sIAr_0jnux4VBnMu13wzWH1EBRdYuD7MmKHmI_QOixo,49396
16
16
  aient/plugins/__init__.py,sha256=p3KO6Aa3Lupos4i2SjzLQw1hzQTigOAfEHngsldrsyk,986
17
17
  aient/plugins/arXiv.py,sha256=yHjb6PS3GUWazpOYRMKMzghKJlxnZ5TX8z9F6UtUVow,1461
18
18
  aient/plugins/config.py,sha256=2DXH-LP9KGl_P4467chJu3q4AAbX5nSn4DIkdI0aYH8,7105
@@ -30,8 +30,8 @@ aient/plugins/write_file.py,sha256=Jt8fOEwqhYiSWpCbwfAr1xoi_BmFnx3076GMhuL06uI,3
30
30
  aient/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
31
  aient/utils/prompt.py,sha256=UcSzKkFE4-h_1b6NofI6xgk3GoleqALRKY8VBaXLjmI,11311
32
32
  aient/utils/scripts.py,sha256=VqtK4RFEx7KxkmcqG3lFDS1DxoNlFFGErEjopVcc8IE,40974
33
- aient-1.1.67.dist-info/licenses/LICENSE,sha256=XNdbcWldt0yaNXXWB_Bakoqnxb3OVhUft4MgMA_71ds,1051
34
- aient-1.1.67.dist-info/METADATA,sha256=ASACIjG-O4pxlG7sKokG11nJi05qq5oYnekYwcRxSUc,4842
35
- aient-1.1.67.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
36
- aient-1.1.67.dist-info/top_level.txt,sha256=3oXzrP5sAVvyyqabpeq8A2_vfMtY554r4bVE-OHBrZk,6
37
- aient-1.1.67.dist-info/RECORD,,
33
+ aient-1.1.68.dist-info/licenses/LICENSE,sha256=XNdbcWldt0yaNXXWB_Bakoqnxb3OVhUft4MgMA_71ds,1051
34
+ aient-1.1.68.dist-info/METADATA,sha256=duF98k4OVbuSq6w-AU4ENUEzwloNGeq-5q08o3n8EDs,4842
35
+ aient-1.1.68.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
36
+ aient-1.1.68.dist-info/top_level.txt,sha256=3oXzrP5sAVvyyqabpeq8A2_vfMtY554r4bVE-OHBrZk,6
37
+ aient-1.1.68.dist-info/RECORD,,
File without changes