camel-ai 0.2.72a8__py3-none-any.whl → 0.2.72a10__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.

Potentially problematic release.


This version of camel-ai might be problematic. Click here for more details.

camel/__init__.py CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
  from camel.logger import disable_logging, enable_logging, set_log_level
16
16
 
17
- __version__ = '0.2.72a8'
17
+ __version__ = '0.2.72a10'
18
18
 
19
19
  __all__ = [
20
20
  '__version__',
@@ -11,7 +11,6 @@
11
11
  # See the License for the specific language governing permissions and
12
12
  # limitations under the License.
13
13
  # ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
14
- import fcntl
15
14
  import os
16
15
  import time
17
16
  from pathlib import Path
@@ -88,58 +87,48 @@ class NoteTakingToolkit(BaseToolkit):
88
87
  return f"Error appending note: {e}"
89
88
 
90
89
  def _load_registry(self) -> None:
91
- r"""Load the note registry from file with file locking."""
90
+ r"""Load the note registry from file."""
92
91
  max_retries = 5
93
92
  retry_delay = 0.1
94
93
 
95
94
  for attempt in range(max_retries):
96
95
  try:
97
96
  if self.registry_file.exists():
98
- with open(self.registry_file, 'r') as f:
99
- fcntl.flock(f.fileno(), fcntl.LOCK_SH)
100
- try:
101
- content = f.read().strip()
102
- self.registry = (
103
- content.split('\n') if content else []
104
- )
105
- finally:
106
- fcntl.flock(f.fileno(), fcntl.LOCK_UN)
107
- return
97
+ content = self.registry_file.read_text(
98
+ encoding='utf-8'
99
+ ).strip()
100
+ self.registry = content.split('\n') if content else []
108
101
  else:
109
102
  self.registry = []
110
- return
111
- except IOError:
103
+ return
104
+ except (IOError, OSError):
112
105
  if attempt < max_retries - 1:
113
106
  time.sleep(retry_delay * (attempt + 1))
114
107
  else:
108
+ # If all retries failed, initialize with empty registry
115
109
  self.registry = []
116
- except Exception:
117
- self.registry = []
118
- return
119
110
 
120
111
  def _save_registry(self) -> None:
121
- r"""Save the note registry to file with file locking."""
112
+ r"""Save the note registry to file using atomic write."""
122
113
  max_retries = 5
123
114
  retry_delay = 0.1
124
115
 
125
116
  for attempt in range(max_retries):
126
117
  try:
127
- with open(self.registry_file, 'w') as f:
128
- fcntl.flock(f.fileno(), fcntl.LOCK_EX)
129
- try:
130
- f.write('\n'.join(self.registry))
131
- f.flush()
132
- os.fsync(f.fileno())
133
- finally:
134
- fcntl.flock(f.fileno(), fcntl.LOCK_UN)
118
+ # Use atomic write with temporary file for all platforms
119
+ temp_file = self.registry_file.with_suffix('.tmp')
120
+ temp_file.write_text(
121
+ '\n'.join(self.registry), encoding='utf-8'
122
+ )
123
+
124
+ # Atomic rename - works on all platforms
125
+ temp_file.replace(self.registry_file)
135
126
  return
136
- except IOError:
127
+ except (IOError, OSError):
137
128
  if attempt < max_retries - 1:
138
129
  time.sleep(retry_delay * (attempt + 1))
139
130
  else:
140
131
  raise
141
- except Exception:
142
- pass
143
132
 
144
133
  def _register_note(self, note_name: str) -> None:
145
134
  r"""Register a new note in the registry with thread-safe operations."""
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: camel-ai
3
- Version: 0.2.72a8
3
+ Version: 0.2.72a10
4
4
  Summary: Communicative Agents for AI Society Study
5
5
  Project-URL: Homepage, https://www.camel-ai.org/
6
6
  Project-URL: Repository, https://github.com/camel-ai/camel
@@ -1,4 +1,4 @@
1
- camel/__init__.py,sha256=plLSliCoCCZfy_ML-MibJ3RAdpkPEEae49muH6Ts4G0,901
1
+ camel/__init__.py,sha256=q0lYqJdzEjRoerFvmRgsd0TXuTbJ0oBldqWm7llhdfY,902
2
2
  camel/generators.py,sha256=JRqj9_m1PF4qT6UtybzTQ-KBT9MJQt18OAAYvQ_fr2o,13844
3
3
  camel/human.py,sha256=Xg8x1cS5KK4bQ1SDByiHZnzsRpvRP-KZViNvmu38xo4,5475
4
4
  camel/logger.py,sha256=WgEwael_eT6D-lVAKHpKIpwXSTjvLbny5jbV1Ab8lnA,5760
@@ -353,7 +353,7 @@ camel/toolkits/meshy_toolkit.py,sha256=NbgdOBD3FYLtZf-AfonIv6-Q8-8DW129jsaP1PqI2
353
353
  camel/toolkits/message_agent_toolkit.py,sha256=yWvAaxoxAvDEtD7NH7IkkHIyfWIYK47WZhn5E_RaxKo,22661
354
354
  camel/toolkits/mineru_toolkit.py,sha256=vRX9LholLNkpbJ6axfEN4pTG85aWb0PDmlVy3rAAXhg,6868
355
355
  camel/toolkits/networkx_toolkit.py,sha256=C7pUCZTzzGkFyqdkrmhRKpAHmHWfLKeuzYHC_BHPtbk,8826
356
- camel/toolkits/note_taking_toolkit.py,sha256=MLKkiPqYULAb6ZXwkRLqFw-Z1egtXrFXScfKAaIqOoE,11037
356
+ camel/toolkits/note_taking_toolkit.py,sha256=cp7uoSBMjiGy331Tdk2Bl6yqKSMGwws7rQJkq8tfTQs,10687
357
357
  camel/toolkits/notion_toolkit.py,sha256=jmmVWk_WazRNWnx4r9DAvhFTAL-n_ige0tb32UHJ_ik,9752
358
358
  camel/toolkits/open_api_toolkit.py,sha256=Venfq8JwTMQfzRzzB7AYmYUMEX35hW0BjIv_ozFMiNk,23316
359
359
  camel/toolkits/openai_agent_toolkit.py,sha256=hT2ancdQigngAiY1LNnGJzZeiBDHUxrRGv6BdZTJizc,4696
@@ -450,7 +450,7 @@ camel/verifiers/math_verifier.py,sha256=tA1D4S0sm8nsWISevxSN0hvSVtIUpqmJhzqfbuMo
450
450
  camel/verifiers/models.py,sha256=GdxYPr7UxNrR1577yW4kyroRcLGfd-H1GXgv8potDWU,2471
451
451
  camel/verifiers/physics_verifier.py,sha256=c1grrRddcrVN7szkxhv2QirwY9viIRSITWeWFF5HmLs,30187
452
452
  camel/verifiers/python_verifier.py,sha256=ogTz77wODfEcDN4tMVtiSkRQyoiZbHPY2fKybn59lHw,20558
453
- camel_ai-0.2.72a8.dist-info/METADATA,sha256=qNYGNVj0-AFaRAg7Tweu9U-F17w0OJUySmL8qZ_MZZs,50002
454
- camel_ai-0.2.72a8.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
455
- camel_ai-0.2.72a8.dist-info/licenses/LICENSE,sha256=id0nB2my5kG0xXeimIu5zZrbHLS6EQvxvkKkzIHaT2k,11343
456
- camel_ai-0.2.72a8.dist-info/RECORD,,
453
+ camel_ai-0.2.72a10.dist-info/METADATA,sha256=H08WhbsP_OpTX9jJi7b96FF4U4TLn0DGXOPLMQvWrOI,50003
454
+ camel_ai-0.2.72a10.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
455
+ camel_ai-0.2.72a10.dist-info/licenses/LICENSE,sha256=id0nB2my5kG0xXeimIu5zZrbHLS6EQvxvkKkzIHaT2k,11343
456
+ camel_ai-0.2.72a10.dist-info/RECORD,,