CollectionsApi

Method

HTTP request

Description

archive_collection

POST /collections/{collection-id}/archive

Archives a collection along with its associated data.

create_collection

POST /collections

Create a Collection

create_delete_collection_job

POST /collections/delete-job

Creates a job to delete collections.

create_delete_collection_thumbnail_job

DELETE /collections/{collection-id}/thumbnail/job

Creates a job to delete collection thumbnail.

create_delete_document_from_collection_job

POST /collections/{collection-id}/documents/delete-job

Creates job to remove documents from the collection.

create_import_collection_to_collection_job

POST /collections/{collection-id}/import-collection-job

Creates job to import collection to the collection.

create_insert_document_to_collection_job

POST /collections/{collection-id}/documents/insert-job

Creates job to insert document to the collection.

create_update_collection_thumbnail_job

PUT /collections/{collection-id}/thumbnail/job

Creates a job to update collection thumbnail.

delete_collection

DELETE /collections/{collection-id}

Deletes collection.

delete_collection_expiry_date

DELETE /collections/{collection-id}/expiry-date

Removes an expiry date from a collection.

delete_collection_inactivity_interval

DELETE /collections/{collection-id}/inactivity-interval

Removes an inactivity interval from the collection.

delete_collection_prompt_template

DELETE /collections/{collection-id}/prompt-template

Removes a prompt template reference from the collection.

delete_collection_thumbnail

DELETE /collections/{collection-id}/thumbnail

Deletes collection thumbnail.

delete_document_from_collection

DELETE /collections/{collection-id}/documents/{document-id}

Removes the document from the collection.

get_chat_session_count_for_collection

GET /collections/{collection-id}/chats/count

Counts a number of chat sessions with the collection.

get_collection

GET /collections/{collection-id}

Get a Collection

get_collection_chat_settings

GET /collections/{collection-id}/chat-settings

Fetches collection chat settings.

get_collection_chunks

GET /collections/{collection-id}/chunks/{chunk-ids}

Returns specific chunks in a collection.

get_collection_count

GET /collections/count

Counts a number of collections.

get_collection_metadata

GET /collections/{collection-id}/metadata

Fetches collection metadata.

get_collection_permissions

GET /collections/{collection-id}/permissions

Returns a list of access permissions for a given collection.

get_collection_settings

GET /collections/{collection-id}/settings

Fetches collection settings.

get_document_count_for_collection

GET /collections/{collection-id}/documents/count

Counts a number of documents in the collection.

insert_document_into_collection

PUT /collections/{collection-id}/documents/{document-id}

Import an already stored document to an existing collection.

list_all_collections

GET /collections/all

Fetches all users&

list_chat_sessions_for_collection

GET /collections/{collection-id}/chats

List chat sessions for a given collection.

list_collections

GET /collections

List collections.

list_documents_for_collection

GET /collections/{collection-id}/documents

List a Collection&

list_questions_for_collection

GET /collections/{collection-id}/questions

List suggested questions for a given collection.

match_collection_chunks

POST /collections/{collection-id}/chunks/match

Finds chunks related to a message using semantic search.

remove_collection_size_limit

DELETE /collections/{collection-id}/size-limit

Removes a size limit for a collection.

reset_collection_prompt_settings

DELETE /collections/{collection-id}/prompt-settings

Resets the prompt settings for a given collection.

search_collection_chunks

POST /collections/{collection-id}/chunks/search

Finds chunks related to a message using lexical search.

set_collection_size_limit

PUT /collections/{collection-id}/size-limit

Sets a maximum limit on the total size of documents (sum) added to a collection.

share_collection

PUT /collections/{collection-id}/permissions/{username}

Shares a collection to a user.

share_collection_with_group

PUT /collections/{collection-id}/group-permissions/{group-id}

Shares a collection to a group.

unarchive_collection

POST /collections/{collection-id}/unarchive

Restores an archived collection to an active status.

unshare_collection

DELETE /collections/{collection-id}/permissions/{username}

Removes sharing of a collection to a user.

unshare_collection_for_all

DELETE /collections/{collection-id}/permissions

Removes sharing of a collection to all other users except the original owner.

unshare_collection_from_group

DELETE /collections/{collection-id}/group-permissions/{group-id}

Removes sharing of a collection to a user.

update_collection

PATCH /collections/{collection-id}

Updates attributes of an existing collection.

update_collection_chat_settings

PUT /collections/{collection-id}/chat-settings

Updates collection chat settings.

update_collection_expiry_date

PUT /collections/{collection-id}/expiry-date

Updates an expiry date of a collection.

update_collection_inactivity_interval

PUT /collections/{collection-id}/inactivity-interval

Updates an inactivity interval of a collection.

update_collection_metadata

PUT /collections/{collection-id}/metadata

Updates collection metadata.

update_collection_privacy

POST /collections/{collection-id}/is-public

Updates a flag specifying whether a collection is private or public.

update_collection_prompt_template

PUT /collections/{collection-id}/prompt-template

Updates a prompt template reference of a collection.

update_collection_settings

PUT /collections/{collection-id}/settings

Updates collection settings.

update_collection_thumbnail

PUT /collections/{collection-id}/thumbnail

Updates collection thumbnail.

archive_collection

archive_collection(collection_id)

Archives a collection along with its associated data.

