AI Model Request

Component AI Model Request sends a request to the selected AI model, stores the response in a variable, and sends the AI-generated reply to the bot.

The operation of the AI Model Request component is largely similar to the ChatGPT OpenAI request component →

The main difference is that you can choose other AI models.

Configuring the Component

1. From the Components section on the right panel, drag the AI Model Request component onto the desired screen, or add it by double-clicking it.

The component is created with a default variable for storing the response: ai_answer. If necessary, you can change this name: open the component settings and enter a new value in the Response Variable Name field.

2. In the Provider field, select an AI model. Instead of selecting a model from the list, you can enter a URL. To do this, click the pencil icon to the right of the Provider field.

For most AI models, you do not need to specify a URL. The exceptions are Azure OpenAI and Amazon Bedrock. When either of these models is selected, an additional Request URL field will appear in the component settings, and it is required.

3. In the Access token field, enter the API token obtained from the settings of the selected AI model.

4. Select the model you want to use from the list. If no list is available for the selected provider, enter the model name manually.

5. In the Role drop-down list, choose the role that the AI assistant will perform.

  • system: A system message used to define the assistant’s behavior and instructions.
  • user: User messages that provide instructions to the assistant. These can be generated by end users of the chatbot.
  • assistant: Assistant messages used to preserve previous responses and conversation context.

6. In the Content field, enter the text you want to send to the AI model. You can also insert a variable that contains user input collected before the AI Model Request component is executed.

If you selected the user role, the screen may look like this:

7. You can leave the Max quantity of used tokens value at its default setting or adjust it to generate shorter or more detailed responses.

8. Specify a Variable name for the complete answer if you need to receive the complete response from the AI model. This field is optional.

9. Enable the Extend AI request cache retention checkbox if you need the conversation cache to be stored for 24 hours.

10. If necessary, expand the More Advanced Settings section and configure the required parameters.

11. If needed, configure the Success Screen and Error Screen for the request.

12. If required, display the AI model's response in a message. The response is inserted using double curly braces.

For example, if the AI response is stored in the ai_answer variable, you can display it in a bot message like this:

{{stringify ai_answer}}

The "Send user latest messages" option and Setting up roles in the AI Model Request component work the same way as in the OpenAI ChatGPT Request component ChatGPT OpenAI request →

To the beginning ↑