AgentsApi

Method

HTTP request

Description

create_agent_key

POST /agents/keys

Creates agent key.

create_agent_key_tool_associations

POST /agents/tool-association

Creates associations between a tool and user&

delete_agent_keys

DELETE /agents/keys/{key-ids}

Deletes agent keys.

delete_agent_tool_association

DELETE /agents/tool-association/{associate-ids}

Deletes agent tool key associations.

delete_agent_tool_preference

DELETE /agents/tool-preference

Deletes the agent tool preferences for the user.

list_agent_directory_stats

GET /agents/directory-stats

Lists agent directory stats across all agent chat sessions.

list_agent_key_tool_associations

GET /agents/tool-association

Returns a list of tools and the user&

list_agent_keys

GET /agents/keys

Lists agent keys.

list_agent_tool_preference

GET /agents/tool-preference

Lists the agent tool preference for the user.

list_agent_tools

GET /agents/tools

Lists agent tools present on the system.

update_agent_key

POST /agents/keys/{key-id}

Updates agent key.

update_agent_tool_preference

POST /agents/tool-preference

Creates or updates the agent tool preference for the user.

create_agent_key

AgentKey create_agent_key(create_agent_key_request)

Creates agent key.

Creates agent key.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.agent_key import AgentKey
from h2ogpte.rest_sync.models.create_agent_key_request import CreateAgentKeyRequest
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.AgentsApi(api_client)
    create_agent_key_request = h2ogpte.rest_sync.CreateAgentKeyRequest() # CreateAgentKeyRequest | 

    try:
        # Creates agent key.
        api_response = api_instance.create_agent_key(create_agent_key_request)
        print("The response of AgentsApi->create_agent_key:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AgentsApi->create_agent_key: %s\n" % e)

Parameters

Name

Type

Description

Notes

create_agent_key_request

CreateAgentKeyRequest

Return type

AgentKey

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

-

409

Conflict

-

500

Internal server error

-

create_agent_key_tool_associations

AgentToolKeyAssociations create_agent_key_tool_associations(create_agent_tool_key_associations_request)

Creates associations between a tool and user’s keys.

Creates associations between a tool and user’s keys.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.agent_tool_key_associations import AgentToolKeyAssociations
from h2ogpte.rest_sync.models.create_agent_tool_key_associations_request import CreateAgentToolKeyAssociationsRequest
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.AgentsApi(api_client)
    create_agent_tool_key_associations_request = h2ogpte.rest_sync.CreateAgentToolKeyAssociationsRequest() # CreateAgentToolKeyAssociationsRequest | 

    try:
        # Creates associations between a tool and user's keys.
        api_response = api_instance.create_agent_key_tool_associations(create_agent_tool_key_associations_request)
        print("The response of AgentsApi->create_agent_key_tool_associations:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AgentsApi->create_agent_key_tool_associations: %s\n" % e)

Parameters

Name

Type

Description

Notes

create_agent_tool_key_associations_request

CreateAgentToolKeyAssociationsRequest

Return type

AgentToolKeyAssociations

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

-

500

Internal server error

-

delete_agent_keys

delete_agent_keys(key_ids)

Deletes agent keys.

Deletes agent keys.

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.AgentsApi(api_client)
    key_ids = ['key_ids_example'] # List[str] | Ids of keys to be deleted.

    try:
        # Deletes agent keys.
        api_instance.delete_agent_keys(key_ids)
    except Exception as e:
        print("Exception when calling AgentsApi->delete_agent_keys: %s\n" % e)

Parameters

Name

Type

Description

Notes

key_ids

List[str]

Ids of keys to be deleted.

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

-

500

Internal server error

-

delete_agent_tool_association

Count delete_agent_tool_association(associate_ids)

Deletes agent tool key associations.

Deletes agent tool key associations given a list of associate ids belonging to the user.

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.AgentsApi(api_client)
    associate_ids = ['associate_ids_example'] # List[str] | The unique identifiers of tool associations to be deleted.

    try:
        # Deletes agent tool key associations.
        api_response = api_instance.delete_agent_tool_association(associate_ids)
        print("The response of AgentsApi->delete_agent_tool_association:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AgentsApi->delete_agent_tool_association: %s\n" % e)

Parameters

Name

Type

Description

Notes

associate_ids

List[str]

The unique identifiers of tool associations to be deleted.

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

-

500

Internal server error

-

delete_agent_tool_preference

delete_agent_tool_preference()

Deletes the agent tool preferences for the user.

Deletes the agent tool preferences for the 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.AgentsApi(api_client)

    try:
        # Deletes the agent tool preferences for the user.
        api_instance.delete_agent_tool_preference()
    except Exception as e:
        print("Exception when calling AgentsApi->delete_agent_tool_preference: %s\n" % e)

Parameters

This endpoint does not need any parameter.

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

-

500

Internal server error

-

list_agent_directory_stats

List[AgentServerDirectoryStatsPerAgentChatSession] list_agent_directory_stats(offset=offset, limit=limit, filter_text=filter_text)

Lists agent directory stats across all agent chat sessions.

