camel-ai 0.2.76a0__py3-none-any.whl → 0.2.76a1__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 +1 -1
- camel/agents/chat_agent.py +8 -1
- camel/memories/__init__.py +2 -1
- camel/memories/agent_memories.py +3 -1
- camel/memories/blocks/chat_history_block.py +17 -2
- camel/societies/workforce/single_agent_worker.py +44 -38
- camel/storages/object_storages/google_cloud.py +1 -1
- camel/toolkits/__init__.py +9 -2
- camel/toolkits/aci_toolkit.py +45 -0
- camel/toolkits/context_summarizer_toolkit.py +683 -0
- camel/toolkits/{file_write_toolkit.py → file_toolkit.py} +194 -34
- camel/toolkits/hybrid_browser_toolkit/config_loader.py +4 -0
- camel/toolkits/hybrid_browser_toolkit/hybrid_browser_toolkit.py +7 -2
- camel/toolkits/hybrid_browser_toolkit/hybrid_browser_toolkit_ts.py +62 -45
- camel/toolkits/hybrid_browser_toolkit/ts/src/browser-session.ts +489 -60
- camel/toolkits/hybrid_browser_toolkit/ts/src/config-loader.ts +5 -2
- camel/toolkits/hybrid_browser_toolkit/ts/src/hybrid-browser-toolkit.ts +72 -12
- camel/toolkits/hybrid_browser_toolkit/ts/src/snapshot-parser.ts +2 -14
- camel/toolkits/hybrid_browser_toolkit/ts/src/types.ts +1 -0
- camel/toolkits/hybrid_browser_toolkit/ws_wrapper.py +196 -60
- camel/toolkits/hybrid_browser_toolkit_py/hybrid_browser_toolkit.py +4 -4
- camel/toolkits/markitdown_toolkit.py +27 -1
- camel/toolkits/note_taking_toolkit.py +18 -8
- camel/toolkits/vertex_ai_veo_toolkit.py +590 -0
- camel/toolkits/wechat_official_toolkit.py +483 -0
- camel/utils/context_utils.py +395 -0
- {camel_ai-0.2.76a0.dist-info → camel_ai-0.2.76a1.dist-info}/METADATA +2 -1
- {camel_ai-0.2.76a0.dist-info → camel_ai-0.2.76a1.dist-info}/RECORD +30 -26
- {camel_ai-0.2.76a0.dist-info → camel_ai-0.2.76a1.dist-info}/WHEEL +0 -0
- {camel_ai-0.2.76a0.dist-info → camel_ai-0.2.76a1.dist-info}/licenses/LICENSE +0 -0
|
@@ -92,12 +92,12 @@ class HybridBrowserToolkit(BaseToolkit, RegisteredAgentToolkit):
|
|
|
92
92
|
user_data_dir: Optional[str] = None,
|
|
93
93
|
stealth: bool = False,
|
|
94
94
|
web_agent_model: Optional[BaseModelBackend] = None,
|
|
95
|
-
cache_dir: str =
|
|
95
|
+
cache_dir: Optional[str] = None,
|
|
96
96
|
enabled_tools: Optional[List[str]] = None,
|
|
97
97
|
browser_log_to_file: bool = False,
|
|
98
98
|
log_dir: Optional[str] = None,
|
|
99
99
|
session_id: Optional[str] = None,
|
|
100
|
-
default_start_url: str =
|
|
100
|
+
default_start_url: Optional[str] = None,
|
|
101
101
|
default_timeout: Optional[int] = None,
|
|
102
102
|
short_timeout: Optional[int] = None,
|
|
103
103
|
navigation_timeout: Optional[int] = None,
|
|
@@ -202,10 +202,10 @@ class HybridBrowserToolkit(BaseToolkit, RegisteredAgentToolkit):
|
|
|
202
202
|
self._user_data_dir = user_data_dir
|
|
203
203
|
self._stealth = stealth
|
|
204
204
|
self._web_agent_model = web_agent_model
|
|
205
|
-
self._cache_dir = cache_dir
|
|
205
|
+
self._cache_dir = cache_dir or "tmp/"
|
|
206
206
|
self._browser_log_to_file = browser_log_to_file
|
|
207
207
|
self._log_dir = log_dir
|
|
208
|
-
self._default_start_url = default_start_url
|
|
208
|
+
self._default_start_url = default_start_url or "https://google.com/"
|
|
209
209
|
self._session_id = session_id or "default"
|
|
210
210
|
self._viewport_limit = viewport_limit
|
|
211
211
|
|
|
@@ -25,12 +25,38 @@ logger = get_logger(__name__)
|
|
|
25
25
|
|
|
26
26
|
@MCPServer()
|
|
27
27
|
class MarkItDownToolkit(BaseToolkit):
|
|
28
|
-
r"""A class representing a toolkit for MarkItDown.
|
|
28
|
+
r"""A class representing a toolkit for MarkItDown.
|
|
29
|
+
|
|
30
|
+
.. deprecated::
|
|
31
|
+
MarkItDownToolkit is deprecated. Use FileToolkit instead, which now
|
|
32
|
+
includes the same functionality through its read_file method that
|
|
33
|
+
supports both single files and multiple files.
|
|
34
|
+
|
|
35
|
+
Example migration:
|
|
36
|
+
# Old way
|
|
37
|
+
from camel.toolkits import MarkItDownToolkit
|
|
38
|
+
toolkit = MarkItDownToolkit()
|
|
39
|
+
content = toolkit.read_files(['file1.pdf', 'file2.docx'])
|
|
40
|
+
|
|
41
|
+
# New way
|
|
42
|
+
from camel.toolkits import FileToolkit
|
|
43
|
+
toolkit = FileToolkit()
|
|
44
|
+
content = toolkit.read_file(['file1.pdf', 'file2.docx'])
|
|
45
|
+
"""
|
|
29
46
|
|
|
30
47
|
def __init__(
|
|
31
48
|
self,
|
|
32
49
|
timeout: Optional[float] = None,
|
|
33
50
|
):
|
|
51
|
+
import warnings
|
|
52
|
+
|
|
53
|
+
warnings.warn(
|
|
54
|
+
"MarkItDownToolkit is deprecated and will be removed in a future "
|
|
55
|
+
"version. Please use FileToolkit instead, which now includes "
|
|
56
|
+
"read_file method that supports both single and multiple files.",
|
|
57
|
+
DeprecationWarning,
|
|
58
|
+
stacklevel=2,
|
|
59
|
+
)
|
|
34
60
|
super().__init__(timeout=timeout)
|
|
35
61
|
|
|
36
62
|
def read_files(self, file_paths: List[str]) -> Dict[str, str]:
|
|
@@ -138,33 +138,43 @@ class NoteTakingToolkit(BaseToolkit):
|
|
|
138
138
|
self.registry.append(note_name)
|
|
139
139
|
self._save_registry()
|
|
140
140
|
|
|
141
|
-
def create_note(
|
|
141
|
+
def create_note(
|
|
142
|
+
self, note_name: str, content: str, overwrite: bool = False
|
|
143
|
+
) -> str:
|
|
142
144
|
r"""Creates a new note with a unique name.
|
|
143
145
|
|
|
144
146
|
This function will create a new file for your note.
|
|
145
|
-
|
|
146
|
-
to add content to an existing note, use the `append_note`
|
|
147
|
-
instead.
|
|
147
|
+
By default, you must provide a `note_name` that does not already exist.
|
|
148
|
+
If you want to add content to an existing note, use the `append_note`
|
|
149
|
+
function instead. If you want to overwrite an existing note, set
|
|
150
|
+
`overwrite=True`.
|
|
148
151
|
|
|
149
152
|
Args:
|
|
150
153
|
note_name (str): The name for your new note (without the .md
|
|
151
|
-
extension). This name must be unique.
|
|
154
|
+
extension). This name must be unique unless overwrite is True.
|
|
152
155
|
content (str): The initial content to write in the note.
|
|
156
|
+
overwrite (bool): Whether to overwrite an existing note.
|
|
157
|
+
Defaults to False.
|
|
153
158
|
|
|
154
159
|
Returns:
|
|
155
160
|
str: A message confirming the creation of the note or an error if
|
|
156
|
-
the note name is not valid or already exists
|
|
161
|
+
the note name is not valid or already exists
|
|
162
|
+
(when overwrite=False).
|
|
157
163
|
"""
|
|
158
164
|
try:
|
|
159
165
|
note_path = self.working_directory / f"{note_name}.md"
|
|
166
|
+
existed_before = note_path.exists()
|
|
160
167
|
|
|
161
|
-
if
|
|
168
|
+
if existed_before and not overwrite:
|
|
162
169
|
return f"Error: Note '{note_name}.md' already exists."
|
|
163
170
|
|
|
164
171
|
note_path.write_text(content, encoding="utf-8")
|
|
165
172
|
self._register_note(note_name)
|
|
166
173
|
|
|
167
|
-
|
|
174
|
+
if existed_before and overwrite:
|
|
175
|
+
return f"Note '{note_name}.md' successfully overwritten."
|
|
176
|
+
else:
|
|
177
|
+
return f"Note '{note_name}.md' successfully created."
|
|
168
178
|
except Exception as e:
|
|
169
179
|
return f"Error creating note: {e}"
|
|
170
180
|
|