AI Engine Chat API
Most of the endpoints depends on various instances and are considered parameters for the actual endpoint, but these are not meant to be passed directly by the user.
Instead, these instance-dependent elements are integrated and managed directly by the backend system. We refer to them as *name_parameter
, where the asterisk (*) is used to denote a specific instance-dependent parameter that the route relies on.
Mind that: to access these APIs, user must be authenticated and have the correct permissions.
Overview
The AI Engine Chat API allows you to interact with the DeltaV backend, allowing you to interact with your agents and more.
EndpointsGET /v1beta1/engine/chat/sessions POST /v1beta1/engine/chat/sessions DELETE /v1beta1/engine/chat/sessions/:session_id POST /v1beta1/engine/chat/sessions/:session_id/submit GET /v1beta1/engine/chat/sessions/:session_id/responses (Deprecated) GET /v1beta1/engine/chat/sessions/:session_id/messages (Deprecated) GET /v1beta1/engine/chat/sessions/:session_id/messages/all GET /v1beta1/engine/chat/sessions/:session_id/new-messages POST /v1beta1/engine/chat/sessions/:session_id/feedback GET /v1beta1/engine/chat/remaining_tokens
Starting your session
Request
- Name
payload
- Type
- JSON
- Required
- required
- Description
- Contains the data for the type of payload being sent.
- Name
email
- Type
- Required
- required
- Description
- The email of the user
- Name
requestModel
- Type
- string
- Required
- required
- Description
- The request model wherein the user wants to interact.
- Name
functionGroup
- Type
- string
- Required
- required
- Description
- The function group that the user wants to interact with. Previously known as service_group. Defaults to Public group!
Responses
Get all sessions for a user
Request
Responses
Sending a new message
There are 4 types of messages that can be sent to the backend:
start
: This is the first message that should be sent to the AI Engine for full session (search + execution). It contains the objective and context of the conversation. The objective and context are used to determine which agent to use for the conversation.execute_functions
: This is the first message that should be sent to the AI Engine for execution only (no search). It contains the list of function-ids you want to execute and a function group (for secondary function picks).user_message
: This is a message sent by the user.user_json
: This is a JSON message sent by the user.stop
: This is the last message that should be sent to the backend. It indicates that the conversation has ended.
IMPORTANT: you need to either send start
or execute_functions
. These two can't be combined.
Sending start message
Request
- Name
payload
- Type
- JSON
- Required
- required
- Description
- Contains the data for the type of message being sent.
- Name
type
- Type
- string
- Required
- required
- Description
- The type of message being sent. For starting the session set it to 'start'.
- Name
objective
- Type
- string
- Required
- required
- Description
- The objective of the conversation. This is used to determine which agent to use for the conversation.
- Name
context
- Type
- string
- Required
- required
- Description
- The context of the conversation. This is used to give information about the user to the agent.
- Name
recommend_only
- Type
- boolean
- Required
- required
- Description
- Optional flag, if is set to true, AI Engine will only do search, it will match your objective to functions/agents and then stops. False by default. Only supported by Next Generation personality.
- Name
session_id
- Type
- string
- Required
- required
- Description
- The session ID, obtained from the Create Session API, uniquely identifies a session
Responses
Sending execute functions message
Request
- Name
payload
- Type
- JSON
- Required
- required
- Description
- Contains the data for the type of message being sent.
- Name
type
- Type
- string
- Required
- required
- Description
- The type of message being sent. Set it to 'execute_functions'.
- Name
functions
- Type
- string[]
- Required
- required
- Description
- List of function ids you want the system to execute.
- Name
objective
- Type
- string
- Required
- required
- Description
- The objective of the conversation. This will guide context building.
- Name
context
- Type
- string
- Required
- required
- Description
- The context of the conversation. This is used to give information about the user to the agent.
- Name
session_id
- Type
- string
- Required
- required
- Description
- The session ID, obtained from the Create Session API, uniquely identifies a session
Responses
Sending user message
Request
- Name
payload
- Type
- JSON
- Required
- required
- Description
- Contains the data for the type of message being sent.
- Name
type
- Type
- string
- Required
- required
- Description
- The type of message being sent.
- Name
user_message
- Type
- string
- Required
- required
- Description
- The user response to a question asked by the agent or to confirm the context
- Name
session_id
- Type
- string
- Required
- required
- Description
- The session ID, obtained from the Create Session API, uniquely identifies a session
Responses
Sending user json message
Request
- Name
payload
- Type
- JSON
- Required
- required
- Description
- Contains the data for the type of message being sent. The payload is different for each type of message.
- Name
type
- Type
- string
- Required
- required
- Description
- The type of message being sent.
- Name
user_json
- Type
- JSON
- Required
- required
- Description
- The objective of the conversation. This is used to determine which agent to use for the conversation.
- Name
user_json-type
- Type
- string
- Required
- required
- Description
- The context of the conversation. type: `task_list`, `options`. `task_list` is used to select a task pertaining to a specific agent. `options` is used to select a subtask pertaining to a specific agent or select an option from a list of suggestions given by the agent.
- Name
user_json-selection
- Type
- array
- Required
- required
- Description
- The selection of the user from the list of options. The selection is an array of integers or UUID4
- Name
session_id
- Type
- string
- Required
- required
- Description
- The session ID, obtained from the Create Session API, uniquely identifies a session
Responses
Sending stop message
Request
- Name
payload
- Type
- JSON
- Required
- required
- Description
- Contains the data for the type of message being sent. The payload is different for each type of message.
- Name
type
- Type
- string
- Required
- required
- Description
- The type of message being sent.
- Name
session_id
- Type
- string
- Required
- required
- Description
- The session ID, obtained from the Create Session API, uniquely identifies a session
Responses
Delete a session for a user
Request
Responses
Fetch new messages sent by agent Deprecated
Request
Responses
Fetch recent messages given a timestamp Deprecated
Request
- Name
from_timestamp
- Type
- datetime
- Required
- optional
- Description
- The timestamp from which to fetch the agent messages. The timestamp is in ISO 8601 format.
- Name
session_id
- Type
- string
- Required
- required
- Description
- The session ID, obtained from the Create Session API, uniquely identifies a session
Responses
Fetch all messages sent by an Agent in a session
Request
- Name
session_id
- Type
- string
- Required
- required
- Description
- The unique identifier of the chat session for which all messages are being retrieved.
Responses
Retrieve new messages sent by Agent (with possible duplicate or missed messages)
Request
- Name
session_id
- Type
- UUID4
- Required
- required
- Description
- The unique identifier of the chat session. It must be a valid UUID4 string.
- Name
last_message_id
- Type
- string
- Required
- optional
- Description
- The message ID of the last message that was retrieved. This is optional and, if provided, the service will return messages that were sent after this message.
Responses
Provide feedback for a session
Request
- Name
models
- Type
- array
- Required
- required
- Description
- Contains the list of models that the user wants to query for remaining tokens. It is an array of strings where each string is the name of the model.
- Name
feedback
- Type
- string
- Required
- required
- Description
- The feedback of the user. It can be positive or negative.
- Name
session_id
- Type
- string
- Required
- required
- Description
- The session ID, obtained from the Create Session API, uniquely identifies a session
Responses
Retrieve remaining tokens
Request
- Name
models
- Type
- array
- Required
- required
- Description
- Contains the list of models that the user wants to query for remaining tokens. It is an array of strings where each string is the name of the model.
- Name
email
- Type
- string
- Required
- required
- Description
- The email of the user