Skip to content

armgit / camel

Public Imported from GitHub
0

🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

Auto-update documentation after merge

camel-docs-botc989516a7a79
diff --git a/docs/reference/camel.agents.chat_agent.md b/docs/reference/camel.agents.chat_agent.md
index 0d6f53318..9d087d29a 100644
--- a/docs/reference/camel.agents.chat_agent.md
+++ b/docs/reference/camel.agents.chat_agent.md
@@ -1243,6 +1243,17 @@ configuration as the current instance.
ChatAgent: A new instance of :obj:`ChatAgent` with the same
configuration.
+<a id="camel.agents.chat_agent.ChatAgent._clone_tools"></a>
+
+### _clone_tools
+
+```python
+def _clone_tools(self):
+```
+
+Clone tools for new agent instance,
+handling stateful toolkits properly.
+
<a id="camel.agents.chat_agent.ChatAgent.__repr__"></a>
### __repr__
diff --git a/docs/reference/camel.toolkits.hybrid_browser_toolkit.actions.md b/docs/reference/camel.toolkits.hybrid_browser_toolkit.actions.md
index fe04fb51f..0eff9c269 100644
--- a/docs/reference/camel.toolkits.hybrid_browser_toolkit.actions.md
+++ b/docs/reference/camel.toolkits.hybrid_browser_toolkit.actions.md
@@ -15,7 +15,7 @@ Executes high-level actions (click, type …) on a Playwright Page.
### __init__
```python
-def __init__(self, page: 'Page'):
+def __init__(self, page: 'Page', session: Optional[Any] = None):
```
<a id="camel.toolkits.hybrid_browser_toolkit.actions.ActionExecutor.should_update_snapshot"></a>
diff --git a/docs/reference/camel.toolkits.hybrid_browser_toolkit.browser_session.md b/docs/reference/camel.toolkits.hybrid_browser_toolkit.browser_session.md
index 733f64835..22a09fb93 100644
--- a/docs/reference/camel.toolkits.hybrid_browser_toolkit.browser_session.md
+++ b/docs/reference/camel.toolkits.hybrid_browser_toolkit.browser_session.md
@@ -8,14 +8,14 @@
class HybridBrowserSession:
```
-Lightweight wrapper around Playwright for non-visual (headless)
-browsing.
+Lightweight wrapper around Playwright for
+browsing with multi-tab support.
-It provides a single *Page* instance plus helper utilities (snapshot &
+It provides multiple *Page* instances plus helper utilities (snapshot &
executor). Multiple toolkits or agents can reuse this class without
duplicating Playwright setup code.
-This class is a singleton per event-loop.
+This class is a singleton per event-loop and session-id combination.
<a id="camel.toolkits.hybrid_browser_toolkit.browser_session.HybridBrowserSession.__new__"></a>
@@ -32,3 +32,13 @@ def __new__(cls):
```python
def __init__(self):
```
+
+<a id="camel.toolkits.hybrid_browser_toolkit.browser_session.HybridBrowserSession._load_stealth_script"></a>
+
+### _load_stealth_script
+
+```python
+def _load_stealth_script(self):
+```
+
+Load the stealth JavaScript script from file.
diff --git a/docs/reference/camel.toolkits.hybrid_browser_toolkit.hybrid_browser_toolkit.md b/docs/reference/camel.toolkits.hybrid_browser_toolkit.hybrid_browser_toolkit.md
index ab902161f..4271d0cf5 100644
--- a/docs/reference/camel.toolkits.hybrid_browser_toolkit.hybrid_browser_toolkit.md
+++ b/docs/reference/camel.toolkits.hybrid_browser_toolkit.hybrid_browser_toolkit.md
@@ -31,9 +31,13 @@ Initialize the HybridBrowserToolkit.
- **headless** (bool): Whether to run the browser in headless mode. Defaults to `True`.
- **user_data_dir** (Optional[str]): Path to a directory for storing browser data like cookies and local storage. Useful for maintaining sessions across runs. Defaults to `None` (a temporary directory is used).
+- **stealth** (bool): Whether to run the browser in stealth mode to avoid bot detection. When enabled, hides WebDriver characteristics, spoofs navigator properties, and implements various anti-detection measures. Highly recommended for production use and when accessing sites with bot detection. Defaults to `False`.
- **web_agent_model** (Optional[BaseModelBackend]): The language model backend to use for the high-level `solve_task` agent. This is required only if you plan to use `solve_task`. Defaults to `None`.
- **cache_dir** (str): The directory to store cached files, such as screenshots. Defaults to `"tmp/"`.
-- **enabled_tools** (Optional[List[str]]): List of tool names to enable. If None, uses DEFAULT_TOOLS. Available tools: open_browser, close_browser, visit_page, get_page_snapshot, get_som_screenshot, get_page_links, click, type, select, scroll, enter, wait_user, solve_task. Defaults to `None`.
+- **enabled_tools** (Optional[List[str]]): List of tool names to enable. If None, uses DEFAULT_TOOLS. Available tools: open_browser, close_browser, visit_page, back, forward, get_page_snapshot, get_som_screenshot, get_page_links, click, type, select, scroll, enter, wait_user, solve_task. Defaults to `None`.
+- **browser_log_to_file** (bool): Whether to save detailed browser action logs to file. When enabled, logs action inputs/outputs, execution times, and page loading times. Logs are saved to an auto-generated timestamped file. Defaults to `False`.
+- **session_id** (Optional[str]): A unique identifier for this browser session. When multiple HybridBrowserToolkit instances are used concurrently, different session IDs prevent them from sharing the same browser session and causing conflicts. If None, a default session will be used. Defaults to `None`.
+- **default_start_url** (str): The default URL to navigate to when open_browser() is called without a start_url parameter or with None. Defaults to `"https://google.com/"`.
<a id="camel.toolkits.hybrid_browser_toolkit.hybrid_browser_toolkit.HybridBrowserToolkit.__del__"></a>
@@ -65,6 +69,26 @@ def _validate_ref(self, ref: str, method_name: str):
Validate ref parameter.
+<a id="camel.toolkits.hybrid_browser_toolkit.hybrid_browser_toolkit.HybridBrowserToolkit._truncate_if_needed"></a>
+
+### _truncate_if_needed
+
+```python
+def _truncate_if_needed(self, content: Any):
+```
+
+Truncate content if max_log_length is set.
+
+<a id="camel.toolkits.hybrid_browser_toolkit.hybrid_browser_toolkit.HybridBrowserToolkit.action_logger"></a>
+
+### action_logger
+
+```python
+def action_logger(func: Callable[..., Any]):
+```
+
+Decorator to add logging to action methods.
+
<a id="camel.toolkits.hybrid_browser_toolkit.hybrid_browser_toolkit.HybridBrowserToolkit._convert_analysis_to_rects"></a>
### _convert_analysis_to_rects
@@ -105,6 +129,26 @@ def _ensure_agent(self):
Create PlaywrightLLMAgent on first use.
+<a id="camel.toolkits.hybrid_browser_toolkit.hybrid_browser_toolkit.HybridBrowserToolkit.get_log_summary"></a>
+
+### get_log_summary
+
+```python
+def get_log_summary(self):
+```
+
+Get a summary of logged actions.
+
+<a id="camel.toolkits.hybrid_browser_toolkit.hybrid_browser_toolkit.HybridBrowserToolkit.clear_logs"></a>
+
+### clear_logs
+
+```python
+def clear_logs(self):
+```
+
+Clear the log buffer.
+
<a id="camel.toolkits.hybrid_browser_toolkit.hybrid_browser_toolkit.HybridBrowserToolkit.get_tools"></a>
### get_tools
@@ -115,3 +159,23 @@ def get_tools(self):
Get available function tools
based on enabled_tools configuration.
+
+<a id="camel.toolkits.hybrid_browser_toolkit.hybrid_browser_toolkit.HybridBrowserToolkit.clone_for_new_session"></a>
+
+### clone_for_new_session
+
+```python
+def clone_for_new_session(self, new_session_id: Optional[str] = None):
+```
+
+Create a new instance of HybridBrowserToolkit with a unique
+session.
+
+**Parameters:**
+
+- **new_session_id**: Optional new session ID. If None, a UUID will be generated.
+
+**Returns:**
+
+ A new HybridBrowserToolkit instance with the same configuration
+but a different session.
diff --git a/docs/reference/camel.toolkits.hybrid_browser_toolkit.stealth_config.md b/docs/reference/camel.toolkits.hybrid_browser_toolkit.stealth_config.md
new file mode 100644
index 000000000..23c7809a0
--- /dev/null
+++ b/docs/reference/camel.toolkits.hybrid_browser_toolkit.stealth_config.md
@@ -0,0 +1,64 @@
+<a id="camel.toolkits.hybrid_browser_toolkit.stealth_config"></a>
+
+Stealth configuration for browser automation to avoid bot detection.
+
+This module contains all the configuration needed to make the browser
+appear as a regular user browser rather than an automated one.
+
+<a id="camel.toolkits.hybrid_browser_toolkit.stealth_config.StealthConfig"></a>
+
+## StealthConfig
+
+```python
+class StealthConfig:
+```
+
+Configuration class for stealth browser settings.
+
+<a id="camel.toolkits.hybrid_browser_toolkit.stealth_config.StealthConfig.get_launch_args"></a>
+
+### get_launch_args
+
+```python
+def get_launch_args():
+```
+
+**Returns:**
+
+ List[str]: Chrome command line arguments to avoid detection.
+
+<a id="camel.toolkits.hybrid_browser_toolkit.stealth_config.StealthConfig.get_context_options"></a>
+
+### get_context_options
+
+```python
+def get_context_options():
+```
+
+**Returns:**
+
+ Dict[str, Any]: Browser context configuration options.
+
+<a id="camel.toolkits.hybrid_browser_toolkit.stealth_config.StealthConfig.get_http_headers"></a>
+
+### get_http_headers
+
+```python
+def get_http_headers():
+```
+
+**Returns:**
+
+ Dict[str, str]: HTTP headers to appear more like a real browser.
+
+<a id="camel.toolkits.hybrid_browser_toolkit.stealth_config.StealthConfig.get_all_config"></a>
+
+### get_all_config
+
+```python
+def get_all_config():
+```
+
+**Returns:**
+
+ Dict[str, Any]: Complete stealth configuration.
diff --git a/docs/reference/camel.toolkits.note_taking_toolkit.md b/docs/reference/camel.toolkits.note_taking_toolkit.md
index 0893344f8..070b54ed6 100644
--- a/docs/reference/camel.toolkits.note_taking_toolkit.md
+++ b/docs/reference/camel.toolkits.note_taking_toolkit.md
@@ -32,20 +32,19 @@ Initialize the NoteTakingToolkit.
- **note_file_path** (str): The path to the note file. (default: :obj:`notes/notes.md`)
- **timeout** (Optional[float]): The timeout for the toolkit.
-<a id="camel.toolkits.note_taking_toolkit.NoteTakingToolkit.take_note"></a>
+<a id="camel.toolkits.note_taking_toolkit.NoteTakingToolkit.append_note"></a>
-### take_note
+### append_note
```python
-def take_note(self, content: str, update: bool = False):
+def append_note(self, content: str):
```
-Takes a note and saves it to the note file.
+Appends a note to the note file.
**Parameters:**
-- **content** (str): The content of the note to be saved.
-- **update** (bool): If True, the existing note file will be overwritten with the new content. If False, the new content will be appended to the end of the file. (default: :obj:`False`)
+- **content** (str): The content of the note to be appended.
**Returns:**