Skip to content
Source
Sign inSign up
TanStack/ai

fix(ai-gemini): keep httpOptions.timeout in geminiImage when a signal is passed #2314 (GitHub #2313)

Openpcbeingused33(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/2313/headopened View on GitHub

Showing 3 changed files with 41 additions and 4 deletions.

x
0 of 3 viewed, 3 left
5 additions and 0 deletions.changeset/gemini-image-http-timeout.mdAdded
View file
@@ -0,0 +1,5 @@
+---
+'@tanstack/ai-gemini': patch
+---
+​
+`geminiImage()` now keeps `httpOptions.timeout` when the caller passes an `abortSignal`, like the text and video adapters.
6 additions and 4 deletionspackages/ai-gemini/src/adapters/image.tsModified
View file
@@ -8,6 +8,7 @@
createGeminiClient,
generateId,
getGeminiApiKeyFromEnv,
+ withHttpTimeout,
} from '../utils'
import { buildGeminiInteractionsUsage } from '../usage'
import {
@@ -91,6 +92,7 @@
​
private readonly client: GeminiClient
+ private readonly timeoutMs: number | undefined
​
constructor(
{ defaultModelOptions, ...config }: GeminiImageConfig,
@@ -98,6 +100,7 @@
) {
super(model, { ...config, defaultModelOptions })
this.client = createGeminiClient(config)