From fc60e4ece8b0d9fca8814bc91dec5a4f919580ea Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Mon, 11 May 2026 09:30:15 -0500 Subject: [PATCH] fix(llm): increase receive_timeout to 120s and allow per-call override MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The network insight prompt is large and max_tokens is 1500 — DeepSeek takes longer than 30s. Also plumb opts[:receive_timeout] through so workers can tune it. --- lib/towerops/llm/deepseek.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/towerops/llm/deepseek.ex b/lib/towerops/llm/deepseek.ex index f5119b30..38a4e182 100644 --- a/lib/towerops/llm/deepseek.ex +++ b/lib/towerops/llm/deepseek.ex @@ -14,7 +14,7 @@ defmodule Towerops.LLM.DeepSeek do @default_base_url "https://api.deepseek.com/v1" @default_model "deepseek-v4-pro" - @receive_timeout 30_000 + @receive_timeout 120_000 @impl true def complete(messages, opts \\ []) do @@ -55,7 +55,7 @@ defmodule Towerops.LLM.DeepSeek do url: base_url <> "/chat/completions", json: body, headers: [{"authorization", "Bearer " <> api_key}], - receive_timeout: @receive_timeout + receive_timeout: opts[:receive_timeout] || @receive_timeout ) case Req.request(req_opts) do