/
v.bolshakov
/
AIEcosystem-Testing
Обзор
Документация
Войти
/
v.bolshakov
/
AIEcosystem-Testing
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
dev
common/forms/ews/EwsAssistantForm.php
51 строка
1 KB
Developer
Initial commit
03 авг 2026, 17:43
03 авг 2026, 17:43
7433917
Код
Авторство
О чём код?
<?php namespace common\forms\ews; use common\forms\ai\BaseRequestAssistantForm; use common\helpers\ArrayHelper; use Yii; use yii\helpers\Json; use yii\helpers\VarDumper; /** * Запрос к ассистенту * * @author Dmitry E. Semenov <sde.tomsk@gmail.com> * @copyright Self (c) 2025 */ class EwsAssistantForm extends BaseRequestAssistantForm { /** * @inheritdoc */ protected function afterSave($result) { parent::afterSave($result); // TODO: Change the autogenerated stub if ($result) { $response = (array)$this->model; $response_text = ArrayHelper::remove($response, 'text'); $response_json = str_replace(['```json', '```'], ['', ''], $response_text); $json = Json::decode($response_json); $this->model['json'] = $json; } } /** * @inheritdoc */ public function proccessBatch($index, $done, $attempt, $error) { Yii::debug(VarDumper::dumpAsString([ 'index' => $index, 'done' => $done, 'attempt' => $attempt, 'error' => $error ])); return true; } }