camel-ai 0.1.6.1__py3-none-any.whl → 0.1.6.2__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
@@ -12,7 +12,7 @@
12
12
  # limitations under the License.
13
13
  # =========== Copyright 2023 @ CAMEL-AI.org. All Rights Reserved. ===========
14
14
 
15
- __version__ = '0.1.6.1'
15
+ __version__ = '0.1.6.2'
16
16
 
17
17
  __all__ = [
18
18
  '__version__',
@@ -63,14 +63,14 @@ if TYPE_CHECKING:
63
63
 
64
64
  # AgentOps decorator setting
65
65
  try:
66
- from agentops import track_agent
67
- except ImportError:
68
-
69
- def track_agent():
70
- def noop(f):
71
- return f
72
-
73
- return noop
66
+ import os
67
+
68
+ if os.getenv("AGENTOPS_API_KEY") is not None:
69
+ from agentops import track_agent
70
+ else:
71
+ raise ImportError
72
+ except (ImportError, AttributeError):
73
+ from camel.utils import track_agent
74
74
 
75
75
 
76
76
  class FunctionCallingRecord(BaseModel):
@@ -26,14 +26,14 @@ from camel.utils import get_first_int, print_text_animated
26
26
 
27
27
  # AgentOps decorator setting
28
28
  try:
29
- from agentops import track_agent
30
- except ImportError:
31
-
32
- def track_agent():
33
- def noop(f):
34
- return f
35
-
36
- return noop
29
+ import os
30
+
31
+ if os.getenv("AGENTOPS_API_KEY") is not None:
32
+ from agentops import track_agent
33
+ else:
34
+ raise ImportError
35
+ except (ImportError, AttributeError):
36
+ from camel.utils import track_agent
37
37
 
38
38
 
39
39
  @track_agent(name="CriticAgent")
@@ -22,14 +22,14 @@ from camel.types import RoleType
22
22
 
23
23
  # AgentOps decorator setting
24
24
  try:
25
- from agentops import track_agent
26
- except ImportError:
25
+ import os
27
26
 
28
- def track_agent():
29
- def noop(f):
30
- return f
31
-
32
- return noop
27
+ if os.getenv("AGENTOPS_API_KEY") is not None:
28
+ from agentops import track_agent
29
+ else:
30
+ raise ImportError
31
+ except (ImportError, AttributeError):
32
+ from camel.utils import track_agent
33
33
 
34
34
 
35
35
  @track_agent(name="DeductiveReasonerAgent")
@@ -29,14 +29,14 @@ from camel.utils import print_text_animated
29
29
 
30
30
  # AgentOps decorator setting
31
31
  try:
32
- from agentops import track_agent
33
- except ImportError:
34
-
35
- def track_agent():
36
- def noop(f):
37
- return f
38
-
39
- return noop
32
+ import os
33
+
34
+ if os.getenv("AGENTOPS_API_KEY") is not None:
35
+ from agentops import track_agent
36
+ else:
37
+ raise ImportError
38
+ except (ImportError, AttributeError):
39
+ from camel.utils import track_agent
40
40
 
41
41
 
42
42
  @track_agent(name="EmbodiedAgent")
@@ -31,14 +31,14 @@ from camel.types import RoleType
31
31
 
32
32
  # AgentOps decorator setting
33
33
  try:
34
- from agentops import track_agent
35
- except ImportError:
36
-
37
- def track_agent():
38
- def noop(f):
39
- return f
40
-
41
- return noop
34
+ import os
35
+
36
+ if os.getenv("AGENTOPS_API_KEY") is not None:
37
+ from agentops import track_agent
38
+ else:
39
+ raise ImportError
40
+ except (ImportError, AttributeError):
41
+ from camel.utils import track_agent
42
42
 
43
43
 
44
44
  text_prompt = """
@@ -22,14 +22,14 @@ from camel.types import RoleType
22
22
 
23
23
  # AgentOps decorator setting
24
24
  try:
25
- from agentops import track_agent
26
- except ImportError:
27
-
28
- def track_agent():
29
- def noop(f):
30
- return f
31
-
32
- return noop
25
+ import os
26
+
27
+ if os.getenv("AGENTOPS_API_KEY") is not None:
28
+ from agentops import track_agent
29
+ else:
30
+ raise ImportError
31
+ except (ImportError, AttributeError):
32
+ from camel.utils import track_agent
33
33
 
34
34
 
35
35
  @track_agent(name="RoleAssignmentAgent")
@@ -22,14 +22,14 @@ from camel.utils import create_chunks
22
22
 
23
23
  # AgentOps decorator setting
24
24
  try:
25
- from agentops import track_agent
26
- except ImportError:
27
-
28
- def track_agent():
29
- def noop(f):
30
- return f
31
-
32
- return noop
25
+ import os
26
+
27
+ if os.getenv("AGENTOPS_API_KEY") is not None:
28
+ from agentops import track_agent
29
+ else:
30
+ raise ImportError
31
+ except (ImportError, AttributeError):
32
+ from camel.utils import track_agent
33
33
 
34
34
 
35
35
  @track_agent(name="SearchAgent")
@@ -22,14 +22,14 @@ from camel.utils import get_task_list
22
22
 
23
23
  # AgentOps decorator setting
24
24
  try:
25
- from agentops import track_agent
26
- except ImportError:
27
-
28
- def track_agent():
29
- def noop(f):
30
- return f
31
-
32
- return noop
25
+ import os
26
+
27
+ if os.getenv("AGENTOPS_API_KEY") is not None:
28
+ from agentops import track_agent
29
+ else:
30
+ raise ImportError
31
+ except (ImportError, AttributeError):
32
+ from camel.utils import track_agent
33
33
 
34
34
 
35
35
  @track_agent(name="TaskSpecifyAgent")
camel/utils/__init__.py CHANGED
@@ -32,6 +32,7 @@ from .commons import (
32
32
  print_text_animated,
33
33
  text_extract_from_web,
34
34
  to_pascal,
35
+ track_agent,
35
36
  )
36
37
  from .constants import Constants
37
38
  from .token_counting import (
@@ -74,4 +75,5 @@ __all__ = [
74
75
  'json_to_function_code',
75
76
  'agentops_decorator',
76
77
  'AgentOpsMeta',
78
+ 'track_agent',
77
79
  ]
camel/utils/commons.py CHANGED
@@ -488,8 +488,14 @@ def is_docker_running() -> bool:
488
488
 
489
489
 
490
490
  try:
491
- from agentops import ToolEvent, record
492
- except ImportError:
491
+ if os.getenv("AGENTOPS_API_KEY") is not None:
492
+ from agentops import (
493
+ ToolEvent,
494
+ record,
495
+ )
496
+ else:
497
+ raise ImportError
498
+ except (ImportError, AttributeError):
493
499
  ToolEvent = None
494
500
 
495
501
 
@@ -528,7 +534,16 @@ class AgentOpsMeta(type):
528
534
  """
529
535
 
530
536
  def __new__(cls, name, bases, dct):
531
- for attr, value in dct.items():
532
- if callable(value) and attr != 'get_tools':
533
- dct[attr] = agentops_decorator(value)
534
- return super(AgentOpsMeta, cls).__new__(cls, name, bases, dct)
537
+ if ToolEvent:
538
+ for attr, value in dct.items():
539
+ if callable(value) and attr != 'get_tools':
540
+ dct[attr] = agentops_decorator(value)
541
+ return super().__new__(cls, name, bases, dct)
542
+
543
+
544
+ # Mock trak agent decorator for AgentOps
545
+ def track_agent(*args, **kwargs):
546
+ def noop(f):
547
+ return f
548
+
549
+ return noop
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: camel-ai
3
- Version: 0.1.6.1
3
+ Version: 0.1.6.2
4
4
  Summary: Communicative Agents for AI Society Study
5
5
  Home-page: https://www.camel-ai.org/
6
6
  License: Apache-2.0
@@ -198,7 +198,7 @@ conda create --name camel python=3.9
198
198
  conda activate camel
199
199
 
200
200
  # Clone github repo
201
- git clone -b v0.1.6.1 https://github.com/camel-ai/camel.git
201
+ git clone -b v0.1.6.2 https://github.com/camel-ai/camel.git
202
202
 
203
203
  # Change directory into project directory
204
204
  cd camel
@@ -1,14 +1,14 @@
1
- camel/__init__.py,sha256=tSbN4cmxPRUQRhoSLga0A7TCIcO0pr0vcwnF-wqA8BI,780
1
+ camel/__init__.py,sha256=GYsqplvLJOJ1R9fzX-tC9iXj2qxfMuhm-y5EDztkhCo,780
2
2
  camel/agents/__init__.py,sha256=SSU1wbhZXWwQnE0rRxkpyN57kEu72KklsZNcdLkXfTs,1551
3
3
  camel/agents/base.py,sha256=X39qWSiT1WnDqaJ9k3gQrTpOQSwUKzNEVpp5AY6fDH8,1130
4
- camel/agents/chat_agent.py,sha256=eFOy2maOh08-oj67P22XVSHIM7TdJW4pQ-ssubv-GAw,36141
5
- camel/agents/critic_agent.py,sha256=j0X31Jzz2JwfAfTGfXLFKCAXhRdcXMao8GxlY63mEq4,7461
6
- camel/agents/deductive_reasoner_agent.py,sha256=AvUwgSNWfhVsQL1MnJrwQ13NW9lRE7XSlGXozpyENqE,13397
7
- camel/agents/embodied_agent.py,sha256=zyHe9bWLZXJHdEO3A2DNY0VDpFwN_ONx1cZr0OeEhJE,7466
8
- camel/agents/knowledge_graph_agent.py,sha256=2W8GgFOjHjwXlvEYtLoGKYV718yj6iLYKbBOdFZ6Myg,8935
9
- camel/agents/role_assignment_agent.py,sha256=VjrFp8qdckOGrW0a5aBvPs612xSejyxoGa5voyUYRLc,5018
10
- camel/agents/search_agent.py,sha256=oWXkaYqXtFyC0hjK7Naipk5MtN1wiE0YeqH-X_7yqyQ,4546
11
- camel/agents/task_agent.py,sha256=W_xRXI-BN8RqRxipzcVonM6cTNvPsFI9FMgoyLL5NAc,14584
4
+ camel/agents/chat_agent.py,sha256=8yqGmaXnhfVE9dIgBanK74cfEZvHgKtx36YqUDvFuWE,36217
5
+ camel/agents/critic_agent.py,sha256=qF7B0nOP7pdUgGZkmW-ZhCLyIEedsufq3Ae1ObAOH_E,7537
6
+ camel/agents/deductive_reasoner_agent.py,sha256=49vwglWYHgXf-VRftdMN9OFGOwqdsXyTt45PP6z-pbg,13473
7
+ camel/agents/embodied_agent.py,sha256=3ABuiRQXBpplKbuhPY5KNLJyKc6Z8SgXgzIges3ZwVs,7542
8
+ camel/agents/knowledge_graph_agent.py,sha256=DNfFD3qJ-xMze3hphPPn66BpeDlchlNtF-7lj_QWFNc,9011
9
+ camel/agents/role_assignment_agent.py,sha256=DOKQVo9unusFOLJfNKsH-8BjvS_JBK7jjyqaTF4p4IY,5094
10
+ camel/agents/search_agent.py,sha256=k4R29_S6GuKnqCnrccjw59MBAR0NCTeaMplI8mUnLVs,4622
11
+ camel/agents/task_agent.py,sha256=n9xIU3QtcptRPSuHZJ4ntQ_M_a8AvJ6U9ZRV8VaxV5A,14660
12
12
  camel/agents/tool_agents/__init__.py,sha256=ulTNWU2qoFGe3pvVmCq_sdfeSX3NKZ0due66TYvsL-M,862
13
13
  camel/agents/tool_agents/base.py,sha256=nQAhfWi8a_bCgzlf5-G-tmj1fKm6AjpRc89NQkWwpnc,1399
14
14
  camel/agents/tool_agents/hugging_face_tool_agent.py,sha256=1Z5tG6f_86eL0vmtRZ-BJvoLDFFLhoHt8JtDvgat1xU,8723
@@ -162,9 +162,9 @@ camel/toolkits/weather_toolkit.py,sha256=n4YrUI_jTIH7oqH918IdHbXLgfQ2BPGIWWK8Jp8
162
162
  camel/types/__init__.py,sha256=ArKXATj3z_Vv4ISmROVeo6Mv3tj5kE1dTkqfgwyxVY4,1975
163
163
  camel/types/enums.py,sha256=AuZhXEH2EMN0iNKwRwxYS_0zjvzcD_Lg5aDQTakROAs,16019
164
164
  camel/types/openai_types.py,sha256=BNQ6iCzKTjSvgcXFsAFIgrUS_YUFZBU6bDoyAp387hI,2045
165
- camel/utils/__init__.py,sha256=0hHoqVcHhFt-OqcV6vagRdgBzi_EDsvezRXvprGyQ_c,2219
165
+ camel/utils/__init__.py,sha256=KBpIUiwA1iUCtMGk62y0FQ3Eatk4W8WNgMJjJUU1Ja8,2255
166
166
  camel/utils/async_func.py,sha256=SLo8KPkrNKdsONvFf3KBb33EgFn4gH2EKSX1aI_LKes,1578
167
- camel/utils/commons.py,sha256=mUT89LRsWU1UtK30r8NjOusApCDXiqABIjAwonOAZhY,15305
167
+ camel/utils/commons.py,sha256=MJ3q1KTt4t3SbZg1_l_dbBKkjGeuovY7m2q_dlM86Uk,15595
168
168
  camel/utils/constants.py,sha256=BdB5qgphZWsgKZf__gsQal6KiQSapvICGWKwiZlzBvM,1205
169
169
  camel/utils/token_counting.py,sha256=PI3I5J5nYqoLMjOHhW5vU33aQxYcksWtqOd_VcXtREk,20863
170
170
  camel/workforce/__init__.py,sha256=6jwJWDlESEqcnWCm61WCyjzFUF6KLzXA_fGI86rHfiE,878
@@ -177,6 +177,6 @@ camel/workforce/utils.py,sha256=Z-kODz5PMPtfeKKVqpcQq-b-B8oqC7XSwi_F3__Ijhs,3526
177
177
  camel/workforce/worker_node.py,sha256=wsRqk2rugCvvkcmCzvn-y-gQuyuJGAG8PIr1KtgqJFw,3878
178
178
  camel/workforce/workforce.py,sha256=SVJJgSSkYvk05RgL9oaJzHwzziH7u51KLINRuzLB8BI,1773
179
179
  camel/workforce/workforce_prompt.py,sha256=cAWYEIA0rau5itEekSoUIFttBzpKM9RzB6x-mfukGSU,4665
180
- camel_ai-0.1.6.1.dist-info/METADATA,sha256=uP3-pN3-HgKEMpu1etRPW8UUGmtiF-PVxiffZIg8Wv4,23992
181
- camel_ai-0.1.6.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
182
- camel_ai-0.1.6.1.dist-info/RECORD,,
180
+ camel_ai-0.1.6.2.dist-info/METADATA,sha256=s4K7Mh9nrlfghkefKXv137q0gr7-EZb9N196MOp77fc,23992
181
+ camel_ai-0.1.6.2.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
182
+ camel_ai-0.1.6.2.dist-info/RECORD,,