camel-ai 0.2.71a5__py3-none-any.whl → 0.2.71a6__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.

@@ -0,0 +1,116 @@
1
+ # ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
2
+ # Licensed under the Apache License, Version 2.0 (the "License");
3
+ # you may not use this file except in compliance with the License.
4
+ # You may obtain a copy of the License at
5
+ #
6
+ # http://www.apache.org/licenses/LICENSE-2.0
7
+ #
8
+ # Unless required by applicable law or agreed to in writing, software
9
+ # distributed under the License is distributed on an "AS IS" BASIS,
10
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ # See the License for the specific language governing permissions and
12
+ # limitations under the License.
13
+ # ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
14
+
15
+ """
16
+ Stealth configuration for browser automation to avoid bot detection.
17
+
18
+ This module contains all the configuration needed to make the browser
19
+ appear as a regular user browser rather than an automated one.
20
+ """
21
+
22
+ from typing import Any, Dict, List
23
+
24
+
25
+ class StealthConfig:
26
+ """Configuration class for stealth browser settings."""
27
+
28
+ @staticmethod
29
+ def get_launch_args() -> List[str]:
30
+ """Get Chrome launch arguments for stealth mode.
31
+
32
+ Returns:
33
+ List[str]: Chrome command line arguments to avoid detection.
34
+ """
35
+ return [
36
+ '--disable-blink-features=AutomationControlled',
37
+ '--disable-features=VizDisplayCompositor',
38
+ '--disable-ipc-flooding-protection',
39
+ '--disable-renderer-backgrounding',
40
+ '--disable-backgrounding-occluded-windows',
41
+ '--disable-dev-shm-usage',
42
+ '--disable-extensions',
43
+ '--disable-plugins',
44
+ '--disable-default-apps',
45
+ '--disable-sync',
46
+ '--no-default-browser-check',
47
+ '--no-first-run',
48
+ '--no-sandbox',
49
+ '--disable-setuid-sandbox',
50
+ '--disable-web-security',
51
+ '--disable-features=TranslateUI',
52
+ '--disable-features=BlinkGenPropertyTrees',
53
+ '--disable-component-extensions-with-background-pages',
54
+ ]
55
+
56
+ @staticmethod
57
+ def get_context_options() -> Dict[str, Any]:
58
+ """Get browser context options for stealth mode.
59
+
60
+ Returns:
61
+ Dict[str, Any]: Browser context configuration options.
62
+ """
63
+ return {
64
+ 'user_agent': (
65
+ 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) '
66
+ 'AppleWebKit/537.36 (KHTML, like Gecko) '
67
+ 'Chrome/131.0.0.0 Safari/537.36'
68
+ ),
69
+ 'viewport': {'width': 1920, 'height': 1080},
70
+ 'locale': 'en-US',
71
+ 'timezone_id': 'America/New_York',
72
+ 'geolocation': {'latitude': 40.7128, 'longitude': -74.0060},
73
+ 'permissions': ['geolocation'],
74
+ }
75
+
76
+ @staticmethod
77
+ def get_http_headers() -> Dict[str, str]:
78
+ """Get HTTP headers for stealth mode.
79
+
80
+ Returns:
81
+ Dict[str, str]: HTTP headers to appear more like a real browser.
82
+ """
83
+ return {
84
+ 'Accept': (
85
+ 'text/html,application/xhtml+xml,application/xml;q=0.9,'
86
+ 'image/avif,image/webp,image/apng,*/*;q=0.8,'
87
+ 'application/signed-exchange;v=b3;q=0.7'
88
+ ),
89
+ 'Accept-Language': 'en-US,en;q=0.9',
90
+ 'Accept-Encoding': 'gzip, deflate, br, zstd',
91
+ 'Cache-Control': 'max-age=0',
92
+ 'Sec-Ch-Ua': (
93
+ '"Google Chrome";v="131", "Chromium";v="131", '
94
+ '"Not=A?Brand";v="24"'
95
+ ),
96
+ 'Sec-Ch-Ua-Mobile': '?0',
97
+ 'Sec-Ch-Ua-Platform': '"Windows"',
98
+ 'Sec-Fetch-Dest': 'document',
99
+ 'Sec-Fetch-Mode': 'navigate',
100
+ 'Sec-Fetch-Site': 'none',
101
+ 'Sec-Fetch-User': '?1',
102
+ 'Upgrade-Insecure-Requests': '1',
103
+ }
104
+
105
+ @staticmethod
106
+ def get_all_config() -> Dict[str, Any]:
107
+ """Get all stealth configuration in one dict.
108
+
109
+ Returns:
110
+ Dict[str, Any]: Complete stealth configuration.
111
+ """
112
+ return {
113
+ 'launch_args': StealthConfig.get_launch_args(),
114
+ 'context_options': StealthConfig.get_context_options(),
115
+ 'http_headers': StealthConfig.get_http_headers(),
116
+ }
@@ -41,27 +41,21 @@ class NoteTakingToolkit(BaseToolkit):
41
41
  self.note_file_path = Path(note_file_path)
