1.3.17 • Published 3 months ago

groundx-typescript-sdk v1.3.17

Weekly downloads
-
License
Unlicense
Repository
github
Last release
3 months ago

Visit Groundx

Groundx

Ground Your RAG Apps in Fact not Fiction

npm More Info

Table of Contents

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

BucketResponse

🌐 Endpoint

/v1/bucket POST

🔙 Back to Table of Contents


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

MessageResponse

🌐 Endpoint

/v1/bucket/{bucketId} DELETE

🔙 Back to Table of Contents


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

BucketResponse

🌐 Endpoint

/v1/bucket/{bucketId} GET

🔙 Back to Table of Contents


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

BucketListResponse

🌐 Endpoint

/v1/bucket GET

🔙 Back to Table of Contents


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

BucketUpdateResponse

🌐 Endpoint

/v1/bucket/{bucketId} PUT

🔙 Back to Table of Contents


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

IngestResponse

🌐 Endpoint

/v1/ingest/documents/website POST

🔙 Back to Table of Contents


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

IngestResponse

🌐 Endpoint

/v1/ingest/documents DELETE

🔙 Back to Table of Contents


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

IngestResponse

🌐 Endpoint

/v1/ingest/document/{documentId} DELETE

🔙 Back to Table of Contents


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

DocumentResponse

🌐 Endpoint

/v1/ingest/document/{documentId} GET

🔙 Back to Table of Contents


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

ProcessStatusResponse

🌐 Endpoint

/v1/ingest/{processId} GET

🔙 Back to Table of Contents


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

DocumentListResponse

🌐 Endpoint

/v1/ingest/documents GET

🔙 Back to Table of Contents


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

DocumentLookupResponse

🌐 Endpoint

/v1/ingest/documents/{id} GET

🔙 Back to Table of Contents


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

IngestResponse

🌐 Endpoint

/v1/ingest/documents/local POST

🔙 Back to Table of Contents


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

IngestResponse

🌐 Endpoint

/v1/ingest/documents/remote POST

🔙 Back to Table of Contents


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

MessageResponse

🌐 Endpoint

/v1/project/{projectId}/bucket/{bucketId} POST

🔙 Back to Table of Contents


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

ProjectResponse

🌐 Endpoint

/v1/project POST

🔙 Back to Table of Contents


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

MessageResponse

🌐 Endpoint

/v1/project/{projectId} DELETE

🔙 Back to Table of Contents


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

ProjectResponse

🌐 Endpoint

/v1/project/{projectId} GET

🔙 Back to Table of Contents


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

ProjectListResponse

🌐 Endpoint

/v1/project GET

🔙 Back to Table of Contents


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

MessageResponse

🌐 Endpoint

/v1/project/{projectId}/bucket/{bucketId} DELETE

🔙 Back to Table of Contents


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

ProjectResponse

🌐 Endpoint

/v1/project/{projectId} PUT

🔙 Back to Table of Contents


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

SearchResponse

🌐 Endpoint

/v1/search/{id} POST

🔙 Back to Table of Contents


Author

This TypeScript package is automatically generated by Konfig

1.3.17

3 months ago

1.3.16

4 months ago

1.3.15

4 months ago

1.3.14

5 months ago

1.3.7

5 months ago

1.3.6

5 months ago

1.3.5

6 months ago

1.3.10

5 months ago

1.3.9

5 months ago

1.3.8

5 months ago

1.3.13

5 months ago

1.3.11

5 months ago

1.3.12

5 months ago

1.3.4

7 months ago

1.3.3

7 months ago

1.3.2

7 months ago

1.3.1

7 months ago

1.3.0

7 months ago

1.2.0

7 months ago

1.1.0

7 months ago

1.0.0

7 months ago