1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "photos": [
12 {
13 "filename": "DEMO_SAMPLE_do_not_use__north_wall_collapse.jpg",
14 "description": "DEMO SAMPLE - automated-test data, NOT a real incident. Roof truss collapsed onto the north wall after a storm.",
15 "tags": [
16 "collapse",
17 "structural",
18 "DEMO"
19 ]
20 },
21 {
22 "filename": "DEMO_SAMPLE_do_not_use__level2_water_leak.jpg",
23 "description": "DEMO SAMPLE - automated-test data, NOT a real incident. Burst pipe flooding the level 2 corridor, saturated ceiling.",
24 "tags": [
25 "water",
26 "leak",
27 "DEMO"
28 ]
29 },
30 {
31 "filename": "DEMO_SAMPLE_do_not_use__plantroom_fire.jpg",
32 "description": "DEMO SAMPLE - automated-test data, NOT a real incident. Charred electrical panel and smoke damage in the plant room.",
33 "tags": [
34 "fire",
35 "smoke",
36 "DEMO"
37 ]
38 }
39 ],
40 "claim_id": "DEMO-SAMPLE-not-a-real-claim"
41};
42
43
44const run = await client.actor("armourylabs/construction-incident-photo-classifier").call(input);
45
46
47console.log('Results from dataset');
48console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
49const { items } = await client.dataset(run.defaultDatasetId).listItems();
50items.forEach((item) => {
51 console.dir(item);
52});
53
54