change request timeout for thinking mode

This commit is contained in:
suruiqiang
2025-02-07 16:34:14 +08:00
parent 3fe55b4f7f
commit a5a9768245
4 changed files with 22 additions and 5 deletions

View File

@@ -5,6 +5,7 @@ import {
DEEPSEEK_BASE_URL,
DeepSeek,
REQUEST_TIMEOUT_MS,
REQUEST_TIMEOUT_MS_FOR_THINKING,
} from "@/app/constant";
import {
useAccessStore,
@@ -117,10 +118,14 @@ export class DeepSeekApi implements LLMApi {
// console.log(chatPayload);
const isR1 =
options.config.model.endsWith("-reasoner") ||
options.config.model.endsWith("-r1");
// make a fetch request
const requestTimeoutId = setTimeout(
() => controller.abort(),
REQUEST_TIMEOUT_MS,
isR1 ? REQUEST_TIMEOUT_MS_FOR_THINKING : REQUEST_TIMEOUT_MS,
);
if (shouldStream) {