Skip to content

Commit 08b18d3

Browse files
committed
Adjust DOM evaluation subject snapshot cut-off limit (8192 tokens)
1 parent 3788eb5 commit 08b18d3

5 files changed

Lines changed: 16 additions & 15 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ D2Snap.d2Snap(
1515
options?: Options
1616
): Promise<string>
1717

18-
D2Snap.d2Snap(
18+
D2Snap.adaptiveD2Snap(
1919
dom: DOM,
2020
maxTokens: number = 4096,
2121
maxIterations: number = 5,
@@ -44,7 +44,7 @@ npm install surfly/D2Snap
4444
```
4545

4646
``` js
47-
import { d2Snap, adaptiveD2Snap } from "@surfly/d2snap";
47+
import D2Snap from "@surfly/d2snap";
4848
```
4949

5050
##

eval/subjects/D2Snap.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ const EVALS = {
1111
"D2Snap.9-3-6": { k: 0.9, l: 0.3, m: 0.6 },
1212
"D2Snap.6-9-3": { k: 0.6, l: 0.9, m: 0.3 },
1313
"D2Snap.3-6-9": { k: 0.3, l: 0.6, m: 0.9 },
14+
"D2Snap.ada.4096": { maxTokens: 4096 },
1415
"D2Snap.ada.8192": { maxTokens: 8192 },
15-
"D2Snap.ada.4096": { maxTokens: 4096 }
16+
"D2Snap.ada.32768": { maxTokens: 32768 }
1617
};
1718

1819

eval/subjects/bu.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ const baseInstructionsBU = {
1313
EXAMPLE_RESPONSE: `
1414
\`\`\` json
1515
[
16-
{
17-
"elementDescription": "Field that contains the mathematical expression to be solved.",
18-
"identifier": 0
19-
},
20-
{
21-
"elementDescription": "Button that triggers the calculation of the provided mathematical expression.",
22-
"identifier": 1
23-
}
16+
{
17+
"elementDescription": "Field that contains the mathematical expression to be solved.",
18+
"identifier": 0
19+
},
20+
{
21+
"elementDescription": "Button that triggers the calculation of the provided mathematical expression.",
22+
"identifier": 1
23+
}
2424
]
2525
\`\`\`
2626
`

eval/subjects/dom.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import { runEvaluation } from "../eval.js";
22
import { INSTRUCTIONS_DOM, DOMInteractiveElementTarget, analyzeResultDOM } from "../eval.shared.js";
33

44

5-
const MAX_SNAPSHOT_SIZE_B = 2**13;
5+
const MAX_SNAPSHOT_SIZE_B = 2**13 * 4; // according to https://platform.openai.com/tokenizer
66

77

8-
// NOTE: Cut-off at maximum context length
8+
// NOTE: Cut-off at 'maximum' context length
99
runEvaluation(
1010
"dom",
1111
async (data) => {

eval/subjects/gui.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAACWCAMAAACsAjcrAAAACXBIWXMAAD
4646
\`\`\` json
4747
[
4848
{
49-
"elementDescription": "Field that contains the search query.",
49+
"elementDescription": "Field that contains the mathematical expression to be solved.",
5050
"x": 100,
5151
"y": 47
5252
},
5353
{
54-
"elementDescription": "Button that submits the search query.",
54+
"elementDescription": "Button that triggers the calculation of the provided mathematical expression.",
5555
"x": 100,
5656
"y": 197
5757
}

0 commit comments

Comments
 (0)