1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "records": [
12 {
13 "schemaVersion": "1.0",
14 "inputId": "example-en",
15 "status": "succeeded",
16 "finalUrl": "https://docs.example.com/sync/guide",
17 "title": "Acme Sync Guide",
18 "language": "en",
19 "markdown": "# Acme Sync Guide\n\nAcme Sync copies files between laptops and the cloud.\n\n## Pricing\n\n| Plan | Price |\n|------|-------|\n| Basic | $10 |\n| Pro | $49 |\n\n## Installation\n\n```bash\ncurl -fsSL https://example.com/install.sh | sh\n```"
20 },
21 {
22 "schemaVersion": "1.0",
23 "inputId": "example-he",
24 "status": "succeeded",
25 "finalUrl": "https://gym.example.co.il/membership",
26 "title": "מדריך מנוי",
27 "language": "he",
28 "markdown": "# מדריך מנוי\n\nניתן לבטל את המנוי בכל עת בהודעה של 30 יום מראש.\n\n## שעות פתיחה\n\n- ראשון עד חמישי: 06:00 עד 23:00\n- שבת: סגור"
29 }
30 ]
31};
32
33
34const run = await client.actor("leadproof/rag-dataset-builder").call(input);
35
36
37console.log('Results from dataset');
38console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
39const { items } = await client.dataset(run.defaultDatasetId).listItems();
40items.forEach((item) => {
41 console.dir(item);
42});
43
44