If you would like to set the parameters in the code instead of the shortcode or chatbot settings, you can use the mwai_chatbot_params filter. Here is an example:
add_filter( 'mwai_chatbot_params', function( $params ) {
// Force specific settings
$params['temperature'] = 0.7;
$params['maxTokens'] = 500;
return $params;
});
The filter runs on your server, at two moments: when the chatbot is displayed (it then receives the shortcode attributes), and every time a message is sent (it then receives all the settings of the chatbot). The second one is what shapes the request sent to the AI. There, the keys are the chatbot settings in camelCase: botId, instructions, model, envId, temperature, maxTokens, and so on.
So, to change only one chatbot, check its ID. Since botId is only there when a message is sent, this also leaves the displayed chatbot alone:
add_filter( 'mwai_chatbot_params', function( $params ) {
if ( ( $params['botId'] ?? '' ) === 'support' && is_user_logged_in() ) {
// Logged-in users get a bigger answer length on the "support" chatbot
$params['maxTokens'] = 4096;
}
return $params;
});
Since this happens on the server, it is the safe way to change sensitive settings like the instructions, the model or the API key. Shortcode attributes for those are restricted since AI Engine 3.8.4 (see Shortcode Overwrite), and visitors can never change them from their browser.