Package: groundx-python-sdk
GroundxGround Your RAG Apps in Fact not FictionTable of ContentsRequirementsInstallingGetting StartedAsyncReferencegroundx.buckets.creategroundx.buckets.deletegroundx.buckets.getgroundx.buckets.listgroundx.buckets.updategroundx.documents.crawl_websitegroundx.documents.deletegroundx.documents.delete1groundx.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.contentRequirementsPython >=3.7Installingpipinstallgroundx-python-sdk==1.3.14Getting StartedfrompprintimportpprintfromgroundximportGroundx,ApiExceptiongroundx=Groundx(api_key="YOUR_API_KEY",)try:# createcreate_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)exceptApiExceptionase: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)Asyncasyncsupport is available by prependingato any method.importasynciofrompprintimportpprintfromgroundximportGroundx,ApiExceptiongroundx=Groundx(api_key="YOUR_API_KEY",)asyncdefmain():try:# createcreate_response=awaitgroundx.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)exceptApiExceptionase: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())Referencegroundx.buckets.createCreate 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.🛠️ Usagecreate_response=groundx.buckets.create(name="your_bucket_name",)⚙️ Parametersname:str⚙️ Request BodyBucketCreateRequest🔄 ReturnBucketResponse🌐 Endpoint/v1/bucketpost🔙Back to Table of Contentsgroundx.buckets.deleteDelete 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.🛠️ Usagedelete_response=groundx.buckets.delete(bucket_id=1,)⚙️ Parametersbucket_id:intThe bucketId of the bucket being deleted.🔄 ReturnMessageResponse🌐 Endpoint/v1/bucket/{bucketId}delete🔙Back to Table of Contentsgroundx.buckets.getLook 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.🛠️ Usageget_response=groundx.buckets.get(bucket_id=1,)⚙️ Parametersbucket_id:intThe bucketId of the bucket to look up.🔄 ReturnBucketResponse🌐 Endpoint/v1/bucket/{bucketId}get🔙Back to Table of Contentsgroundx.buckets.listList 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.🛠️ Usagelist_response=groundx.buckets.list(n=1,next_token="string_example",)⚙️ Parametersn:intThe maximum number of returned documents. Accepts 1-100 with a default of 20.next_token:strA 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.🔄 ReturnBucketListResponse🌐 Endpoint/v1/bucketget🔙Back to Table of Contentsgroundx.buckets.updateRename 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.🛠️ Usageupdate_response=groundx.buckets.update(new_name="your_bucket_name",bucket_id=1,)⚙️ Parametersnew_name:strThe new name of the bucket being renamed.bucket_id:intThe bucketId of the bucket being updated.⚙️ Request BodyBucketUpdateRequest🔄 ReturnBucketUpdateResponse🌐 Endpoint/v1/bucket/{bucketId}put🔙Back to Table of Contentsgroundx.documents.crawl_websiteUpload the content of a publicly accessible website to 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.🛠️ Usagecrawl_website_response=groundx.documents.crawl_website(websites=[{"bucket_id":123,"cap":100,"depth":3,"source_url":"https://my.website.com",}],)⚙️ Parameterswebsites:WebsiteCrawlRequestWebsites⚙️ Request BodyWebsiteCrawlRequest🔄 ReturnIngestResponse🌐 Endpoint/v1/ingest/documents/websitepost🔙Back to Table of Contentsgroundx.documents.deleteDelete 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.🛠️ Usagedelete_response=groundx.documents.delete(document_ids=["documentIds_example"],)⚙️ Parametersdocument_ids: List[str]A list of documentIds which correspond to documents uploaded to GroundX🔄 ReturnIngestResponse🌐 Endpoint/v1/ingest/documentsdelete🔙Back to Table of Contentsgroundx.documents.delete1Delete 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.🛠️ Usagedelete1_response=groundx.documents.delete1(document_id="documentId_example",)⚙️ Parametersdocument_id:strA documentId which correspond to a document uploaded to GroundX🔄 ReturnIngestResponse🌐 Endpoint/v1/ingest/document/{documentId}delete🔙Back to Table of Contentsgroundx.documents.getLook 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.🛠️ Usageget_response=groundx.documents.get(document_id="documentId_example",)⚙️ Parametersdocument_id:strThe documentId of the document for which GroundX information will be provided.🔄 ReturnDocumentResponse🌐 Endpoint/v1/ingest/document/{documentId}get🔙Back to Table of Contentsgroundx.documents.get_processing_status_by_idGet the current status of an upload, initiated with documents.upload_remote, documents.upload_local, or documents.crawl_website, by specifying the processId (the processId is included in the response of the documents.upload 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.🛠️ Usageget_processing_status_by_id_response=groundx.documents.get_processing_status_by_id(process_id="processId_example",)⚙️ Parametersprocess_id:strthe processId for the upload process being checked🔄 ReturnProcessStatusResponse🌐 Endpoint/v1/ingest/{processId}get🔙Back to Table of Contentsgroundx.documents.listlookup 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.🛠️ Usagelist_response=groundx.documents.list(n=1,next_token="string_example",)⚙️ Parametersn:intThe maximum number of returned documents. Accepts 1-100 with a default of 20.next_token:strA 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.🔄 ReturnDocumentListResponse🌐 Endpoint/v1/ingest/documentsget🔙Back to Table of Contentsgroundx.documents.lookuplookup the document(s) associated with a processId, bucketId, 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.🛠️ Usagelookup_response=groundx.documents.lookup(id=1,n=1,next_token="string_example",)⚙️ Parametersid:inta processId, bucketId, or projectIdn:intThe maximum number of returned documents. Accepts 1-100 with a default of 20.next_token:strA 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.🔄 ReturnDocumentLookupResponse🌐 Endpoint/v1/ingest/documents/{id}get🔙Back to Table of Contentsgroundx.documents.upload_localUpload documents hosted on a local file system 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.🛠️ Usageupload_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 BodyDocumentLocalUploadRequest🔄 ReturnIngestResponse🌐 Endpoint/v1/ingest/documents/localpost🔙Back to Table of Contentsgroundx.documents.upload_remoteUpload 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.🛠️ Usageupload_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",}],)⚙️ Parametersdocuments:DocumentRemoteUploadRequestDocuments⚙️ Request BodyDocumentRemoteUploadRequest🔄 ReturnIngestResponse🌐 Endpoint/v1/ingest/documents/remotepost🔙Back to Table of Contentsgroundx.projects.add_bucketAdd an existing bucket to an existing project. Buckets and projects 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.🛠️ Usageadd_bucket_response=groundx.projects.add_bucket(project_id=1,bucket_id=1,)⚙️ Parametersproject_id:intThe projectId of the project which the bucket will be added to.bucket_id:intThe bucketId of the bucket being added to the project.🔄 ReturnMessageResponse🌐 Endpoint/v1/project/{projectId}/bucket/{bucketId}post🔙Back to Table of Contentsgroundx.projects.createcreate a new project, a project 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.🛠️ Usagecreate_response=groundx.projects.create(name="your_project_name",bucket_name="your_new_bucket_name",)⚙️ Parametersname:strThe name of the project being created.bucket_name:strSpecify bucketName to automatically create a bucket, by the name specified, and add it to the created project.⚙️ Request BodyProjectCreateRequest🔄 ReturnProjectResponse🌐 Endpoint/v1/projectpost🔙Back to Table of Contentsgroundx.projects.deleteDelete a project.  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.🛠️ Usagedelete_response=groundx.projects.delete(project_id=1,)⚙️ Parametersproject_id:intThe projectId of the project to be deleted.🔄 ReturnMessageResponse🌐 Endpoint/v1/project/{projectId}delete🔙Back to Table of Contentsgroundx.projects.getlook up a specific project by its 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.🛠️ Usageget_response=groundx.projects.get(project_id=1,)⚙️ Parametersproject_id:intThe projectId of the project to look up.🔄 ReturnProjectResponse🌐 Endpoint/v1/project/{projectId}get🔙Back to Table of Contentsgroundx.projects.listlist all projects 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.🛠️ Usagelist_response=groundx.projects.list(n=1,next_token="string_example",)⚙️ Parametersn:intThe maximum number of returned documents. Accepts 1-100 with a default of 20.next_token:strA 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.🔄 ReturnProjectListResponse🌐 Endpoint/v1/projectget🔙Back to Table of Contentsgroundx.projects.remove_bucketremove a bucket from a project. Buckets and projects can be associated many to many, this removes one bucket to project 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.🛠️ Usageremove_bucket_response=groundx.projects.remove_bucket(project_id=1,bucket_id=1,)⚙️ Parametersproject_id:intThe projectId of the project which the bucket will be removed from.bucket_id:intThe bucketId of the bucket which will be removed from the project.🔄 ReturnMessageResponse🌐 Endpoint/v1/project/{projectId}/bucket/{bucketId}delete🔙Back to Table of Contentsgroundx.projects.updateRename a project  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.🛠️ Usageupdate_response=groundx.projects.update(new_name="your_project_name",project_id=1,)⚙️ Parametersnew_name:strThe new name of the project being renamed.project_id:intThe projectId of the project to update.⚙️ Request BodyProjectUpdateRequest🔄 ReturnProjectResponse🌐 Endpoint/v1/project/{projectId}put🔙Back to Table of Contentsgroundx.search.contentSearch 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.🛠️ Usagecontent_response=groundx.search.content(query="my search query",id=1,n=20,next_token="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9",verbosity=0,)⚙️ Parametersquery:strThe search query to be used to find relevant documentation.id:intThe bucketId or projectId of the bucket or project being searched. The documents within the specified container will be compared to the query, and relevant information will be extracted.n:intThe maximum number of returned documents. Accepts 1-100 with a default of 20.next_token:strA 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:intThe 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.⚙️ Request BodySearchRequest🔄 ReturnSearchResponse🌐 Endpoint/v1/search/{id}post🔙Back to Table of ContentsAuthorThis Python package is automatically generated byKonfig