* [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:
sunhao
2025-10-09 13:35:37 +08:00
parent 1612b35ab2
commit 83b0a1951c
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -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)
+1 -1
View File
@@ -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),