Table of Contents
- Requirements
- Installing
- Getting Started
- Async
- Reference
groundx.buckets.creategroundx.buckets.deletegroundx.buckets.getgroundx.buckets.listgroundx.buckets.updategroundx.documents.crawl_websitegroundx.documents.deletegroundx.documents.delete_0groundx.documents.getgroundx.documents.get_processing_status_by_idgroundx.documents.listgroundx.documents.lookupgroundx.documents.upload_localgroundx.documents.upload_remotegroundx.projects.add_bucketgroundx.projects.creategroundx.projects.deletegroundx.projects.getgroundx.projects.listgroundx.projects.remove_bucketgroundx.projects.updategroundx.search.content
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
🔄 Return
🌐 Endpoint
/v1/bucket post
groundx.buckets.delete
Delete a bucket
🛠️ Usage
delete_response = groundx.buckets.delete(
bucket_id=1,
)
⚙️ Parameters
bucket_id: int
🔄 Return
🌐 Endpoint
/v1/bucket/{bucketId} delete
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
🌐 Endpoint
/v1/bucket/{bucketId} get
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
🌐 Endpoint
/v1/bucket get
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
🔄 Return
🌐 Endpoint
/v1/bucket/{bucketId} put
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
🔄 Return
🌐 Endpoint
/v1/ingest/documents/website post
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
🌐 Endpoint
/v1/ingest/documents delete
groundx.documents.delete_0
Delete a document
🛠️ Usage
delete_0_response = groundx.documents.delete_0(
document_id="documentId_example",
)
⚙️ Parameters
document_id: str
🔄 Return
🌐 Endpoint
/v1/ingest/document/{documentId} delete
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
🌐 Endpoint
/v1/ingest/document/{documentId} get
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
🌐 Endpoint
/v1/ingest/{processId} get
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
🌐 Endpoint
/v1/ingest/documents get
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
🌐 Endpoint
/v1/ingest/documents/{id} get
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
🔄 Return
🌐 Endpoint
/v1/ingest/documents/local post
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
🔄 Return
🌐 Endpoint
/v1/ingest/documents/remote post
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
🌐 Endpoint
/v1/project/{projectId}/bucket/{bucketId} post
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
🔄 Return
🌐 Endpoint
/v1/project post
groundx.projects.delete
Delete a project
🛠️ Usage
delete_response = groundx.projects.delete(
project_id=1,
)
⚙️ Parameters
project_id: int
🔄 Return
🌐 Endpoint
/v1/project/{projectId} delete
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
🌐 Endpoint
/v1/project/{projectId} get
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
🌐 Endpoint
/v1/project get
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
🌐 Endpoint
/v1/project/{projectId}/bucket/{bucketId} delete
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
🔄 Return
🌐 Endpoint
/v1/project/{projectId} put
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
🔄 Return
🌐 Endpoint
/v1/search/{id} post
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
891a8551fdc4f4c85ec4a403ae76489466d68dcb0fddc7afc0f54885ea373b08
|
|
| MD5 |
07734a99beb07ae3894e0815851ab699
|
|
| BLAKE2b-256 |
1cf7003a10df81ebdf3621e7362cf512cb105981f7d74de6642a03839b1c14a9
|
File details
Details for the file groundx_python_sdk-1.3.7-py3-none-any.whl.
File metadata
- Download URL: groundx_python_sdk-1.3.7-py3-none-any.whl
- Upload date:
- Size: 294.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c0ebe3138a1a40e516a6e32fac2de4a4941469262a603069384df253eb63f51c
|
|
| MD5 |
fb494d1f93d5aff92afd1b4a9b0f716b
|
|
| BLAKE2b-256 |
194f555ab079660bf4f8119758d51de2a59d484e0ee49d9849273ef15da37778
|