npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

groundx-typescript-sdk

v1.3.32

Published

Client for GroundX APIs

Downloads

381

Readme

Visit EyeLevel's GroundX APIs

EyeLevel's GroundX APIs

RAG Made Simple, Secure and Hallucination Free

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 buckets. Accepts 1-100 with a default of 20.

nextToken: string

A token for pagination. If the number of buckets 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 buckets.

🔄 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.customer.get

Get the account information associated with the API key.

🛠️ Usage

const getResponse = await groundx.customer.get();

🔄 Return

CustomerResponse

🌐 Endpoint

/v1/customer GET

🔙 Back to Table of Contents


groundx.documents.crawlWebsite

Upload the content of a publicly accessible website for ingestion into 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 ingested by 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 ingested by 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 ingest, initiated with documents.ingest_remote, documents.ingest_local, or documents.crawl_website, by specifying the processId (the processId is included in the response of the documents.ingest 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 ingest process being checked

🔄 Return

ProcessStatusResponse

🌐 Endpoint

/v1/ingest/{processId} GET

🔙 Back to Table of Contents


groundx.documents.ingestLocal

Upload documents hosted on a local file system for ingestion into 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 ingestLocalResponse = await groundx.documents.ingestLocal([
  {
    blob: fs.readFileSync("/path/to/file"),
    metadata: {
      bucketId: 1234,
      fileName: "my_file.txt",
      fileType: "txt",
    },
  },
]);

⚙️ Request Body

DocumentLocalIngestRequestInner[]

🔄 Return

IngestResponse

🌐 Endpoint

/v1/ingest/documents/local POST

🔙 Back to Table of Contents


groundx.documents.ingestRemote

Ingest 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 ingestRemoteResponse = await groundx.documents.ingestRemote({
  documents: [
    {
      bucketId: 1234,
      fileName: "my_file.txt",
      fileType: "txt",
      sourceUrl: "https://my.source.url.com/file.txt",
    },
  ],
});

⚙️ Parameters

documents: DocumentRemoteIngestRequestDocumentsInner[]

🔄 Return

IngestResponse

🌐 Endpoint

/v1/ingest/documents/remote POST

🔙 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({
  sort: "name",
  sortOrder: "asc",
  status: "queued",
});

⚙️ Parameters

n: number

The maximum number of returned documents. Accepts 1-100 with a default of 20.

filter: string

Only documents with names that contain the filter string will be returned in the results.

sort: Sort

The document attribute that will be used to sort the results.

sortOrder: SortOrder

The order in which to sort the results. A value for sort must also be set.

status: ProcessingStatus

A status filter on the get documents query. If this value is set, then only documents with this status will be returned in the results.

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, groupId, 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,
  sort: "name",
  sortOrder: "asc",
  status: "queued",
});

⚙️ Parameters

id: number

a processId, bucketId, groupId, or projectId

n: number

The maximum number of returned documents. Accepts 1-100 with a default of 20.

filter: string

Only documents with names that contain the filter string will be returned in the results.

sort: Sort

The document attribute that will be used to sort the results.

sortOrder: SortOrder

The order in which to sort the results. A value for sort must also be set.

status: ProcessingStatus

A status filter on the get documents query. If this value is set, then only documents with this status will be returned in the results.

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.groups.addBucket

Add an existing bucket to an existing group. Buckets and groups 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.groups.addBucket({
  groupId: 1,
  bucketId: 1,
});

⚙️ Parameters

groupId: number

The groupId of the group which the bucket will be added to.

bucketId: number

The bucketId of the bucket being added to the group.

🔄 Return

MessageResponse

🌐 Endpoint

/v1/group/{groupId}/bucket/{bucketId} POST

🔙 Back to Table of Contents


groundx.groups.create

create a new group, a group 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.groups.create({
  name: "your_group_name",
  bucketName: "your_new_bucket_name",
});

⚙️ Parameters

name: string

The name of the group being created.

bucketName: string

