1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Copilot.php
См. документацию.
1<?php
2
3namespace Bitrix\Im\V2\Controller\Chat;
4
5use Bitrix\Im\V2\Chat;
6use Bitrix\Im\V2\Controller\BaseController;
7use Bitrix\Im\V2\Controller\Filter\ChatTypeFilter;
8use Bitrix\Im\V2\Integration\AI\EngineManager;
9use Bitrix\Im\V2\Integration\AI\RoleManager;
10
12{
13 protected function getDefaultPreFilters(): array
14 {
15 return array_merge(
16 parent::getDefaultPreFilters(),
17 [
18 new ChatTypeFilter([Chat\CopilotChat::class]),
19 ]
20 );
21 }
22
26 public function updateRoleAction(Chat $chat, ?string $role = null): ?array
27 {
28 $result = (new RoleManager())->updateRole($chat, $role);
29
30 if (!$result->isSuccess())
31 {
32 $this->addErrors($result->getErrors());
33
34 return null;
35 }
36
37 return ['result' => true];
38 }
39
43 public function updateEngineAction(Chat $chat, string $engineCode): ?array
44 {
45 $result = (new EngineManager())->updateEngine($chat, $engineCode);
46
47 if (!$result->isSuccess())
48 {
49 $this->addErrors($result->getErrors());
50
51 return null;
52 }
53
54 return ['result' => true];
55 }
56}
updateRoleAction(Chat $chat, ?string $role=null)
Определения Copilot.php:26
updateEngineAction(Chat $chat, string $engineCode)
Определения Copilot.php:43
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14