<?php
 namespace Modules\Reports\AriaReports\Model\AnalyzeReport; class Request extends \Modules\Reports\AriaReports\Model\RequestAbstract { public string $aiModel = 'gpt-4.1-mini'; protected string $userPrompt = 'Analyze the following pivot table. Return a short interpretation.'; protected array $pivotTableContent; public function setPivotTableContent(array $pivotTableContent): void { $this->pivotTableContent = $pivotTableContent; } protected function init(): void { $this->systemRole = trim('
You are helping me interpret the results of a pivot table. You may include political/geo-political or economical implications when analyzing the data but consider the interval that was used and the events that took place at that moment, if you think they are relevant for the analysis. 
Treat nulls as transactions that are missing for that certain cell - do not mention the word "null" in your output.
If I am analzing current year or previous year, your output should also help me decide what to do in the future based on previous data.
'); $offListObj = new \App\EntityList\Offices(); $offListObj->setFilter('countryCode', '!=', ''); $offListObj->setColumns(['countryCode']); $offList = $offListObj->exportRecordsByColumn('countryCode'); if ($offList) { $this->systemRole .= "\n" . sprintf('These are the ISO country codes where my agency has offices: %s.', implode(', ', array_unique($offList)) ); } $this->systemRole .= "\n" . 'Do not engage the user in next prompts.'; } protected function populateBody(array &$body): void { if (!isset($this->pivotTableContent)) { throw new \RuntimeException('No pivot table content set.'); } $body['input'][] = [ 'type' => 'message', 'role'=>'user', 'content' => json_encode($this->pivotTableContent), ]; } } 