From ba8ad9248d33e6f8ec49fc0c2474cce48aa45505 Mon Sep 17 00:00:00 2001 From: "Misha M.-Kupriyanov" Date: Tue, 3 Feb 2026 14:59:28 +0100 Subject: [PATCH] fix(OpenAiAPIService): correct text processing time update method This commit fixes a bug where the method updateExpTextProcessingTime incorrectly called getExpImgProcessingTime. The change ensures that text and image processing times are tracked independently. Additionally, unit tests have been added to verify the correct functionality of processing time tracking for both text and image generations. Signed-off-by: Misha M.-Kupriyanov --- lib/Service/OpenAiAPIService.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Service/OpenAiAPIService.php b/lib/Service/OpenAiAPIService.php index 9c643869..64f21866 100644 --- a/lib/Service/OpenAiAPIService.php +++ b/lib/Service/OpenAiAPIService.php @@ -953,7 +953,7 @@ public function getExpTextProcessingTime(): int { * @return void */ public function updateExpTextProcessingTime(int $runtime): void { - $oldTime = floatval($this->getExpImgProcessingTime()); + $oldTime = floatval($this->getExpTextProcessingTime()); $newTime = (1.0 - Application::EXPECTED_RUNTIME_LOWPASS_FACTOR) * $oldTime + Application::EXPECTED_RUNTIME_LOWPASS_FACTOR * floatval($runtime); if ($this->isUsingOpenAi()) {