MemoryBlocksApi

Method

HTTP request

Description

create_memory_block

POST /memory-blocks

Create a Memory Block

delete_memory_block

DELETE /memory-blocks/{memory-block-id}

Delete a memory block.

get_default_memory_blocks

GET /users/current/default-memory-blocks

Get default memory blocks

get_memory_block

GET /memory-blocks/{memory-block-id}

Get a memory block by ID.

list_memory_block_group_permissions

GET /memory-blocks/{memory-block-id}/group-permissions

List group share permissions for a memory block.

list_memory_block_permissions

GET /memory-blocks/{memory-block-id}/permissions

List user share permissions for a memory block.

list_memory_blocks

GET /memory-blocks

List memory blocks.

list_public_memory_block_permissions

GET /memory-blocks/{memory-block-id}/public-permissions

Returns the public permissions for a memory block.

set_default_memory_block

PUT /users/current/default-memory-blocks

Set a default memory block

set_memory_block_privacy

PUT /memory-blocks/{memory-block-id}/privacy

Set memory block public or private.

share_memory_block

PUT /memory-blocks/{memory-block-id}/permissions/{username}

Share a memory block with a user.

share_memory_block_with_group

PUT /memory-blocks/{memory-block-id}/group-permissions/{group-id}

Share a memory block with a group.

unshare_memory_block

DELETE /memory-blocks/{memory-block-id}/permissions/{username}

Remove sharing of a memory block from a user.

unshare_memory_block_from_group

DELETE /memory-blocks/{memory-block-id}/group-permissions/{group-id}

Remove sharing of a memory block from a group.

update_memory_block

PUT /memory-blocks/{memory-block-id}

Update a memory block.

create_memory_block

MemoryBlock create_memory_block(memory_block_create_request)

Create a Memory Block

Creates a new memory block for persistent agent memory. Memory blocks are cross-collection and per-user.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_async
from h2ogpte.rest_async.models.memory_block import MemoryBlock
from h2ogpte.rest_async.models.memory_block_create_request import MemoryBlockCreateRequest
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.MemoryBlocksApi(api_client)
    memory_block_create_request = h2ogpte.rest_async.MemoryBlockCreateRequest() # MemoryBlockCreateRequest | 

    try:
        # Create a Memory Block
        api_response = await api_instance.create_memory_block(memory_block_create_request)
        print("The response of MemoryBlocksApi->create_memory_block:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling MemoryBlocksApi->create_memory_block: %s\n" % e)

Parameters

Name

Type

Description

Notes

memory_block_create_request

MemoryBlockCreateRequest

Return type

MemoryBlock

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

-

404

Not found

-

409

Conflict

-

delete_memory_block

delete_memory_block(memory_block_id)

Delete a memory block.

Deletes a memory block. Only the owner can delete.

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.MemoryBlocksApi(api_client)
    memory_block_id = 'memory_block_id_example' # str | Id of the memory block.

    try:
        # Delete a memory block.
        await api_instance.delete_memory_block(memory_block_id)
    except Exception as e:
        print("Exception when calling MemoryBlocksApi->delete_memory_block: %s\n" % e)

Parameters

Name

Type

Description

Notes

memory_block_id

str

Id of the memory block.

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

-

404

Not found

-

409

Conflict

-

get_default_memory_blocks

DefaultMemoryBlocksResponse get_default_memory_blocks()

Get default memory blocks

