groundx-typescript-sdk v1.3.17
Groundx
Ground Your RAG Apps in Fact not Fiction
Table of Contents
- Installation
- Getting Started
- Reference
groundx.buckets.create
groundx.buckets.delete
groundx.buckets.get
groundx.buckets.list
groundx.buckets.update
groundx.documents.crawlWebsite
groundx.documents.delete
groundx.documents.delete1
groundx.documents.get
groundx.documents.getProcessingStatusById
groundx.documents.list
groundx.documents.lookup
groundx.documents.uploadLocal
groundx.documents.uploadRemote
groundx.projects.addBucket
groundx.projects.create
groundx.projects.delete
groundx.projects.get
groundx.projects.list
groundx.projects.removeBucket
groundx.projects.update
groundx.search.content
Installation
npm i groundx-typescript-sdk
pnpm i groundx-typescript-sdk
yarn add groundx-typescript-sdk
Getting Started
import { Groundx } from "groundx-typescript-sdk";
const groundx = new Groundx({
// Defining the base path is optional and defaults to https://api.groundx.ai/api
// basePath: "https://api.groundx.ai/api",
apiKey: "API_KEY",
});
const createResponse = await groundx.buckets.create({
name: "your_bucket_name",
});
console.log(createResponse);
Reference
groundx.buckets.create
Create a new bucket. Interact with the \"Request Body\" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
🛠️ Usage
const createResponse = await groundx.buckets.create({
name: "your_bucket_name",
});
⚙️ Parameters
name: string
🔄 Return
🌐 Endpoint
/v1/bucket
POST
groundx.buckets.delete
Delete a bucket. Interact with the \"Request Body\" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
🛠️ Usage
const deleteResponse = await groundx.buckets.delete({
bucketId: 1,
});
⚙️ Parameters
bucketId: number
The bucketId of the bucket being deleted.
🔄 Return
🌐 Endpoint
/v1/bucket/{bucketId}
DELETE
groundx.buckets.get
Look up a specific bucket by its bucketId. Interact with the \"Request Body\" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
🛠️ Usage
const getResponse = await groundx.buckets.get({
bucketId: 1,
});
⚙️ Parameters
bucketId: number
The bucketId of the bucket to look up.
🔄 Return
🌐 Endpoint
/v1/bucket/{bucketId}
GET
groundx.buckets.list
List all buckets within your GroundX account Interact with the \"Request Body\" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
🛠️ Usage
const listResponse = await groundx.buckets.list({});
⚙️ Parameters
n: number
The maximum number of returned documents. Accepts 1-100 with a default of 20.
nextToken: string
A token for pagination. If the number of documents for a given query is larger than n, the response will include a \"nextToken\" value. That token can be included in this field to retrieve the next batch of n documents.
🔄 Return
🌐 Endpoint
/v1/bucket
GET
groundx.buckets.update
Rename a bucket. Interact with the \"Request Body\" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
🛠️ Usage
const updateResponse = await groundx.buckets.update({
bucketId: 1,
newName: "your_bucket_name",
});
⚙️ Parameters
newName: string
The new name of the bucket being renamed.
bucketId: number
The bucketId of the bucket being updated.
🔄 Return
🌐 Endpoint
/v1/bucket/{bucketId}
PUT
groundx.documents.crawlWebsite
Upload the content of a publicly accessible website to a GroundX bucket. This is done by following links within a specified URL, recursively, up to a specified depth or number of pages. Interact with the \"Request Body\" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
🛠️ Usage
const crawlWebsiteResponse = await groundx.documents.crawlWebsite({
websites: [
{
bucketId: 123,
cap: 100,
depth: 3,
sourceUrl: "https://my.website.com",
},
],
});
⚙️ Parameters
websites: WebsiteCrawlRequestWebsitesInner
[]
🔄 Return
🌐 Endpoint
/v1/ingest/documents/website
POST
groundx.documents.delete
Delete multiple documents hosted on GroundX Interact with the \"Request Body\" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
🛠️ Usage
const deleteResponse = await groundx.documents.delete({
documentIds: ["documentIds_example"],
});
⚙️ Parameters
documentIds: string
[]
A list of documentIds which correspond to documents uploaded to GroundX
🔄 Return
🌐 Endpoint
/v1/ingest/documents
DELETE
groundx.documents.delete1
Delete a single document hosted on GroundX Interact with the \"Request Body\" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
🛠️ Usage
const delete1Response = await groundx.documents.delete1({
documentId: "documentId_example",
});
⚙️ Parameters
documentId: string
A documentId which correspond to a document uploaded to GroundX
🔄 Return
🌐 Endpoint
/v1/ingest/document/{documentId}
DELETE
groundx.documents.get
Look up an existing document by documentId. Interact with the \"Request Body\" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
🛠️ Usage
const getResponse = await groundx.documents.get({
documentId: "documentId_example",
});
⚙️ Parameters
documentId: string
The documentId of the document for which GroundX information will be provided.
🔄 Return
🌐 Endpoint
/v1/ingest/document/{documentId}
GET
groundx.documents.getProcessingStatusById
Get the current status of an upload, initiated with documents.upload_remote, documents.upload_local, or documents.crawl_website, by specifying the processId (the processId is included in the response of the documents.upload functions). Interact with the \"Request Body\" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
🛠️ Usage
const getProcessingStatusByIdResponse =
await groundx.documents.getProcessingStatusById({
processId: "processId_example",
});
⚙️ Parameters
processId: string
the processId for the upload process being checked
🔄 Return
🌐 Endpoint
/v1/ingest/{processId}
GET
groundx.documents.list
lookup all documents across all resources which are currently on GroundX Interact with the \"Request Body\" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
🛠️ Usage
const listResponse = await groundx.documents.list({});
⚙️ Parameters
n: number
The maximum number of returned documents. Accepts 1-100 with a default of 20.
nextToken: string
A token for pagination. If the number of documents for a given query is larger than n, the response will include a \"nextToken\" value. That token can be included in this field to retrieve the next batch of n documents.
🔄 Return
🌐 Endpoint
/v1/ingest/documents
GET
groundx.documents.lookup
lookup the document(s) associated with a processId, bucketId, or projectId. Interact with the \"Request Body\" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
🛠️ Usage
const lookupResponse = await groundx.documents.lookup({
id: 1,
});
⚙️ Parameters
id: number
a processId, bucketId, or projectId
n: number
The maximum number of returned documents. Accepts 1-100 with a default of 20.
nextToken: string
A token for pagination. If the number of documents for a given query is larger than n, the response will include a \"nextToken\" value. That token can be included in this field to retrieve the next batch of n documents.
🔄 Return
🌐 Endpoint
/v1/ingest/documents/{id}
GET
groundx.documents.uploadLocal
Upload documents hosted on a local file system to a GroundX bucket. Interact with the \"Request Body\" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
🛠️ Usage
const uploadLocalResponse = await groundx.documents.uploadLocal([
{
blob: fs.readFileSync("/path/to/file"),
metadata: {
bucketId: 1234,
fileName: "my_file.txt",
fileType: "string_example",
},
},
]);
⚙️ Request Body
DocumentLocalUploadRequestInner
[]
🔄 Return
🌐 Endpoint
/v1/ingest/documents/local
POST
groundx.documents.uploadRemote
Upload documents hosted on public URLs to a GroundX bucket. Interact with the \"Request Body\" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
🛠️ Usage
const uploadRemoteResponse = await groundx.documents.uploadRemote({
documents: [
{
bucketId: 1234,
fileName: "my_file.txt",
sourceUrl: "https://my.source.url.com/file.txt",
},
],
});
⚙️ Parameters
documents: DocumentRemoteUploadRequestDocumentsInner
[]
🔄 Return
🌐 Endpoint
/v1/ingest/documents/remote
POST
groundx.projects.addBucket
Add an existing bucket to an existing project. Buckets and projects can be associated many to many. Interact with the \"Request Body\" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
🛠️ Usage
const addBucketResponse = await groundx.projects.addBucket({
projectId: 1,
bucketId: 1,
});
⚙️ Parameters
projectId: number
The projectId of the project which the bucket will be added to.
bucketId: number
The bucketId of the bucket being added to the project.
🔄 Return
🌐 Endpoint
/v1/project/{projectId}/bucket/{bucketId}
POST
groundx.projects.create
create a new project, a project being a collection of buckets which can be searched. Interact with the \"Request Body\" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
🛠️ Usage
const createResponse = await groundx.projects.create({
name: "your_project_name",
bucketName: "your_new_bucket_name",
});
⚙️ Parameters
name: string
The name of the project being created.
bucketName: string
Specify bucketName to automatically create a bucket, by the name specified, and add it to the created project.
🔄 Return
🌐 Endpoint
/v1/project
POST
groundx.projects.delete
Delete a project. Interact with the \"Request Body\" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
🛠️ Usage
const deleteResponse = await groundx.projects.delete({
projectId: 1,
});
⚙️ Parameters
projectId: number
The projectId of the project to be deleted.
🔄 Return
🌐 Endpoint
/v1/project/{projectId}
DELETE
groundx.projects.get
look up a specific project by its projectId. Interact with the \"Request Body\" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
🛠️ Usage
const getResponse = await groundx.projects.get({
projectId: 1,
});
⚙️ Parameters
projectId: number
The projectId of the project to look up.
🔄 Return
🌐 Endpoint
/v1/project/{projectId}
GET
groundx.projects.list
list all projects within your GroundX account. Interact with the \"Request Body\" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
🛠️ Usage
const listResponse = await groundx.projects.list({});
⚙️ Parameters
n: number
The maximum number of returned documents. Accepts 1-100 with a default of 20.
nextToken: string
A token for pagination. If the number of documents for a given query is larger than n, the response will include a \"nextToken\" value. That token can be included in this field to retrieve the next batch of n documents.
🔄 Return
🌐 Endpoint
/v1/project
GET
groundx.projects.removeBucket
remove a bucket from a project. Buckets and projects can be associated many to many, this removes one bucket to project association without disturbing others. Interact with the \"Request Body\" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
🛠️ Usage
const removeBucketResponse = await groundx.projects.removeBucket({
projectId: 1,
bucketId: 1,
});
⚙️ Parameters
projectId: number
The projectId of the project which the bucket will be removed from.
bucketId: number
The bucketId of the bucket which will be removed from the project.
🔄 Return
🌐 Endpoint
/v1/project/{projectId}/bucket/{bucketId}
DELETE
groundx.projects.update
Rename a project Interact with the \"Request Body\" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
🛠️ Usage
const updateResponse = await groundx.projects.update({
projectId: 1,
newName: "your_project_name",
});
⚙️ Parameters
newName: string
The new name of the project being renamed.
projectId: number
The projectId of the project to update.
🔄 Return
🌐 Endpoint
/v1/project/{projectId}
PUT
groundx.search.content
Search documents on GroundX for the most relevant information to a given query. The result of this query is typically used in one of two ways; result\'search\' can be used to provide context to a language model, facilitating RAG, or result\'search\' can be used to observe chunks of text which are relevant to the query, facilitating citation. Interact with the \"Request Body\" below to explore the arguments of this function. Enter your GroundX API key to send a request directly from this web page. Select your language of choice to structure a code snippet based on your specified arguments.
🛠️ Usage
const contentResponse = await groundx.search.content({
id: 1,
n: 20,
nextToken: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9",
query: "my search query",
});
⚙️ Parameters
query: string
The search query to be used to find relevant documentation.
id: number
The bucketId or projectId of the bucket or project being searched. The documents within the specified container will be compared to the query, and relevant information will be extracted.
n: number
The maximum number of returned documents. Accepts 1-100 with a default of 20.
nextToken: string
A token for pagination. If the number of search results for a given query is larger than n, the response will include a \"nextToken\" value. That token can be included in this field to retrieve the next batch of n search results.
verbosity: number
The amount of data returned with each search result. 0 == no search results, only the recommended context. 1 == search results but no searchData. 2 == search results and searchData.
🔄 Return
🌐 Endpoint
/v1/search/{id}
POST
Author
This TypeScript package is automatically generated by Konfig
3 months ago
4 months ago
4 months ago
5 months ago
5 months ago
5 months ago
6 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
5 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago