mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2026-01-09 06:49:02 +08:00
fix(GeminiAPIClient): update abortSignal option and ensure userLastMessage is pushed to messages (#7387)
This commit is contained in:
parent
3e142f67ad
commit
1915ba5bfb
@ -85,7 +85,7 @@ export class GeminiAPIClient extends BaseApiClient<
|
|||||||
...rest,
|
...rest,
|
||||||
config: {
|
config: {
|
||||||
...rest.config,
|
...rest.config,
|
||||||
abortSignal: options?.abortSignal,
|
abortSignal: options?.signal,
|
||||||
httpOptions: {
|
httpOptions: {
|
||||||
...rest.config?.httpOptions,
|
...rest.config?.httpOptions,
|
||||||
timeout: options?.timeout
|
timeout: options?.timeout
|
||||||
@ -479,6 +479,7 @@ export class GeminiAPIClient extends BaseApiClient<
|
|||||||
for (const message of messages) {
|
for (const message of messages) {
|
||||||
history.push(await this.convertMessageToSdkParam(message))
|
history.push(await this.convertMessageToSdkParam(message))
|
||||||
}
|
}
|
||||||
|
messages.push(userLastMessage)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -102,6 +102,6 @@ export type GeminiSdkToolCall = FunctionCall
|
|||||||
|
|
||||||
export type GeminiOptions = {
|
export type GeminiOptions = {
|
||||||
streamOutput: boolean
|
streamOutput: boolean
|
||||||
abortSignal?: AbortSignal
|
signal?: AbortSignal
|
||||||
timeout?: number
|
timeout?: number
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user