Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
252c72be3d | ||
|
|
42af47ea2e |
@@ -30,6 +30,6 @@ Szkielet komponentu Joomla 6 do gromadzenia pytań testowych.
|
|||||||
|
|
||||||
## Instalacja
|
## Instalacja
|
||||||
|
|
||||||
W Joomla wybierz **System → Install → Install from Folder** i wskaż ten katalog. Manifestem instalacyjnym jest `com_testquestions.xml` (wersja 1.43.28).
|
W Joomla wybierz **System → Install → Install from Folder** i wskaż ten katalog. Manifestem instalacyjnym jest `com_testquestions.xml` (wersja 1.43.30).
|
||||||
|
|
||||||
Po instalacji komponent jest dostępny w panelu administratora jako **Pytania testowe**.
|
Po instalacji komponent jest dostępny w panelu administratora jako **Pytania testowe**.
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
-- Wydanie 1.43.29: ograniczono czas generowania oceny przez Gemini.
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
-- Wydanie 1.43.30: odczyt tokenów Gemini z pola usageMetadata.
|
||||||
@@ -74,7 +74,11 @@ class AiService
|
|||||||
],
|
],
|
||||||
'gemini' => [
|
'gemini' => [
|
||||||
'contents' => [['parts' => [['text' => $input]]]],
|
'contents' => [['parts' => [['text' => $input]]]],
|
||||||
'generationConfig' => ['responseMimeType' => 'application/json'],
|
'generationConfig' => [
|
||||||
|
'maxOutputTokens' => 256,
|
||||||
|
'responseMimeType' => 'application/json',
|
||||||
|
'thinkingConfig' => ['thinkingLevel' => 'low'],
|
||||||
|
],
|
||||||
],
|
],
|
||||||
default => [
|
default => [
|
||||||
'model' => $model,
|
'model' => $model,
|
||||||
@@ -100,7 +104,7 @@ class AiService
|
|||||||
$config['url'],
|
$config['url'],
|
||||||
$payload,
|
$payload,
|
||||||
$headers,
|
$headers,
|
||||||
60
|
$provider === 'gemini' ? 25 : 60
|
||||||
);
|
);
|
||||||
$body = json_decode((string) $response->body, true);
|
$body = json_decode((string) $response->body, true);
|
||||||
|
|
||||||
@@ -143,7 +147,9 @@ class AiService
|
|||||||
|
|
||||||
private function getUsage(array $body, string $provider, string $model): ?array
|
private function getUsage(array $body, string $provider, string $model): ?array
|
||||||
{
|
{
|
||||||
$usage = $body['usage'] ?? null;
|
// Gemini uses camelCase UsageMetadata at the response root; the
|
||||||
|
// OpenAI-compatible providers return their counters in `usage`.
|
||||||
|
$usage = $body['usageMetadata'] ?? $body['usage'] ?? null;
|
||||||
if (!is_array($usage)) {
|
if (!is_array($usage)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
<creationDate>2026-10-14</creationDate>
|
<creationDate>2026-10-14</creationDate>
|
||||||
<author>Komponent</author>
|
<author>Komponent</author>
|
||||||
<license>GNU General Public License version 2 or later</license>
|
<license>GNU General Public License version 2 or later</license>
|
||||||
<version>1.43.28</version>
|
<version>1.43.30</version>
|
||||||
<description>COM_TESTQUESTIONS_DESCRIPTION</description>
|
<description>COM_TESTQUESTIONS_DESCRIPTION</description>
|
||||||
<element>com_testquestions</element>
|
<element>com_testquestions</element>
|
||||||
<namespace path="src">Komponent\Component\Testquestions</namespace>
|
<namespace path="src">Komponent\Component\Testquestions</namespace>
|
||||||
|
|||||||
Reference in New Issue
Block a user