SharedChatsApi

Method

HTTP request

Description

delete_shared_chat

DELETE /shared-chats/{shared-chat-id}

Delete a shared chat

delete_shared_chats

POST /shared-chats/batch-delete

Batch delete shared chats

get_shared_chat

GET /shared-chats/{shared-chat-id}

Get a shared chat

list_shared_chats

GET /shared-chats

List shared chats

share_chat_session

POST /shared-chats

Share a chat session

update_shared_chat

PATCH /shared-chats/{shared-chat-id}

Update a shared chat

delete_shared_chat

delete_shared_chat(shared_chat_id)

Delete a shared chat

Delete a single shared chat by its ID. Only the owner can delete a shared chat.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_async
from h2ogpte.rest_async.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_async.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_async.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
async with h2ogpte.rest_async.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_async.SharedChatsApi(api_client)
    shared_chat_id = 'shared_chat_id_example' # str | ID of the shared chat to delete.

    try:
        # Delete a shared chat
        await api_instance.delete_shared_chat(shared_chat_id)
    except Exception as e:
        print("Exception when calling SharedChatsApi->delete_shared_chat: %s\n" % e)

Parameters

Name

Type

Description

Notes

shared_chat_id

str

ID of the shared chat to delete.

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

-

400

Bad request

-

401

Unauthorized - Invalid or missing API key

-

403

Forbidden

-

409

Conflict

-

delete_shared_chats

delete_shared_chats(delete_shared_chats_request)

Batch delete shared chats

Delete multiple shared chats by their IDs. Only the owner can delete shared chats.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_async
from h2ogpte.rest_async.models.delete_shared_chats_request import DeleteSharedChatsRequest
from h2ogpte.rest_async.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_async.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_async.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
async with h2ogpte.rest_async.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_async.SharedChatsApi(api_client)
    delete_shared_chats_request = h2ogpte.rest_async.DeleteSharedChatsRequest() # DeleteSharedChatsRequest | 

    try:
        # Batch delete shared chats
        await api_instance.delete_shared_chats(delete_shared_chats_request)
    except Exception as e:
        print("Exception when calling SharedChatsApi->delete_shared_chats: %s\n" % e)

Parameters

Name

Type

Description

Notes

delete_shared_chats_request

DeleteSharedChatsRequest

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

-

400

Bad request

-

401

Unauthorized - Invalid or missing API key

-

403

Forbidden

-

409

Conflict

-

get_shared_chat

SharedChatDetail get_shared_chat(shared_chat_id)

Get a shared chat

Get a shared chat by its ID. Public shared chats are accessible without authentication. Private shared chats require authentication.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_async
from h2ogpte.rest_async.models.shared_chat_detail import SharedChatDetail
from h2ogpte.rest_async.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_async.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_async.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
async with h2ogpte.rest_async.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_async.SharedChatsApi(api_client)
    shared_chat_id = 'shared_chat_id_example' # str | ID of the shared chat.

    try:
        # Get a shared chat
        api_response = await api_instance.get_shared_chat(shared_chat_id)
        print("The response of SharedChatsApi->get_shared_chat:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling SharedChatsApi->get_shared_chat: %s\n" % e)

Parameters

Name

Type

Description

Notes

shared_chat_id

str

ID of the shared chat.

Return type

SharedChatDetail

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successful operation

-

400

Bad request

-

401

Unauthorized - Invalid or missing API key

-

404

Not found

-

list_shared_chats

List[SharedChatInfo] list_shared_chats(offset=offset, limit=limit, name_filter=name_filter, filter_type=filter_type, showcase_filter=showcase_filter)

List shared chats

List shared chats created by the current user.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_async
from h2ogpte.rest_async.models.shared_chat_info import SharedChatInfo
from h2ogpte.rest_async.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_async.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_async.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
async with h2ogpte.rest_async.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_async.SharedChatsApi(api_client)
    offset = 0 # int | How many shared chats to skip. (optional) (default to 0)
    limit = 56 # int | How many shared chats to return. (optional)
    name_filter = 'name_filter_example' # str | Filter shared chats by name (case-insensitive substring match). (optional)
    filter_type = 'all' # str | Filter shared chats by type (all, private, public, frozen). (optional) (default to 'all')
    showcase_filter = 'all' # str | Filter shared chats by Showcase membership (all, featured, not_featured). (optional) (default to 'all')

    try:
        # List shared chats
        api_response = await api_instance.list_shared_chats(offset=offset, limit=limit, name_filter=name_filter, filter_type=filter_type, showcase_filter=showcase_filter)
        print("The response of SharedChatsApi->list_shared_chats:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling SharedChatsApi->list_shared_chats: %s\n" % e)

Parameters

Name

Type

Description

Notes

offset

int

How many shared chats to skip.

[optional] [default to 0]

limit

int

How many shared chats to return.

[optional]

name_filter

str

Filter shared chats by name (case-insensitive substring match).

[optional]

filter_type

str

Filter shared chats by type (all, private, public, frozen).

[optional] [default to ‘all’]

showcase_filter

str

Filter shared chats by Showcase membership (all, featured, not_featured).

[optional] [default to ‘all’]

Return type

List[SharedChatInfo]

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successful operation

-

400

Bad request

-

401

Unauthorized - Invalid or missing API key

-

share_chat_session

ShareChatResponse share_chat_session(share_chat_request)

Share a chat session

Creates a shared chat from an existing chat session. Returns a URL that can be used to access the shared chat.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_async
from h2ogpte.rest_async.models.share_chat_request import ShareChatRequest
from h2ogpte.rest_async.models.share_chat_response import ShareChatResponse
from h2ogpte.rest_async.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_async.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_async.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
async with h2ogpte.rest_async.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_async.SharedChatsApi(api_client)
    share_chat_request = h2ogpte.rest_async.ShareChatRequest() # ShareChatRequest | 

    try:
        # Share a chat session
        api_response = await api_instance.share_chat_session(share_chat_request)
        print("The response of SharedChatsApi->share_chat_session:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling SharedChatsApi->share_chat_session: %s\n" % e)

Parameters

Name

Type

Description

Notes

share_chat_request

ShareChatRequest

Return type

ShareChatResponse

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

201

Successful operation

-

400

Bad request

-

401

Unauthorized - Invalid or missing API key

-

403

Forbidden

-

update_shared_chat

update_shared_chat(shared_chat_id, update_shared_chat_request)

Update a shared chat

Update a shared chat’s settings. Only the owner can update a shared chat.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_async
from h2ogpte.rest_async.models.update_shared_chat_request import UpdateSharedChatRequest
from h2ogpte.rest_async.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_async.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_async.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)

# Enter a context with an instance of the API client
async with h2ogpte.rest_async.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = h2ogpte.rest_async.SharedChatsApi(api_client)
    shared_chat_id = 'shared_chat_id_example' # str | ID of the shared chat to update.
    update_shared_chat_request = h2ogpte.rest_async.UpdateSharedChatRequest() # UpdateSharedChatRequest | 

    try:
        # Update a shared chat
        await api_instance.update_shared_chat(shared_chat_id, update_shared_chat_request)
    except Exception as e:
        print("Exception when calling SharedChatsApi->update_shared_chat: %s\n" % e)

Parameters

Name

Type

Description

Notes

shared_chat_id

str

ID of the shared chat to update.

update_shared_chat_request

UpdateSharedChatRequest

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

-

400

Bad request

-

401

Unauthorized - Invalid or missing API key

-

403

Forbidden

-

409

Conflict

-