Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
controller.php
1<?php
2
4
5use Bitrix\AI\Context;
6use Bitrix\AI\Engine;
9
10final class Controller
11{
12 public const TEXT_CATEGORY = 'text';
13 public const IMAGE_CATEGORY = 'image';
14
15 public static function isAvailable(string $category, string $contextId = ''): bool
16 {
17 if (!Loader::includeModule('ai'))
18 {
19 return false;
20 }
21
22 $engine = Engine::getByCategory($category, new Context('sender', $contextId));
23 if (is_null($engine))
24 {
25 return false;
26 }
27
28 return Option::get('sender', 'ai_base_enabled', 'N') === 'Y';
29 }
30}
static isAvailable(string $category, string $contextId='')