|
|
@@ -96,13 +96,14 @@ class BxDolAIAssistant extends BxDol
|
|
|
'onclick' => "javascrip:bx_agents_action(this, 'asst', 'ask', {id: " . $this->_iId . ", text: '" . $sText . "'})"
|
|
|
]);
|
|
|
}
|
|
|
-
|
|
|
- public function getAskChat($sName = '', $sText = '', $oTemplate = false)
|
|
|
+
|
|
|
+ public function getAskChat($sName = '', $sDescription = '', $sText = '', $oTemplate = false)
|
|
|
{
|
|
|
if(!$oTemplate)
|
|
|
$oTemplate = BxDolTemplate::getInstance();
|
|
|
|
|
|
$bName = !empty($sName);
|
|
|
+ $bDescription = !empty($sDescription);
|
|
|
$bText = !empty($sText);
|
|
|
|
|
|
$iChatId = 0;
|
|
|
@@ -113,13 +114,22 @@ class BxDolAIAssistant extends BxDol
|
|
|
}
|
|
|
|
|
|
if(empty($iChatId)) {
|
|
|
- if(!$bName)
|
|
|
- $sName = self::getChatName($bText ? strmaxtextlen($sText, 8) : genRndPwd());
|
|
|
+ if(!$bName) {
|
|
|
+ if($bDescription)
|
|
|
+ $sName = strmaxtextlen(_t($sDescription), 8);
|
|
|
+ else if($bText)
|
|
|
+ $sName = strmaxtextlen($sText, 8);
|
|
|
+ else
|
|
|
+ $sName = genRndPwd();
|
|
|
+
|
|
|
+ $sName = self::getChatName($sName);
|
|
|
+ }
|
|
|
|
|
|
$iChatId = $this->_oDb->insertChat([
|
|
|
'name' => $sName,
|
|
|
'type' => BX_DOL_AI_ASST_TYPE_TRANSIENT,
|
|
|
'assistant_id' => $this->_iId,
|
|
|
+ 'description' => $sDescription,
|
|
|
'added' => time(),
|
|
|
]);
|
|
|
}
|
|
|
@@ -143,7 +153,7 @@ class BxDolAIAssistant extends BxDol
|
|
|
|
|
|
public function getAskBlock($aParams = [])
|
|
|
{
|
|
|
- return $this->getAskChat();
|
|
|
+ return $this->getAskChat('sys_block_assistant', '_sys_agents_assistants_chat_dsc_block');
|
|
|
}
|
|
|
|
|
|
public function deleteChat($mixedChat)
|
|
|
@@ -248,6 +258,7 @@ class BxDolAIAssistant extends BxDol
|
|
|
'name' => self::getChatName(strmaxtextlen($sText, 8)),
|
|
|
'type' => BX_DOL_AI_ASST_TYPE_TRANSIENT,
|
|
|
'assistant_id' => $this->_iId,
|
|
|
+ 'description' => '_sys_agents_assistants_chat_dsc_live_search',
|
|
|
'added' => time(),
|
|
|
]);
|
|
|
|