fix(llm): increase receive_timeout to 120s and allow per-call override

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.
This commit is contained in:
Graham McIntire 2026-05-11 09:30:15 -05:00
parent a05907b76d
commit fc60e4ece8

View file

@ -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