@eko-ai/eko 3.0.9-alpha.1 → 3.0.9-alpha.2
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.
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function extract_page_content(max_url_length?: number): string;
|
|
1
|
+
export declare function extract_page_content(max_url_length?: number, max_content_length?: number): string;
|
|
2
2
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/agent/browser/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,oBAAoB,CAAC,cAAc,SAAM,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/agent/browser/utils.ts"],"names":[],"mappings":"AAAA,wBAAgB,oBAAoB,CAAC,cAAc,SAAM,EAAE,kBAAkB,SAAQ,UAkHpF"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -13,7 +13,7 @@ const config$1 = {
|
|
|
13
13
|
agentParallel: false,
|
|
14
14
|
compressThreshold: 80,
|
|
15
15
|
compressTokensThreshold: 80000,
|
|
16
|
-
largeTextLength:
|
|
16
|
+
largeTextLength: 8000,
|
|
17
17
|
fileTextMaxLength: 20000,
|
|
18
18
|
maxDialogueImgFileNum: 1,
|
|
19
19
|
toolResultMultimodal: true,
|
|
@@ -36463,7 +36463,7 @@ This is a computer GUI interface, observe the execution through screenshots, and
|
|
|
36463
36463
|
}
|
|
36464
36464
|
}
|
|
36465
36465
|
|
|
36466
|
-
function extract_page_content(max_url_length = 200) {
|
|
36466
|
+
function extract_page_content(max_url_length = 200, max_content_length = 50000) {
|
|
36467
36467
|
let result = "";
|
|
36468
36468
|
max_url_length = max_url_length || 200;
|
|
36469
36469
|
try {
|
|
@@ -36574,7 +36574,11 @@ function extract_page_content(max_url_length = 200) {
|
|
|
36574
36574
|
catch (e) {
|
|
36575
36575
|
result = document.body.innerText;
|
|
36576
36576
|
}
|
|
36577
|
-
|
|
36577
|
+
result = result.replace(/\s*\n/g, "\n").replace(/\n+/g, "\n").trim();
|
|
36578
|
+
if (result.length > max_content_length) {
|
|
36579
|
+
result = result.slice(0, max_content_length) + "...";
|
|
36580
|
+
}
|
|
36581
|
+
return result;
|
|
36578
36582
|
}
|
|
36579
36583
|
|
|
36580
36584
|
const AGENT_NAME = "Browser";
|