mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-07-03 12:27:41 +08:00
fix: limit topic naming retries and timeout (#14265)
Co-authored-by: SuYao <sy20010504@gmail.com>
This commit is contained in:
@@ -54,6 +54,7 @@ import type { StreamProcessorCallbacks } from './StreamProcessingService'
|
||||
// FIXME: 这里太多重复逻辑,需要重构
|
||||
|
||||
const logger = loggerService.withContext('ApiService')
|
||||
const SUMMARY_REQUEST_TIMEOUT_MS = 15_000
|
||||
|
||||
/**
|
||||
* Get the MCP servers to use based on the assistant's MCP mode.
|
||||
@@ -493,7 +494,9 @@ export async function fetchMessagesSummary({
|
||||
system: prompt,
|
||||
prompt: conversation,
|
||||
providerOptions,
|
||||
...standardParams
|
||||
...standardParams,
|
||||
abortSignal: AbortSignal.timeout(SUMMARY_REQUEST_TIMEOUT_MS),
|
||||
maxRetries: 0
|
||||
}
|
||||
|
||||
const middlewareConfig: AiSdkMiddlewareConfig = {
|
||||
@@ -575,7 +578,9 @@ export async function fetchNoteSummary({ content, assistant }: { content: string
|
||||
|
||||
const llmMessages = {
|
||||
system: prompt,
|
||||
prompt: purifiedContent
|
||||
prompt: purifiedContent,
|
||||
abortSignal: AbortSignal.timeout(SUMMARY_REQUEST_TIMEOUT_MS),
|
||||
maxRetries: 0
|
||||
}
|
||||
|
||||
const middlewareConfig: AiSdkMiddlewareConfig = {
|
||||
|
||||
Reference in New Issue
Block a user