42
42
  self.note_file_path.parent.mkdir(parents=True, exist_ok=True)
43
43
 
44
- def take_note(self, content: str, update: bool = False) -> str:
45
- r"""Takes a note and saves it to the note file.
44
+ def append_note(self, content: str) -> str:
45
+ r"""Appends a note to the note file.
46
46
 
47
47
  Args:
48
- content (str): The content of the note to be saved.
49
- update (bool): If True, the existing note file will be
50
- overwritten with the new content. If False, the new content
51
- will be appended to the end of the file.
52
- (default: :obj:`False`)
48
+ content (str): The content of the note to be appended.
53
49
 
54
50
  Returns:
55
51
  str: A message indicating the result of the operation.
56
52
  """
57
- mode = "w" if update else "a"
58
53
  try:
59
- with self.note_file_path.open(mode, encoding="utf-8") as f:
54
+ with self.note_file_path.open("a", encoding="utf-8") as f:
60
55
  f.write(content + "\n")
61
- action = "updated" if update else "appended to"
62
- return f"Note successfully {action} in {self.note_file_path}."
56
+ return f"Note successfully appended to in {self.note_file_path}."
63
57
  except Exception as e:
64
- return f"Error taking note: {e}"
58
+ return f"Error appending note: {e}"
65
59
 
66
60
  def read_note(self) -> str:
67
61
  r"""Reads the content of the note file.
@@ -85,6 +79,6 @@ class NoteTakingToolkit(BaseToolkit):
85
79
  List[FunctionTool]: A list of FunctionTool objects.
