camel-ai 0.2.71a2__py3-none-any.whl → 0.2.71a3__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/_types.py +6 -2
- camel/agents/chat_agent.py +297 -16
- camel/messages/base.py +2 -6
- camel/services/agent_openapi_server.py +380 -0
- camel/toolkits/__init__.py +2 -2
- camel/toolkits/{non_visual_browser_toolkit → hybrid_browser_toolkit}/__init__.py +2 -2
- camel/toolkits/{non_visual_browser_toolkit → hybrid_browser_toolkit}/actions.py +47 -11
- camel/toolkits/{non_visual_browser_toolkit → hybrid_browser_toolkit}/agent.py +21 -11
- camel/toolkits/{non_visual_browser_toolkit/nv_browser_session.py → hybrid_browser_toolkit/browser_session.py} +64 -10
- camel/toolkits/hybrid_browser_toolkit/hybrid_browser_toolkit.py +1002 -0
- camel/toolkits/{non_visual_browser_toolkit → hybrid_browser_toolkit}/snapshot.py +16 -4
- camel/toolkits/{non_visual_browser_toolkit/snapshot.js → hybrid_browser_toolkit/unified_analyzer.js} +171 -15
- camel/types/agents/tool_calling_record.py +4 -1
- camel/types/enums.py +24 -24
- camel/utils/tool_result.py +44 -0
- {camel_ai-0.2.71a2.dist-info → camel_ai-0.2.71a3.dist-info}/METADATA +16 -2
- {camel_ai-0.2.71a2.dist-info → camel_ai-0.2.71a3.dist-info}/RECORD +20 -18
- camel/toolkits/non_visual_browser_toolkit/browser_non_visual_toolkit.py +0 -446
- {camel_ai-0.2.71a2.dist-info → camel_ai-0.2.71a3.dist-info}/WHEEL +0 -0
- {camel_ai-0.2.71a2.dist-info → camel_ai-0.2.71a3.dist-info}/licenses/LICENSE +0 -0
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
# limitations under the License.
|
|
13
13
|
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
|
|
14
14
|
from pathlib import Path
|
|
15
|
-
from typing import TYPE_CHECKING, Dict, List, Optional
|
|
15
|
+
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Union
|
|
16
16
|
|
|
17
17
|
if TYPE_CHECKING:
|
|
18
18
|
from playwright.async_api import Page
|
|
@@ -64,7 +64,17 @@ class PageSnapshot:
|
|
|
64
64
|
)
|
|
65
65
|
|
|
66
66
|
logger.debug("Capturing page snapshot …")
|
|
67
|
-
|
|
67
|
+
snapshot_result = await self._get_snapshot_direct()
|
|
68
|
+
|
|
69
|
+
# Extract snapshot text from the unified analyzer result
|
|
70
|
+
if (
|
|
71
|
+
isinstance(snapshot_result, dict)
|
|
72
|
+
and 'snapshotText' in snapshot_result
|
|
73
|
+
):
|
|
74
|
+
snapshot_text = snapshot_result['snapshotText']
|
|
75
|
+
else:
|
|
76
|
+
snapshot_text = snapshot_result
|
|
77
|
+
|
|
68
78
|
formatted = self._format_snapshot(snapshot_text or "<empty>")
|
|
69
79
|
|
|
70
80
|
output = formatted
|
|
@@ -99,7 +109,9 @@ class PageSnapshot:
|
|
|
99
109
|
# ------------------------------------------------------------------
|
|
100
110
|
_snapshot_js_cache: Optional[str] = None # class-level cache
|
|
101
111
|
|
|
102
|
-
async def _get_snapshot_direct(
|
|
112
|
+
async def _get_snapshot_direct(
|
|
113
|
+
self,
|
|
114
|
+
) -> Optional[Union[str, Dict[str, Any]]]:
|
|
103
115
|
r"""Evaluate the snapshot-extraction JS with simple retry logic.
|
|
104
116
|
|
|
105
117
|
Playwright throws *Execution context was destroyed* when a new page
|
|
@@ -110,7 +122,7 @@ class PageSnapshot:
|
|
|
110
122
|
|
|
111
123
|
# Load JS once and cache it at class level
|
|
112
124
|
if PageSnapshot._snapshot_js_cache is None:
|
|
113
|
-
js_path = Path(__file__).parent / "
|
|
125
|
+
js_path = Path(__file__).parent / "unified_analyzer.js"
|
|
114
126
|
PageSnapshot._snapshot_js_cache = js_path.read_text(
|
|
115
127
|
encoding="utf-8"
|
|
116
128
|
)
|
camel/toolkits/{non_visual_browser_toolkit/snapshot.js → hybrid_browser_toolkit/unified_analyzer.js}
RENAMED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
(() => {
|
|
2
|
-
//
|
|
3
|
-
//
|
|
2
|
+
// Unified analyzer that combines visual and structural analysis
|
|
3
|
+
// Preserves complete snapshot.js logic while adding visual coordinate information
|
|
4
|
+
|
|
5
|
+
let refCounter = 1;
|
|
6
|
+
function generateRef() {
|
|
7
|
+
return `e${refCounter++}`;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
// === Complete snapshot.js logic preservation ===
|
|
4
11
|
|
|
5
12
|
function isVisible(node) {
|
|
6
13
|
if (node.nodeType !== Node.ELEMENT_NODE) return true;
|
|
@@ -70,13 +77,9 @@
|
|
|
70
77
|
return result;
|
|
71
78
|
}
|
|
72
79
|
|
|
73
|
-
let refCounter = 1;
|
|
74
|
-
function generateRef() {
|
|
75
|
-
return `e${refCounter++}`;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
80
|
/**
|
|
79
81
|
* Phase 1: Build an in-memory representation of the accessibility tree.
|
|
82
|
+
* Complete preservation of snapshot.js buildAriaTree logic
|
|
80
83
|
*/
|
|
81
84
|
function buildAriaTree(rootElement) {
|
|
82
85
|
const visited = new Set();
|
|
@@ -153,9 +156,34 @@
|
|
|
153
156
|
}
|
|
154
157
|
}
|
|
155
158
|
|
|
156
|
-
// FIX:
|
|
157
|
-
if (ariaNode && ariaNode.children.length
|
|
158
|
-
|
|
159
|
+
// FIX: Remove redundant text children that match the element's name
|
|
160
|
+
if (ariaNode && ariaNode.children.length > 0) {
|
|
161
|
+
// Remove text children that are the same as the parent's name or are contained in it
|
|
162
|
+
ariaNode.children = ariaNode.children.filter(child => {
|
|
163
|
+
if (typeof child === 'string') {
|
|
164
|
+
const childText = child.trim();
|
|
165
|
+
const parentName = ariaNode.name.trim();
|
|
166
|
+
|
|
167
|
+
// Remove if text child exactly matches parent name
|
|
168
|
+
if (childText === parentName) {
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
// Also remove if the child text is completely contained in parent name
|
|
173
|
+
// and represents a significant portion (to avoid removing important partial text)
|
|
174
|
+
if (childText.length > 3 && parentName.includes(childText)) {
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return true;
|
|
179
|
+
}
|
|
180
|
+
return true;
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
// If after filtering, we have only one text child that equals the name, remove it
|
|
184
|
+
if (ariaNode.children.length === 1 && typeof ariaNode.children[0] === 'string' && ariaNode.name === ariaNode.children[0]) {
|
|
185
|
+
ariaNode.children = [];
|
|
186
|
+
}
|
|
159
187
|
}
|
|
160
188
|
}
|
|
161
189
|
|
|
@@ -166,7 +194,7 @@
|
|
|
166
194
|
|
|
167
195
|
/**
|
|
168
196
|
* Phase 2: Normalize the tree by removing redundant generic wrappers.
|
|
169
|
-
*
|
|
197
|
+
* Complete preservation of snapshot.js normalizeTree logic
|
|
170
198
|
*/
|
|
171
199
|
function normalizeTree(node) {
|
|
172
200
|
if (typeof node === 'string') return [node];
|
|
@@ -178,6 +206,24 @@
|
|
|
178
206
|
node.children = newChildren;
|
|
179
207
|
|
|
180
208
|
// Remove child elements that have the same name as their parent
|
|
209
|
+
const filteredChildren = [];
|
|
210
|
+
for (const child of node.children) {
|
|
211
|
+
if (typeof child !== 'string' && child.name && node.name) {
|
|
212
|
+
const childName = child.name.trim();
|
|
213
|
+
const parentName = node.name.trim();
|
|
214
|
+
if (childName === parentName) {
|
|
215
|
+
// If child has same name as parent, merge its children into parent
|
|
216
|
+
filteredChildren.push(...(child.children || []));
|
|
217
|
+
} else {
|
|
218
|
+
filteredChildren.push(child);
|
|
219
|
+
}
|
|
220
|
+
} else {
|
|
221
|
+
filteredChildren.push(child);
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
node.children = filteredChildren;
|
|
225
|
+
|
|
226
|
+
// Also handle the case where we have only one child with same name
|
|
181
227
|
if (node.children.length === 1 && typeof node.children[0] !== 'string') {
|
|
182
228
|
const child = node.children[0];
|
|
183
229
|
if (child.name && node.name && child.name.trim() === node.name.trim()) {
|
|
@@ -195,9 +241,9 @@
|
|
|
195
241
|
return [node];
|
|
196
242
|
}
|
|
197
243
|
|
|
198
|
-
|
|
199
244
|
/**
|
|
200
245
|
* Phase 3: Render the normalized tree into the final string format.
|
|
246
|
+
* Complete preservation of snapshot.js renderTree logic
|
|
201
247
|
*/
|
|
202
248
|
function renderTree(node, indent = '') {
|
|
203
249
|
const lines = [];
|
|
@@ -263,6 +309,116 @@
|
|
|
263
309
|
return lines;
|
|
264
310
|
}
|
|
265
311
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
312
|
+
// === Visual analysis functions from page_script.js ===
|
|
313
|
+
|
|
314
|
+
// From page_script.js - check if element is topmost at coordinates
|
|
315
|
+
function isTopmost(element, x, y) {
|
|
316
|
+
let hit = document.elementFromPoint(x, y);
|
|
317
|
+
if (hit === null) return true;
|
|
318
|
+
|
|
319
|
+
while (hit) {
|
|
320
|
+
if (hit == element) return true;
|
|
321
|
+
hit = hit.parentNode;
|
|
322
|
+
}
|
|
323
|
+
return false;
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
// From page_script.js - get visual coordinates
|
|
327
|
+
function getElementCoordinates(element) {
|
|
328
|
+
let rects = element.getClientRects();
|
|
329
|
+
let scale = window.devicePixelRatio || 1;
|
|
330
|
+
let validRects = [];
|
|
331
|
+
|
|
332
|
+
for (const rect of rects) {
|
|
333
|
+
let x = rect.left + rect.width / 2;
|
|
334
|
+
let y = rect.top + rect.height / 2;
|
|
335
|
+
if (isTopmost(element, x, y)) {
|
|
336
|
+
validRects.push({
|
|
337
|
+
x: rect.x * scale,
|
|
338
|
+
y: rect.y * scale,
|
|
339
|
+
width: rect.width * scale,
|
|
340
|
+
height: rect.height * scale,
|
|
341
|
+
top: rect.top * scale,
|
|
342
|
+
left: rect.left * scale,
|
|
343
|
+
right: rect.right * scale,
|
|
344
|
+
bottom: rect.bottom * scale
|
|
345
|
+
});
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
return validRects;
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
// === Unified analysis function ===
|
|
353
|
+
|
|
354
|
+
function collectElementsFromTree(node, elementsMap) {
|
|
355
|
+
if (typeof node === 'string') return;
|
|
356
|
+
|
|
357
|
+
if (node.element && node.ref) {
|
|
358
|
+
// Get visual coordinates for this element
|
|
359
|
+
const coordinates = getElementCoordinates(node.element);
|
|
360
|
+
|
|
361
|
+
// Store comprehensive element information
|
|
362
|
+
elementsMap[node.ref] = {
|
|
363
|
+
// Structural information (preserved from snapshot.js)
|
|
364
|
+
role: node.role,
|
|
365
|
+
name: node.name,
|
|
366
|
+
tagName: node.element.tagName.toLowerCase(),
|
|
367
|
+
disabled: node.disabled,
|
|
368
|
+
checked: node.checked,
|
|
369
|
+
expanded: node.expanded,
|
|
370
|
+
|
|
371
|
+
// Visual information (from page_script.js)
|
|
372
|
+
coordinates: coordinates,
|
|
373
|
+
|
|
374
|
+
// Additional metadata
|
|
375
|
+
href: node.element.href || null,
|
|
376
|
+
value: node.element.value || null,
|
|
377
|
+
placeholder: node.element.placeholder || null,
|
|
378
|
+
scrollable: node.element.scrollHeight > node.element.clientHeight
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
// Recursively process children
|
|
383
|
+
if (node.children) {
|
|
384
|
+
for (const child of node.children) {
|
|
385
|
+
collectElementsFromTree(child, elementsMap);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
function analyzePageElements() {
|
|
391
|
+
// Generate the complete structured snapshot using original snapshot.js logic
|
|
392
|
+
const outputLines = processDocument(document);
|
|
393
|
+
const snapshotText = outputLines.join('\n');
|
|
394
|
+
|
|
395
|
+
// Build the tree again to collect element information with visual data
|
|
396
|
+
textCache.clear();
|
|
397
|
+
refCounter = 1; // Reset counter to match snapshot generation
|
|
398
|
+
let tree = buildAriaTree(document.body);
|
|
399
|
+
[tree] = normalizeTree(tree);
|
|
400
|
+
|
|
401
|
+
const elementsMap = {};
|
|
402
|
+
collectElementsFromTree(tree, elementsMap);
|
|
403
|
+
|
|
404
|
+
const result = {
|
|
405
|
+
url: window.location.href,
|
|
406
|
+
elements: elementsMap,
|
|
407
|
+
snapshotText: snapshotText,
|
|
408
|
+
metadata: {
|
|
409
|
+
timestamp: new Date().toISOString(),
|
|
410
|
+
elementCount: Object.keys(elementsMap).length,
|
|
411
|
+
screenInfo: {
|
|
412
|
+
width: window.innerWidth,
|
|
413
|
+
height: window.innerHeight,
|
|
414
|
+
devicePixelRatio: window.devicePixelRatio || 1
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
};
|
|
418
|
+
|
|
419
|
+
return result;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
// Execute analysis and return result
|
|
423
|
+
return analyzePageElements();
|
|
424
|
+
})();
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
# See the License for the specific language governing permissions and
|
|
12
12
|
# limitations under the License.
|
|
13
13
|
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
|
|
14
|
-
from typing import Any, Dict
|
|
14
|
+
from typing import Any, Dict, List, Optional
|
|
15
15
|
|
|
16
16
|
from pydantic import BaseModel
|
|
17
17
|
|
|
@@ -24,12 +24,15 @@ class ToolCallingRecord(BaseModel):
|
|
|
24
24
|
args (Dict[str, Any]): The dictionary of arguments passed to the tool.
|
|
25
25
|
result (Any): The execution result of calling this tool.
|
|
26
26
|
tool_call_id (str): The ID of the tool call, if available.
|
|
27
|
+
images (Optional[List[str]]): List of base64-encoded images returned
|
|
28
|
+
by the tool, if any.
|
|
27
29
|
"""
|
|
28
30
|
|
|
29
31
|
tool_name: str
|
|
30
32
|
args: Dict[str, Any]
|
|
31
33
|
result: Any
|
|
32
34
|
tool_call_id: str
|
|
35
|
+
images: Optional[List[str]] = None
|
|
33
36
|
|
|
34
37
|
def __str__(self) -> str:
|
|
35
38
|
r"""Overridden version of the string function.
|
camel/types/enums.py
CHANGED
|
@@ -388,14 +388,14 @@ class ModelType(UnifiedModelType, Enum):
|
|
|
388
388
|
WATSONX_MISTRAL_LARGE = "mistralai/mistral-large"
|
|
389
389
|
|
|
390
390
|
# Qianfan models
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
391
|
+
ERNIE_X1_TURBO_32K = "ernie-x1-turbo-32k"
|
|
392
|
+
ERNIE_X1_32K = "ernie-x1-32k"
|
|
393
|
+
ERNIE_X1_32K_PREVIEW = "ernie-x1-32k-preview"
|
|
394
|
+
ERNIE_4_5_TURBO_128K = "ernie-4.5-turbo-128k"
|
|
395
|
+
ERNIE_4_5_TURBO_32K = "ernie-4.5-turbo-32k"
|
|
396
|
+
DEEPSEEK_V3 = "deepseek-v3"
|
|
397
|
+
DEEPSEEK_R1 = "deepseek-r1"
|
|
398
|
+
QWEN3_235B_A22B = "qwen3-235b-a22b"
|
|
399
399
|
|
|
400
400
|
# Crynux models
|
|
401
401
|
CRYNUX_DEEPSEEK_R1_DISTILL_QWEN_1_5B = (
|
|
@@ -882,14 +882,14 @@ class ModelType(UnifiedModelType, Enum):
|
|
|
882
882
|
@property
|
|
883
883
|
def is_qianfan(self) -> bool:
|
|
884
884
|
return self in {
|
|
885
|
-
ModelType.
|
|
886
|
-
ModelType.
|
|
887
|
-
ModelType.
|
|
888
|
-
ModelType.
|
|
889
|
-
ModelType.
|
|
890
|
-
ModelType.
|
|
891
|
-
ModelType.
|
|
892
|
-
ModelType.
|
|
885
|
+
ModelType.ERNIE_X1_TURBO_32K,
|
|
886
|
+
ModelType.ERNIE_X1_32K,
|
|
887
|
+
ModelType.ERNIE_X1_32K_PREVIEW,
|
|
888
|
+
ModelType.ERNIE_4_5_TURBO_128K,
|
|
889
|
+
ModelType.ERNIE_4_5_TURBO_32K,
|
|
890
|
+
ModelType.DEEPSEEK_V3,
|
|
891
|
+
ModelType.DEEPSEEK_R1,
|
|
892
|
+
ModelType.QWEN3_235B_A22B,
|
|
893
893
|
}
|
|
894
894
|
|
|
895
895
|
@property
|
|
@@ -1063,11 +1063,11 @@ class ModelType(UnifiedModelType, Enum):
|
|
|
1063
1063
|
ModelType.CRYNUX_QWEN_2_5_7B_INSTRUCT,
|
|
1064
1064
|
ModelType.CRYNUX_NOUS_HERMES_3_LLAMA_3_1_8B,
|
|
1065
1065
|
ModelType.CRYNUX_NOUS_HERMES_3_LLAMA_3_2_3B,
|
|
1066
|
-
ModelType.
|
|
1067
|
-
ModelType.
|
|
1068
|
-
ModelType.
|
|
1069
|
-
ModelType.
|
|
1070
|
-
ModelType.
|
|
1066
|
+
ModelType.ERNIE_X1_TURBO_32K,
|
|
1067
|
+
ModelType.ERNIE_X1_32K,
|
|
1068
|
+
ModelType.ERNIE_X1_32K_PREVIEW,
|
|
1069
|
+
ModelType.ERNIE_4_5_TURBO_32K,
|
|
1070
|
+
ModelType.QWEN3_235B_A22B,
|
|
1071
1071
|
}:
|
|
1072
1072
|
return 32_000
|
|
1073
1073
|
elif self in {
|
|
@@ -1148,7 +1148,7 @@ class ModelType(UnifiedModelType, Enum):
|
|
|
1148
1148
|
return 65_535
|
|
1149
1149
|
elif self in {
|
|
1150
1150
|
ModelType.NOVITA_QWEN_2_5_V1_72B,
|
|
1151
|
-
ModelType.
|
|
1151
|
+
ModelType.DEEPSEEK_R1,
|
|
1152
1152
|
}:
|
|
1153
1153
|
return 96_000
|
|
1154
1154
|
elif self in {
|
|
@@ -1203,8 +1203,8 @@ class ModelType(UnifiedModelType, Enum):
|
|
|
1203
1203
|
ModelType.NETMIND_DEEPSEEK_V3,
|
|
1204
1204
|
ModelType.NOVITA_DEEPSEEK_V3_0324,
|
|
1205
1205
|
ModelType.MISTRAL_MEDIUM_3,
|
|
1206
|
-
ModelType.
|
|
1207
|
-
ModelType.
|
|
1206
|
+
ModelType.ERNIE_4_5_TURBO_128K,
|
|
1207
|
+
ModelType.DEEPSEEK_V3,
|
|
1208
1208
|
}:
|
|
1209
1209
|
return 128_000
|
|
1210
1210
|
elif self in {
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
from typing import List, Optional
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class ToolResult:
|
|
19
|
+
r"""Special result type for tools that can return images along with text.
|
|
20
|
+
|
|
21
|
+
This class is used by ChatAgent to detect when a tool returns visual
|
|
22
|
+
content that should be included in the conversation context.
|
|
23
|
+
"""
|
|
24
|
+
|
|
25
|
+
def __init__(self, text: str, images: Optional[List[str]] = None):
|
|
26
|
+
r"""Initialize a tool result.
|
|
27
|
+
|
|
28
|
+
Args:
|
|
29
|
+
text (str): The text description or result of the tool operation.
|
|
30
|
+
images (Optional[List[str]]): List of base64-encoded images to
|
|
31
|
+
include in the conversation context. Images should be encoded
|
|
32
|
+
as "data:image/{format};base64,{data}" format.
|
|
33
|
+
"""
|
|
34
|
+
self.text = text
|
|
35
|
+
self.images = images or []
|
|
36
|
+
|
|
37
|
+
def __str__(self) -> str:
|
|
38
|
+
r"""Return the text representation of the result."""
|
|
39
|
+
return self.text
|
|
40
|
+
|
|
41
|
+
def __repr__(self) -> str:
|
|
42
|
+
r"""Return a detailed representation of the result."""
|
|
43
|
+
img_count = len(self.images) if self.images else 0
|
|
44
|
+
return f"ToolResult(text='{self.text[:50]}...', images={img_count})"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: camel-ai
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.71a3
|
|
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
|
|
@@ -34,7 +34,7 @@ Requires-Dist: botocore<2,>=1.35.3; extra == 'all'
|
|
|
34
34
|
Requires-Dist: chromadb<1.0.0,>=0.6.0; extra == 'all'
|
|
35
35
|
Requires-Dist: chunkr-ai>=0.0.50; extra == 'all'
|
|
36
36
|
Requires-Dist: cohere<6,>=5.11.0; extra == 'all'
|
|
37
|
-
Requires-Dist: crawl4ai>=0.
|
|
37
|
+
Requires-Dist: crawl4ai>=0.4.0; extra == 'all'
|
|
38
38
|
Requires-Dist: dappier<0.4,>=0.3.3; extra == 'all'
|
|
39
39
|
Requires-Dist: datacommons-pandas<0.0.4,>=0.0.3; extra == 'all'
|
|
40
40
|
Requires-Dist: datacommons<2,>=1.4.3; extra == 'all'
|
|
@@ -253,6 +253,7 @@ Requires-Dist: docx2txt<0.9,>=0.8; extra == 'owl'
|
|
|
253
253
|
Requires-Dist: docx>=0.2.4; extra == 'owl'
|
|
254
254
|
Requires-Dist: duckduckgo-search<7,>=6.3.5; extra == 'owl'
|
|
255
255
|
Requires-Dist: e2b-code-interpreter<2,>=1.0.3; extra == 'owl'
|
|
256
|
+
Requires-Dist: exa-py<2,>=1.10.0; extra == 'owl'
|
|
256
257
|
Requires-Dist: ffmpeg-python<0.3,>=0.2.0; extra == 'owl'
|
|
257
258
|
Requires-Dist: html2text>=2024.2.26; extra == 'owl'
|
|
258
259
|
Requires-Dist: imageio[pyav]<3,>=2.34.2; extra == 'owl'
|
|
@@ -756,6 +757,19 @@ Practical guides and tutorials for implementing specific functionalities in CAME
|
|
|
756
757
|
<br>
|
|
757
758
|
|
|
758
759
|
|
|
760
|
+
## 🗓️ Events
|
|
761
|
+
|
|
762
|
+
We are actively involved in community events including:
|
|
763
|
+
|
|
764
|
+
- 🎙️ **Community Meetings** — Weekly virtual syncs with the CAMEL team
|
|
765
|
+
- 🏆 **Competitions** — Hackathons, Bounty Tasks and coding challenges hosted by CAMEL
|
|
766
|
+
- 🤝 **Volunteer Activities** — Contributions, documentation drives, and mentorship
|
|
767
|
+
- 🌍 **Ambassador Programs** — Represent CAMEL in your university or local tech groups
|
|
768
|
+
|
|
769
|
+
> Want to host or participate in a CAMEL event? Join our [Discord](https://discord.com/invite/CNcNpquyDc) or want to be part of [Ambassador Program](https://www.camel-ai.org/ambassador).
|
|
770
|
+
|
|
771
|
+
|
|
772
|
+
|
|
759
773
|
## Contributing to CAMEL
|
|
760
774
|
|
|
761
775
|
> For those who'd like to contribute code, we appreciate your interest in contributing to our open-source initiative. Please take a moment to review our [contributing guidelines](https://github.com/camel-ai/camel/blob/master/CONTRIBUTING.md) to get started on a smooth collaboration journey.🚀
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
camel/__init__.py,sha256=
|
|
1
|
+
camel/__init__.py,sha256=Xx_Vi3MBcnH09Cz4Uh0KP-x9JhblyfHevUuVU407fNg,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=rZVeOVYuQ9RYJ5Tqyv0usqy0g4zaVEq4qSfZ9nd2640,5755
|
|
5
5
|
camel/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
camel/agents/__init__.py,sha256=64weKqdvmpZcGWyVkO-OKASAmVUdrQjv60JApgPk_SA,1644
|
|
7
|
-
camel/agents/_types.py,sha256=
|
|
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=
|
|
10
|
+
camel/agents/chat_agent.py,sha256=Lc_dRkrDfbq1SWD0FDAmBfD96m1EzYv45i-exS6L6h4,101405
|
|
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
|
|
@@ -162,7 +162,7 @@ camel/memories/blocks/vectordb_block.py,sha256=r0mRGLV14YUr8aruLdylBjKdSm11oprsi
|
|
|
162
162
|
camel/memories/context_creators/__init__.py,sha256=pqzkBM2ro5JZD7RhWg05TjinphhCq0QTIqBJlIL1sJ0,800
|
|
163
163
|
camel/memories/context_creators/score_based.py,sha256=OQ7eEECkzu4Op5sS9qS1dVgZl-cchSkUZj8Puh8C024,16488
|
|
164
164
|
camel/messages/__init__.py,sha256=Px-gTFp2Kcgbeb2sZQ_f4tqjoLHE-QEOiMHIMfPrvTw,1949
|
|
165
|
-
camel/messages/base.py,sha256=
|
|
165
|
+
camel/messages/base.py,sha256=u67NdYW5G0v-ZgojP8MQpoW5OKP2_AJKEz1JHoRxJ3U,19553
|
|
166
166
|
camel/messages/func_message.py,sha256=7e6HsU2FmiDwxhQCFhUenAhms6s9q22ol2Eg7FJa3yw,6892
|
|
167
167
|
camel/messages/conversion/__init__.py,sha256=8B4C-0wj-dm925YRKNyx31WYK25PWpME7Q9jPtx2jkY,1047
|
|
168
168
|
camel/messages/conversion/alpaca.py,sha256=jBU2bMhzNjzptGuoasThYvFov_cYPCYt3pEfs0T7z7U,4163
|
|
@@ -266,6 +266,7 @@ camel/schemas/__init__.py,sha256=UHt0krcozkPQFqD00q2Vk6hLbwV0ySrgaq17MJEZK1c,863
|
|
|
266
266
|
camel/schemas/base.py,sha256=x0H0oIwbQR6UGdEvR5v-srI25MJ8uTrEw8nnygvLwjw,1604
|
|
267
267
|
camel/schemas/openai_converter.py,sha256=SEnYsYcboZgVmjcC1YP5xke3c0MYPESPRmYQWsDGZ4Y,4362
|
|
268
268
|
camel/schemas/outlines_converter.py,sha256=OYKPR1fNyrYs9eh5RiXEAccMbnRc9WTwSVJYbh9HkKE,8738
|
|
269
|
+
camel/services/agent_openapi_server.py,sha256=NUCBLNZBvi4C-J1ESMyRHiRX1NDhPdPkXTMJTl0oUQo,14698
|
|
269
270
|
camel/societies/__init__.py,sha256=NOHjtlsY-gV9UCF2xXgcbG-xXyuigmbwbpLpNsDgEJ4,826
|
|
270
271
|
camel/societies/babyagi_playing.py,sha256=KbTdpHfZ2V8AripVck0bNTOyF-RSaMPCRARz3DvzWfQ,11855
|
|
271
272
|
camel/societies/role_playing.py,sha256=0XScr3WfxX1QOC71RhBLmrcS5y2c7DMQB_mAFOHU34M,31421
|
|
@@ -313,7 +314,7 @@ camel/terminators/__init__.py,sha256=t8uqrkUnXEOYMXQDgaBkMFJ0EXFKI0kmx4cUimli3Ls
|
|
|
313
314
|
camel/terminators/base.py,sha256=xmJzERX7GdSXcxZjAHHODa0rOxRChMSRboDCNHWSscs,1511
|
|
314
315
|
camel/terminators/response_terminator.py,sha256=n3G5KP6Oj7-7WlRN0yFcrtLpqAJKaKS0bmhrWlFfCgQ,4982
|
|
315
316
|
camel/terminators/token_limit_terminator.py,sha256=YWv6ZR8R9yI2Qnf_3xES5bEE_O5bb2CxQ0EUXfMh34c,2118
|
|
316
|
-
camel/toolkits/__init__.py,sha256=
|
|
317
|
+
camel/toolkits/__init__.py,sha256=KdVeX1CTxQECh6andawWPAbj2C84mDpsLKzHGd1Vtkw,5434
|
|
317
318
|
camel/toolkits/aci_toolkit.py,sha256=39AsXloBb16hHB7DKi6mFU6NPZ3iVpM2FZgaP4o4eLE,16060
|
|
318
319
|
camel/toolkits/arxiv_toolkit.py,sha256=mw629nIN_ozaAxNv3nbvhonJKNI2-97ScRCBS3gVqNo,6297
|
|
319
320
|
camel/toolkits/ask_news_toolkit.py,sha256=WfWaqwEo1Apbil3-Rb5y65Ws43NU4rAFWZu5VHe4los,23448
|
|
@@ -377,13 +378,13 @@ camel/toolkits/weather_toolkit.py,sha256=fs9x9aC38Wsvni6A4PPpbRX6-aBnZiqs2Jix39y
|
|
|
377
378
|
camel/toolkits/whatsapp_toolkit.py,sha256=udUQXkXyeWsmrUlOJZsGBhHtc_jhB05Axe_TchhibsU,5760
|
|
378
379
|
camel/toolkits/wolfram_alpha_toolkit.py,sha256=qeIM8ySn5ilcExBWtx-hDOc35bNcebLVnZ67kt1H3mQ,9295
|
|
379
380
|
camel/toolkits/zapier_toolkit.py,sha256=A83y1UcfuopH7Fx82pORzypl1StbhBjB2HhyOqYa300,7124
|
|
380
|
-
camel/toolkits/
|
|
381
|
-
camel/toolkits/
|
|
382
|
-
camel/toolkits/
|
|
383
|
-
camel/toolkits/
|
|
384
|
-
camel/toolkits/
|
|
385
|
-
camel/toolkits/
|
|
386
|
-
camel/toolkits/
|
|
381
|
+
camel/toolkits/hybrid_browser_toolkit/__init__.py,sha256=vxjWhq7GjUKE5I9RGQU_GoikZJ-AVK4ertdvEqp9pd0,802
|
|
382
|
+
camel/toolkits/hybrid_browser_toolkit/actions.py,sha256=687NtNdjkx8MfXQRSY7hSUAshZnVBxCbYYHZjnal_Go,8746
|
|
383
|
+
camel/toolkits/hybrid_browser_toolkit/agent.py,sha256=nYTNeLEaPg1bhzl65IcG9JkjiS9cRNV3bjsyct4pzM8,10881
|
|
384
|
+
camel/toolkits/hybrid_browser_toolkit/browser_session.py,sha256=ZbPTKoRJaA4kcd-i9B9J98MEaAgPZ3FGjNzs3IJdoWs,11034
|
|
385
|
+
camel/toolkits/hybrid_browser_toolkit/hybrid_browser_toolkit.py,sha256=xvJGQPnJQC9X9HfTCjCNp7kWWi1Q6mKIFV0ujsLG-10,37913
|
|
386
|
+
camel/toolkits/hybrid_browser_toolkit/snapshot.py,sha256=0gVhOsGujUmv-LdQ5FZGfRNmKaECmJah5W-FOAOu64Q,8489
|
|
387
|
+
camel/toolkits/hybrid_browser_toolkit/unified_analyzer.js,sha256=aVdlR9XszD-Ofisov5T0JGL9IjlNg2PCJaCI5IEbEoA,16369
|
|
387
388
|
camel/toolkits/open_api_specs/security_config.py,sha256=ZVnBa_zEifaE_ao2xsvV5majuJHpn2Tn7feMDOnj-eo,898
|
|
388
389
|
camel/toolkits/open_api_specs/biztoc/__init__.py,sha256=OKCZrQCDwaWtXIN_2rA9FSqEvgpQRieRoHh7Ek6N16A,702
|
|
389
390
|
camel/toolkits/open_api_specs/biztoc/ai-plugin.json,sha256=IJinQbLv5MFPGFwdN7PbOhwArFVExSEZdJspe-mOBIo,866
|
|
@@ -410,12 +411,12 @@ camel/toolkits/open_api_specs/web_scraper/openapi.yaml,sha256=u_WalQ01e8W1D27VnZ
|
|
|
410
411
|
camel/toolkits/open_api_specs/web_scraper/paths/__init__.py,sha256=OKCZrQCDwaWtXIN_2rA9FSqEvgpQRieRoHh7Ek6N16A,702
|
|
411
412
|
camel/toolkits/open_api_specs/web_scraper/paths/scraper.py,sha256=aWy1_ppV4NVVEZfnbN3tu9XA9yAPAC9bRStJ5JuXMRU,1117
|
|
412
413
|
camel/types/__init__.py,sha256=pFTg3CWGSCfwFdoxPDTf4dKV8DdJS1x-bBPuEOmtdf0,2549
|
|
413
|
-
camel/types/enums.py,sha256=
|
|
414
|
+
camel/types/enums.py,sha256=tUTwrEj5-R6EEXxclxiMkrThLL4SotpYX3saXQI01vo,62822
|
|
414
415
|
camel/types/mcp_registries.py,sha256=dl4LgYtSaUhsqAKpz28k_SA9La11qxqBvDLaEuyzrFE,4971
|
|
415
416
|
camel/types/openai_types.py,sha256=8ZFzLe-zGmKNPfuVZFzxlxAX98lGf18gtrPhOgMmzus,2104
|
|
416
417
|
camel/types/unified_model_type.py,sha256=ZweHiS4MQ1QbDEX3a3oUc-pvgueYP27Zt0SlAPcYg_4,5623
|
|
417
418
|
camel/types/agents/__init__.py,sha256=cbvVkogPoZgcwZrgxLH6EtpGXk0kavF79nOic0Dc1vg,786
|
|
418
|
-
camel/types/agents/tool_calling_record.py,sha256=
|
|
419
|
+
camel/types/agents/tool_calling_record.py,sha256=xG0a9TJu-nQQ9aAxpZwYmgqnpjEbnm2cRjjG8uDSIbg,1979
|
|
419
420
|
camel/utils/__init__.py,sha256=qQeMHZJ8Bbgpm4tBu-LWc_P3iFjXBlVfALdKTiD_s8I,3305
|
|
420
421
|
camel/utils/async_func.py,sha256=KqoktGSWjZBuAMQ2CV0X6FRgHGlzCKLfeaWvp-f1Qz8,1568
|
|
421
422
|
camel/utils/commons.py,sha256=hJNvcegHXruFkPaFHh6r9kwHErN9j4vbkLUhSbInbNU,37067
|
|
@@ -428,6 +429,7 @@ camel/utils/mcp_client.py,sha256=1581sSQKNFxZFq-MvLXRq8jU1HIo3-X3xTfz6hJkKtE,360
|
|
|
428
429
|
camel/utils/message_summarizer.py,sha256=7AvPDlevle5uU3mXtfvSFS--nDjp9yqfrf546qTe9rE,5939
|
|
429
430
|
camel/utils/response_format.py,sha256=xZcx6xBxeg3A0e7R0JCMJdNm2oQ1-diqVLs0JsiCkZU,5319
|
|
430
431
|
camel/utils/token_counting.py,sha256=apkERzNoVc4sgvJvWVosvepX3KH8pVypVjrL4AA7RB4,17521
|
|
432
|
+
camel/utils/tool_result.py,sha256=8dyf20_GHKxsHq8e0BmqVff3JZlmT6MV4npKZuXlcTc,1821
|
|
431
433
|
camel/utils/chunker/__init__.py,sha256=6iN6HL6sblIjDuJTILk-9qKcHBZ97t8b6tZCWPZ0OYI,899
|
|
432
434
|
camel/utils/chunker/base.py,sha256=9CuqymFCRncyAdEST-IcRonB732YAPhusznqH-RES3E,960
|
|
433
435
|
camel/utils/chunker/code_chunker.py,sha256=9h4rd39H9ngbOWAjd_12xt-EzVMh0e_fZnC4my8h_Jg,6823
|
|
@@ -438,7 +440,7 @@ camel/verifiers/math_verifier.py,sha256=tA1D4S0sm8nsWISevxSN0hvSVtIUpqmJhzqfbuMo
|
|
|
438
440
|
camel/verifiers/models.py,sha256=GdxYPr7UxNrR1577yW4kyroRcLGfd-H1GXgv8potDWU,2471
|
|
439
441
|
camel/verifiers/physics_verifier.py,sha256=c1grrRddcrVN7szkxhv2QirwY9viIRSITWeWFF5HmLs,30187
|
|
440
442
|
camel/verifiers/python_verifier.py,sha256=ogTz77wODfEcDN4tMVtiSkRQyoiZbHPY2fKybn59lHw,20558
|
|
441
|
-
camel_ai-0.2.
|
|
442
|
-
camel_ai-0.2.
|
|
443
|
-
camel_ai-0.2.
|
|
444
|
-
camel_ai-0.2.
|
|
443
|
+
camel_ai-0.2.71a3.dist-info/METADATA,sha256=tIea5ItJdGIRSE70RXxPtvucOws2qknSnto4scpQKNg,45951
|
|
444
|
+
camel_ai-0.2.71a3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
445
|
+
camel_ai-0.2.71a3.dist-info/licenses/LICENSE,sha256=id0nB2my5kG0xXeimIu5zZrbHLS6EQvxvkKkzIHaT2k,11343
|
|
446
|
+
camel_ai-0.2.71a3.dist-info/RECORD,,
|