From 55e11cb6494ec1aa36c459762f47a73370a65d8c Mon Sep 17 00:00:00 2001 From: davegilligan Date: Fri, 15 May 2026 09:38:55 +0200 Subject: [PATCH] Azure: route azure_mini engine to gpt-4o-mini explicitly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The .env default DBN_AZURE_OPENAI_CHAT_DEPLOYMENT is gpt-4o, so the azure_mini branch (which just called ->chat() without withDeployment) was silently hitting gpt-4o too. Both UI engine options resolved to the same model, and timed out together on long Norwegian documents. Fix: explicitly route azure_mini → gpt-4o-mini in both timeline and redact paths. Co-Authored-By: Claude Sonnet 4.6 --- includes/LegalTools.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/includes/LegalTools.php b/includes/LegalTools.php index 12ac451..4e546df 100644 --- a/includes/LegalTools.php +++ b/includes/LegalTools.php @@ -367,8 +367,8 @@ PROMPT; $response = $this->azure->withDeployment('gpt-4o')->chat($messages, $chatOptions); $deployLabel = 'gpt-4o'; } else { - $response = $this->azure->chat($messages, $chatOptions); - $deployLabel = $this->azure->chatDeployment(); + $response = $this->azure->withDeployment('gpt-4o-mini')->chat($messages, $chatOptions); + $deployLabel = 'gpt-4o-mini'; } } catch (Throwable $e) { dbnToolsAbort('LLM request failed: ' . $e->getMessage(), 502, 'llm_error'); @@ -1050,8 +1050,8 @@ PROMPT; $response = $this->azure->withDeployment('gpt-4o')->chat($messages, $chatOptions); $deployLabel = 'gpt-4o'; } else { - $response = $this->azure->chat($messages, $chatOptions); - $deployLabel = $this->azure->chatDeployment(); + $response = $this->azure->withDeployment('gpt-4o-mini')->chat($messages, $chatOptions); + $deployLabel = 'gpt-4o-mini'; } $content = (string)($response['choices'][0]['message']['content'] ?? '');