Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
AIHelper.php
1<?php
2
4
6
8{
9 public const CONTEXT_MODULE = 'im';
10 public const CONTEXT_ID = 'copilot_chat';
11
12 public static function getProviderName(): ?string
13 {
14 if (!Loader::includeModule('ai'))
15 {
16 return null;
17 }
18
19 if (!isset(\Bitrix\AI\Engine::CATEGORIES['text']))
20 {
21 return null;
22 }
23
24 $engine = \Bitrix\AI\Engine::getByCategory(\Bitrix\AI\Engine::CATEGORIES['text'], \Bitrix\AI\Context::getFake());
25 if (isset($engine))
26 {
27 return $engine->getIEngine()->getName();
28 }
29
30 return null;
31 }
32}