1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
AiAssistantBaseChat.php
См. документацию.
1<?php
2
3declare(strict_types=1);
4
6
15
16abstract class AiAssistantBaseChat extends GroupChat
17{
19
20 public function __construct($source = null)
21 {
22 $this->aiAssistantService = ServiceLocator::getInstance()->get(AiAssistantService::class);
23 parent::__construct($source);
24 }
25
26 public function add(array $params, ?Context $context = null): Result
27 {
28 if (!Features::isAiAssistantChatCreationAvailable())
29 {
30 return (new Result())->addError(new ChatError(ChatError::AI_ASSISTANT_NOT_AVAILABLE));
31 }
32
33 $params['USERS'][] = $this->aiAssistantService->getBotId();
34
35 return parent::add($params, $context);
36 }
37
38 protected function sendMessageUsersAdd(array $usersToAdd, AddUsersConfig $config): void
39 {
40 $aiAssistantBotId = $this->aiAssistantService->getBotId();
41 unset($usersToAdd[$aiAssistantBotId]);
42 parent::sendMessageUsersAdd($usersToAdd, $config);
43 }
44}
sendMessageUsersAdd(array $usersToAdd, AddUsersConfig $config)
Определения AiAssistantBaseChat.php:38
add(array $params, ?Context $context=null)
Определения AiAssistantBaseChat.php:26
AiAssistantService $aiAssistantService
Определения AiAssistantBaseChat.php:18
const AI_ASSISTANT_NOT_AVAILABLE
Определения ChatError.php:29
Определения result.php:20
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$context
Определения csv_new_setup.php:223
Определения culture.php:9
$config
Определения quickway.php:69
if($inWords) echo htmlspecialcharsbx(Number2Word_Rus(roundEx($totalVatSum $params['CURRENCY']
Определения template.php:799