open_ai
The "open_ai" action allows the bot to get responses from the OpenAI (ChatGPT) for the visitor's questions. To use this action, OpenAI-SalesIQ integration is mandatory.
Channel compatibility
Payload
- config
- command - A command to make ChatGPT behave based on specific instructions. For example, if the "Translate to French" is passed as a command, the action will translate the user's/visitor's reply to French.
- openai_failure - Define the action to handle when open_ai fails.
- first_input
- type - (prompt_message/last_message) type of input for the open_ai action.
- prompt - Allows the bot to send a message prompting the visitors for a response and use it as input ("prompt_message" is required).
- last_message - The bot will take the visitor's last message as the input.
- prompt_message - The message to be sent/prompt to the visitor for input.
- type - (prompt_message/last_message) type of input for the open_ai action.
- user_actions
- text - The name of the suggestions/buttons.
- response - The response/reply when the visitor clicks on the suggestions/buttons.
Syntax
Copied{
"action": "open_ai",
"config": {
"ai_engine_model": "gpt-3.5-turbo|gpt-4",
"command": "Translate to French",
"failure_handler": {
"enabled": true,
"openai_failure": {
"action": "reply",
"replies": [
"Oops! We're facing some technical issues"
]
}
},
"first_input": {
"type": "prompt",
"prompt_message": {
"replies": [
{
"text": "How can I help?"
}
]
}
},
"user_actions": [
{
"enabled": true,
"response": "Connection you to an agent...",
"text": "Connect to agent",
"action": "reply"
}
]
}
}