beswarm 0.2.61__py3-none-any.whl → 0.2.62__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.
@@ -33,6 +33,10 @@ class ModelNotFoundError(Exception):
33
33
  """Custom exception for model not found (404) errors."""
34
34
  pass
35
35
 
36
+ class RateLimitError(Exception):
37
+ """Custom exception for rate limit (429) errors."""
38
+ pass
39
+
36
40
  class TaskComplete(Exception):
37
41
  """Exception-like signal to indicate the task is complete."""
38
42
  def __init__(self, message):
@@ -778,6 +782,8 @@ class chatgpt(BaseLLM):
778
782
  raise APITimeoutError("Response timeout")
779
783
  if "HTTP Error', 'status_code': 404" in processed_chunk:
780
784
  raise ModelNotFoundError(f"Model: {model or self.engine} not found!")
785
+ if "HTTP Error', 'status_code': 429" in processed_chunk:
786
+ raise RateLimitError(f"Rate limit exceeded for model: {model or self.engine}")
781
787
  yield processed_chunk
782
788
  index += 1
783
789
 
@@ -791,6 +797,9 @@ class chatgpt(BaseLLM):
791
797
  except APITimeoutError:
792
798
  self.logger.warning("API response timeout (524), retrying...")
793
799
  continue
800
+ except RateLimitError as e:
801
+ self.logger.warning(f"{e}, retrying...")
802
+ continue
794
803
  except ValidationError as e:
795
804
  self.logger.warning(f"Validation failed: {e}. Retrying with corrective prompt.")
796
805
  need_done_prompt = [
@@ -941,4 +950,4 @@ class chatgpt(BaseLLM):
941
950
  {"role": "system", "content": self.system_prompt},
942
951
  ]
943
952
  self.tokens_usage[convo_id] = 0
944
- self.current_tokens[convo_id] = 0
953
+ self.current_tokens[convo_id] = 0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: beswarm
3
- Version: 0.2.61
3
+ Version: 0.2.62
4
4
  Summary: MAS
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -21,7 +21,7 @@ beswarm/aient/aient/core/test/test_payload.py,sha256=8jBiJY1uidm1jzL-EiK0s6UGmW9
21
21
  beswarm/aient/aient/models/__init__.py,sha256=ZTiZgbfBPTjIPSKURE7t6hlFBVLRS9lluGbmqc1WjxQ,43
22
22
  beswarm/aient/aient/models/audio.py,sha256=kRd-8-WXzv4vwvsTGwnstK-WR8--vr9CdfCZzu8y9LA,1934
23
23
  beswarm/aient/aient/models/base.py,sha256=-nnihYnx-vHZMqeVO9ljjt3k4FcD3n-iMk4tT-10nRQ,7232
24
- beswarm/aient/aient/models/chatgpt.py,sha256=q62B6cbtHqKrqsQjM24k_1wi_5-UiuxkXa7e2yG_Clg,44661
24
+ beswarm/aient/aient/models/chatgpt.py,sha256=37Vafo8iqV1CNvTT2Ai7ar2QAmWsSiwt1o9y-d9kXcI,45071
25
25
  beswarm/aient/aient/plugins/__init__.py,sha256=p3KO6Aa3Lupos4i2SjzLQw1hzQTigOAfEHngsldrsyk,986
26
26
  beswarm/aient/aient/plugins/arXiv.py,sha256=yHjb6PS3GUWazpOYRMKMzghKJlxnZ5TX8z9F6UtUVow,1461
27
27
  beswarm/aient/aient/plugins/config.py,sha256=TGgZ5SnNKZ8MmdznrZ-TEq7s2ulhAAwTSKH89bci3dA,7079
@@ -116,7 +116,7 @@ beswarm/tools/search_web.py,sha256=NYrb5KL_WUGPm-fOKT8Cyjon04lxBU-gaLdrVjeYgGo,1
116
116
  beswarm/tools/subtasks.py,sha256=mIjA2QrRy9Fos4rYm8fCfu2QrsE_MGnQI9IR8dOxsGs,9885
117
117
  beswarm/tools/worker.py,sha256=_cSkRUKRJMAiZiTfnBze_e9Kc7k7KvbB5hdxdvp4FW4,2009
118
118
  beswarm/tools/write_csv.py,sha256=u0Hq18Ksfheb52MVtyLNCnSDHibITpsYBPs2ub7USYA,1466
119
- beswarm-0.2.61.dist-info/METADATA,sha256=s14zUG7R6_2LWhXRMX-UZF0MQeh06d0bmX84pH5KlhU,3878
120
- beswarm-0.2.61.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
121
- beswarm-0.2.61.dist-info/top_level.txt,sha256=pJw4O87wvt5882smuSO6DfByJz7FJ8SxxT8h9fHCmpo,8
122
- beswarm-0.2.61.dist-info/RECORD,,
119
+ beswarm-0.2.62.dist-info/METADATA,sha256=q-588I0-yBg6skJGRrmIv9iGUvGIc6Hzqw2VeBlJkiA,3878
120
+ beswarm-0.2.62.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
121
+ beswarm-0.2.62.dist-info/top_level.txt,sha256=pJw4O87wvt5882smuSO6DfByJz7FJ8SxxT8h9fHCmpo,8
122
+ beswarm-0.2.62.dist-info/RECORD,,