Skip to main content

Visit Groundx

Groundx

Ground Your RAG Apps in Fact not Fiction

PyPI GitHub last commit README.md More Info

Table of Contents

Requirements

Python >=3.7

Installing

pip install groundx-python-sdk==1.3.4

Getting Started

from pprint import pprint
from groundx import Groundx, ApiException

groundx = Groundx(
    api_key="YOUR_API_KEY",
)

try:
    # Look up existing API Keys
    list_response = groundx.api_keys.list()
    pprint(list_response.body)
    pprint(list_response.body["api_keys"])
    pprint(list_response.headers)
    pprint(list_response.status)
    pprint(list_response.round_trip_time)
except ApiException as e:
    print("Exception when calling APIKeysApi.list: %s\n" % e)
    pprint(e.body)
    pprint(e.headers)
    pprint(e.status)
    pprint(e.reason)
    pprint(e.round_trip_time)

Async

async support is available by prepending a to any method.

import asyncio
from pprint import pprint
from groundx import Groundx, ApiException

groundx = Groundx(
    api_key="YOUR_API_KEY",
)


async def main():
    try:
        # Look up existing API Keys
        list_response = await groundx.api_keys.alist()
        pprint(list_response.body)
        pprint(list_response.body["api_keys"])
        pprint(list_response.headers)
        pprint(list_response.status)
        pprint(list_response.round_trip_time)
    except ApiException as e:
        print("Exception when calling APIKeysApi.list: %s\n" % e)
        pprint(e.body)
        pprint(e.headers)
        pprint(e.status)
        pprint(e.reason)
        pprint(e.round_trip_time)


asyncio.run(main())

Reference

groundx.api_keys.list

Retrieve the API keys for your account.

๐Ÿ› ๏ธ Usage

list_response = groundx.api_keys.list()

๐Ÿ”„ Return

ApiKeyManagementListResponse

๐ŸŒ Endpoint

/v1/apikey get

๐Ÿ”™ Back to Table of Contents


groundx.buckets.get

Look up a bucket by its bucketId.

๐Ÿ› ๏ธ Usage

get_response = groundx.buckets.get(
    bucket_id=1,
)

โš™๏ธ Parameters

bucket_id: int

The ID of the bucket to retrieve.

๐Ÿ”„ Return

BucketResponse

๐ŸŒ Endpoint

/v1/bucket/{bucketId} get

๐Ÿ”™ Back to Table of Contents


groundx.buckets.list

Look up existing buckets associated with your account.

๐Ÿ› ๏ธ Usage

list_response = groundx.buckets.list()

๐Ÿ”„ Return

BucketListResponse

๐ŸŒ Endpoint

/v1/bucket get

๐Ÿ”™ Back to Table of Contents


groundx.buckets.update

Update the configurations of an existing bucket.

๐Ÿ› ๏ธ Usage

update_response = groundx.buckets.update(
    bucket={
        "name": "your_bucket_name",
    },
    bucket_id=1,
)

โš™๏ธ Parameters

bucket: BucketUpdateRequestBucket
bucket_id: int

The ID of the bucket to update.

โš™๏ธ Request Body

BucketUpdateRequest

๐Ÿ”„ Return

BucketUpdateResponse

๐ŸŒ Endpoint

/v1/bucket/{bucketId} put

๐Ÿ”™ Back to Table of Contents


groundx.documents.crawl_website

Crawl and ingest a website into GroundX

๐Ÿ› ๏ธ Usage

crawl_website_response = groundx.documents.crawl_website(
    project=None,
)

โš™๏ธ Parameters

project: WebsiteRequest

โš™๏ธ Request Body

WebsiteCrawlRequest

๐Ÿ”„ Return

IngestResponse

๐ŸŒ Endpoint

/v1/ingest/documents/website post

๐Ÿ”™ Back to Table of Contents


groundx.documents.delete

Delete one or more documents from GroundX

๐Ÿ› ๏ธ Usage

delete_response = groundx.documents.delete(
    documents=[
        {
            "document_id": "document_id_example",
        }
    ],
)

โš™๏ธ Parameters

documents: DocumentsDeleteRequestDocuments

โš™๏ธ Request Body

DocumentsDeleteRequest

๐Ÿ”„ Return

IngestResponse

๐ŸŒ Endpoint

/v1/ingest/documents delete

๐Ÿ”™ Back to Table of Contents


groundx.documents.delete_0

Delete a document

๐Ÿ› ๏ธ Usage

delete_0_response = groundx.documents.delete_0(
    document_id="documentId_example",
)

โš™๏ธ Parameters

document_id: str

๐Ÿ”„ Return

IngestResponse

๐ŸŒ Endpoint

/v1/ingest/document/{documentId} delete

๐Ÿ”™ Back to Table of Contents


groundx.documents.get

Look up an existing document by its ID

๐Ÿ› ๏ธ Usage

get_response = groundx.documents.get(
    document_id="documentId_example",
)

โš™๏ธ Parameters

document_id: str

๐Ÿ”„ Return

DocumentResponse

๐ŸŒ Endpoint

/v1/ingest/document/{documentId} get

๐Ÿ”™ Back to Table of Contents


groundx.documents.get_processing_status_by_id

Look up the processing status of documents for a given processId

๐Ÿ› ๏ธ Usage

get_processing_status_by_id_response = groundx.documents.get_processing_status_by_id(
    process_id="processId_example",
)

โš™๏ธ Parameters

process_id: str

๐Ÿ”„ Return

ProcessStatusResponse

๐ŸŒ Endpoint

/v1/ingest/{processId} get

๐Ÿ”™ Back to Table of Contents


