mirror of
https://github.com/openclaw/openclaw.git
synced 2026-08-27 21:07:01 -06:00
b4d6aff098
* chore(deps): refresh cooled provider and native tooling * build: preserve installed SDK package identity * test: isolate dependency validation fixtures
22 lines
722 B
TypeScript
22 lines
722 B
TypeScript
// Google plugin module implements google genai runtime behavior.
|
|
import { GoogleGenAI, type GoogleGenAIOptions } from "@google/genai";
|
|
import { resolveGoogleApiClientHeaders } from "./google-api-client-header.js";
|
|
|
|
export type GoogleGenAIClient = InstanceType<typeof GoogleGenAI>;
|
|
|
|
export function createGoogleGenAI(options: GoogleGenAIOptions): GoogleGenAIClient {
|
|
const httpOptions = options.httpOptions ?? {};
|
|
return new GoogleGenAI({
|
|
...options,
|
|
httpOptions: {
|
|
...httpOptions,
|
|
headers: {
|
|
...httpOptions.headers,
|
|
...resolveGoogleApiClientHeaders({
|
|
baseUrl: typeof httpOptions.baseUrl === "string" ? httpOptions.baseUrl : undefined,
|
|
}),
|
|
},
|
|
},
|
|
});
|
|
}
|