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 "url": "https://example.com/help/delivery",
14 "markdown": "# Delivery policy\nStandard delivery takes three to five working days after dispatch. Tracking information is sent by email when the parcel leaves the warehouse. Delivery estimates exclude public holidays. Customers can contact support with their order number if tracking has not updated for two working days.\n"
15 },
16 {
17 "url": "https://example.com/help/delivery?utm_source=newsletter",
18 "markdown": "# Delivery policy\nStandard delivery takes three to five working days after dispatch. Tracking information is sent by email when the parcel leaves the warehouse. Delivery estimates exclude public holidays. Customers can contact support with their order number if tracking has not updated for two working days.\n"
19 },
20 {
21 "url": "https://example.com/help/returns",
22 "markdown": "# Returns policy\nUnused products can be returned within fourteen days of delivery. Keep the original packaging and contact support for return instructions before sending the parcel. Refunds are processed after the returned item has been inspected. This sample policy is fictional demonstration content.\n"
23 },
24 {
25 "url": "https://example.com/archive/delivery",
26 "markdown": "# Delivery policy\nStandard delivery takes three to five working days after dispatch. Tracking information is sent by email when the parcel leaves the warehouse. Delivery estimates exclude public holidays. Customers can contact support with their order number if tracking has not updated for two working days.\n"
27 },
28 {
29 "url": "https://example.com/help/empty",
30 "markdown": " "
31 }
32 ],
33 "maxDocuments": 5
34};
35
36
37const run = await client.actor("variable_mitts/rag-dataset-cleaner-evidence").call(input);
38
39
40console.log('Results from dataset');
41console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
42const { items } = await client.dataset(run.defaultDatasetId).listItems();
43items.forEach((item) => {
44 console.dir(item);
45});
46
47