Manages the fleet around the runtime: the queue a conversation waits in, the configuration each agent runs from, and the tasks raised for a person when a conversation needs one.
Used when
Wherever a conversation has to wait, escalate, or be picked up by someone.
Collects
The queue a conversation belongs to, and its state.
The configuration version each agent is running.
Returns
The queue position and the state transitions.
The task raised for a person, and the answer that closed it.
Evidence
chatbot-queues
chatbot-asana-tasks
chatbot-assistant-template
Operations
ChatMTG
POST/functions
Create Function
createFunction
Create a function that can be invoked by GPT in the conversation based on user input by calling a webhook URL
with some values for the parameters defined in the function.
Learn more about functions in the GPT documentation.
Request
application/json
{
"name": "execute_sql_query",
"description": "Use this to execute Trino SQL query using AWS Athena Engine version 3. In case of error you will get error message, you have to fix your query and try again. You can apply JOIN opperations. You should use only columns from get_database_schema function. You should use columns only for it's tables. You can join tables if needed using provided columns. You should check that column is not empty string before casting it to avoid errors like this INVALID_CAST_ARGUMENT: Cannot cast '' to BIGINT. You should never compare numbers with strings.You should NEVER call this function before get_database_schema has been called in the conversation. You should NEVER use columns names of the wrong table. You should NEVER cast comare number types to strings or char. You should ALWAYS limit query results by maximum 50. You should NEVER compare fields to NULL.",
"parameters": {
"type": "object",
"properties": {
"sql_query": {
"type": "string",
"description": "SQL query, that user asked. Table names has to be inside \"\". Subqueries are only supported for EXISTS, IN and Scalar subquery, A scalar subquery is a non-correlated subquery that returns zero or one row. It is an error for the subquery to produce more than one row. The returned value is NULL if the subquery produces no rows. Example: SELECT COUNT(*) FROM \"first-american-listings\" WHERE facalculateddaysonmarket != '' AND CAST(\"facalculateddaysonmarket\" as BIGINT) > 15. Example: {\"sql_query\": \"SELECT mtg1lender, COUNT(*) as count FROM \"table_09_fulllaunch-first-american-equity-broker-listings-assesor\" WHERE currentoriginallistingdate >= '2022-03-20' GROUP BY mtg1lender ORDER BY count DESC LIMIT 5\"}. To get current date use current_date constant"
}
},
"required": [
"sql_query"
]
},
"webhook_url": "https://webhook.site/8efe8cf4-b7b5-4864-8b89-0302bf9749eb"
}
application/json
{
"name": "get_database_schema",
"description": "Use this function to get database schema of AWS Athena with columns and descriptions based what data should be retrived. You should ALWAYS use unfolded descriptions.",
"parameters": {
"type": "object",
"properties": {
"question": {
"type": "string",
"description": "what data should be retrived"
}
},
"required": [
"question"
]
},
"webhook_url": "https://webhook.site/8efe8cf4-b7b5-4864-8b89-0302bf9749eb"
}
Response
application/json
Function is created
{
"function": {
"name": "get_database_schema",
"description": "Use this function to get database schema of AWS Athena with columns and descriptions based what data should be retrived. You should ALWAYS use unfolded descriptions.",
"parameters": {
"type": "object",
"properties": {
"question": {
"type": "string",
"description": "what data should be retrived"
}
},
"required": [
"question"
]
},
"webhook_url": "https://webhook.site/8efe8cf4-b7b5-4864-8b89-0302bf9749eb"
}
}
application/json
Request data invalid
{
"message": "Request body is invalid."
}
application/json
Forbidden
{
"message": "Invalid Api Key"
}
Request bodyapplication/json
4 fields
Field
Type
Description
namerequired
string
Function name
descriptionrequired
string
Function description
parametersrequired
object
Function arguments
webhook_urlrequired
string
Url for function invocation
Response 201application/json
1 fields
Function is created
Field
Type
Description
function
object
Function configuration
namerequired
string
Function name
descriptionrequired
string
Function description
parametersrequired
object
Function arguments
webhook_urlrequired
string
Url for function invocation
Response 400application/json
1 fields
Request data invalid
Field
Type
Description
message
string
Error message
Response 403application/json
1 fields
Forbidden
Field
Type
Description
message
string
Error message
POST/system_prompt
Set System Prompt
setSystemPrompt
Set a system prompt for a ChatBot.
Request
application/json
{
"system_prompt": "You are ChatBot called ChatMTG by US Mortgage data company called staircase. You should help users with his question about the data. NEVER mention any table or column name."
}
Response
application/json
System prompt is created
{
"system_prompt": "You are ChatBot called ChatMTG by US Mortgage data company called staircase. You should help users with his question about the data. NEVER mention any table or column name."
}
application/json
Request data invalid
{
"message": "Request body is invalid."
}
application/json
Forbidden
{
"message": "Invalid Api Key"
}
Request bodyapplication/json
1 fields
Field
Type
Description
system_promptrequired
string
System prompt content
Response 200application/json
1 fields
System prompt is created
Field
Type
Description
system_promptrequired
string
System prompt content
Response 400application/json
1 fields
Request data invalid
Field
Type
Description
message
string
Error message
Response 403application/json
1 fields
Forbidden
Field
Type
Description
message
string
Error message
POST/temperature
Set Temperature
setTemperature
Set a GPT temperature for a chatbot. The temperature controls the randomness of the text generated by GPT model.
Lower temperatures make the model more deterministic and repetitive, while higher temperatures make the model more varied.
You can learn more about temperature in the GPT documentation.
Request
application/json
{
"temperature": 0.55
}
Response
application/json
System prompt is created
{
"temperature": 0.55
}
application/json
Request data invalid
{
"message": "Request body is invalid."
}
application/json
Forbidden
{
"message": "Invalid Api Key"
}
Request bodyapplication/json
1 fields
Field
Type
Description
temperaturerequired
number
GPT Temperature.
Response 200application/json
1 fields
System prompt is created
Field
Type
Description
temperaturerequired
number
GPT Temperature.
Response 400application/json
1 fields
Request data invalid
Field
Type
Description
message
string
Error message
Response 403application/json
1 fields
Forbidden
Field
Type
Description
message
string
Error message
GET/functions
List Functions
listFunction
Provides a list of registered functions.
Response
application/json
Functions
{
"functions": [
{
"name": "get_database_schema",
"description": "Use this function to get database schema of AWS Athena with columns and descriptions based what data should be retrived. You should ALWAYS use unfolded descriptions.",
"parameters": {
"type": "object",
"properties": {
"question": {
"type": "string",
"description": "what data should be retrived"
}
},
"required": [
"question"
]
},
"webhook_url": "https://webhook.site/8efe8cf4-b7b5-4864-8b89-0302bf9749eb"
}
]
}
application/json
Request data invalid
{
"message": "Request body is invalid."
}
application/json
Forbidden
{
"message": "Invalid Api Key"
}
Response 200application/json
1 fields
Functions
Field
Type
Description
functions
array
Functions
Response 400application/json
1 fields
Request data invalid
Field
Type
Description
message
string
Error message
Response 403application/json
1 fields
Forbidden
Field
Type
Description
message
string
Error message
GET/system_prompt
Get System Prompt
getSystemPrompt
Get a configured system prompt for a ChatBot.
Response
application/json
System prompt
{
"system_prompt": "You are chatbot called ChatMTG by US Mortgage data company called staircase. You should help users with his question about the data. NEVER mention any table or column name."
}
application/json
Request data invalid
{
"message": "Request body is invalid."
}
application/json
Forbidden
{
"message": "Invalid Api Key"
}
application/json
Resource is not found
{
"message": "Job not found."
}
Response 200application/json
1 fields
System prompt
Field
Type
Description
system_promptrequired
string
System prompt content
Response 400application/json
1 fields
Request data invalid
Field
Type
Description
message
string
Error message
Response 403application/json
1 fields
Forbidden
Field
Type
Description
message
string
Error message
Response 404application/json
1 fields
Resource is not found
Field
Type
Description
message
string
Error message
GET/temperature
Get Temperature
getTemperature
Get a configured GPT temperature for a ChatBot.
Response
application/json
Temperature
{
"temperature": 0.55
}
application/json
Request data invalid
{
"message": "Request body is invalid."
}
application/json
Forbidden
{
"message": "Invalid Api Key"
}
application/json
Resource is not found
{
"message": "Job not found."
}
Response 200application/json
1 fields
Temperature
Field
Type
Description
temperaturerequired
number
GPT Temperature.
Response 400application/json
1 fields
Request data invalid
Field
Type
Description
message
string
Error message
Response 403application/json
1 fields
Forbidden
Field
Type
Description
message
string
Error message
Response 404application/json
1 fields
Resource is not found
Field
Type
Description
message
string
Error message
GET/functions/{name}
Get Function
getFunction
Provides a configuration of the registered function.
Response
application/json
Function
{
"function": {
"name": "get_database_schema",
"description": "Use this function to get database schema of AWS Athena with columns and descriptions based what data should be retrived. You should ALWAYS use unfolded descriptions.",
"parameters": {
"type": "object",
"properties": {
"question": {
"type": "string",
"description": "what data should be retrived"
}
},
"required": [
"question"
]
},
"webhook_url": "https://webhook.site/8efe8cf4-b7b5-4864-8b89-0302bf9749eb"
}
}