Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
controller.php
1
<?php
2
3
namespace
Bitrix\Sender\Integration\AI
;
4
5
use Bitrix\AI\Context;
6
use Bitrix\AI\Engine;
7
use
Bitrix\Main\Config\Option
;
8
use
Bitrix\Main\Loader
;
9
10
final
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
}
Bitrix\Main\Config\Option
Definition
option.php:15
Bitrix\Main\Loader
Definition
loader.php:12
Bitrix\Sender\Integration\AI\Controller\IMAGE_CATEGORY
const IMAGE_CATEGORY
Definition
controller.php:13
Bitrix\Sender\Integration\AI\Controller\isAvailable
static isAvailable(string $category, string $contextId='')
Definition
controller.php:15
Bitrix\Sender\Integration\AI\Controller\TEXT_CATEGORY
const TEXT_CATEGORY
Definition
controller.php:12
Bitrix\Sender\Integration\AI
Definition
controller.php:3
Bitrix\Sender\Internals\QueryController
Definition
action.php:8
modules
sender
lib
integration
ai
controller.php
Создано системой
1.10.0