Add Groq API as an AI provider

This commit is contained in:
Wojtek
2026-10-16 22:00:28 +02:00
parent 032ffeb9da
commit 8045698072
13 changed files with 99 additions and 33 deletions
@@ -18,7 +18,7 @@ class ResultsModel extends ListModel
$item->ai_output_tokens = 0;
$item->ai_total_tokens = 0;
$item->ai_cost_usd = 0.0;
$item->ai_tokens_by_provider = ['openai' => 0, 'grok' => 0];
$item->ai_tokens_by_provider = ['openai' => 0, 'grok' => 0, 'groq' => 0];
$answers = json_decode((string) ($item->answers ?? ''), true);
if (!is_array($answers)) {
@@ -68,7 +68,7 @@ class ResultsModel extends ListModel
'output_tokens' => 0,
'total_tokens' => 0,
'cost_usd' => 0.0,
'providers' => ['openai' => $emptyProviderTotals, 'grok' => $emptyProviderTotals],
'providers' => ['openai' => $emptyProviderTotals, 'grok' => $emptyProviderTotals, 'groq' => $emptyProviderTotals],
];
foreach ($answersRows as $answersJson) {