Table of Contents
- Requirements
- Installing
- Getting Started
- Async
- Reference
groundx.api_keys.listgroundx.buckets.getgroundx.buckets.listgroundx.buckets.updategroundx.documents.deletegroundx.documents.getgroundx.documents.get_processing_status_by_idgroundx.documents.listgroundx.documents.lookupgroundx.documents.upload_localgroundx.documents.upload_remotegroundx.projects.getgroundx.projects.listgroundx.projects.updategroundx.search.content
Requirements
Python >=3.7
Installing
pip install groundx-python-sdk==1.3.2
Getting Started
from pprint import pprint
from groundx import Groundx, ApiException
groundx = Groundx(
api_key="YOUR_API_KEY",
)
try:
# Get 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)
if e.status == 405:
pprint(e.body["message"])
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:
# Get 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)
if e.status == 405:
pprint(e.body["message"])
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
๐ 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
๐ 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
๐ 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
๐ Return
๐ Endpoint
/v1/bucket/{bucketId} put
๐ Back to Table of Contents
groundx.documents.delete
Delete a document
๐ ๏ธ Usage
delete_response = groundx.documents.delete(
document_id="documentId_example",
)
โ๏ธ Parameters
document_id: str
๐ Return
๐ 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
๐ 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
๐ 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
๐ 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
๐ 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",
"callback_data": "my_callback_data",
"callback_url": "https://my.callback.url.com",
},
}
],
)
โ๏ธ Request Body
๐ Return
๐ 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,
"source_url": "https://my.source.url.com/file.txt",
"callback_data": "my_callback_data",
"callback_url": "https://my.callback.url.com",
"type": "txt",
}
],
)
โ๏ธ Parameters
documents: DocumentRemoteUploadRequestDocuments
โ๏ธ Request Body
๐ Return
๐ 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
๐ 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
๐ 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
๐ Return
๐ Endpoint
/v1/project/{projectId} put
๐ Back to Table of Contents
groundx.search.content
Search and retrieve relevant content from a project, group, 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, group, or bucket to search within.
n: int
Number of results
โ๏ธ Request Body
๐ Return
๐ 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
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.2.tar.gz.
File metadata
- Download URL: groundx_python_sdk-1.3.2.tar.gz
- Upload date:
- Size: 78.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
489fd431481846fe25a5f7fa8477fc8f1240723b1891fa552e0828ba8955e956
|
|
| MD5 |
f48c10925dcafdfafcb9e316f04e3aec
|
|
| BLAKE2b-256 |
20f4640f68c8b333b1fa6fc64eda358e8fb447d90fa3c427f551d17ac0cfd259
|
File details
Details for the file groundx_python_sdk-1.3.2-py3-none-any.whl.
File metadata
- Download URL: groundx_python_sdk-1.3.2-py3-none-any.whl
- Upload date:
- Size: 253.3 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 |
fd061a1073d013789da45aac06e757dbe6fee0dec86f4fd01cc1afa6122f4cd2
|
|
| MD5 |
a678e4d3ddcc47410a84b88b25c22483
|
|
| BLAKE2b-256 |
46e146d18a1caadb0d1f72c09f71e89699bc4827bdec76ac70cce39b803594d5
|