camel-ai 0.2.71a4__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.

Files changed (36) hide show
  1. camel/__init__.py +1 -1
  2. camel/agents/chat_agent.py +1533 -135
  3. camel/agents/repo_agent.py +2 -1
  4. camel/benchmarks/browsecomp.py +6 -6
  5. camel/logger.py +1 -1
  6. camel/messages/base.py +12 -1
  7. camel/models/azure_openai_model.py +96 -7
  8. camel/models/base_model.py +68 -10
  9. camel/models/deepseek_model.py +5 -0
  10. camel/models/gemini_model.py +5 -0
  11. camel/models/litellm_model.py +48 -16
  12. camel/models/model_manager.py +24 -6
  13. camel/models/openai_compatible_model.py +109 -5
  14. camel/models/openai_model.py +117 -8
  15. camel/societies/workforce/prompts.py +68 -5
  16. camel/societies/workforce/role_playing_worker.py +65 -7
  17. camel/societies/workforce/single_agent_worker.py +72 -18
  18. camel/societies/workforce/structured_output_handler.py +500 -0
  19. camel/societies/workforce/utils.py +67 -2
  20. camel/societies/workforce/workforce.py +527 -114
  21. camel/societies/workforce/workforce_logger.py +0 -8
  22. camel/tasks/task.py +3 -1
  23. camel/toolkits/__init__.py +2 -0
  24. camel/toolkits/file_write_toolkit.py +526 -121
  25. camel/toolkits/hybrid_browser_toolkit/actions.py +235 -60
  26. camel/toolkits/hybrid_browser_toolkit/agent.py +25 -8
  27. camel/toolkits/hybrid_browser_toolkit/browser_session.py +574 -164
  28. camel/toolkits/hybrid_browser_toolkit/hybrid_browser_toolkit.py +996 -126
  29. camel/toolkits/hybrid_browser_toolkit/stealth_config.py +116 -0
  30. camel/toolkits/hybrid_browser_toolkit/stealth_script.js +0 -0
  31. camel/toolkits/message_agent_toolkit.py +608 -0
  32. camel/toolkits/note_taking_toolkit.py +7 -13
  33. {camel_ai-0.2.71a4.dist-info → camel_ai-0.2.71a6.dist-info}/METADATA +6 -4
  34. {camel_ai-0.2.71a4.dist-info → camel_ai-0.2.71a6.dist-info}/RECORD +36 -32
  35. {camel_ai-0.2.71a4.dist-info → camel_ai-0.2.71a6.dist-info}/WHEEL +0 -0
  36. {camel_ai-0.2.71a4.dist-info → camel_ai-0.2.71a6.dist-info}/licenses/LICENSE +0 -0
@@ -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
+ }