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 [skip ci]

camel-docs-bot9da66160cbf0
diff --git a/docs/mintlify/docs.json b/docs/mintlify/docs.json
index 16bc07ec9..c7f9fce69 100644
--- a/docs/mintlify/docs.json
+++ b/docs/mintlify/docs.json
@@ -515,6 +515,7 @@
"reference/camel.toolkits.pyautogui_toolkit",
"reference/camel.toolkits.reddit_toolkit",
"reference/camel.toolkits.retrieval_toolkit",
+ "reference/camel.toolkits.screenshot_toolkit",
"reference/camel.toolkits.search_toolkit",
"reference/camel.toolkits.searxng_toolkit",
"reference/camel.toolkits.semantic_scholar_toolkit",
diff --git a/docs/mintlify/reference/camel.toolkits.markitdown_toolkit.mdx b/docs/mintlify/reference/camel.toolkits.markitdown_toolkit.mdx
index dd1ab916e..617cc3b2f 100644
--- a/docs/mintlify/reference/camel.toolkits.markitdown_toolkit.mdx
+++ b/docs/mintlify/reference/camel.toolkits.markitdown_toolkit.mdx
@@ -18,12 +18,12 @@ A class representing a toolkit for MarkItDown.
def __init__(self, timeout: Optional[float] = None):
```
-<a id="camel.toolkits.markitdown_toolkit.MarkItDownToolkit.load_files"></a>
+<a id="camel.toolkits.markitdown_toolkit.MarkItDownToolkit.read_files"></a>
-### load_files
+### read_files
```python
-def load_files(self, file_paths: List[str]):
+def read_files(self, file_paths: List[str]):
```
Scrapes content from a list of files and converts it to Markdown.
diff --git a/docs/mintlify/reference/camel.toolkits.note_taking_toolkit.mdx b/docs/mintlify/reference/camel.toolkits.note_taking_toolkit.mdx
index 34c66f428..dc12ea27d 100644
--- a/docs/mintlify/reference/camel.toolkits.note_taking_toolkit.mdx
+++ b/docs/mintlify/reference/camel.toolkits.note_taking_toolkit.mdx
@@ -8,10 +8,11 @@
class NoteTakingToolkit(BaseToolkit):
```
-A toolkit for taking notes in a Markdown file.
+A toolkit for managing and interacting with markdown note files.
-This toolkit allows an agent to create, append to, and update a specific
-Markdown file for note-taking purposes.
+This toolkit provides tools for creating, reading, appending to, and
+listing notes. All notes are stored as `.md` files in a dedicated working
+directory and are tracked in a registry.
<a id="camel.toolkits.note_taking_toolkit.NoteTakingToolkit.__init__"></a>
@@ -29,7 +30,7 @@ Initialize the NoteTakingToolkit.
**Parameters:**
-- **working_directory** (str, optional): The path to the note file. If not provided, it will be determined by the `CAMEL_WORKDIR` environment variable (if set), saving the note as `notes.md` in that directory. If the environment variable is not set, it defaults to `camel_working_dir/notes.md`.
+- **working_directory** (str, optional): The directory path where notes will be stored. If not provided, it will be determined by the `CAMEL_WORKDIR` environment variable (if set). If the environment variable is not set, it defaults to `camel_working_dir`.
- **timeout** (Optional[float]): The timeout for the toolkit.
<a id="camel.toolkits.note_taking_toolkit.NoteTakingToolkit.append_note"></a>
@@ -37,31 +38,118 @@ Initialize the NoteTakingToolkit.
### append_note
```python
-def append_note(self, content: str):
+def append_note(self, note_name: str, content: str):
```
-Appends a note to the note file.
+Appends content to a note.
+
+If the note does not exist, it will be created with the given content.
+If the note already exists, the new content will be added to the end of
+the note.
**Parameters:**
-- **content** (str): The content of the note to be appended.
+- **note_name** (str): The name of the note (without the .md extension).
+- **content** (str): The content to append to the note.
**Returns:**
- str: A message indicating the result of the operation.
+ str: A message confirming that the content was appended or the note
+was created.
+
+<a id="camel.toolkits.note_taking_toolkit.NoteTakingToolkit._load_registry"></a>
+
+### _load_registry
+
+```python
+def _load_registry(self):
+```
+
+Load the note registry from file with file locking.
+
+<a id="camel.toolkits.note_taking_toolkit.NoteTakingToolkit._save_registry"></a>
+
+### _save_registry
+
+```python
+def _save_registry(self):
+```
+
+Save the note registry to file with file locking.
+
+<a id="camel.toolkits.note_taking_toolkit.NoteTakingToolkit._register_note"></a>
+
+### _register_note
+
+```python
+def _register_note(self, note_name: str):
+```
+
+Register a new note in the registry with thread-safe operations.
+
+<a id="camel.toolkits.note_taking_toolkit.NoteTakingToolkit.create_note"></a>
+
+### create_note
+
+```python
+def create_note(self, note_name: str, content: str = ''):
+```
+
+Creates a new note with a unique name.
+
+This function will create a new file for your note.
+You must provide a `note_name` that does not already exist. If you want
+to add content to an existing note, use the `append_note` function
+instead.
+
+**Parameters:**
+
+- **note_name** (str): The name for your new note (without the .md extension). This name must be unique.
+- **content** (str, optional): The initial content to write in the note. If not provided, an empty note will be created. Defaults to "".
+
+**Returns:**
+
+ str: A message confirming the creation of the note or an error if
+the note name is not valid or already exists.
+
+<a id="camel.toolkits.note_taking_toolkit.NoteTakingToolkit.list_note"></a>
+
+### list_note
+
+```python
+def list_note(self):
+```
+
+**Returns:**
+
+ str: A string containing a list of available notes and their sizes,
+or a message indicating that no notes have been created yet.
<a id="camel.toolkits.note_taking_toolkit.NoteTakingToolkit.read_note"></a>
### read_note
```python
-def read_note(self):
+def read_note(self, note_name: Optional[str] = 'all_notes'):
```
+Reads the content of a specific note or all notes.
+
+You can use this function in two ways:
+1. **Read a specific note:** Provide the `note_name` (without the .md
+extension) to get the content of that single note.
+2. **Read all notes:** Use `note_name="all_notes"` (default), and this
+function will return the content of all your notes, concatenated
+together.
+
+**Parameters:**
+
+- **note_name** (str, optional): The name of the note you want to read. Defaults to "all_notes" which reads all notes.
+
**Returns:**
- str: The content of the note file, or an error message if the
-file cannot be read.
+ str: The content of the specified note(s), or an error message if
+a note cannot be read.
<a id="camel.toolkits.note_taking_toolkit.NoteTakingToolkit.get_tools"></a>
diff --git a/docs/mintlify/reference/camel.toolkits.screenshot_toolkit.mdx b/docs/mintlify/reference/camel.toolkits.screenshot_toolkit.mdx
new file mode 100644
index 000000000..8b0214880
--- /dev/null
+++ b/docs/mintlify/reference/camel.toolkits.screenshot_toolkit.mdx
@@ -0,0 +1,64 @@
+<a id="camel.toolkits.screenshot_toolkit"></a>
+
+<a id="camel.toolkits.screenshot_toolkit.ScreenshotToolkit"></a>
+
+## ScreenshotToolkit
+
+```python
+class ScreenshotToolkit(BaseToolkit):
+```
+
+A toolkit for taking screenshots.
+
+<a id="camel.toolkits.screenshot_toolkit.ScreenshotToolkit.__init__"></a>
+
+### __init__
+
+```python
+def __init__(
+ self,
+ working_directory: Optional[str] = None,
+ timeout: Optional[float] = None
+):
+```
+
+Initializes the ScreenshotToolkit.
+
+**Parameters:**
+
+- **working_directory** (str, optional): The directory path where notes will be stored. If not provided, it will be determined by the `CAMEL_WORKDIR` environment variable (if set). If the environment variable is not set, it defaults to `camel_working_dir`.
+- **timeout** (Optional[float]): Timeout for API requests in seconds. (default: :obj:`None`)
+
+<a id="camel.toolkits.screenshot_toolkit.ScreenshotToolkit.take_screenshot"></a>
+
+### take_screenshot
+
+```python
+def take_screenshot(self, save_to_file: bool = True):
+```
+
+Take a screenshot of the entire screen and return it as a
+base64-encoded image.
+
+**Parameters:**
+
+- **save_to_file** (bool): Whether to save the screenshot to a file. (default: :obj:`True`)
+
+**Returns:**
+
+ ToolResult: An object containing:
+- text (str): A description of the screenshot.
+- images (List[str]): A list containing one base64-encoded
+PNG image data URL.
+
+<a id="camel.toolkits.screenshot_toolkit.ScreenshotToolkit.get_tools"></a>
+
+### get_tools
+
+```python
+def get_tools(self):
+```
+
+**Returns:**
+
+ List[FunctionTool]: List of screenshot functions.