86
80
  """
87
81
  return [
88
- FunctionTool(self.take_note),
82
+ FunctionTool(self.append_note),
89
83
  FunctionTool(self.read_note),
90
84
  ]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: camel-ai
3
- Version: 0.2.71a5
3
+ Version: 0.2.71a6
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=5hsEe5A3r8jZt4M34LX2tDcGa2NFXB_YJuUobKpnH1U,901
1
+ camel/__init__.py,sha256=RaohPLH7lOKgC4cz7u4F_LTfirdamTUqD_DubGNwJX0,901
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
@@ -7,7 +7,7 @@ camel/agents/__init__.py,sha256=64weKqdvmpZcGWyVkO-OKASAmVUdrQjv60JApgPk_SA,1644
7
7
  camel/agents/_types.py,sha256=MeFZzay2kJA6evALQ-MbBTKW-0lu_0wBuKsxzH_4gWI,1552
8
8
  camel/agents/_utils.py,sha256=AR7Qqgbkmn4X2edYUQf1rdksGUyV5hm3iK1z-Dn0Mcg,6266
9
9
  camel/agents/base.py,sha256=c4bJYL3G3Z41SaFdMPMn8ZjLdFiFaVOFO6EQIfuCVR8,1124
10
- camel/agents/chat_agent.py,sha256=sb1I2nwsiPmjYztMj6Ewp5KSpHK0AHeI6cpkpWt-9TA,157197
10
+ camel/agents/chat_agent.py,sha256=eJaYpiXeTukSZaymwQy2l1RzpjUtZjvpsYg8De4hJB8,159308
11
11
  camel/agents/critic_agent.py,sha256=L6cTbYjyZB0DCa51tQ6LZLA6my8kHLC4nktHySH78H4,10433
12
12
  camel/agents/deductive_reasoner_agent.py,sha256=6BZGaq1hR6hKJuQtOfoYQnk_AkZpw_Mr7mUy2MspQgs,13540
13
13
  camel/agents/embodied_agent.py,sha256=XBxBu5ZMmSJ4B2U3Z7SMwvLlgp6yNpaBe8HNQmY9CZA,7536
@@ -274,12 +274,13 @@ camel/societies/role_playing.py,sha256=0XScr3WfxX1QOC71RhBLmrcS5y2c7DMQB_mAFOHU3
274
274
  camel/societies/workforce/__init__.py,sha256=bkTI-PE-MSK9AQ2V2gR6cR2WY-R7Jqy_NmXRtAoqo8o,920
275
275
  camel/societies/workforce/base.py,sha256=z2DmbTP5LL5-aCAAqglznQqCLfPmnyM5zD3w6jjtsb8,2175
276
276
  camel/societies/workforce/prompts.py,sha256=gobVelz7rRdReogFG2QCfFy21GfhaQJyoiNnKWo4EHE,14391
277
- camel/societies/workforce/role_playing_worker.py,sha256=MnVKiA7B5OdbQj1XPmlmGIbvyIyWRoMDolY1bwe_Mx4,7675
278
- camel/societies/workforce/single_agent_worker.py,sha256=s1aQnnhr_h79Hx6DDtQHcGG6vKy4nxsr28ESzWliYeI,14507
277
+ camel/societies/workforce/role_playing_worker.py,sha256=z5-OcNiaNEaoC206_3HD7xeonuUkD-XTxYbD3AqoNC8,10319
278
+ camel/societies/workforce/single_agent_worker.py,sha256=KIZ3hsv5QZ1DjotFd2pTdaQpxeVxP8Fy_7xovtfW-2w,17206
279
+ camel/societies/workforce/structured_output_handler.py,sha256=xr8szFN86hg3jQ825aEkJTjkSFQnTlbinVg4j1vZJVI,17870
279
280
  camel/societies/workforce/task_channel.py,sha256=uqQQI67Tr4awbR4bjZXdx8_4gL6-ON5IjQk_H_ryqT4,7431
280
281
  camel/societies/workforce/utils.py,sha256=THgNHSeZsNVnjTzQTur3qCJhi72MrDS8X2gPET174cI,8434
281
282
  camel/societies/workforce/worker.py,sha256=36tkOyz4G2wfBdrFjt9NBPXsx4UbE6uL5on8sP2aoqk,6414
282
- camel/societies/workforce/workforce.py,sha256=Nxu07L4DSl4MZLbMwl7XvfblvJUNJzGoXSWsgPdMn84,125500
283
+ camel/societies/workforce/workforce.py,sha256=yW-x2cXrCxCO2JfToEfLddXtVd5bE7UCiKVExUwXYgs,133975
283
284
  camel/societies/workforce/workforce_logger.py,sha256=0YT__ys48Bgn0IICKIZBmSWhON-eA1KShebjCdn5ppE,24525
284
285
  camel/storages/__init__.py,sha256=RwpEyvxpMbJzVDZJJygeBg4AzyYMkTjjkfB53hTuqGo,2141
285
286
  camel/storages/graph_storages/__init__.py,sha256=G29BNn651C0WTOpjCl4QnVM-4B9tcNh8DdmsCiONH8Y,948
@@ -309,7 +310,7 @@ camel/storages/vectordb_storages/qdrant.py,sha256=a_cT0buSCHQ2CPZy852-mdvMDwy5zo
309
310
  camel/storages/vectordb_storages/tidb.py,sha256=w83bxgKgso43MtHqlpf2EMSpn1_Nz6ZZtY4fPw_-vgs,11192
310
311
  camel/storages/vectordb_storages/weaviate.py,sha256=wDUE4KvfmOl3DqHFU4uF0VKbHu-q9vKhZDe8FZ6QXsk,27888
311
312
  camel/tasks/__init__.py,sha256=MuHwkw5GRQc8NOCzj8tjtBrr2Xg9KrcKp-ed_-2ZGIM,906
312
- camel/tasks/task.py,sha256=e6vFhZyC8TUQJEqa-tU5b6TK2vNWnaUsZ7-n3LNdy8A,20363
313
+ camel/tasks/task.py,sha256=-TqoSIrWk_BaocNUqr3RVowA9JBe2OO_fAXTdp6nXAU,20366
313
314
  camel/tasks/task_prompt.py,sha256=3KZmKYKUPcTKe8EAZOZBN3G05JHRVt7oHY9ORzLVu1g,2150
314
315
  camel/terminators/__init__.py,sha256=t8uqrkUnXEOYMXQDgaBkMFJ0EXFKI0kmx4cUimli3Ls,991
315
316
  camel/terminators/base.py,sha256=xmJzERX7GdSXcxZjAHHODa0rOxRChMSRboDCNHWSscs,1511
@@ -351,7 +352,7 @@ camel/toolkits/meshy_toolkit.py,sha256=NbgdOBD3FYLtZf-AfonIv6-Q8-8DW129jsaP1PqI2
351
352
  camel/toolkits/message_agent_toolkit.py,sha256=yWvAaxoxAvDEtD7NH7IkkHIyfWIYK47WZhn5E_RaxKo,22661
352
353
  camel/toolkits/mineru_toolkit.py,sha256=vRX9LholLNkpbJ6axfEN4pTG85aWb0PDmlVy3rAAXhg,6868
353
354
  camel/toolkits/networkx_toolkit.py,sha256=C7pUCZTzzGkFyqdkrmhRKpAHmHWfLKeuzYHC_BHPtbk,8826
354
- camel/toolkits/note_taking_toolkit.py,sha256=LBJ-_zZriSmmb4PKiT1z7P0uFcRAYLuOOpdf3kTdpXI,3389
355
+ camel/toolkits/note_taking_toolkit.py,sha256=GnSQmKpXWDQlj9FRkrTF1o8UoLsd6rH1nZ5Yr2wgzpU,3030
355
356
  camel/toolkits/notion_toolkit.py,sha256=jmmVWk_WazRNWnx4r9DAvhFTAL-n_ige0tb32UHJ_ik,9752
356
357
  camel/toolkits/open_api_toolkit.py,sha256=Venfq8JwTMQfzRzzB7AYmYUMEX35hW0BjIv_ozFMiNk,23316
357
358
  camel/toolkits/openai_agent_toolkit.py,sha256=hT2ancdQigngAiY1LNnGJzZeiBDHUxrRGv6BdZTJizc,4696
@@ -382,11 +383,13 @@ camel/toolkits/whatsapp_toolkit.py,sha256=udUQXkXyeWsmrUlOJZsGBhHtc_jhB05Axe_Tch
382
383
  camel/toolkits/wolfram_alpha_toolkit.py,sha256=qeIM8ySn5ilcExBWtx-hDOc35bNcebLVnZ67kt1H3mQ,9295
383
384
  camel/toolkits/zapier_toolkit.py,sha256=A83y1UcfuopH7Fx82pORzypl1StbhBjB2HhyOqYa300,7124
384
385
  camel/toolkits/hybrid_browser_toolkit/__init__.py,sha256=vxjWhq7GjUKE5I9RGQU_GoikZJ-AVK4ertdvEqp9pd0,802
385
- camel/toolkits/hybrid_browser_toolkit/actions.py,sha256=687NtNdjkx8MfXQRSY7hSUAshZnVBxCbYYHZjnal_Go,8746
386
- camel/toolkits/hybrid_browser_toolkit/agent.py,sha256=nYTNeLEaPg1bhzl65IcG9JkjiS9cRNV3bjsyct4pzM8,10881
387
- camel/toolkits/hybrid_browser_toolkit/browser_session.py,sha256=ZbPTKoRJaA4kcd-i9B9J98MEaAgPZ3FGjNzs3IJdoWs,11034
388
- camel/toolkits/hybrid_browser_toolkit/hybrid_browser_toolkit.py,sha256=4RoVnodjIEUNg64Qz9gOQdqWT2Exh0l5Cz7XyZqV5wo,38188
386
+ camel/toolkits/hybrid_browser_toolkit/actions.py,sha256=OwVL0aO_7V1bvOIK66WLvPLvfjt9l7ck_t221rXvMFs,14658
387
+ camel/toolkits/hybrid_browser_toolkit/agent.py,sha256=otQCgHpPSBVG04zhz87E0CtiwhcPEXlrAm994tLfnZk,11482
388
+ camel/toolkits/hybrid_browser_toolkit/browser_session.py,sha256=-yRfep_VLz-KnbLTw9baOoSosBLjEAfjBGyRvv1mir8,25734
389
+ camel/toolkits/hybrid_browser_toolkit/hybrid_browser_toolkit.py,sha256=n5Xt0zXAbSt9T1Aehyj5w9_aQtLoomiKzfY3FwIq4uQ,72470
389
390
  camel/toolkits/hybrid_browser_toolkit/snapshot.py,sha256=0gVhOsGujUmv-LdQ5FZGfRNmKaECmJah5W-FOAOu64Q,8489
391
+ camel/toolkits/hybrid_browser_toolkit/stealth_config.py,sha256=-iCZT_OptYxC4eKUDOUwJD4NxG3lTp5OseAy1S9sX6w,4267
392
+ camel/toolkits/hybrid_browser_toolkit/stealth_script.js,sha256=z4XRSVUpAS87Sj36s3bY8XXhvRcHBlgsUOyMxV2HI80,27650
390
393
  camel/toolkits/hybrid_browser_toolkit/unified_analyzer.js,sha256=FXzbnjjXRRaMo5PBFgxa84UFWLn5jymBnFvW_yHdzCM,17378
391
394
  camel/toolkits/open_api_specs/security_config.py,sha256=ZVnBa_zEifaE_ao2xsvV5majuJHpn2Tn7feMDOnj-eo,898
392
395
  camel/toolkits/open_api_specs/biztoc/__init__.py,sha256=OKCZrQCDwaWtXIN_2rA9FSqEvgpQRieRoHh7Ek6N16A,702
@@ -443,7 +446,7 @@ camel/verifiers/math_verifier.py,sha256=tA1D4S0sm8nsWISevxSN0hvSVtIUpqmJhzqfbuMo
443
446
  camel/verifiers/models.py,sha256=GdxYPr7UxNrR1577yW4kyroRcLGfd-H1GXgv8potDWU,2471
444
447
  camel/verifiers/physics_verifier.py,sha256=c1grrRddcrVN7szkxhv2QirwY9viIRSITWeWFF5HmLs,30187
445
448
  camel/verifiers/python_verifier.py,sha256=ogTz77wODfEcDN4tMVtiSkRQyoiZbHPY2fKybn59lHw,20558
446
- camel_ai-0.2.71a5.dist-info/METADATA,sha256=fQl8019ucVKyYfAB2oHQzplC1y39jr6JT2OQB9nqQac,50002
447
- camel_ai-0.2.71a5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
448
- camel_ai-0.2.71a5.dist-info/licenses/LICENSE,sha256=id0nB2my5kG0xXeimIu5zZrbHLS6EQvxvkKkzIHaT2k,11343
449
- camel_ai-0.2.71a5.dist-info/RECORD,,
449
+ camel_ai-0.2.71a6.dist-info/METADATA,sha256=UJ7o5pDsTKPorwnJdGHG2R_-sYKcLYBynyy4YaZnMlM,50002
450
+ camel_ai-0.2.71a6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
451
+ camel_ai-0.2.71a6.dist-info/licenses/LICENSE,sha256=id0nB2my5kG0xXeimIu5zZrbHLS6EQvxvkKkzIHaT2k,11343
452
+ camel_ai-0.2.71a6.dist-info/RECORD,,