• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/connector/ai.php
  • Класс: BitrixLandingConnectorAi
  • Вызов: Ai::onBeforeCompletions
static function onBeforeCompletions(Event $event): EventResult
{
	/** @var IEngine $engine */
	$engine = $event->getParameter('engine');
	$category = $engine->getCategory();
	$module = $engine->getContext()->getModuleId();

	$config = new TuningManager();
	$configItem = $config->getItem("{$module}_allow_{$category}_generate");

	if ($configItem && $configItem->getValue())
	{
		return new EventResult(EventResult::SUCCESS);
	}
	else
	{
		return new EventResult(EventResult::ERROR);
	}
}