Returns the user’s default memory blocks for LLM and agent scopes. The two scopes are independent with no cascade.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_async
from h2ogpte.rest_async.models.default_memory_blocks_response import DefaultMemoryBlocksResponse
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.MemoryBlocksApi(api_client)

    try:
        # Get default memory blocks
        api_response = await api_instance.get_default_memory_blocks()
        print("The response of MemoryBlocksApi->get_default_memory_blocks:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling MemoryBlocksApi->get_default_memory_blocks: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

DefaultMemoryBlocksResponse

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

-

get_memory_block

MemoryBlock get_memory_block(memory_block_id)

Get a memory block by ID.

Returns a specific memory block by its ID.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_async
from h2ogpte.rest_async.models.memory_block import MemoryBlock
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.MemoryBlocksApi(api_client)
    memory_block_id = 'memory_block_id_example' # str | Id of the memory block.

    try:
        # Get a memory block by ID.
        api_response = await api_instance.get_memory_block(memory_block_id)
        print("The response of MemoryBlocksApi->get_memory_block:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling MemoryBlocksApi->get_memory_block: %s\n" % e)

Parameters

Name

Type

Description

Notes

memory_block_id

str

Id of the memory block.

Return type

MemoryBlock

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_memory_block_group_permissions

List[GroupSharePermission] list_memory_block_group_permissions(memory_block_id)

List group share permissions for a memory block.

Returns the list of groups with explicit (direct) share grants on the memory block. Does not include cascade access derived from collection sharing.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_async
from h2ogpte.rest_async.models.group_share_permission import GroupSharePermission
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.MemoryBlocksApi(api_client)
    memory_block_id = 'memory_block_id_example' # str | Id of the memory block.

    try:
        # List group share permissions for a memory block.
        api_response = await api_instance.list_memory_block_group_permissions(memory_block_id)
        print("The response of MemoryBlocksApi->list_memory_block_group_permissions:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling MemoryBlocksApi->list_memory_block_group_permissions: %s\n" % e)

Parameters

Name

Type

Description

Notes

memory_block_id

str

Id of the memory block.

Return type

List[GroupSharePermission]

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

-

403

Forbidden

-

404

Not found

-

list_memory_block_permissions

List[SharePermission] list_memory_block_permissions(memory_block_id)

List user share permissions for a memory block.

Returns the list of users with explicit (direct) share grants on the memory block. Does not include cascade access derived from collection sharing.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_async
from h2ogpte.rest_async.models.share_permission import SharePermission
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.MemoryBlocksApi(api_client)
    memory_block_id = 'memory_block_id_example' # str | Id of the memory block.

    try:
        # List user share permissions for a memory block.
        api_response = await api_instance.list_memory_block_permissions(memory_block_id)
        print("The response of MemoryBlocksApi->list_memory_block_permissions:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling MemoryBlocksApi->list_memory_block_permissions: %s\n" % e)

Parameters

Name

Type

Description

Notes

memory_block_id

str

Id of the memory block.

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

-

403

Forbidden

-

404

Not found

-

list_memory_blocks

ListMemoryBlocks200Response list_memory_blocks(offset=offset, limit=limit, name_filter=name_filter, updated_after=updated_after)

List memory blocks.

List memory blocks accessible to the current user (owned, shared, or public).

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_async
from h2ogpte.rest_async.models.list_memory_blocks200_response import ListMemoryBlocks200Response
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.MemoryBlocksApi(api_client)
    offset = 0 # int | How many memory blocks to skip. (optional) (default to 0)
    limit = 56 # int | How many memory blocks to return. (optional)
    name_filter = 'name_filter_example' # str | Filter memory blocks by name (case-insensitive substring match). (optional)
    updated_after = '2013-10-20T19:20:30+01:00' # datetime | Only return memory blocks updated at or after this timestamp (ISO 8601). (optional)

    try:
        # List memory blocks.
        api_response = await api_instance.list_memory_blocks(offset=offset, limit=limit, name_filter=name_filter, updated_after=updated_after)
        print("The response of MemoryBlocksApi->list_memory_blocks:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling MemoryBlocksApi->list_memory_blocks: %s\n" % e)

Parameters

Name

Type

Description

Notes

offset

int

How many memory blocks to skip.

[optional] [default to 0]

limit

int

How many memory blocks to return.

[optional]

name_filter

str

Filter memory blocks by name (case-insensitive substring match).

[optional]

updated_after

datetime

Only return memory blocks updated at or after this timestamp (ISO 8601).

[optional]

Return type

ListMemoryBlocks200Response

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

-

list_public_memory_block_permissions

List[str] list_public_memory_block_permissions(memory_block_id)

Returns the public permissions for a memory block.

Returns the list of public permissions for a memory block. Returns an empty array if the memory block is not public or has no permissions. Read access is implicit for public memory blocks; an empty array on a public block means public read-only, while [‘h2ogpte/memory_block/edit’] means public read + edit. Never raises 404 — unknown memory block ids also return an empty array (mirrors the collection endpoint).

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.MemoryBlocksApi(api_client)
    memory_block_id = 'memory_block_id_example' # str | Id of the memory block.

    try:
        # Returns the public permissions for a memory block.
        api_response = await api_instance.list_public_memory_block_permissions(memory_block_id)
        print("The response of MemoryBlocksApi->list_public_memory_block_permissions:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling MemoryBlocksApi->list_public_memory_block_permissions: %s\n" % e)

Parameters

Name

Type

Description

Notes

memory_block_id

str

Id of the memory block.

Return type

List[str]

HTTP request headers

  • Content-Type: Not defined

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successful operation. Returns list of permissions.

-

401

Unauthorized - Invalid or missing API key

-

set_default_memory_block

SetDefaultMemoryBlockResponse set_default_memory_block(set_default_memory_block_request)

Set a default memory block

Sets a default memory block for a given scope (llm or agent). Pass memory_block_id as null to clear.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_async
from h2ogpte.rest_async.models.set_default_memory_block_request import SetDefaultMemoryBlockRequest
from h2ogpte.rest_async.models.set_default_memory_block_response import SetDefaultMemoryBlockResponse
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.MemoryBlocksApi(api_client)
    set_default_memory_block_request = h2ogpte.rest_async.SetDefaultMemoryBlockRequest() # SetDefaultMemoryBlockRequest | 

    try:
        # Set a default memory block
        api_response = await api_instance.set_default_memory_block(set_default_memory_block_request)
        print("The response of MemoryBlocksApi->set_default_memory_block:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling MemoryBlocksApi->set_default_memory_block: %s\n" % e)

Parameters

Name

Type

Description

Notes

set_default_memory_block_request

SetDefaultMemoryBlockRequest

Return type

SetDefaultMemoryBlockResponse

HTTP request headers

  • Content-Type: application/json

  • Accept: application/json

HTTP response details

Status code

Description

Response headers

200

Successful operation

-

400

Invalid request - scope must be llm or agent.

-

401

Unauthorized - Invalid or missing API key

-

404

Not found

-

set_memory_block_privacy

set_memory_block_privacy(memory_block_id, memory_block_privacy_request)

Set memory block public or private.

Toggle whether a memory block is publicly accessible.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_async
from h2ogpte.rest_async.models.memory_block_privacy_request import MemoryBlockPrivacyRequest
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.MemoryBlocksApi(api_client)
    memory_block_id = 'memory_block_id_example' # str | Id of the memory block.
    memory_block_privacy_request = h2ogpte.rest_async.MemoryBlockPrivacyRequest() # MemoryBlockPrivacyRequest | 

    try:
        # Set memory block public or private.
        await api_instance.set_memory_block_privacy(memory_block_id, memory_block_privacy_request)
    except Exception as e:
        print("Exception when calling MemoryBlocksApi->set_memory_block_privacy: %s\n" % e)

Parameters

Name

Type

Description

Notes

memory_block_id

str

Id of the memory block.

memory_block_privacy_request

MemoryBlockPrivacyRequest

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

-

404

Not found

-

409

Conflict

-

share_memory_block

share_memory_block(memory_block_id, username, share_memory_block_request=share_memory_block_request)

Share a memory block with a user.

Shares a memory block with a user, granting read and/or edit permissions.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_async
from h2ogpte.rest_async.models.share_memory_block_request import ShareMemoryBlockRequest
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.MemoryBlocksApi(api_client)
    memory_block_id = 'memory_block_id_example' # str | Id of the memory block.
    username = 'username_example' # str | Username to share with.
    share_memory_block_request = h2ogpte.rest_async.ShareMemoryBlockRequest() # ShareMemoryBlockRequest |  (optional)

    try:
        # Share a memory block with a user.
        await api_instance.share_memory_block(memory_block_id, username, share_memory_block_request=share_memory_block_request)
    except Exception as e:
        print("Exception when calling MemoryBlocksApi->share_memory_block: %s\n" % e)

Parameters

Name

Type

Description

Notes

memory_block_id

str

Id of the memory block.

username

str

Username to share with.

share_memory_block_request

ShareMemoryBlockRequest

[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

-

400

Bad request

-

401

Unauthorized - Invalid or missing API key

-

403

Forbidden

-

404

Not found

-

409

Conflict

-

share_memory_block_with_group

share_memory_block_with_group(memory_block_id, group_id, share_memory_block_request=share_memory_block_request)

Share a memory block with a group.

Shares a memory block with a group, granting read and/or edit permissions.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_async
from h2ogpte.rest_async.models.share_memory_block_request import ShareMemoryBlockRequest
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.MemoryBlocksApi(api_client)
    memory_block_id = 'memory_block_id_example' # str | Id of the memory block.
    group_id = 'group_id_example' # str | Id of the group that will obtain access to the memory block.
    share_memory_block_request = h2ogpte.rest_async.ShareMemoryBlockRequest() # ShareMemoryBlockRequest |  (optional)

    try:
        # Share a memory block with a group.
        await api_instance.share_memory_block_with_group(memory_block_id, group_id, share_memory_block_request=share_memory_block_request)
    except Exception as e:
        print("Exception when calling MemoryBlocksApi->share_memory_block_with_group: %s\n" % e)

Parameters

Name

Type

Description

Notes

memory_block_id

str

Id of the memory block.

group_id

str

Id of the group that will obtain access to the memory block.

share_memory_block_request

ShareMemoryBlockRequest

[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

-

403

Forbidden

-

404

Not found

-

unshare_memory_block

unshare_memory_block(memory_block_id, username)

Remove sharing of a memory block from a user.

Removes sharing of a memory block from a user.

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.MemoryBlocksApi(api_client)
    memory_block_id = 'memory_block_id_example' # str | Id of the memory block.
    username = 'username_example' # str | Username to unshare from.

    try:
        # Remove sharing of a memory block from a user.
        await api_instance.unshare_memory_block(memory_block_id, username)
    except Exception as e:
        print("Exception when calling MemoryBlocksApi->unshare_memory_block: %s\n" % e)

Parameters

Name

Type

Description

Notes

memory_block_id

str

Id of the memory block.

username

str

Username to unshare from.

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

-

404

Not found

-

409

Conflict

-

unshare_memory_block_from_group

unshare_memory_block_from_group(memory_block_id, group_id)

Remove sharing of a memory block from a group.

Removes sharing of a memory block from a group.

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.MemoryBlocksApi(api_client)
    memory_block_id = 'memory_block_id_example' # str | Id of the memory block.
    group_id = 'group_id_example' # str | Id of the group that will lose access to the memory block.

    try:
        # Remove sharing of a memory block from a group.
        await api_instance.unshare_memory_block_from_group(memory_block_id, group_id)
    except Exception as e:
        print("Exception when calling MemoryBlocksApi->unshare_memory_block_from_group: %s\n" % e)

Parameters

Name

Type

Description

Notes

memory_block_id

str

Id of the memory block.

group_id

str

Id of the group that will lose access to the memory block.

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

-

403

Forbidden

-

404

Not found

-

update_memory_block

update_memory_block(memory_block_id, memory_block_update_request)

Update a memory block.

Updates the name, content, and/or system prompt amendment of a memory block.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_async
from h2ogpte.rest_async.models.memory_block_update_request import MemoryBlockUpdateRequest
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.MemoryBlocksApi(api_client)
    memory_block_id = 'memory_block_id_example' # str | Id of the memory block.
    memory_block_update_request = h2ogpte.rest_async.MemoryBlockUpdateRequest() # MemoryBlockUpdateRequest | 

    try:
        # Update a memory block.
        await api_instance.update_memory_block(memory_block_id, memory_block_update_request)
    except Exception as e:
        print("Exception when calling MemoryBlocksApi->update_memory_block: %s\n" % e)

Parameters

Name

Type

Description

Notes

memory_block_id

str

Id of the memory block.

memory_block_update_request

MemoryBlockUpdateRequest

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

-

404

Not found

-

409

Conflict

-