-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathevals.json
More file actions
166 lines (166 loc) · 10.2 KB
/
Copy pathevals.json
File metadata and controls
166 lines (166 loc) · 10.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
{
"skill_name": "dbr-js-sample-creator",
"evals": [
{
"id": 1,
"prompt": "Write a plain HTML page that uses the Dynamsoft Barcode Reader to continuously scan barcodes via the camera and display the results on the page.",
"expected_output": "A single HTML file that loads the SDK from CDN, calls initLicense, creates CameraView + CameraEnhancer + CaptureVisionRouter, adds a result receiver and dedup filter, appends the camera UI to a container div, opens the camera, and starts capturing.",
"files": [],
"expectations": [
"Loads SDK via CDN script tag: dynamsoft-barcode-reader-bundle@11.4.2001/dist/dbr.bundle.js",
"Calls Dynamsoft.License.LicenseManager.initLicense() with a license key",
"Creates CameraView via Dynamsoft.DCE.CameraView.createInstance()",
"Creates CameraEnhancer via Dynamsoft.DCE.CameraEnhancer.createInstance(cameraView)",
"Creates CaptureVisionRouter via Dynamsoft.CVR.CaptureVisionRouter.createInstance()",
"Calls cvRouter.setInput(cameraEnhancer)",
"Adds a result receiver with onDecodedBarcodesReceived callback",
"Result callback iterates result.barcodeResultItems and accesses item.formatString and item.text",
"Adds MultiFrameResultCrossFilter with cross-verification and deduplication enabled",
"Appends cameraView.getUIElement() to a DOM container",
"Calls cameraEnhancer.open()",
"Calls cvRouter.startCapturing('ReadBarcodes_SpeedFirst')"
]
},
{
"id": 2,
"prompt": "Write a plain HTML page that lets the user pick an image file and decodes barcodes from it, displaying each barcode's format and text.",
"expected_output": "A single HTML file with a file input, that loads the SDK from CDN, calls initLicense, creates a CaptureVisionRouter, captures from the selected file using ReadBarcodes_ReadRateFirst, and displays results.",
"files": [],
"expectations": [
"Loads SDK via CDN script tag: dynamsoft-barcode-reader-bundle@11.4.2001/dist/dbr.bundle.js",
"Calls Dynamsoft.License.LicenseManager.initLicense() with a license key",
"Has an <input type='file'> element",
"Creates CaptureVisionRouter once (not inside the event handler)",
"Calls cvRouter.capture(file, 'ReadBarcodes_ReadRateFirst') inside the change event handler",
"Resets e.target.value = '' after reading the file",
"Accesses result.decodedBarcodesResult?.barcodeResultItems for barcode results",
"Displays item.formatString and item.text for each barcode",
"Handles the no-barcode case by displaying a message",
"Wraps async code in try/catch"
]
},
{
"id": 3,
"prompt": "Create a React component that scans barcodes from a live camera feed using the Dynamsoft Barcode Reader SDK (npm package), with proper cleanup when the component unmounts.",
"expected_output": "A React functional component using useEffect, with isDestroyed guard after every await, pInit promise pattern for safe cleanup, useRef for the camera container, and dispose calls in the cleanup function.",
"files": [],
"expectations": [
"Imports from 'dynamsoft-barcode-reader-bundle' (npm)",
"Imports './dynamsoft.config' (or equivalent) as a side effect",
"Uses useRef for the camera container DOM element",
"Calls CameraView.createInstance() and CameraEnhancer.createInstance(cameraView)",
"Calls CaptureVisionRouter.createInstance() and cvRouter.setInput(cameraEnhancer)",
"Checks isDestroyed flag after every await before continuing",
"Creates a pInit promise that resolves at the end of the async IIFE",
"Awaits pInit in the useEffect cleanup before calling dispose()",
"Calls cvRouter.dispose() and cameraEnhancer.dispose() in cleanup",
"Adds MultiFrameResultCrossFilter with cross-verification and deduplication",
"Uses useState to display barcode results"
]
},
{
"id": 4,
"prompt": "Create an ES6 module HTML sample that imports the Dynamsoft Barcode Reader from a CDN .mjs URL and scans barcodes from the camera.",
"expected_output": "An HTML file with <script type='module'> that imports named exports from the CDN .mjs bundle, sets engineResourcePaths.rootDirectory, calls initLicense, and implements the full camera scanning pipeline.",
"files": [],
"expectations": [
"Uses <script type='module'>",
"Imports from 'https://cdn.jsdelivr.net/npm/dynamsoft-barcode-reader-bundle@11.4.2001/dist/dbr.bundle.mjs'",
"Sets CoreModule.engineResourcePaths.rootDirectory = 'https://cdn.jsdelivr.net/npm/'",
"Calls LicenseManager.initLicense() with a license key",
"Creates CameraView, CameraEnhancer, CaptureVisionRouter instances",
"Sets up result receiver with onDecodedBarcodesReceived",
"Adds MultiFrameResultCrossFilter",
"Calls cameraEnhancer.open() and cvRouter.startCapturing()"
]
},
{
"id": 5,
"prompt": "Write a plain HTML barcode scanner that only reads QR codes using a custom JSON template file.",
"expected_output": "An HTML file that calls cvRouter.initSettings('./template.json') with a custom template that restricts BarcodeFormatIds to BF_QR_CODE, then calls startCapturing with the template name from the JSON.",
"files": [],
"expectations": [
"Loads SDK from CDN",
"Calls cvRouter.initSettings('./template.json') or similar",
"The template JSON (or inline JSON) sets BarcodeFormatIds to ['BF_QR_CODE']",
"Calls cvRouter.startCapturing() with the template name from the JSON (not a preset string)",
"Sets up camera scanning pipeline (CameraView, CameraEnhancer, cvRouter)",
"Adds result receiver and displays barcode text"
]
},
{
"id": 6,
"prompt": "Build a Next.js 14 App Router page that scans barcodes from a camera, using proper SSR guards.",
"expected_output": "A Next.js App Router page with a 'use client' wrapper that uses next/dynamic with ssr: false to load a VideoCapture component. The component follows the React pattern with useEffect, isDestroyed, pInit, and proper disposal.",
"files": [],
"expectations": [
"Page file uses 'use client' directive",
"Uses next/dynamic with { ssr: false } to import the VideoCapture component",
"VideoCapture component imports from 'dynamsoft-barcode-reader-bundle' (npm)",
"VideoCapture component imports dynamsoft.config as side effect",
"Uses the full React lifecycle pattern (useEffect, isDestroyed, pInit, dispose)",
"Does NOT import SDK packages in any server component",
"Camera container uses useRef, not document.querySelector"
]
},
{
"id": 7,
"prompt": "Create a plain HTML barcode scanner that shows a tip message when no barcode is detected, and plays a beep sound when a barcode is found.",
"expected_output": "An HTML page with camera scanning that uses cameraView.setTipConfig(), cameraView.updateTipMessage(), cameraView.setTipVisible() for guidance, and Dynamsoft.DCE.Feedback.beep() on successful detection.",
"files": [],
"expectations": [
"Loads SDK from CDN",
"Sets up camera scanning pipeline (CameraView, CameraEnhancer, CaptureVisionRouter)",
"Calls cameraView.setTipConfig() with topLeftPoint, width, and duration",
"In result callback: calls cameraView.updateTipMessage() and cameraView.setTipVisible(true) when no barcodes found",
"In result callback: calls cameraView.setTipVisible(false) when barcodes are found",
"Calls Dynamsoft.DCE.Feedback.beep() on successful barcode detection",
"Adds result receiver and dedup filter"
]
},
{
"id": 8,
"prompt": "Write a plain HTML page that scans barcodes and lets the user filter by barcode format (1D retail, 1D industrial, 2D, or all) using a dropdown.",
"expected_output": "An HTML page with a select dropdown for format presets, that uses cvRouter.outputSettings() to get current settings, modifies BarcodeFormatIds, and re-applies with cvRouter.initSettings().",
"files": [],
"expectations": [
"Loads SDK from CDN",
"Has a <select> dropdown with format options (retail, industrial, 2D, all)",
"On dropdown change: calls cvRouter.outputSettings() to get current settings",
"Modifies settings.BarcodeReaderTaskSettingOptions[0].BarcodeFormatIds with correct BF_* values",
"Re-applies settings with cvRouter.initSettings(settings)",
"Uses correct BF_* format IDs for each preset (e.g., BF_EAN_13, BF_UPC_A for retail)",
"Camera scanning continues after format change"
]
},
{
"id": 9,
"prompt": "Create a plain HTML page that scans a GS1 barcode from the camera and displays the parsed Application Identifier fields.",
"expected_output": "An HTML page that loads GS1_AI spec via CodeParserModule.loadSpec(), creates a CodeParser, and in the result callback parses barcode bytes to extract structured GS1 AI fields.",
"files": [],
"expectations": [
"Loads SDK from CDN",
"Calls Dynamsoft.DCP.CodeParserModule.loadSpec('GS1_AI')",
"Creates CodeParser via Dynamsoft.DCP.CodeParser.createInstance()",
"Sets up camera scanning pipeline",
"In result callback: calls parser.parse(item.bytes) or parser.parse(item.text)",
"Accesses parsed.codeType and parsed.jsonString (or getFieldValue)",
"Displays structured parsed fields, not just raw barcode text",
"Handles parse failures gracefully (try/catch)"
]
},
{
"id": 10,
"prompt": "Create a plain HTML barcode scanner with auto-zoom enabled for scanning distant barcodes.",
"expected_output": "An HTML page that enables EF_AUTO_ZOOM via cameraEnhancer.enableEnhancedFeatures() for scanning barcodes from a distance.",
"files": [],
"expectations": [
"Loads SDK from CDN",
"Sets up camera scanning pipeline",
"Calls cameraEnhancer.enableEnhancedFeatures(Dynamsoft.DCE.EnumEnhancedFeatures.EF_AUTO_ZOOM)",
"Adds result receiver and displays barcode text",
"Adds MultiFrameResultCrossFilter"
]
}
]
}