ChatApi
Method |
HTTP request |
Description |
|---|---|---|
POST /admin/chats/cleanup |
Trigger cleanup of old chat sessions. |
|
POST /chats/{session-id}/archive |
Archive a chat session. |
|
POST /chats |
Creates chat session. |
|
POST /chats/delete-job |
Creates job to delete chat sessions. |
|
DELETE /chats/{session-ids}/agent-server-directories |
Deletes agent server directories. |
|
DELETE /chats/{session-id}/agent-server-files |
Deletes agent server files. |
|
DELETE /chats/{session-id} |
Deletes collection. |
|
DELETE /chats/{session-id}/collection |
Removes a collection reference from the chat session. |
|
DELETE /chats/{session-id}/expiry-date |
Removes an expiry date from a chat session. |
|
DELETE /chats/{session-id}/prompt-template |
Removes a prompt template reference from the chat session. |
|
DELETE /messages/{message-ids} |
Deletes specific chat messages. |
|
GET /question-answer-feedbacks/export/{job-id} |
Download a completed feedback CSV export. |
|
POST /messages/{question-id}/finish |
Signal the LLM to finish its response gracefully. |
|
POST /chats/{session-id}/fork |
Forks a chat session. |
|
GET /chats/{session-id}/agent-server-directories/{directory-name}/stats |
Gets stats of a agent server directory. |
|
GET /chats/{session-id} |
Finds a chat session by id. |
|
GET /chats/count |
Counts a number of chat sessions. |
|
GET /chats/{session-id}/guardrails |
Get guardrails settings for a chat session. |
|
GET /chats/{session-id}/messages |
Fetches chat message and metadata for messages in a chat session. |
|
POST /chats/{session-id}/completions |
||
GET /messages/{message-id}/meta |
Fetches chat message meta information. |
|
GET /messages/{message-id}/references |
Fetches metadata for references of a chat message. |
|
GET /question-answer-feedbacks/count |
Counts a number of question-answer feedbacks. |
|
POST /chats/{session-id}/synth-message-pair |
Insert a synthetic user-question + AI-reply pair into chat history. |
|
GET /chats/{session-id}/agent-server-files |
Lists agent server files. |
|
GET /chats/{session-id}/agent-server-directories/stats |
Lists stats of agent server directories. |
|
GET /admin/chats/archived |
List archived chat sessions. |
|
GET /chats |
List chat sessions. |
|
GET /question-answer-feedbacks |
Lists user& |
|
GET /chats/{session-id}/questions |
List suggested questions for a given chat session. |
|
POST /messages/{question-id}/pause |
Pause a streaming chat response. |
|
POST /messages/{question-id}/resume |
Resume a paused chat response. |
|
POST /messages/{question-id}/hitl |
Send a course correction message to a running agent. |
|
PUT /messages/{message-id}/votes |
Changes the vote value of a chat message. |
|
POST /messages/{question-id}/stop |
Stop a streaming chat response immediately. |
|
POST /chats/{session-id}/unarchive |
Unarchive a chat session. |
|
PATCH /chats/{session-id} |
Updates the name of a chat session. |
|
PUT /chats/{session-id}/collection |
Updates a collection reference of a chat session. |
|
PUT /chats/{session-id}/expiry-date |
Updates an expiry date of a chat session. |
|
PUT /chats/{session-id}/keep-forever |
Updates the keep-forever flag of a chat session. |
|
PUT /chats/{session-id}/prompt-template |
Updates a prompt template reference of a chat session. |
|
POST /question-answer-feedbacks/{answer-id} |
Update feedback for a specific answer to a question. |
admin_cleanup_chat_sessions
JobDetails admin_cleanup_chat_sessions(admin_cleanup_chat_sessions_request)
Trigger cleanup of old chat sessions.
Admin endpoint to delete chat sessions older than a specified number of days.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.admin_cleanup_chat_sessions_request import AdminCleanupChatSessionsRequest
from h2ogpte.rest_async.models.job_details import JobDetails
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.ChatApi(api_client)
admin_cleanup_chat_sessions_request = h2ogpte.rest_async.AdminCleanupChatSessionsRequest() # AdminCleanupChatSessionsRequest |
try:
# Trigger cleanup of old chat sessions.
api_response = await api_instance.admin_cleanup_chat_sessions(admin_cleanup_chat_sessions_request)
print("The response of ChatApi->admin_cleanup_chat_sessions:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChatApi->admin_cleanup_chat_sessions: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
admin_cleanup_chat_sessions_request |
Return type
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 |
- |
archive_chat_session
archive_chat_session(session_id)
Archive a chat session.
Archives a chat session along with its associated data.
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.ChatApi(api_client)
session_id = 'session_id_example' # str | Id of the chat session
try:
# Archive a chat session.
await api_instance.archive_chat_session(session_id)
except Exception as e:
print("Exception when calling ChatApi->archive_chat_session: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
session_id |
str |
Id of the chat session |
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 |
- |
404 |
Chat session not found or already archived |
- |
create_chat_session
ChatSession create_chat_session(collection_id=collection_id, create_chat_session_request=create_chat_session_request)
Creates chat session.
Creates chat session with a collection if provided. Otherwise, the session will be with a generic LLM.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.chat_session import ChatSession
from h2ogpte.rest_async.models.create_chat_session_request import CreateChatSessionRequest
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.ChatApi(api_client)
collection_id = 'collection_id_example' # str | Id of collection (optional)
create_chat_session_request = h2ogpte.rest_async.CreateChatSessionRequest() # CreateChatSessionRequest | (optional)
try:
# Creates chat session.
api_response = await api_instance.create_chat_session(collection_id=collection_id, create_chat_session_request=create_chat_session_request)
print("The response of ChatApi->create_chat_session:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChatApi->create_chat_session: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
collection_id |
str |
Id of collection |
[optional] |
create_chat_session_request |
[optional] |
Return type
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 |
- |
create_delete_chat_session_job
JobDetails create_delete_chat_session_job(delete_chat_sessions_job_request)
Creates job to delete chat sessions.
Creates job to delete chat sessions.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.delete_chat_sessions_job_request import DeleteChatSessionsJobRequest
from h2ogpte.rest_async.models.job_details import JobDetails
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.ChatApi(api_client)
delete_chat_sessions_job_request = h2ogpte.rest_async.DeleteChatSessionsJobRequest() # DeleteChatSessionsJobRequest |
try:
# Creates job to delete chat sessions.
api_response = await api_instance.create_delete_chat_session_job(delete_chat_sessions_job_request)
print("The response of ChatApi->create_delete_chat_session_job:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChatApi->create_delete_chat_session_job: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
delete_chat_sessions_job_request |
Return type
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 |
- |
delete_agent_server_directories
delete_agent_server_directories(session_ids, dir_types=dir_types)
Deletes agent server directories.
Deletes agent server directories. Deprecated: this endpoint will be removed in a future release. Agent directories are now cleaned up automatically as part of the chat-session delete cascade — call DELETE /chats/{session_ids} instead. Deleting agent files mid-conversation leaves the agent in an inconsistent state (see h2oai/h2ogpte#7302), so this standalone path is no longer recommended.
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.ChatApi(api_client)
session_ids = ['session_ids_example'] # List[str] | Id of the chat session
dir_types = ['dir_types_example'] # List[str] | Types of agent directories to be deleted (optional)
try:
# Deletes agent server directories.
await api_instance.delete_agent_server_directories(session_ids, dir_types=dir_types)
except Exception as e:
print("Exception when calling ChatApi->delete_agent_server_directories: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
session_ids |
Id of the chat session |
||
dir_types |
Types of agent directories to be deleted |
[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 |
- |
400 |
Bad request |
- |
401 |
Unauthorized - Invalid or missing API key |
- |
409 |
Conflict |
- |
delete_agent_server_files
delete_agent_server_files(session_id)
Deletes agent server files.
Deletes agent server files.
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.ChatApi(api_client)
session_id = 'session_id_example' # str | Id of the chat session
try:
# Deletes agent server files.
await api_instance.delete_agent_server_files(session_id)
except Exception as e:
print("Exception when calling ChatApi->delete_agent_server_files: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
session_id |
str |
Id of the chat session |
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 |
- |
409 |
Conflict |
- |
delete_chat_session
ChatSession delete_chat_session(session_id, timeout=timeout)
Deletes collection.
Deletes collection with a given unique identifier.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.chat_session import ChatSession
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.ChatApi(api_client)
session_id = 'session_id_example' # str | Id of the chat session
timeout = 300 # float | Timeout in seconds (optional) (default to 300)
try:
# Deletes collection.
api_response = await api_instance.delete_chat_session(session_id, timeout=timeout)
print("The response of ChatApi->delete_chat_session:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChatApi->delete_chat_session: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
session_id |
str |
Id of the chat session |
|
timeout |
float |
Timeout in seconds |
[optional] [default to 300] |
Return type
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 |
- |
delete_chat_session_collection
ChatSession delete_chat_session_collection(session_id)
Removes a collection reference from the chat session.
Removes a collection reference from the chat session.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.chat_session import ChatSession
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.ChatApi(api_client)
session_id = 'session_id_example' # str | Id of the chat session
try:
# Removes a collection reference from the chat session.
api_response = await api_instance.delete_chat_session_collection(session_id)
print("The response of ChatApi->delete_chat_session_collection:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChatApi->delete_chat_session_collection: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
session_id |
str |
Id of the chat session |
Return type
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 |
- |
delete_chat_session_expiry_date
delete_chat_session_expiry_date(session_id)
Removes an expiry date from a chat session.
Removes an expiry date from a chat session.
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.ChatApi(api_client)
session_id = 'session_id_example' # str | Id of the chat session
try:
# Removes an expiry date from a chat session.
await api_instance.delete_chat_session_expiry_date(session_id)
except Exception as e:
print("Exception when calling ChatApi->delete_chat_session_expiry_date: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
session_id |
str |
Id of the chat session |
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_chat_session_prompt_template
ChatSession delete_chat_session_prompt_template(session_id)
Removes a prompt template reference from the chat session.
Removes a prompt template reference from the chat session.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.chat_session import ChatSession
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.ChatApi(api_client)
session_id = 'session_id_example' # str | Id of the chat session
try:
# Removes a prompt template reference from the chat session.
api_response = await api_instance.delete_chat_session_prompt_template(session_id)
print("The response of ChatApi->delete_chat_session_prompt_template:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChatApi->delete_chat_session_prompt_template: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
session_id |
str |
Id of the chat session |
Return type
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 |
- |
delete_messages
delete_messages(message_ids)
Deletes specific chat messages.
Deletes specific chat messages.
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.ChatApi(api_client)
message_ids = ['message_ids_example'] # List[str] | Ids of messages to be deleted
try:
# Deletes specific chat messages.
await api_instance.delete_messages(message_ids)
except Exception as e:
print("Exception when calling ChatApi->delete_messages: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
message_ids |
Ids of messages 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 |
- |
400 |
Bad request |
- |
401 |
Unauthorized - Invalid or missing API key |
- |
403 |
Forbidden |
- |
404 |
Not found |
- |
409 |
Conflict |
- |
download_feedback_export
bytearray download_feedback_export(job_id)
Download a completed feedback CSV export.
Downloads the CSV file produced by an ExportFeedbackCSVJob.
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.ChatApi(api_client)
job_id = 'job_id_example' # str | The job ID of the completed export job.
try:
# Download a completed feedback CSV export.
api_response = await api_instance.download_feedback_export(job_id)
print("The response of ChatApi->download_feedback_export:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChatApi->download_feedback_export: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
job_id |
str |
The job ID of the completed export job. |
Return type
bytearray
HTTP request headers
Content-Type: Not defined
Accept: text/csv, application/json
HTTP response details
Status code |
Description |
Response headers |
|---|---|---|
200 |
CSV file download |
- |
400 |
Bad request |
- |
401 |
Unauthorized - Invalid or missing API key |
- |
404 |
Export not found or expired. |
- |
finish_chat_message
finish_chat_message(question_id)
Signal the LLM to finish its response gracefully.
Signals the LLM to complete its current thought and finish naturally, providing a more coherent ending than an immediate stop.
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.ChatApi(api_client)
question_id = 'question_id_example' # str | The ID of the chat question to finish gracefully.
try:
# Signal the LLM to finish its response gracefully.
await api_instance.finish_chat_message(question_id)
except Exception as e:
print("Exception when calling ChatApi->finish_chat_message: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
question_id |
str |
The ID of the chat question to finish gracefully. |
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 |
- |
fork_chat_session
ChatSession fork_chat_session(session_id, fork_chat_session_request=fork_chat_session_request)
Forks a chat session.
Creates a new independent copy of a chat session with all messages, references, metadata, and document associations preserved.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.chat_session import ChatSession
from h2ogpte.rest_async.models.fork_chat_session_request import ForkChatSessionRequest
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.ChatApi(api_client)
session_id = 'session_id_example' # str | Id of the chat session to fork
fork_chat_session_request = h2ogpte.rest_async.ForkChatSessionRequest() # ForkChatSessionRequest | (optional)
try:
# Forks a chat session.
api_response = await api_instance.fork_chat_session(session_id, fork_chat_session_request=fork_chat_session_request)
print("The response of ChatApi->fork_chat_session:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChatApi->fork_chat_session: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
session_id |
str |
Id of the chat session to fork |
|
fork_chat_session_request |
[optional] |
Return type
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 |
- |
get_agent_server_directory_stats
AgentServerDirectoryStats get_agent_server_directory_stats(session_id, directory_name, detail_level=detail_level)
Gets stats of a agent server directory.
Gets stats of a agent server directory.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.agent_server_directory_stats import AgentServerDirectoryStats
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.ChatApi(api_client)
session_id = 'session_id_example' # str | Id of the chat session
directory_name = 'directory_name_example' # str | Directory name
detail_level = 0 # int | the higher value, more details are returned. (optional) (default to 0)
try:
# Gets stats of a agent server directory.
api_response = await api_instance.get_agent_server_directory_stats(session_id, directory_name, detail_level=detail_level)
print("The response of ChatApi->get_agent_server_directory_stats:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChatApi->get_agent_server_directory_stats: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
session_id |
str |
Id of the chat session |
|
directory_name |
str |
Directory name |
|
detail_level |
int |
the higher value, more details are returned. |
[optional] [default to 0] |
Return type
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 |
- |
get_chat_session
ChatSession get_chat_session(session_id)
Finds a chat session by id.
Returns a single chat session by its unique identifier.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.chat_session import ChatSession
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.ChatApi(api_client)
session_id = 'session_id_example' # str | Id of the chat session
try:
# Finds a chat session by id.
api_response = await api_instance.get_chat_session(session_id)
print("The response of ChatApi->get_chat_session:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChatApi->get_chat_session: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
session_id |
str |
Id of the chat session |
Return type
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_chat_session_count
Count get_chat_session_count()
Counts a number of chat sessions.
Counts a number of chat sessions.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.count import Count
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.ChatApi(api_client)
try:
# Counts a number of chat sessions.
api_response = await api_instance.get_chat_session_count()
print("The response of ChatApi->get_chat_session_count:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChatApi->get_chat_session_count: %s\n" % e)
Parameters
This endpoint does not need any parameter.
Return type
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 |
- |
get_chat_session_guardrails
GuardrailsSettings get_chat_session_guardrails(session_id)
Get guardrails settings for a chat session.
Returns the guardrails settings configured for a specific chat session.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.guardrails_settings import GuardrailsSettings
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.ChatApi(api_client)
session_id = 'session_id_example' # str | Id of the chat session
try:
# Get guardrails settings for a chat session.
api_response = await api_instance.get_chat_session_guardrails(session_id)
print("The response of ChatApi->get_chat_session_guardrails:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChatApi->get_chat_session_guardrails: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
session_id |
str |
Id of the chat session |
Return type
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 |
- |
get_chat_session_messages
List[ChatMessage] get_chat_session_messages(session_id, offset=offset, limit=limit)
Fetches chat message and metadata for messages in a chat session.
Fetches chat message and metadata for messages in a chat session. Messages without a reply_to are from the end user, messages with a reply_to are from an LLM and a response to a specific user message.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.chat_message import ChatMessage
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.ChatApi(api_client)
session_id = 'session_id_example' # str | Id of the chat session
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:
# Fetches chat message and metadata for messages in a chat session.
api_response = await api_instance.get_chat_session_messages(session_id, offset=offset, limit=limit)
print("The response of ChatApi->get_chat_session_messages:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChatApi->get_chat_session_messages: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
session_id |
str |
Id of the chat session |
|
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
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_completion
ChatCompletion get_completion(session_id, chat_completion_request)
Asks question in a given chat session.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.chat_completion import ChatCompletion
from h2ogpte.rest_async.models.chat_completion_request import ChatCompletionRequest
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.ChatApi(api_client)
session_id = 'session_id_example' # str | Id of a chat session
chat_completion_request = h2ogpte.rest_async.ChatCompletionRequest() # ChatCompletionRequest |
try:
api_response = await api_instance.get_completion(session_id, chat_completion_request)
print("The response of ChatApi->get_completion:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChatApi->get_completion: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
session_id |
str |
Id of a chat session |
|
chat_completion_request |
Return type
HTTP request headers
Content-Type: application/json
Accept: application/json, application/jsonl
HTTP response details
Status code |
Description |
Response headers |
|---|---|---|
200 |
Successful operation |
- |
400 |
Bad request |
- |
401 |
Unauthorized - Invalid or missing API key |
- |
500 |
Internal server error |
- |
get_message_meta
List[ChatMessageMeta] get_message_meta(message_id, info_type=info_type)
Fetches chat message meta information.
Fetches chat message meta information.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.chat_message_meta import ChatMessageMeta
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.ChatApi(api_client)
message_id = 'message_id_example' # str | Id of the chat message.
info_type = 'info_type_example' # str | Metadata type to fetch. (optional)
try:
# Fetches chat message meta information.
api_response = await api_instance.get_message_meta(message_id, info_type=info_type)
print("The response of ChatApi->get_message_meta:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChatApi->get_message_meta: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
message_id |
str |
Id of the chat message. |
|
info_type |
str |
Metadata type to fetch. |
[optional] |
Return type
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_message_references
List[ChatMessageReference] get_message_references(message_id, limit=limit)
Fetches metadata for references of a chat message.
Fetches metadata for references of a chat message. References are only available for messages sent from an LLM, an empty list will be returned for messages sent by the user.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.chat_message_reference import ChatMessageReference
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.ChatApi(api_client)
message_id = 'message_id_example' # str | Id of the chat message
limit = 56 # int | The number of references to consider based on the highest confidence scores. (optional)
try:
# Fetches metadata for references of a chat message.
api_response = await api_instance.get_message_references(message_id, limit=limit)
print("The response of ChatApi->get_message_references:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChatApi->get_message_references: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
message_id |
str |
Id of the chat message |
|
limit |
int |
The number of references to consider based on the highest confidence scores. |
[optional] |
Return type
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 |
- |
get_question_answer_feedback_count
Count get_question_answer_feedback_count(collection_id=collection_id, interval=interval, no_collection=no_collection)
Counts a number of question-answer feedbacks.
Counts a number of question-answer feedbacks.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.count import Count
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.ChatApi(api_client)
collection_id = 'collection_id_example' # str | Filter by collection ID. (optional)
interval = 'interval_example' # str | Filter by time interval (e.g. \"7 days\", \"30 days\", \"90 days\", \"1 year\"). (optional)
no_collection = False # bool | If true, only return feedbacks with no collection. (optional) (default to False)
try:
# Counts a number of question-answer feedbacks.
api_response = await api_instance.get_question_answer_feedback_count(collection_id=collection_id, interval=interval, no_collection=no_collection)
print("The response of ChatApi->get_question_answer_feedback_count:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChatApi->get_question_answer_feedback_count: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
collection_id |
str |
Filter by collection ID. |
[optional] |
interval |
str |
Filter by time interval (e.g. "7 days", "30 days", "90 days", "1 year"). |
[optional] |
no_collection |
bool |
If true, only return feedbacks with no collection. |
[optional] [default to False] |
Return type
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 |
- |
insert_command_synth_pair
InsertCommandSynthPair201Response insert_command_synth_pair(session_id, insert_command_synth_pair_request)
Insert a synthetic user-question + AI-reply pair into chat history.
Used by slash-command flows (e.g. /schedule, /create-assistant) that produce an LLM response outside the normal streaming pipeline and need the resulting prompt/response pair to show up in the chat history on reload. The pair is tagged with chat_message_meta(message_type=”command_synth”, content=command_name) so UIs can identify these turns later.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.insert_command_synth_pair201_response import InsertCommandSynthPair201Response
from h2ogpte.rest_async.models.insert_command_synth_pair_request import InsertCommandSynthPairRequest
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.ChatApi(api_client)
session_id = 'session_id_example' # str | Id of the chat session to attach the pair to.
insert_command_synth_pair_request = h2ogpte.rest_async.InsertCommandSynthPairRequest() # InsertCommandSynthPairRequest |
try:
# Insert a synthetic user-question + AI-reply pair into chat history.
api_response = await api_instance.insert_command_synth_pair(session_id, insert_command_synth_pair_request)
print("The response of ChatApi->insert_command_synth_pair:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChatApi->insert_command_synth_pair: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
session_id |
str |
Id of the chat session to attach the pair to. |
|
insert_command_synth_pair_request |
Return type
HTTP request headers
Content-Type: application/json
Accept: application/json
HTTP response details
Status code |
Description |
Response headers |
|---|---|---|
201 |
Pair inserted. |
- |
400 |
Bad request |
- |
401 |
Unauthorized - Invalid or missing API key |
- |
404 |
Chat session not found or not owned by the caller. |
- |
list_agent_server_files
List[AgentServerFile] list_agent_server_files(session_id)
Lists agent server files.
Lists agent server files.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.agent_server_file import AgentServerFile
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.ChatApi(api_client)
session_id = 'session_id_example' # str | Id of the chat session
try:
# Lists agent server files.
api_response = await api_instance.list_agent_server_files(session_id)
print("The response of ChatApi->list_agent_server_files:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChatApi->list_agent_server_files: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
session_id |
str |
Id of the chat session |
Return type
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_all_agent_server_directories_stats
List[AgentServerDirectoryStats] list_all_agent_server_directories_stats(session_id, detail_level=detail_level)
Lists stats of agent server directories.
Lists stats of agent server directories.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.agent_server_directory_stats import AgentServerDirectoryStats
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.ChatApi(api_client)
session_id = 'session_id_example' # str | Id of the chat session
detail_level = 0 # int | the higher value, more details are returned. (optional) (default to 0)
try:
# Lists stats of agent server directories.
api_response = await api_instance.list_all_agent_server_directories_stats(session_id, detail_level=detail_level)
print("The response of ChatApi->list_all_agent_server_directories_stats:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChatApi->list_all_agent_server_directories_stats: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
session_id |
str |
Id of the chat session |
|
detail_level |
int |
the higher value, more details are returned. |
[optional] [default to 0] |
Return type
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_archived_chat_sessions_as_admin
ListArchivedChatSessionsAsAdmin200Response list_archived_chat_sessions_as_admin(offset=offset, limit=limit, filter=filter, sort_column=sort_column, ascending=ascending)
List archived chat sessions.
Admin-only endpoint to list archived chat sessions with pagination and filtering.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.list_archived_chat_sessions_as_admin200_response import ListArchivedChatSessionsAsAdmin200Response
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.ChatApi(api_client)
offset = 0 # int | (optional) (default to 0)
limit = 100 # int | (optional) (default to 100)
filter = 'filter_example' # str | (optional)
sort_column = 'archived_at' # str | (optional) (default to 'archived_at')
ascending = False # bool | (optional) (default to False)
try:
# List archived chat sessions.
api_response = await api_instance.list_archived_chat_sessions_as_admin(offset=offset, limit=limit, filter=filter, sort_column=sort_column, ascending=ascending)
print("The response of ChatApi->list_archived_chat_sessions_as_admin:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChatApi->list_archived_chat_sessions_as_admin: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
offset |
int |
[optional] [default to 0] |
|
limit |
int |
[optional] [default to 100] |
|
filter |
str |
[optional] |
|
sort_column |
str |
[optional] [default to ‘archived_at’] |
|
ascending |
bool |
[optional] [default to False] |
Return type
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
List[ChatSession] list_chat_sessions(offset=offset, limit=limit)
List chat sessions.
List chat sessions.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.chat_session import ChatSession
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.ChatApi(api_client)
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.
api_response = await api_instance.list_chat_sessions(offset=offset, limit=limit)
print("The response of ChatApi->list_chat_sessions:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChatApi->list_chat_sessions: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
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
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_question_answer_feedbacks
List[QAFeedback] list_question_answer_feedbacks(offset=offset, limit=limit, collection_id=collection_id, interval=interval, no_collection=no_collection)
Lists user’s questions and answers that have a feedback.
Lists user’s questions and answers that have a feedback.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.qa_feedback import QAFeedback
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.ChatApi(api_client)
offset = 0 # int | How many feedbacks to skip before returning. (optional) (default to 0)
limit = 100 # int | How many feedbacks to return. (optional) (default to 100)
collection_id = 'collection_id_example' # str | Filter by collection ID. (optional)
interval = 'interval_example' # str | Filter by time interval (e.g. \"7 days\", \"30 days\", \"90 days\", \"1 year\"). (optional)
no_collection = False # bool | If true, only return feedbacks with no collection. (optional) (default to False)
try:
# Lists user's questions and answers that have a feedback.
api_response = await api_instance.list_question_answer_feedbacks(offset=offset, limit=limit, collection_id=collection_id, interval=interval, no_collection=no_collection)
print("The response of ChatApi->list_question_answer_feedbacks:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChatApi->list_question_answer_feedbacks: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
offset |
int |
How many feedbacks to skip before returning. |
[optional] [default to 0] |
limit |
int |
How many feedbacks to return. |
[optional] [default to 100] |
collection_id |
str |
Filter by collection ID. |
[optional] |
interval |
str |
Filter by time interval (e.g. "7 days", "30 days", "90 days", "1 year"). |
[optional] |
no_collection |
bool |
If true, only return feedbacks with no collection. |
[optional] [default to False] |
Return type
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_questions_for_chat_session
List[SuggestedQuestion] list_questions_for_chat_session(session_id, limit=limit)
List suggested questions for a given chat session.
List suggested questions for a given chat session.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.suggested_question import SuggestedQuestion
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.ChatApi(api_client)
session_id = 'session_id_example' # str | Id of a chat session
limit = 100 # int | How many questions to return. (optional) (default to 100)
try:
# List suggested questions for a given chat session.
api_response = await api_instance.list_questions_for_chat_session(session_id, limit=limit)
print("The response of ChatApi->list_questions_for_chat_session:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChatApi->list_questions_for_chat_session: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
session_id |
str |
Id of a chat session |
|
limit |
int |
How many questions to return. |
[optional] [default to 100] |
Return type
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 |
- |
pause_chat_message
pause_chat_message(question_id)
Pause a streaming chat response.
Pauses the streaming generation of a chat message response. The message can be resumed later using the resume 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.ChatApi(api_client)
question_id = 'question_id_example' # str | The ID of the chat question to pause.
try:
# Pause a streaming chat response.
await api_instance.pause_chat_message(question_id)
except Exception as e:
print("Exception when calling ChatApi->pause_chat_message: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
question_id |
str |
The ID of the chat question to pause. |
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 |
- |
resume_chat_message
resume_chat_message(question_id)
Resume a paused chat response.
Resumes the streaming generation of a previously paused chat message response.
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.ChatApi(api_client)
question_id = 'question_id_example' # str | The ID of the chat question to resume.
try:
# Resume a paused chat response.
await api_instance.resume_chat_message(question_id)
except Exception as e:
print("Exception when calling ChatApi->resume_chat_message: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
question_id |
str |
The ID of the chat question to resume. |
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 |
- |
send_hitl_message
send_hitl_message(question_id, send_hitl_message_request)
Send a course correction message to a running agent.
Sends a human-in-the-loop message to a running agent. The agent will incorporate this guidance before its next LLM call.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.send_hitl_message_request import SendHitlMessageRequest
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.ChatApi(api_client)
question_id = 'question_id_example' # str | The ID of the chat question (active streaming session).
send_hitl_message_request = h2ogpte.rest_async.SendHitlMessageRequest() # SendHitlMessageRequest |
try:
# Send a course correction message to a running agent.
await api_instance.send_hitl_message(question_id, send_hitl_message_request)
except Exception as e:
print("Exception when calling ChatApi->send_hitl_message: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
question_id |
str |
The ID of the chat question (active streaming session). |
|
send_hitl_message_request |
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 |
- |
set_message_votes
set_message_votes(message_id, message_vote_update_request)
Changes the vote value of a chat message.
Set the exact value of a vote for a chat message. Any message type can be updated, but only LLM response votes will be visible in the UI. The expectation is 0 - unvoted, -1 - dislike, 1 - like. Values outside of this will not be viewable in the UI.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.message_vote_update_request import MessageVoteUpdateRequest
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.ChatApi(api_client)
message_id = 'message_id_example' # str | Id of the chat message.
message_vote_update_request = h2ogpte.rest_async.MessageVoteUpdateRequest() # MessageVoteUpdateRequest |
try:
# Changes the vote value of a chat message.
await api_instance.set_message_votes(message_id, message_vote_update_request)
except Exception as e:
print("Exception when calling ChatApi->set_message_votes: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
message_id |
str |
Id of the chat message. |
|
message_vote_update_request |
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 |
- |
404 |
Not found |
- |
409 |
Conflict |
- |
stop_chat_message
stop_chat_message(question_id)
Stop a streaming chat response immediately.
Immediately stops/cancels the streaming generation of a chat message response. This may result in an incomplete sentence or thought.
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.ChatApi(api_client)
question_id = 'question_id_example' # str | The ID of the chat question to stop.
try:
# Stop a streaming chat response immediately.
await api_instance.stop_chat_message(question_id)
except Exception as e:
print("Exception when calling ChatApi->stop_chat_message: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
question_id |
str |
The ID of the chat question to stop. |
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 |
- |
unarchive_chat_session
unarchive_chat_session(session_id)
Unarchive a chat session.
Admin-only endpoint to restore an archived chat session to active state.
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.ChatApi(api_client)
session_id = 'session_id_example' # str | Id of the chat session
try:
# Unarchive a chat session.
await api_instance.unarchive_chat_session(session_id)
except Exception as e:
print("Exception when calling ChatApi->unarchive_chat_session: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
session_id |
str |
Id of the chat session |
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 |
- |
404 |
Chat session not found or not archived |
- |
update_chat_session
ChatSession update_chat_session(session_id, chat_session_update_request)
Updates the name of a chat session.
Updates the name of a chat session.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.chat_session import ChatSession
from h2ogpte.rest_async.models.chat_session_update_request import ChatSessionUpdateRequest
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.ChatApi(api_client)
session_id = 'session_id_example' # str | Id of the chat session
chat_session_update_request = h2ogpte.rest_async.ChatSessionUpdateRequest() # ChatSessionUpdateRequest |
try:
# Updates the name of a chat session.
api_response = await api_instance.update_chat_session(session_id, chat_session_update_request)
print("The response of ChatApi->update_chat_session:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChatApi->update_chat_session: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
session_id |
str |
Id of the chat session |
|
chat_session_update_request |
Return type
HTTP request headers
Content-Type: application/json
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 |
- |
update_chat_session_collection
ChatSession update_chat_session_collection(session_id, collection_change_request)
Updates a collection reference of a chat session.
Updates a collection reference of a chat session.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.chat_session import ChatSession
from h2ogpte.rest_async.models.collection_change_request import CollectionChangeRequest
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.ChatApi(api_client)
session_id = 'session_id_example' # str | Id of the chat session
collection_change_request = h2ogpte.rest_async.CollectionChangeRequest() # CollectionChangeRequest |
try:
# Updates a collection reference of a chat session.
api_response = await api_instance.update_chat_session_collection(session_id, collection_change_request)
print("The response of ChatApi->update_chat_session_collection:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChatApi->update_chat_session_collection: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
session_id |
str |
Id of the chat session |
|
collection_change_request |
Return type
HTTP request headers
Content-Type: application/json
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 |
- |
update_chat_session_expiry_date
update_chat_session_expiry_date(session_id, update_expiry_date_request)
Updates an expiry date of a chat session.
Updates an expiry date of a chat session.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.update_expiry_date_request import UpdateExpiryDateRequest
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.ChatApi(api_client)
session_id = 'session_id_example' # str | Id of the chat session
update_expiry_date_request = h2ogpte.rest_async.UpdateExpiryDateRequest() # UpdateExpiryDateRequest |
try:
# Updates an expiry date of a chat session.
await api_instance.update_chat_session_expiry_date(session_id, update_expiry_date_request)
except Exception as e:
print("Exception when calling ChatApi->update_chat_session_expiry_date: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
session_id |
str |
Id of the chat session |
|
update_expiry_date_request |
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_chat_session_keep_forever
update_chat_session_keep_forever(session_id, update_chat_session_keep_forever_request)
Updates the keep_forever flag of a chat session.
Sets or unsets the keep_forever flag to preserve a chat session from auto-archival.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.update_chat_session_keep_forever_request import UpdateChatSessionKeepForeverRequest
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.ChatApi(api_client)
session_id = 'session_id_example' # str | Id of the chat session
update_chat_session_keep_forever_request = h2ogpte.rest_async.UpdateChatSessionKeepForeverRequest() # UpdateChatSessionKeepForeverRequest |
try:
# Updates the keep_forever flag of a chat session.
await api_instance.update_chat_session_keep_forever(session_id, update_chat_session_keep_forever_request)
except Exception as e:
print("Exception when calling ChatApi->update_chat_session_keep_forever: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
session_id |
str |
Id of the chat session |
|
update_chat_session_keep_forever_request |
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_chat_session_prompt_template
ChatSession update_chat_session_prompt_template(session_id, prompt_template_change_request)
Updates a prompt template reference of a chat session.
Updates a prompt template reference of a chat session.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.chat_session import ChatSession
from h2ogpte.rest_async.models.prompt_template_change_request import PromptTemplateChangeRequest
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.ChatApi(api_client)
session_id = 'session_id_example' # str | Id of the chat session
prompt_template_change_request = h2ogpte.rest_async.PromptTemplateChangeRequest() # PromptTemplateChangeRequest |
try:
# Updates a prompt template reference of a chat session.
api_response = await api_instance.update_chat_session_prompt_template(session_id, prompt_template_change_request)
print("The response of ChatApi->update_chat_session_prompt_template:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling ChatApi->update_chat_session_prompt_template: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
session_id |
str |
Id of the chat session |
|
prompt_template_change_request |
Return type
HTTP request headers
Content-Type: application/json
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 |
- |
update_question_answer_feedback
update_question_answer_feedback(answer_id, update_qa_feedback_request)
Update feedback for a specific answer to a question.
Update feedback for a specific answer to a question.
Example
Bearer Authentication (bearerAuth):
import h2ogpte.rest_async
from h2ogpte.rest_async.models.update_qa_feedback_request import UpdateQAFeedbackRequest
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.ChatApi(api_client)
answer_id = 'answer_id_example' # str | Unique identifier of and answer connected with a feedback.
update_qa_feedback_request = h2ogpte.rest_async.UpdateQAFeedbackRequest() # UpdateQAFeedbackRequest |
try:
# Update feedback for a specific answer to a question.
await api_instance.update_question_answer_feedback(answer_id, update_qa_feedback_request)
except Exception as e:
print("Exception when calling ChatApi->update_question_answer_feedback: %s\n" % e)
Parameters
Name |
Type |
Description |
Notes |
|---|---|---|---|
answer_id |
str |
Unique identifier of and answer connected with a feedback. |
|
update_qa_feedback_request |
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 |
- |