Setup the SDK

Install the SDK

npm i -S @ragg/node-sdk

Use it

import * as Ragg from '@ragg/node-sdk'

const ragg = Ragg.init(<API_KEY>)

const dataSource = await ragg.dataSource.create({
    workspaceId: string,
    file: string,
});

const result = await ragg.search.retrieve({
   workspaceId: string,
   query: "I would like to learn more about canada",
   history: [],
});

console.log(result.data);
// { results: [] }

const result2 = await ragg.search.llmQuery({
   workspaceId: string,
   query: "I would like to learn more about canada",
   history: [],
});

console.log(result2.data);
// I am sorry but I cannot provide information about canada.

Last updated