* [misc] enhance AI chat functionality by adding 'chatType' parameter to message payload and updating initialization options in the browse mini program.
This commit is contained in:
@@ -108,7 +108,8 @@ function clearErrorTip()
|
||||
*/
|
||||
function sendMessagesToAI(message, renew)
|
||||
{
|
||||
aiChatView.$.postMessage(message, renew ? 'NEW' : undefined);
|
||||
const chatID = (renew || aiChatView.$.chat.$local.id) ? 'NEW' : undefined;
|
||||
aiChatView.$.postMessage({content: message, chatType: 'miniprogram'}, chatID);
|
||||
}
|
||||
|
||||
window.aiBrowseMiniProgram.initAIChatView = function(options)
|
||||
|
||||
@@ -218,7 +218,7 @@ div(
|
||||
setID('aiChatView'),
|
||||
setClass('shadow rounded flex-1 ring'),
|
||||
on::init()->call('window.aiBrowseMiniProgram.initAIChatView', array(
|
||||
'creatingChat' => array('title' => $miniProgram->name),
|
||||
'creatingChat' => array('title' => $miniProgram->name, 'chatType' => 'miniprogram'),
|
||||
'noContexts' => true,
|
||||
'hideHeader' => true,
|
||||
'sendbox' => array('placeholder' => $lang->aiapp->continueasking),
|
||||
|
||||
Reference in New Issue
Block a user