Archives a collection along with its associated data.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection.

    try:
        # Archives a collection along with its associated data.
        api_instance.archive_collection(collection_id)
    except Exception as e:
        print("Exception when calling CollectionsApi->archive_collection: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection.

Return type

void (empty response body)

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

204

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

create_collection

Collection create_collection(collection_create_request)

Create a Collection

A Collection refers to a group of related Documents. A Collection lets a user aggregate documents in one location. A user can utilize Collections to group particular sets of material (documents) to explore individually through Chats utilizing a large language model (LLM).

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.collection import Collection
from h2ogpte.rest_sync.models.collection_create_request import CollectionCreateRequest
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_create_request = h2ogpte.rest_sync.CollectionCreateRequest() # CollectionCreateRequest | 

    try:
        # Create a Collection
        api_response = api_instance.create_collection(collection_create_request)
        print("The response of CollectionsApi->create_collection:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CollectionsApi->create_collection: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_create_request

CollectionCreateRequest

Return type

Collection

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

201

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

403

Forbidden

-

create_delete_collection_job

JobDetails create_delete_collection_job(delete_collections_job_request)

Creates a job to delete collections.

Creates a job to delete collections with a given unique identifier.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.delete_collections_job_request import DeleteCollectionsJobRequest
from h2ogpte.rest_sync.models.job_details import JobDetails
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    delete_collections_job_request = h2ogpte.rest_sync.DeleteCollectionsJobRequest() # DeleteCollectionsJobRequest | 

    try:
        # Creates a job to delete collections.
        api_response = api_instance.create_delete_collection_job(delete_collections_job_request)
        print("The response of CollectionsApi->create_delete_collection_job:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CollectionsApi->create_delete_collection_job: %s\n" % e)

Parameters

Name

Type

Description

Notes

delete_collections_job_request

DeleteCollectionsJobRequest

Return type

JobDetails

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

201

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

create_delete_collection_thumbnail_job

JobDetails create_delete_collection_thumbnail_job(collection_id)

Creates a job to delete collection thumbnail.

Creates a job to delete collection thumbnail image.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.job_details import JobDetails
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection

    try:
        # Creates a job to delete collection thumbnail.
        api_response = api_instance.create_delete_collection_thumbnail_job(collection_id)
        print("The response of CollectionsApi->create_delete_collection_thumbnail_job:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CollectionsApi->create_delete_collection_thumbnail_job: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection

Return type

JobDetails

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

201

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

create_delete_document_from_collection_job

JobDetails create_delete_document_from_collection_job(collection_id, delete_documents_job_request)

Creates job to remove documents from the collection.

Creates job to remove documents from the collection.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.delete_documents_job_request import DeleteDocumentsJobRequest
from h2ogpte.rest_sync.models.job_details import JobDetails
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection to remove the document from.
    delete_documents_job_request = h2ogpte.rest_sync.DeleteDocumentsJobRequest() # DeleteDocumentsJobRequest | 

    try:
        # Creates job to remove documents from the collection.
        api_response = api_instance.create_delete_document_from_collection_job(collection_id, delete_documents_job_request)
        print("The response of CollectionsApi->create_delete_document_from_collection_job:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CollectionsApi->create_delete_document_from_collection_job: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection to remove the document from.

delete_documents_job_request

DeleteDocumentsJobRequest

Return type

JobDetails

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

201

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

create_import_collection_to_collection_job

JobDetails create_import_collection_to_collection_job(collection_id, create_import_collection_to_collection_job_request, copy_document=copy_document, gen_doc_summaries=gen_doc_summaries, gen_doc_questions=gen_doc_questions, ocr_model=ocr_model, tesseract_lang=tesseract_lang, keep_tables_as_one_chunk=keep_tables_as_one_chunk, chunk_by_page=chunk_by_page, handwriting_check=handwriting_check, ingest_mode=ingest_mode, timeout=timeout)

Creates job to import collection to the collection.

Creates job to import collection to the collection.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.create_import_collection_to_collection_job_request import CreateImportCollectionToCollectionJobRequest
from h2ogpte.rest_sync.models.job_details import JobDetails
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the destination collection.
    create_import_collection_to_collection_job_request = h2ogpte.rest_sync.CreateImportCollectionToCollectionJobRequest() # CreateImportCollectionToCollectionJobRequest | 
    copy_document = True # bool | Whether to save a new copy of the document (optional)
    gen_doc_summaries = False # bool | Whether to auto-generate document summaries (uses LLM). (optional) (default to False)
    gen_doc_questions = False # bool | Whether to auto-generate sample questions for each document (uses LLM). (optional) (default to False)
    ocr_model = 'auto' # str | Which method to use to extract text from images using AI-enabled optical character recognition (OCR) models. docTR is best for Latin text, PaddleOCR is best for certain non-Latin languages, Tesseract covers a wide range of languages. Mississippi works well on handwriting. - `auto` - Automatic will auto-select the best OCR model for every page. - `off` - Disable OCR for speed, but all images will then be skipped (also no image captions will be made). (optional) (default to 'auto')
    tesseract_lang = 'tesseract_lang_example' # str | Which language to use when using ocr_model=\"tesseract\". (optional)
    keep_tables_as_one_chunk = True # bool | When tables are identified by the table parser the table tokens will be kept in a single chunk. (optional)
    chunk_by_page = True # bool | Each page will be a chunk. `keep_tables_as_one_chunk` will be ignored if this is `true`. (optional)
    handwriting_check = True # bool | Check pages for handwriting. Will use specialized models if handwriting is found. (optional)
    ingest_mode = 'ingest_mode_example' # str | Ingest mode to use. - `standard` - Files will be ingested for use with RAG - `agent_only` - Bypasses standard ingestion. Files can only be used with agents. (optional)
    timeout = 3.4 # float | Timeout in seconds (optional)

    try:
        # Creates job to import collection to the collection.
        api_response = api_instance.create_import_collection_to_collection_job(collection_id, create_import_collection_to_collection_job_request, copy_document=copy_document, gen_doc_summaries=gen_doc_summaries, gen_doc_questions=gen_doc_questions, ocr_model=ocr_model, tesseract_lang=tesseract_lang, keep_tables_as_one_chunk=keep_tables_as_one_chunk, chunk_by_page=chunk_by_page, handwriting_check=handwriting_check, ingest_mode=ingest_mode, timeout=timeout)
        print("The response of CollectionsApi->create_import_collection_to_collection_job:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CollectionsApi->create_import_collection_to_collection_job: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the destination collection.

create_import_collection_to_collection_job_request

CreateImportCollectionToCollectionJobRequest

copy_document

bool

Whether to save a new copy of the document

[optional]

gen_doc_summaries

bool

Whether to auto-generate document summaries (uses LLM).

[optional] [default to False]

gen_doc_questions

bool

Whether to auto-generate sample questions for each document (uses LLM).

[optional] [default to False]

ocr_model

str

Which method to use to extract text from images using AI-enabled optical character recognition (OCR) models. docTR is best for Latin text, PaddleOCR is best for certain non-Latin languages, Tesseract covers a wide range of languages. Mississippi works well on handwriting. - `auto` - Automatic will auto-select the best OCR model for every page. - `off` - Disable OCR for speed, but all images will then be skipped (also no image captions will be made).

[optional] [default to ‘auto’]

tesseract_lang

str

Which language to use when using ocr_model="tesseract".

[optional]

keep_tables_as_one_chunk

bool

When tables are identified by the table parser the table tokens will be kept in a single chunk.

[optional]

chunk_by_page

bool

Each page will be a chunk. `keep_tables_as_one_chunk` will be ignored if this is `true`.

[optional]

handwriting_check

bool

Check pages for handwriting. Will use specialized models if handwriting is found.

[optional]

ingest_mode

str

Ingest mode to use. - `standard` - Files will be ingested for use with RAG - `agent_only` - Bypasses standard ingestion. Files can only be used with agents.

[optional]

timeout

float

Timeout in seconds

[optional]

Return type

JobDetails

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

201

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

create_insert_document_to_collection_job

JobDetails create_insert_document_to_collection_job(collection_id, create_insert_document_to_collection_job_request, copy_document=copy_document, gen_doc_summaries=gen_doc_summaries, gen_doc_questions=gen_doc_questions, ocr_model=ocr_model, tesseract_lang=tesseract_lang, keep_tables_as_one_chunk=keep_tables_as_one_chunk, chunk_by_page=chunk_by_page, handwriting_check=handwriting_check, ingest_mode=ingest_mode, timeout=timeout)

Creates job to insert document to the collection.

Creates job to insert document to the collection.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.create_insert_document_to_collection_job_request import CreateInsertDocumentToCollectionJobRequest
from h2ogpte.rest_sync.models.job_details import JobDetails
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection where the document will be inserted into.
    create_insert_document_to_collection_job_request = h2ogpte.rest_sync.CreateInsertDocumentToCollectionJobRequest() # CreateInsertDocumentToCollectionJobRequest | 
    copy_document = True # bool | Whether to save a new copy of the document (optional)
    gen_doc_summaries = False # bool | Whether to auto-generate document summaries (uses LLM). (optional) (default to False)
    gen_doc_questions = False # bool | Whether to auto-generate sample questions for each document (uses LLM). (optional) (default to False)
    ocr_model = 'auto' # str | Which method to use to extract text from images using AI-enabled optical character recognition (OCR) models. docTR is best for Latin text, PaddleOCR is best for certain non-Latin languages, Tesseract covers a wide range of languages. Mississippi works well on handwriting. - `auto` - Automatic will auto-select the best OCR model for every page. - `off` - Disable OCR for speed, but all images will then be skipped (also no image captions will be made). (optional) (default to 'auto')
    tesseract_lang = 'tesseract_lang_example' # str | Which language to use when using ocr_model=\"tesseract\". (optional)
    keep_tables_as_one_chunk = True # bool | When tables are identified by the table parser the table tokens will be kept in a single chunk. (optional)
    chunk_by_page = True # bool | Each page will be a chunk. `keep_tables_as_one_chunk` will be ignored if this is `true`. (optional)
    handwriting_check = True # bool | Check pages for handwriting. Will use specialized models if handwriting is found. (optional)
    ingest_mode = 'ingest_mode_example' # str | Ingest mode to use. - `standard` - Files will be ingested for use with RAG - `agent_only` - Bypasses standard ingestion. Files can only be used with agents. (optional)
    timeout = 3.4 # float | Timeout in seconds (optional)

    try:
        # Creates job to insert document to the collection.
        api_response = api_instance.create_insert_document_to_collection_job(collection_id, create_insert_document_to_collection_job_request, copy_document=copy_document, gen_doc_summaries=gen_doc_summaries, gen_doc_questions=gen_doc_questions, ocr_model=ocr_model, tesseract_lang=tesseract_lang, keep_tables_as_one_chunk=keep_tables_as_one_chunk, chunk_by_page=chunk_by_page, handwriting_check=handwriting_check, ingest_mode=ingest_mode, timeout=timeout)
        print("The response of CollectionsApi->create_insert_document_to_collection_job:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CollectionsApi->create_insert_document_to_collection_job: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection where the document will be inserted into.

create_insert_document_to_collection_job_request

CreateInsertDocumentToCollectionJobRequest

copy_document

bool

Whether to save a new copy of the document

[optional]

gen_doc_summaries

bool

Whether to auto-generate document summaries (uses LLM).

[optional] [default to False]

gen_doc_questions

bool

Whether to auto-generate sample questions for each document (uses LLM).

[optional] [default to False]

ocr_model

str

Which method to use to extract text from images using AI-enabled optical character recognition (OCR) models. docTR is best for Latin text, PaddleOCR is best for certain non-Latin languages, Tesseract covers a wide range of languages. Mississippi works well on handwriting. - `auto` - Automatic will auto-select the best OCR model for every page. - `off` - Disable OCR for speed, but all images will then be skipped (also no image captions will be made).

[optional] [default to ‘auto’]

tesseract_lang

str

Which language to use when using ocr_model="tesseract".

[optional]

keep_tables_as_one_chunk

bool

When tables are identified by the table parser the table tokens will be kept in a single chunk.

[optional]

chunk_by_page

bool

Each page will be a chunk. `keep_tables_as_one_chunk` will be ignored if this is `true`.

[optional]

handwriting_check

bool

Check pages for handwriting. Will use specialized models if handwriting is found.

[optional]

ingest_mode

str

Ingest mode to use. - `standard` - Files will be ingested for use with RAG - `agent_only` - Bypasses standard ingestion. Files can only be used with agents.

[optional]

timeout

float

Timeout in seconds

[optional]

Return type

JobDetails

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

201

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

create_update_collection_thumbnail_job

JobDetails create_update_collection_thumbnail_job(collection_id, timeout=timeout, file=file)

Creates a job to update collection thumbnail.

Creates a job to update a new thumbnail image for the collection.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.job_details import JobDetails
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection
    timeout = 3.4 # float | Timeout in seconds (optional)
    file = None # bytearray |  (optional)

    try:
        # Creates a job to update collection thumbnail.
        api_response = api_instance.create_update_collection_thumbnail_job(collection_id, timeout=timeout, file=file)
        print("The response of CollectionsApi->create_update_collection_thumbnail_job:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CollectionsApi->create_update_collection_thumbnail_job: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection

timeout

float

Timeout in seconds

[optional]

file

bytearray

[optional]

Return type

JobDetails

HTTP request headers

  • Content-Type: multipart/form-data

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

201

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

413

Request entity is too large

-

415

Unsupported media type

-

delete_collection

delete_collection(collection_id, timeout=timeout)

Deletes collection.

Deletes collection with a given unique identifier.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of collection to delete
    timeout = 300 # float | Timeout in seconds (optional) (default to 300)

    try:
        # Deletes collection.
        api_instance.delete_collection(collection_id, timeout=timeout)
    except Exception as e:
        print("Exception when calling CollectionsApi->delete_collection: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of collection to delete

timeout

float

Timeout in seconds

[optional] [default to 300]

Return type

void (empty response body)

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

204

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

delete_collection_expiry_date

delete_collection_expiry_date(collection_id)

Removes an expiry date from a collection.

Removes an expiry date from a collection.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection

    try:
        # Removes an expiry date from a collection.
        api_instance.delete_collection_expiry_date(collection_id)
    except Exception as e:
        print("Exception when calling CollectionsApi->delete_collection_expiry_date: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection

Return type

void (empty response body)

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

204

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

delete_collection_inactivity_interval

delete_collection_inactivity_interval(collection_id)

Removes an inactivity interval from the collection.

Removes an inactivity interval from the collection.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection

    try:
        # Removes an inactivity interval from the collection.
        api_instance.delete_collection_inactivity_interval(collection_id)
    except Exception as e:
        print("Exception when calling CollectionsApi->delete_collection_inactivity_interval: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection

Return type

void (empty response body)

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

204

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

delete_collection_prompt_template

Collection delete_collection_prompt_template(collection_id)

Removes a prompt template reference from the collection.

Removes a prompt template reference from the collection.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.collection import Collection
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection

    try:
        # Removes a prompt template reference from the collection.
        api_response = api_instance.delete_collection_prompt_template(collection_id)
        print("The response of CollectionsApi->delete_collection_prompt_template:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CollectionsApi->delete_collection_prompt_template: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection

Return type

Collection

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

delete_collection_thumbnail

delete_collection_thumbnail(collection_id, timeout=timeout)

Deletes collection thumbnail.

Deletes collection thumbnail image.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection
    timeout = 300 # float | Timeout in seconds (optional) (default to 300)

    try:
        # Deletes collection thumbnail.
        api_instance.delete_collection_thumbnail(collection_id, timeout=timeout)
    except Exception as e:
        print("Exception when calling CollectionsApi->delete_collection_thumbnail: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection

timeout

float

Timeout in seconds

[optional] [default to 300]

Return type

void (empty response body)

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

204

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

delete_document_from_collection

delete_document_from_collection(collection_id, document_id, timeout=timeout)

Removes the document from the collection.

Removes the document from the collection.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection to remove the document from.
    document_id = 'document_id_example' # str | Id of the document to be removed.
    timeout = 300 # float | Timeout in seconds (optional) (default to 300)

    try:
        # Removes the document from the collection.
        api_instance.delete_document_from_collection(collection_id, document_id, timeout=timeout)
    except Exception as e:
        print("Exception when calling CollectionsApi->delete_document_from_collection: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection to remove the document from.

document_id

str

Id of the document to be removed.

timeout

float

Timeout in seconds

[optional] [default to 300]

Return type

void (empty response body)

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

204

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

get_chat_session_count_for_collection

Count get_chat_session_count_for_collection(collection_id)

Counts a number of chat sessions with the collection.

Counts a number of chat sessions with the collection.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.count import Count
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection to filter by.

    try:
        # Counts a number of chat sessions with the collection.
        api_response = api_instance.get_chat_session_count_for_collection(collection_id)
        print("The response of CollectionsApi->get_chat_session_count_for_collection:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CollectionsApi->get_chat_session_count_for_collection: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection to filter by.

Return type

Count

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

get_collection

Collection get_collection(collection_id)

Get a Collection

A user can obtain a Collection by specifying its ID.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.collection import Collection
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of collection to return

    try:
        # Get a Collection
        api_response = api_instance.get_collection(collection_id)
        print("The response of CollectionsApi->get_collection:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CollectionsApi->get_collection: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of collection to return

Return type

Collection

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

get_collection_chat_settings

ChatSettings get_collection_chat_settings(collection_id)

Fetches collection chat settings.

Returns details of collection chat settings

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.chat_settings import ChatSettings
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection associated with the chat settings

    try:
        # Fetches collection chat settings.
        api_response = api_instance.get_collection_chat_settings(collection_id)
        print("The response of CollectionsApi->get_collection_chat_settings:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CollectionsApi->get_collection_chat_settings: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection associated with the chat settings

Return type

ChatSettings

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

get_collection_chunks

List[Chunk] get_collection_chunks(collection_id, chunk_ids)

Returns specific chunks in a collection.

Returns specific chunks in a collection.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.chunk import Chunk
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection to search in
    chunk_ids = [56] # List[int] | List of ids for the chunks to return. Chunks are indexed starting at 1.

    try:
        # Returns specific chunks in a collection.
        api_response = api_instance.get_collection_chunks(collection_id, chunk_ids)
        print("The response of CollectionsApi->get_collection_chunks:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CollectionsApi->get_collection_chunks: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection to search in

chunk_ids

List[int]

List of ids for the chunks to return. Chunks are indexed starting at 1.

Return type

List[Chunk]

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

get_collection_count

Count get_collection_count()

Counts a number of collections.

Counts a number of collections.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.count import Count
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)

    try:
        # Counts a number of collections.
        api_response = api_instance.get_collection_count()
        print("The response of CollectionsApi->get_collection_count:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CollectionsApi->get_collection_count: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

Count

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

get_collection_metadata

Dict[str, object] get_collection_metadata(collection_id)

Fetches collection metadata.

Returns details of collection metadata.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection associated with metadata.

    try:
        # Fetches collection metadata.
        api_response = api_instance.get_collection_metadata(collection_id)
        print("The response of CollectionsApi->get_collection_metadata:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CollectionsApi->get_collection_metadata: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection associated with metadata.

Return type

Dict[str, object]

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

get_collection_permissions

List[SharePermission] get_collection_permissions(collection_id)

Returns a list of access permissions for a given collection.

The returned list of permissions denotes who has access to the collection.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.share_permission import SharePermission
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection.

    try:
        # Returns a list of access permissions for a given collection.
        api_response = api_instance.get_collection_permissions(collection_id)
        print("The response of CollectionsApi->get_collection_permissions:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CollectionsApi->get_collection_permissions: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection.

Return type

List[SharePermission]

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

get_collection_settings

CollectionSettings get_collection_settings(collection_id)

Fetches collection settings.

Returns details of collection settings

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.collection_settings import CollectionSettings
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection associated with the settings

    try:
        # Fetches collection settings.
        api_response = api_instance.get_collection_settings(collection_id)
        print("The response of CollectionsApi->get_collection_settings:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CollectionsApi->get_collection_settings: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection associated with the settings

Return type

CollectionSettings

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

get_document_count_for_collection

Count get_document_count_for_collection(collection_id)

Counts a number of documents in the collection.

Counts a number of documents in the collection.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.count import Count
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection to filter by.

    try:
        # Counts a number of documents in the collection.
        api_response = api_instance.get_document_count_for_collection(collection_id)
        print("The response of CollectionsApi->get_document_count_for_collection:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CollectionsApi->get_document_count_for_collection: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection to filter by.

Return type

Count

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

insert_document_into_collection

insert_document_into_collection(collection_id, document_id, copy_document=copy_document, gen_doc_summaries=gen_doc_summaries, gen_doc_questions=gen_doc_questions, ocr_model=ocr_model, tesseract_lang=tesseract_lang, keep_tables_as_one_chunk=keep_tables_as_one_chunk, chunk_by_page=chunk_by_page, handwriting_check=handwriting_check, ingest_mode=ingest_mode, timeout=timeout)

Import an already stored document to an existing collection.

Import an already stored document to an existing collection.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection to remove the document from.
    document_id = 'document_id_example' # str | Id of the document to be inserted.
    copy_document = True # bool | Whether to save a new copy of the document (optional)
    gen_doc_summaries = False # bool | Whether to auto-generate document summaries (uses LLM). (optional) (default to False)
    gen_doc_questions = False # bool | Whether to auto-generate sample questions for each document (uses LLM). (optional) (default to False)
    ocr_model = 'auto' # str | Which method to use to extract text from images using AI-enabled optical character recognition (OCR) models. docTR is best for Latin text, PaddleOCR is best for certain non-Latin languages, Tesseract covers a wide range of languages. Mississippi works well on handwriting. - `auto` - Automatic will auto-select the best OCR model for every page. - `off` - Disable OCR for speed, but all images will then be skipped (also no image captions will be made). (optional) (default to 'auto')
    tesseract_lang = 'tesseract_lang_example' # str | Which language to use when using ocr_model=\"tesseract\". (optional)
    keep_tables_as_one_chunk = True # bool | When tables are identified by the table parser the table tokens will be kept in a single chunk. (optional)
    chunk_by_page = True # bool | Each page will be a chunk. `keep_tables_as_one_chunk` will be ignored if this is `true`. (optional)
    handwriting_check = True # bool | Check pages for handwriting. Will use specialized models if handwriting is found. (optional)
    ingest_mode = 'ingest_mode_example' # str | Ingest mode to use. - `standard` - Files will be ingested for use with RAG - `agent_only` - Bypasses standard ingestion. Files can only be used with agents. (optional)
    timeout = 3.4 # float | Timeout in seconds (optional)

    try:
        # Import an already stored document to an existing collection.
        api_instance.insert_document_into_collection(collection_id, document_id, copy_document=copy_document, gen_doc_summaries=gen_doc_summaries, gen_doc_questions=gen_doc_questions, ocr_model=ocr_model, tesseract_lang=tesseract_lang, keep_tables_as_one_chunk=keep_tables_as_one_chunk, chunk_by_page=chunk_by_page, handwriting_check=handwriting_check, ingest_mode=ingest_mode, timeout=timeout)
    except Exception as e:
        print("Exception when calling CollectionsApi->insert_document_into_collection: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection to remove the document from.

document_id

str

Id of the document to be inserted.

copy_document

bool

Whether to save a new copy of the document

[optional]

gen_doc_summaries

bool

Whether to auto-generate document summaries (uses LLM).

[optional] [default to False]

gen_doc_questions

bool

Whether to auto-generate sample questions for each document (uses LLM).

[optional] [default to False]

ocr_model

str

Which method to use to extract text from images using AI-enabled optical character recognition (OCR) models. docTR is best for Latin text, PaddleOCR is best for certain non-Latin languages, Tesseract covers a wide range of languages. Mississippi works well on handwriting. - `auto` - Automatic will auto-select the best OCR model for every page. - `off` - Disable OCR for speed, but all images will then be skipped (also no image captions will be made).

[optional] [default to ‘auto’]

tesseract_lang

str

Which language to use when using ocr_model="tesseract".

[optional]

keep_tables_as_one_chunk

bool

When tables are identified by the table parser the table tokens will be kept in a single chunk.

[optional]

chunk_by_page

bool

Each page will be a chunk. `keep_tables_as_one_chunk` will be ignored if this is `true`.

[optional]

handwriting_check

bool

Check pages for handwriting. Will use specialized models if handwriting is found.

[optional]

ingest_mode

str

Ingest mode to use. - `standard` - Files will be ingested for use with RAG - `agent_only` - Bypasses standard ingestion. Files can only be used with agents.

[optional]

timeout

float

Timeout in seconds

[optional]

Return type

void (empty response body)

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

204

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

list_all_collections

List[Collection] list_all_collections(offset=offset, limit=limit, sort_column=sort_column, ascending=ascending)

Fetches all users’ collection metadata sorted by last update time by default.

Fetches all users’ collection metadata sorted by last update time by default. This is for admin use only and includes private, public, and shared collections in the result.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.collection import Collection
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    offset = 0 # int | How many collections to skip before returning. (optional) (default to 0)
    limit = 100 # int | How many collections to return. (optional) (default to 100)
    sort_column = updated_at # str | Sort column. (optional) (default to updated_at)
    ascending = False # bool | When true, returns sorted by sort_column in ascending order. (optional) (default to False)

    try:
        # Fetches all users' collection metadata sorted by last update time by default.
        api_response = api_instance.list_all_collections(offset=offset, limit=limit, sort_column=sort_column, ascending=ascending)
        print("The response of CollectionsApi->list_all_collections:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CollectionsApi->list_all_collections: %s\n" % e)

Parameters

Name

Type

Description

Notes

offset

int

How many collections to skip before returning.

[optional] [default to 0]

limit

int

How many collections to return.

[optional] [default to 100]

sort_column

str

Sort column.

[optional] [default to updated_at]

ascending

bool

When true, returns sorted by sort_column in ascending order.

[optional] [default to False]

Return type

List[Collection]

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

list_chat_sessions_for_collection

List[ChatSession] list_chat_sessions_for_collection(collection_id, offset=offset, limit=limit)

List chat sessions for a given collection.

List chat sessions for a given collection.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.chat_session import ChatSession
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection to filter by.
    offset = 0 # int | How many chat sessions to skip before returning. (optional) (default to 0)
    limit = 100 # int | How many chat sessions to return. (optional) (default to 100)

    try:
        # List chat sessions for a given collection.
        api_response = api_instance.list_chat_sessions_for_collection(collection_id, offset=offset, limit=limit)
        print("The response of CollectionsApi->list_chat_sessions_for_collection:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CollectionsApi->list_chat_sessions_for_collection: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection to filter by.

offset

int

How many chat sessions to skip before returning.

[optional] [default to 0]

limit

int

How many chat sessions to return.

[optional] [default to 100]

Return type

List[ChatSession]

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

list_collections

List[Collection] list_collections(offset=offset, limit=limit, sort_column=sort_column, ascending=ascending, metadata_filter=metadata_filter, name_filter=name_filter, current_user_only=current_user_only)

List collections.

List collections for a given user. If sort_column is not specified, the output is sorted by by last update time in descending order.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.collection import Collection
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    offset = 0 # int | How many collections to skip before returning. (optional) (default to 0)
    limit = 100 # int | How many collections to return. (optional) (default to 100)
    sort_column = updated_at # str | Sort column. (optional) (default to updated_at)
    ascending = False # bool | When true, returns sorted by sort_column in ascending order. (optional) (default to False)
    metadata_filter = 'metadata_filter_example' # str | Only returns collections with metadata matching this filter. (optional)
    name_filter = 'name_filter_example' # str | Only returns collections with names matching this filter. (optional)
    current_user_only = False # bool | When true, will only return the user owned collections. (optional) (default to False)

    try:
        # List collections.
        api_response = api_instance.list_collections(offset=offset, limit=limit, sort_column=sort_column, ascending=ascending, metadata_filter=metadata_filter, name_filter=name_filter, current_user_only=current_user_only)
        print("The response of CollectionsApi->list_collections:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CollectionsApi->list_collections: %s\n" % e)

Parameters

Name

Type

Description

Notes

offset

int

How many collections to skip before returning.

[optional] [default to 0]

limit

int

How many collections to return.

[optional] [default to 100]

sort_column

str

Sort column.

[optional] [default to updated_at]

ascending

bool

When true, returns sorted by sort_column in ascending order.

[optional] [default to False]

metadata_filter

str

Only returns collections with metadata matching this filter.

[optional]

name_filter

str

Only returns collections with names matching this filter.

[optional]

current_user_only

bool

When true, will only return the user owned collections.

[optional] [default to False]

Return type

List[Collection]

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

list_documents_for_collection

List[Document] list_documents_for_collection(collection_id, offset=offset, limit=limit, metadata_filter=metadata_filter)

List a Collection’s documents

A user can list a Collection’s documents.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.document import Document
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | This parameter refers to the unique identifier ( ID) of the Collection to filter results.
    offset = 0 # int | This parameter refers to the number of documents to skip before retrieving results. (optional) (default to 0)
    limit = 100 # int | This parameter refers to the maximum number of documents to return in the result set. (optional) (default to 100)
    metadata_filter = 'metadata_filter_example' # str | String containing metadata json dict to filter documents by metadata. (optional)

    try:
        # List a Collection's documents
        api_response = api_instance.list_documents_for_collection(collection_id, offset=offset, limit=limit, metadata_filter=metadata_filter)
        print("The response of CollectionsApi->list_documents_for_collection:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CollectionsApi->list_documents_for_collection: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

This parameter refers to the unique identifier ( ID) of the Collection to filter results.

offset

int

This parameter refers to the number of documents to skip before retrieving results.

[optional] [default to 0]

limit

int

This parameter refers to the maximum number of documents to return in the result set.

[optional] [default to 100]

metadata_filter

str

String containing metadata json dict to filter documents by metadata.

[optional]

Return type

List[Document]

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

list_questions_for_collection

List[SuggestedQuestion] list_questions_for_collection(collection_id, limit=limit)

List suggested questions for a given collection.

List suggested questions for a given collection.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.suggested_question import SuggestedQuestion
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection to filter by.
    limit = 100 # int | How many questions to return. (optional) (default to 100)

    try:
        # List suggested questions for a given collection.
        api_response = api_instance.list_questions_for_collection(collection_id, limit=limit)
        print("The response of CollectionsApi->list_questions_for_collection:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CollectionsApi->list_questions_for_collection: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection to filter by.

limit

int

How many questions to return.

[optional] [default to 100]

Return type

List[SuggestedQuestion]

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

match_collection_chunks

List[ChunkSearchResult] match_collection_chunks(collection_id, match_collection_chunks_request)

Finds chunks related to a message using semantic search.

Finds chunks related to a message using semantic search. Chunks are sorted by relevance and similarity score to the message.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.chunk_search_result import ChunkSearchResult
from h2ogpte.rest_sync.models.match_collection_chunks_request import MatchCollectionChunksRequest
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of collection to search within.
    match_collection_chunks_request = h2ogpte.rest_sync.MatchCollectionChunksRequest() # MatchCollectionChunksRequest | 

    try:
        # Finds chunks related to a message using semantic search.
        api_response = api_instance.match_collection_chunks(collection_id, match_collection_chunks_request)
        print("The response of CollectionsApi->match_collection_chunks:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CollectionsApi->match_collection_chunks: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of collection to search within.

match_collection_chunks_request

MatchCollectionChunksRequest

Return type

List[ChunkSearchResult]

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

remove_collection_size_limit

remove_collection_size_limit(collection_id)

Removes a size limit for a collection.

Removes a size limit for a collection.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection.

    try:
        # Removes a size limit for a collection.
        api_instance.remove_collection_size_limit(collection_id)
    except Exception as e:
        print("Exception when calling CollectionsApi->remove_collection_size_limit: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection.

Return type

void (empty response body)

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

204

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

reset_collection_prompt_settings

reset_collection_prompt_settings(collection_id)

Resets the prompt settings for a given collection.

Resets the prompt settings for a given collection.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection

    try:
        # Resets the prompt settings for a given collection.
        api_instance.reset_collection_prompt_settings(collection_id)
    except Exception as e:
        print("Exception when calling CollectionsApi->reset_collection_prompt_settings: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection

Return type

void (empty response body)

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

204

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

409

Conflict

-

search_collection_chunks

List[ChunkSearchResult] search_collection_chunks(collection_id, search_collection_chunks_request)

Finds chunks related to a message using lexical search.

Finds chunks related to a message using lexical search. Chunks are sorted by relevance and similarity score to the message.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.chunk_search_result import ChunkSearchResult
from h2ogpte.rest_sync.models.search_collection_chunks_request import SearchCollectionChunksRequest
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection to search within.
    search_collection_chunks_request = h2ogpte.rest_sync.SearchCollectionChunksRequest() # SearchCollectionChunksRequest | 

    try:
        # Finds chunks related to a message using lexical search.
        api_response = api_instance.search_collection_chunks(collection_id, search_collection_chunks_request)
        print("The response of CollectionsApi->search_collection_chunks:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CollectionsApi->search_collection_chunks: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection to search within.

search_collection_chunks_request

SearchCollectionChunksRequest

Return type

List[ChunkSearchResult]

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

set_collection_size_limit

set_collection_size_limit(collection_id, set_collection_size_limit_request)

Sets a maximum limit on the total size of documents (sum) added to a collection.

Sets a maximum limit on the total size of documents (sum) added to a collection. The limit is measured in bytes.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.set_collection_size_limit_request import SetCollectionSizeLimitRequest
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection.
    set_collection_size_limit_request = h2ogpte.rest_sync.SetCollectionSizeLimitRequest() # SetCollectionSizeLimitRequest | 

    try:
        # Sets a maximum limit on the total size of documents (sum) added to a collection.
        api_instance.set_collection_size_limit(collection_id, set_collection_size_limit_request)
    except Exception as e:
        print("Exception when calling CollectionsApi->set_collection_size_limit: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection.

set_collection_size_limit_request

SetCollectionSizeLimitRequest

Return type

void (empty response body)

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

204

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

share_collection

share_collection(collection_id, username, share_collection_request=share_collection_request)

Shares a collection to a user.

Shares a collection template to a user.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.share_collection_request import ShareCollectionRequest
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection.
    username = 'username_example' # str | User name that will obtain access to the collection
    share_collection_request = h2ogpte.rest_sync.ShareCollectionRequest() # ShareCollectionRequest |  (optional)

    try:
        # Shares a collection to a user.
        api_instance.share_collection(collection_id, username, share_collection_request=share_collection_request)
    except Exception as e:
        print("Exception when calling CollectionsApi->share_collection: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection.

username

str

User name that will obtain access to the collection

share_collection_request

ShareCollectionRequest

[optional]

Return type

void (empty response body)

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

204

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

409

Conflict

-

share_collection_with_group

share_collection_with_group(collection_id, group_id, share_collection_request=share_collection_request)

Shares a collection to a group.

Shares a collection to a group. The permission attribute defines the level of access, and which group can access the collection, the collection_id attribute denotes the collection to be shared.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.share_collection_request import ShareCollectionRequest
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection.
    group_id = 'group_id_example' # str | Id of a group that will obtain access to the collection.
    share_collection_request = h2ogpte.rest_sync.ShareCollectionRequest() # ShareCollectionRequest |  (optional)

    try:
        # Shares a collection to a group.
        api_instance.share_collection_with_group(collection_id, group_id, share_collection_request=share_collection_request)
    except Exception as e:
        print("Exception when calling CollectionsApi->share_collection_with_group: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection.

group_id

str

Id of a group that will obtain access to the collection.

share_collection_request

ShareCollectionRequest

[optional]

Return type

void (empty response body)

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

204

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

409

Conflict

-

unarchive_collection

unarchive_collection(collection_id)

Restores an archived collection to an active status.

Restores an archived collection to an active status.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection.

    try:
        # Restores an archived collection to an active status.
        api_instance.unarchive_collection(collection_id)
    except Exception as e:
        print("Exception when calling CollectionsApi->unarchive_collection: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection.

Return type

void (empty response body)

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

204

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

unshare_collection

unshare_collection(collection_id, username)

Removes sharing of a collection to a user.

Removes sharing of a collection to a user.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection.
    username = 'username_example' # str | User name that will lose access to the collection

    try:
        # Removes sharing of a collection to a user.
        api_instance.unshare_collection(collection_id, username)
    except Exception as e:
        print("Exception when calling CollectionsApi->unshare_collection: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection.

username

str

User name that will lose access to the collection

Return type

void (empty response body)

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

204

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

409

Conflict

-

unshare_collection_for_all

unshare_collection_for_all(collection_id)

Removes sharing of a collection to all other users except the original owner.

Removes sharing of a collection to all other users except the original owner.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection.

    try:
        # Removes sharing of a collection to all other users except the original owner.
        api_instance.unshare_collection_for_all(collection_id)
    except Exception as e:
        print("Exception when calling CollectionsApi->unshare_collection_for_all: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection.

Return type

void (empty response body)

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

204

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

409

Conflict

-

unshare_collection_from_group

unshare_collection_from_group(collection_id, group_id)

Removes sharing of a collection to a user.

Removes sharing of a collection to a user.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection.
    group_id = 'group_id_example' # str | Id of a group that will obtain access to the collection.

    try:
        # Removes sharing of a collection to a user.
        api_instance.unshare_collection_from_group(collection_id, group_id)
    except Exception as e:
        print("Exception when calling CollectionsApi->unshare_collection_from_group: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection.

group_id

str

Id of a group that will obtain access to the collection.

Return type

void (empty response body)

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

204

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

409

Conflict

-

update_collection

Collection update_collection(collection_id, collection_update_request)

Updates attributes of an existing collection.

Updates of an existing collection, particularly name and description.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.collection import Collection
from h2ogpte.rest_sync.models.collection_update_request import CollectionUpdateRequest
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of collection to to be updated
    collection_update_request = h2ogpte.rest_sync.CollectionUpdateRequest() # CollectionUpdateRequest | 

    try:
        # Updates attributes of an existing collection.
        api_response = api_instance.update_collection(collection_id, collection_update_request)
        print("The response of CollectionsApi->update_collection:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CollectionsApi->update_collection: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of collection to to be updated

collection_update_request

CollectionUpdateRequest

Return type

Collection

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

update_collection_chat_settings

update_collection_chat_settings(collection_id, chat_settings=chat_settings)

Updates collection chat settings.

Recreates entire chat settings on the collection.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.chat_settings import ChatSettings
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection
    chat_settings = h2ogpte.rest_sync.ChatSettings() # ChatSettings |  (optional)

    try:
        # Updates collection chat settings.
        api_instance.update_collection_chat_settings(collection_id, chat_settings=chat_settings)
    except Exception as e:
        print("Exception when calling CollectionsApi->update_collection_chat_settings: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection

chat_settings

ChatSettings

[optional]

Return type

void (empty response body)

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

204

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

update_collection_expiry_date

update_collection_expiry_date(collection_id, update_collection_expiry_date_request)

Updates an expiry date of a collection.

Updates an expiry date of a collection.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.update_collection_expiry_date_request import UpdateCollectionExpiryDateRequest
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection
    update_collection_expiry_date_request = h2ogpte.rest_sync.UpdateCollectionExpiryDateRequest() # UpdateCollectionExpiryDateRequest | 

    try:
        # Updates an expiry date of a collection.
        api_instance.update_collection_expiry_date(collection_id, update_collection_expiry_date_request)
    except Exception as e:
        print("Exception when calling CollectionsApi->update_collection_expiry_date: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection

update_collection_expiry_date_request

UpdateCollectionExpiryDateRequest

Return type

void (empty response body)

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

204

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

update_collection_inactivity_interval

update_collection_inactivity_interval(collection_id, update_collection_inactivity_interval_request)

Updates an inactivity interval of a collection.

Updates an inactivity interval of a collection.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.update_collection_inactivity_interval_request import UpdateCollectionInactivityIntervalRequest
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection
    update_collection_inactivity_interval_request = h2ogpte.rest_sync.UpdateCollectionInactivityIntervalRequest() # UpdateCollectionInactivityIntervalRequest | 

    try:
        # Updates an inactivity interval of a collection.
        api_instance.update_collection_inactivity_interval(collection_id, update_collection_inactivity_interval_request)
    except Exception as e:
        print("Exception when calling CollectionsApi->update_collection_inactivity_interval: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection

update_collection_inactivity_interval_request

UpdateCollectionInactivityIntervalRequest

Return type

void (empty response body)

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

204

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

update_collection_metadata

update_collection_metadata(collection_id, request_body=request_body)

Updates collection metadata.

Recreates entire metadata of the collection.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection
    request_body = None # Dict[str, object] |  (optional)

    try:
        # Updates collection metadata.
        api_instance.update_collection_metadata(collection_id, request_body=request_body)
    except Exception as e:
        print("Exception when calling CollectionsApi->update_collection_metadata: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection

request_body

Dict[str, object]

[optional]

Return type

void (empty response body)

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

204

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

update_collection_privacy

update_collection_privacy(collection_id, update_collection_privacy_request)

Updates a flag specifying whether a collection is private or public.

Updates a flag specifying whether a collection is private or public.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.update_collection_privacy_request import UpdateCollectionPrivacyRequest
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection.
    update_collection_privacy_request = h2ogpte.rest_sync.UpdateCollectionPrivacyRequest() # UpdateCollectionPrivacyRequest | 

    try:
        # Updates a flag specifying whether a collection is private or public.
        api_instance.update_collection_privacy(collection_id, update_collection_privacy_request)
    except Exception as e:
        print("Exception when calling CollectionsApi->update_collection_privacy: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection.

update_collection_privacy_request

UpdateCollectionPrivacyRequest

Return type

void (empty response body)

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

204

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

update_collection_prompt_template

Collection update_collection_prompt_template(collection_id, prompt_template_change_request)

Updates a prompt template reference of a collection.

Updates a prompt template reference of a collection.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.collection import Collection
from h2ogpte.rest_sync.models.prompt_template_change_request import PromptTemplateChangeRequest
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection
    prompt_template_change_request = h2ogpte.rest_sync.PromptTemplateChangeRequest() # PromptTemplateChangeRequest | 

    try:
        # Updates a prompt template reference of a collection.
        api_response = api_instance.update_collection_prompt_template(collection_id, prompt_template_change_request)
        print("The response of CollectionsApi->update_collection_prompt_template:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling CollectionsApi->update_collection_prompt_template: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection

prompt_template_change_request

PromptTemplateChangeRequest

Return type

Collection

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

update_collection_settings

update_collection_settings(collection_id, collection_settings=collection_settings)

Updates collection settings.

Recreates entire settings on the collection.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.collection_settings import CollectionSettings
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection
    collection_settings = h2ogpte.rest_sync.CollectionSettings() # CollectionSettings |  (optional)

    try:
        # Updates collection settings.
        api_instance.update_collection_settings(collection_id, collection_settings=collection_settings)
    except Exception as e:
        print("Exception when calling CollectionsApi->update_collection_settings: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection

collection_settings

CollectionSettings

[optional]

Return type

void (empty response body)

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

204

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

update_collection_thumbnail

update_collection_thumbnail(collection_id, timeout=timeout, file=file)

Updates collection thumbnail.

Uploads a new thumbnail image for the collection.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://h2ogpte.genai.h2o.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = h2ogpte.rest_sync.Configuration(
    host = "https://h2ogpte.genai.h2o.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = h2ogpte.rest_sync.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
with h2ogpte.rest_sync.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_sync.CollectionsApi(api_client)
    collection_id = 'collection_id_example' # str | Id of the collection
    timeout = 3.4 # float | Timeout in seconds (optional)
    file = None # bytearray |  (optional)

    try:
        # Updates collection thumbnail.
        api_instance.update_collection_thumbnail(collection_id, timeout=timeout, file=file)
    except Exception as e:
        print("Exception when calling CollectionsApi->update_collection_thumbnail: %s\n" % e)

Parameters

Name

Type

Description

Notes

collection_id

str

Id of the collection

timeout

float

Timeout in seconds

[optional]

file

bytearray

[optional]

Return type

void (empty response body)

HTTP request headers

  • Content-Type: multipart/form-data

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

204

Successful operation

-

401

Unauthorized - Invalid or missing API key

-

413

Request entity is too large

-

415

Unsupported media type

-