1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "action": "full_workflow",
12 "documents": [
13 {
14 "content": "Machine learning is a type of AI that learns patterns from data to make predictions.",
15 "metadata": {
16 "category": "AI"
17 }
18 },
19 {
20 "content": "PostgreSQL is a powerful open-source relational database.",
21 "metadata": {
22 "category": "Database"
23 }
24 },
25 {
26 "content": "Neural networks are inspired by the human brain and consist of layers of nodes.",
27 "metadata": {
28 "category": "AI"
29 }
30 },
31 {
32 "content": "Vector databases store data as mathematical embeddings for similarity search.",
33 "metadata": {
34 "category": "Database"
35 }
36 }
37 ]
38};
39
40
41const run = await client.actor("ruv/self-learning-postgres-db").call(input);
42
43
44console.log('Results from dataset');
45console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
46const { items } = await client.dataset(run.defaultDatasetId).listItems();
47items.forEach((item) => {
48 console.dir(item);
49});
50
51