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

Getting Started

from pprint import pprint
from groundx import Groundx, ApiException

groundx = Groundx(
    api_key="YOUR_API_KEY",
)

try:
    # Create a new bucket
    create_response = groundx.buckets.create(
        name="your_bucket_name",
    )
    pprint(create_response.body)
    pprint(create_response.body["bucket"])
    pprint(create_response.headers)
    pprint(create_response.status)
    pprint(create_response.round_trip_time)
except ApiException as e:
    print("Exception when calling BucketsApi.create: %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:
        # Create a new bucket
        create_response = await groundx.buckets.acreate(
            name="your_bucket_name",
        )
        pprint(create_response.body)
        pprint(create_response.body["bucket"])
        pprint(create_response.headers)
        pprint(create_response.status)
        pprint(create_response.round_trip_time)
    except ApiException as e:
        print("Exception when calling BucketsApi.create: %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.buckets.create

This endpoint allows you to create a new bucket.

🛠️ Usage

create_response = groundx.buckets.create(
    name="your_bucket_name",
)

⚙️ Parameters

name: str

⚙️ Request Body

BucketCreateRequest

🔄 Return

BucketResponse

🌐 Endpoint

/v1/bucket post

🔙 Back to Table of Contents


groundx.buckets.delete

Delete a bucket

🛠️ Usage

delete_response = groundx.buckets.delete(
    bucket_id=1,
)

⚙️ Parameters

bucket_id: int

🔄 Return

MessageResponse

🌐 Endpoint

/v1/bucket/{bucketId} delete

🔙 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(
    n=1,
    next_token="string_example",
)

⚙️ Parameters

n: int
next_token: str

🔄 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(
    new_name="your_bucket_name",
    bucket_id=1,
)

⚙️ Parameters

new_name: str
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(
    websites=[
        {
            "bucket_id": 123,
            "cap": 100,
            "depth": 3,
            "source_url": "https://my.website.com",
        }
    ],
)

⚙️ Parameters

websites: WebsiteCrawlRequestWebsites

⚙️ 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(
    document_ids=["documentIds_example"],
)

⚙️ Parameters

document_ids: List[str]

A comma delimited list of document IDs

🔄 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,
                "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,
            "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.add_bucket

This endpoint allows you to add a bucket to a project.

🛠️ Usage

add_bucket_response = groundx.projects.add_bucket(
    project_id=1,
    bucket_id=1,
)

⚙️ Parameters

project_id: int

The ID of the project to update.

bucket_id: int

The ID of the bucket to update.

🔄 Return

MessageResponse

🌐 Endpoint

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

🔙 Back to Table of Contents


groundx.projects.create

This endpoint allows you to create a new project.

🛠️ Usage

create_response = groundx.projects.create(
    name="your_project_name",
    bucket_name="your_new_bucket_name",
)

⚙️ Parameters

name: str
bucket_name: str

Include a bucket name to automatically create a bucket and add it to this project

⚙️ Request Body

ProjectCreateRequest

🔄 Return

ProjectResponse

🌐 Endpoint

/v1/project post

🔙 Back to Table of Contents


groundx.projects.delete

Delete a project

🛠️ Usage

delete_response = groundx.projects.delete(
    project_id=1,
)

⚙️ Parameters

project_id: int

🔄 Return

MessageResponse

🌐 Endpoint

/v1/project/{projectId} delete

🔙 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=1,
)

⚙️ Parameters

project_id: int

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(
    n=1,
    next_token="string_example",
)

⚙️ Parameters

n: int
next_token: str

🔄 Return

ProjectListResponse

🌐 Endpoint

/v1/project get

🔙 Back to Table of Contents


groundx.projects.remove_bucket

This endpoint allows you to remove a bucket from a project.

🛠️ Usage

remove_bucket_response = groundx.projects.remove_bucket(
    project_id=1,
    bucket_id=1,
)

⚙️ Parameters

project_id: int

The ID of the project to update.

bucket_id: int

The ID of the bucket to update.

🔄 Return

MessageResponse

🌐 Endpoint

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

🔙 Back to Table of Contents


groundx.projects.update

This endpoint allows you to update an existing project.

🛠️ Usage

update_response = groundx.projects.update(
    new_name="your_project_name",
    project_id=1,
)

⚙️ Parameters

new_name: str
project_id: int

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.7.tar.gz (85.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.7-py3-none-any.whl (294.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: groundx_python_sdk-1.3.7.tar.gz
  • Upload date:
  • Size: 85.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.7.tar.gz
Algorithm Hash digest
SHA256 891a8551fdc4f4c85ec4a403ae76489466d68dcb0fddc7afc0f54885ea373b08
MD5 07734a99beb07ae3894e0815851ab699
BLAKE2b-256 1cf7003a10df81ebdf3621e7362cf512cb105981f7d74de6642a03839b1c14a9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for groundx_python_sdk-1.3.7-py3-none-any.whl
Algorithm Hash digest
SHA256 c0ebe3138a1a40e516a6e32fac2de4a4941469262a603069384df253eb63f51c
MD5 fb494d1f93d5aff92afd1b4a9b0f716b
BLAKE2b-256 194f555ab079660bf4f8119758d51de2a59d484e0ee49d9849273ef15da37778

See more details on using hashes here.

Release history Release notifications | RSS feed

1.3.30

2 files

1.3.29

2 files

1.3.28

2 files

1.3.27

2 files

1.3.26

2 files

1.3.25

2 files

1.3.24

2 files

1.3.23

2 files

1.3.22

2 files

1.3.21

2 files

1.3.20

2 files

1.3.19

2 files

1.3.18

2 files

1.3.17

2 files

1.3.16

2 files

1.3.15

2 files

1.3.14

2 files

1.3.13

2 files

1.3.12

2 files

1.3.11

2 files

1.3.10

2 files

1.3.9

2 files

1.3.8

2 files

This release

1.3.7 This release

2 files

1.3.6

2 files

1.3.5

2 files

1.3.4

2 files

1.3.3

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.0

2 files

1.1.0

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page