mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 16:30:57 +00:00
fix(media): propagate image timeout to providers
This commit is contained in:
@@ -938,10 +938,12 @@ function resolveOllamaModelHeaders(model: {
|
||||
|
||||
function resolveOllamaRequestTimeoutMs(
|
||||
model: object,
|
||||
options: { requestTimeoutMs?: unknown } | undefined,
|
||||
options: { requestTimeoutMs?: unknown; timeoutMs?: unknown } | undefined,
|
||||
): number | undefined {
|
||||
const raw =
|
||||
options?.requestTimeoutMs ?? (model as { requestTimeoutMs?: unknown }).requestTimeoutMs;
|
||||
options?.requestTimeoutMs ??
|
||||
options?.timeoutMs ??
|
||||
(model as { requestTimeoutMs?: unknown }).requestTimeoutMs;
|
||||
return typeof raw === "number" && Number.isFinite(raw) && raw > 0 ? Math.floor(raw) : undefined;
|
||||
}
|
||||
|
||||
@@ -1004,7 +1006,7 @@ export function createOllamaStreamFn(
|
||||
policy: ssrfPolicy,
|
||||
timeoutMs: resolveOllamaRequestTimeoutMs(
|
||||
model,
|
||||
options as { requestTimeoutMs?: unknown } | undefined,
|
||||
options as { requestTimeoutMs?: unknown; timeoutMs?: unknown } | undefined,
|
||||
),
|
||||
auditContext: "ollama-stream.chat",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user