Lists agent directory stats across all agent chat sessions.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.agent_server_directory_stats_per_agent_chat_session import AgentServerDirectoryStatsPerAgentChatSession
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.AgentsApi(api_client)
    offset = 0 # int | How many agent chat sessions to skip before returning. (optional) (default to 0)
    limit = 100 # int | How many agent chat sessions to return. (optional) (default to 100)
    filter_text = 'filter_text_example' # str | Applied text filter. (optional)

    try:
        # Lists agent directory stats across all agent chat sessions.
        api_response = api_instance.list_agent_directory_stats(offset=offset, limit=limit, filter_text=filter_text)
        print("The response of AgentsApi->list_agent_directory_stats:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AgentsApi->list_agent_directory_stats: %s\n" % e)

Parameters

Name

Type

Description

Notes

offset

int

How many agent chat sessions to skip before returning.

[optional] [default to 0]

limit

int

How many agent chat sessions to return.

[optional] [default to 100]

filter_text

str

Applied text filter.

[optional]

Return type

List[AgentServerDirectoryStatsPerAgentChatSession]

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_agent_key_tool_associations

List[AgentToolKeyAssociations] list_agent_key_tool_associations()

Returns a list of tools and the user’s associated keys.

Returns a list of tools and the user’s associated keys.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.agent_tool_key_associations import AgentToolKeyAssociations
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.AgentsApi(api_client)

    try:
        # Returns a list of tools and the user's associated keys.
        api_response = api_instance.list_agent_key_tool_associations()
        print("The response of AgentsApi->list_agent_key_tool_associations:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AgentsApi->list_agent_key_tool_associations: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

List[AgentToolKeyAssociations]

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

-

500

Internal server error

-

list_agent_keys

List[AgentKey] list_agent_keys()

Lists agent keys.

Lists agent keys.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.agent_key import AgentKey
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.AgentsApi(api_client)

    try:
        # Lists agent keys.
        api_response = api_instance.list_agent_keys()
        print("The response of AgentsApi->list_agent_keys:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AgentsApi->list_agent_keys: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

List[AgentKey]

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

-

500

Internal server error

-

list_agent_tool_preference

List[str] list_agent_tool_preference()

Lists the agent tool preference for the user.

Lists the agent tool preference for the 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.AgentsApi(api_client)

    try:
        # Lists the agent tool preference for the user.
        api_response = api_instance.list_agent_tool_preference()
        print("The response of AgentsApi->list_agent_tool_preference:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AgentsApi->list_agent_tool_preference: %s\n" % e)

Parameters

This endpoint does not need any parameter.

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

-

401

Unauthorized - Invalid or missing API key

-

500

Internal server error

-

list_agent_tools

List[AgentToolSpec] list_agent_tools()

Lists agent tools present on the system.

Lists agent tools present on the system.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.agent_tool_spec import AgentToolSpec
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.AgentsApi(api_client)

    try:
        # Lists agent tools present on the system.
        api_response = api_instance.list_agent_tools()
        print("The response of AgentsApi->list_agent_tools:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AgentsApi->list_agent_tools: %s\n" % e)

Parameters

This endpoint does not need any parameter.

Return type

List[AgentToolSpec]

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

-

500

Internal server error

-

update_agent_key

AgentKey update_agent_key(key_id, update_agent_key_request)

Updates agent key.

Updates agent key.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.agent_key import AgentKey
from h2ogpte.rest_sync.models.update_agent_key_request import UpdateAgentKeyRequest
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.AgentsApi(api_client)
    key_id = 'key_id_example' # str | Id of the key to be updated.
    update_agent_key_request = h2ogpte.rest_sync.UpdateAgentKeyRequest() # UpdateAgentKeyRequest | 

    try:
        # Updates agent key.
        api_response = api_instance.update_agent_key(key_id, update_agent_key_request)
        print("The response of AgentsApi->update_agent_key:\n")
        pprint(api_response)
    except Exception as e:
        print("Exception when calling AgentsApi->update_agent_key: %s\n" % e)

Parameters

Name

Type

Description

Notes

key_id

str

Id of the key to be updated.

update_agent_key_request

UpdateAgentKeyRequest

Return type

AgentKey

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

-

409

Conflict

-

500

Internal server error

-

update_agent_tool_preference

update_agent_tool_preference(update_agent_tool_preference_request)

Creates or updates the agent tool preference for the user.

Creates or updates the agent tool preference for the user.

Example

  • Bearer Authentication (bearerAuth):

import h2ogpte.rest_sync
from h2ogpte.rest_sync.models.update_agent_tool_preference_request import UpdateAgentToolPreferenceRequest
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.AgentsApi(api_client)
    update_agent_tool_preference_request = h2ogpte.rest_sync.UpdateAgentToolPreferenceRequest() # UpdateAgentToolPreferenceRequest | 

    try:
        # Creates or updates the agent tool preference for the user.
        api_instance.update_agent_tool_preference(update_agent_tool_preference_request)
    except Exception as e:
        print("Exception when calling AgentsApi->update_agent_tool_preference: %s\n" % e)

Parameters

Name

Type

Description

Notes

update_agent_tool_preference_request

UpdateAgentToolPreferenceRequest

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

-

500

Internal server error

-