mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-28 13:31:32 +08:00
refactor(services): 提取 FetchChatCompletionOptions 类型以提升代码可维护性
This commit is contained in:
parent
ddb203170e
commit
d4a22d3b0c
@ -75,6 +75,12 @@ export async function fetchMcpTools(assistant: Assistant) {
|
||||
return mcpTools
|
||||
}
|
||||
|
||||
export type FetchChatCompletionOptions = {
|
||||
signal?: AbortSignal
|
||||
timeout?: number
|
||||
headers?: Record<string, string>
|
||||
}
|
||||
|
||||
export async function fetchChatCompletion({
|
||||
messages,
|
||||
assistant,
|
||||
@ -84,11 +90,7 @@ export async function fetchChatCompletion({
|
||||
}: {
|
||||
messages: StreamTextParams['messages']
|
||||
assistant: Assistant
|
||||
options: {
|
||||
signal?: AbortSignal
|
||||
timeout?: number
|
||||
headers?: Record<string, string>
|
||||
}
|
||||
options: FetchChatCompletionOptions
|
||||
onChunkReceived: (chunk: Chunk) => void
|
||||
topicId?: string // 添加 topicId 参数
|
||||
}) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user