groundx.documents.list

Look up all existing documents

๐Ÿ› ๏ธ Usage

list_response = groundx.documents.list(
    n=1,
    next_token="string_example",
)

โš™๏ธ Parameters

n: int
next_token: str

๐Ÿ”„ Return

DocumentListResponse

๐ŸŒ Endpoint

/v1/ingest/documents get

๐Ÿ”™ Back to Table of Contents


groundx.documents.lookup

Look up existing documents by processId, bucketId, or projectId

๐Ÿ› ๏ธ Usage

lookup_response = groundx.documents.lookup(
    id=1,
    n=1,
    next_token="string_example",
)

โš™๏ธ Parameters

id: int
n: int
next_token: str

๐Ÿ”„ Return

DocumentLookupResponse

๐ŸŒ Endpoint

/v1/ingest/documents/{id} get

๐Ÿ”™ Back to Table of Contents


groundx.documents.upload_local

Upload local documents to GroundX

๐Ÿ› ๏ธ Usage

upload_local_response = groundx.documents.upload_local(
    body=[
        {
            "blob": open("/path/to/file", "rb"),
            "metadata": {
                "bucket_id": 1234,
                "callback_data": "my_callback_data",
                "callback_url": "https://my.callback.url.com",
                "file_name": "my_file.txt",
                "file_type": "txt",
            },
        }
    ],
)

โš™๏ธ Request Body

DocumentLocalUploadRequest

๐Ÿ”„ Return

IngestResponse

๐ŸŒ Endpoint

/v1/ingest/documents/local post

๐Ÿ”™ Back to Table of Contents


groundx.documents.upload_remote

Upload hosted documents to GroundX

๐Ÿ› ๏ธ Usage

upload_remote_response = groundx.documents.upload_remote(
    documents=[
        {
            "bucket_id": 1234,
            "callback_data": "my_callback_data",
            "callback_url": "https://my.callback.url.com",
            "file_name": "my_file.txt",
            "file_type": "txt",
            "source_url": "https://my.source.url.com/file.txt",
        }
    ],
)

โš™๏ธ Parameters

documents: DocumentRemoteUploadRequestDocuments

โš™๏ธ Request Body

DocumentRemoteUploadRequest

๐Ÿ”„ Return

IngestResponse

๐ŸŒ Endpoint

/v1/ingest/documents/remote post

๐Ÿ”™ Back to Table of Contents


groundx.projects.get

This endpoint allows you to retrieve a specific project by projectId.

๐Ÿ› ๏ธ Usage

get_response = groundx.projects.get(
    project_id="projectId_example",
)

โš™๏ธ Parameters

project_id: str

The ID of the project to retrieve.

๐Ÿ”„ Return

ProjectResponse

๐ŸŒ Endpoint

/v1/project/{projectId} get

๐Ÿ”™ Back to Table of Contents


groundx.projects.list

This endpoint allows you to retrieve your existing projects.

๐Ÿ› ๏ธ Usage

list_response = groundx.projects.list()

๐Ÿ”„ Return

ProjectListResponse

๐ŸŒ Endpoint

/v1/project get

๐Ÿ”™ Back to Table of Contents


groundx.projects.update

This endpoint allows you to update an existing project.

๐Ÿ› ๏ธ Usage

update_response = groundx.projects.update(
    project={
        "name": "your_project_name",
    },
    project_id="projectId_example",
)

โš™๏ธ Parameters

project: ProjectUpdateRequestProject
project_id: str

The ID of the project to update.

โš™๏ธ Request Body

ProjectUpdateRequest

๐Ÿ”„ Return

ProjectResponse

๐ŸŒ Endpoint

/v1/project/{projectId} put

๐Ÿ”™ Back to Table of Contents


groundx.search.content

Search and retrieve relevant content from a project or bucket by id.

๐Ÿ› ๏ธ Usage

content_response = groundx.search.content(
    search={
        "query": "my search query",
        "next_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9",
    },
    id=1,
    n=20,
)

โš™๏ธ Parameters

search: SearchRequestSearch
id: int

The ID of the project or bucket to search within.

n: int

Number of results

โš™๏ธ Request Body

SearchRequest

๐Ÿ”„ Return

SearchResponse

๐ŸŒ Endpoint

/v1/search/{id} post

๐Ÿ”™ Back to Table of Contents


Author

This Python package is automatically generated by Konfig

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

groundx_python_sdk-1.3.4.tar.gz (82.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

groundx_python_sdk-1.3.4-py3-none-any.whl (276.5 kB view details)

Uploaded Python 3

File details

Details for the file groundx_python_sdk-1.3.4.tar.gz.

File metadata

  • Download URL: groundx_python_sdk-1.3.4.tar.gz
  • Upload date:
  • Size: 82.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for groundx_python_sdk-1.3.4.tar.gz
Algorithm Hash digest
SHA256 b787a18508474e78e5da38b828234839efa13f02a248a19d2262b5f32502dadc
MD5 8a5cd791558625cb92f3e827eda34872
BLAKE2b-256 73d757fdf5bef50333ee9fa99da74b034cd3968f958f273c2f908f38a98caaee

See more details on using hashes here.

File details

Details for the file groundx_python_sdk-1.3.4-py3-none-any.whl.

File metadata

File hashes

Hashes for groundx_python_sdk-1.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f08e93a8274e9461e01a5858c0654dd2284e2192eebd28ce50d96090b244d780
MD5 c17f9fd8a0191cfd492ca515233486d4
BLAKE2b-256 f9864a1e05255f8f12f67293ed9aee783a58d4350bcfd1eccbbe15d1f1ba0d1c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page