Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/openai-adapters/src/apis/Gemini.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,16 @@ export class GeminiApi implements BaseLlmApi {
this.apiBase = config.apiBase ?? this.apiBase;
// Create GoogleGenAI with native fetch to avoid pollution
// from Vercel AI SDK packages that can break stream handling
const customHeaders = this.config.requestOptions?.headers;
this.genAI = withNativeFetch(
() =>
new GoogleGenAI({
apiKey: this.config.apiKey,
...(customHeaders && {
httpOptions: {
headers: customHeaders,
},
}),
}),
);
}
Expand Down
Loading