Specify bucketName to automatically create a bucket, by the name specified, and add it to the created group.

🔄 Return

GroupResponse

🌐 Endpoint

/v1/group POST

🔙 Back to Table of Contents


groundx.groups.delete

Delete a group.

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.groups.delete({
  groupId: 1,
});

⚙️ Parameters

groupId: number

The groupId of the group to be deleted.

🔄 Return

MessageResponse

🌐 Endpoint

/v1/group/{groupId} DELETE

🔙 Back to Table of Contents


groundx.groups.get

look up a specific group by its groupId.

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.groups.get({
  groupId: 1,
});

⚙️ Parameters

groupId: number

The groupId of the group to look up.

🔄 Return

GroupResponse

🌐 Endpoint

/v1/group/{groupId} GET

🔙 Back to Table of Contents


groundx.groups.list

list all groups 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.groups.list({});

⚙️ Parameters

n: number

The maximum number of returned groups. Accepts 1-100 with a default of 20.

nextToken: string

A token for pagination. If the number of groups 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 groups.

🔄 Return

GroupListResponse

🌐 Endpoint

/v1/group GET

🔙 Back to Table of Contents


groundx.groups.removeBucket

remove a bucket from a group. Buckets and groups can be associated many to many, this removes one bucket to group 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.groups.removeBucket({
  groupId: 1,
  bucketId: 1,
});

⚙️ Parameters

groupId: number

The groupId of the group which the bucket will be removed from.

bucketId: number

The bucketId of the bucket which will be removed from the group.

🔄 Return

MessageResponse

🌐 Endpoint

/v1/group/{groupId}/bucket/{bucketId} DELETE

🔙 Back to Table of Contents


groundx.groups.update

Rename a group

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.groups.update({
  groupId: 1,
  newName: "your_group_name",
});

⚙️ Parameters

newName: string

The new name of the group being renamed.

groupId: number

The groupId of the group to update.

🔄 Return

GroupResponse

🌐 Endpoint

/v1/group/{groupId} PUT

🔙 Back to Table of Contents


groundx.health.get

Look up the current health status of a specific service. Statuses update every 5 minutes.

🛠️ Usage

const getResponse = await groundx.health.get({
  service: "service_example",
});

⚙️ Parameters

service: string

The name of the service to look up.

🔄 Return

HealthResponse

🌐 Endpoint

/v1/health/{service} GET

🔙 Back to Table of Contents


groundx.health.list

List the current health status of all services. Statuses update every 5 minutes.

🛠️ Usage

const listResponse = await groundx.health.list();

🔄 Return

HealthResponse

🌐 Endpoint

/v1/health GET

🔙 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']['text'] can be used to provide context to a language model, facilitating RAG, or result['search']['results'] 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: null,
  n: 20,
  nextToken: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9",
  query: "my search query",
  relevance: 10,
});

⚙️ Parameters

query: string

The search query to be used to find relevant documentation.

id: SearchContentIdParameter

The bucketId, groupId, projectId, or documentId to be searched. The document or documents within the specified container will be compared to the query, and relevant information will be extracted.

relevance: number

The minimum search relevance score required to include the result. By default, this is 10.0.

n: number

The maximum number of returned search results. 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


groundx.search.documents

Search documents on GroundX for the most relevant information to a given query by documentId(s).

The result of this query is typically used in one of two ways; result['search']['text'] can be used to provide context to a language model, facilitating RAG, or result['search']['results'] 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 documentsResponse = await groundx.search.documents({
  n: 20,
  nextToken: "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9",
  query: "my search query",
  documentIds: ["docUUID1", "docUUID2"],
  relevance: 10,
});

⚙️ Parameters

query: string

The search query to be used to find relevant documentation.

documentIds: string[]

An array of unique documentIds to be searched.

relevance: number

The minimum search relevance score required to include the result. By default, this is 10.0.

n: number

The maximum number of returned search results. 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/documents POST

🔙 Back to Table of Contents


Author

This TypeScript package is automatically generated by Konfig