mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-28 15:53:37 +00:00
* fix(google): add gemini-3.1-flash-lite to provider catalog Adds the missing gemini-3.1-flash-lite model definition to the GOOGLE_GEMINI_TEXT_MODELS array. This resolves the ProviderFailoverError when configuring google-vertex/gemini-3.1-flash-lite. Fixes #89390 * test(google): cover Gemini flash lite catalog row --------- Co-authored-by: Peter Steinberger <steipete@gmail.com>
81 lines
2.0 KiB
TypeScript
81 lines
2.0 KiB
TypeScript
import type {
|
|
ModelDefinitionConfig,
|
|
ModelProviderConfig,
|
|
} from "openclaw/plugin-sdk/provider-model-shared";
|
|
|
|
const GOOGLE_GEMINI_BASE_URL = "https://generativelanguage.googleapis.com/v1beta";
|
|
const GOOGLE_VERTEX_BASE_URL = "https://{location}-aiplatform.googleapis.com";
|
|
const GOOGLE_GEMINI_COST = { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 } as const;
|
|
const GOOGLE_GEMINI_TEXT_MODELS: ModelDefinitionConfig[] = [
|
|
{
|
|
id: "gemini-2.5-pro",
|
|
name: "Gemini 2.5 Pro",
|
|
reasoning: true,
|
|
input: ["text", "image"],
|
|
cost: GOOGLE_GEMINI_COST,
|
|
contextWindow: 1_048_576,
|
|
maxTokens: 65_536,
|
|
},
|
|
{
|
|
id: "gemini-2.5-flash",
|
|
name: "Gemini 2.5 Flash",
|
|
reasoning: true,
|
|
input: ["text", "image"],
|
|
cost: GOOGLE_GEMINI_COST,
|
|
contextWindow: 1_048_576,
|
|
maxTokens: 65_536,
|
|
},
|
|
{
|
|
id: "gemini-2.5-flash-lite",
|
|
name: "Gemini 2.5 Flash-Lite",
|
|
reasoning: true,
|
|
input: ["text", "image"],
|
|
cost: GOOGLE_GEMINI_COST,
|
|
contextWindow: 1_048_576,
|
|
maxTokens: 65_536,
|
|
},
|
|
{
|
|
id: "gemini-3.1-pro-preview",
|
|
name: "Gemini 3.1 Pro Preview",
|
|
reasoning: true,
|
|
input: ["text", "image"],
|
|
cost: GOOGLE_GEMINI_COST,
|
|
contextWindow: 1_048_576,
|
|
maxTokens: 65_536,
|
|
},
|
|
{
|
|
id: "gemini-3.1-flash-lite",
|
|
name: "Gemini 3.1 Flash Lite",
|
|
reasoning: true,
|
|
input: ["text", "image"],
|
|
cost: GOOGLE_GEMINI_COST,
|
|
contextWindow: 1_048_576,
|
|
maxTokens: 65_536,
|
|
},
|
|
{
|
|
id: "gemini-3-flash-preview",
|
|
name: "Gemini 3 Flash Preview",
|
|
reasoning: true,
|
|
input: ["text", "image"],
|
|
cost: GOOGLE_GEMINI_COST,
|
|
contextWindow: 1_048_576,
|
|
maxTokens: 65_536,
|
|
},
|
|
];
|
|
|
|
export function buildGoogleStaticCatalogProvider(): ModelProviderConfig {
|
|
return {
|
|
baseUrl: GOOGLE_GEMINI_BASE_URL,
|
|
api: "google-generative-ai",
|
|
models: GOOGLE_GEMINI_TEXT_MODELS,
|
|
};
|
|
}
|
|
|
|
export function buildGoogleVertexStaticCatalogProvider(): ModelProviderConfig {
|
|
return {
|
|
baseUrl: GOOGLE_VERTEX_BASE_URL,
|
|
api: "google-vertex",
|
|
models: GOOGLE_GEMINI_TEXT_MODELS,
|
|
};
|
|
}
|