mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
This builds the model catalog from per-provider definitions and models.dev v2 data. It eplacer `generate-models.ts` with one `defineProvider()` file per built-in provider, shared model-family rules (Claude, GPT, DeepSeek, Kimi, Google), and source adapters. models.dev is read through its v2 API. Outputs and CLI flags are unchanged.
22 lines
791 B
TypeScript
22 lines
791 B
TypeScript
// Google Gemini and Gemma models.
|
|
|
|
import type { ThinkingLevelMap } from "../../src/types.ts";
|
|
import { getEffortThinkingLevelMap } from "../reasoning.ts";
|
|
import type { ModelsDevReasoningOption } from "../sources/models-dev.ts";
|
|
|
|
function isGemma4Model(modelId: string): boolean {
|
|
return /gemma-?4/.test(modelId.toLowerCase());
|
|
}
|
|
|
|
/** Gemini effort levels from models.dev, with a Gemma 4 fallback. */
|
|
export function googleThinkingLevels(
|
|
modelId: string,
|
|
reasoningOptions: readonly ModelsDevReasoningOption[] = [],
|
|
): ThinkingLevelMap | undefined {
|
|
const effortMap = getEffortThinkingLevelMap(reasoningOptions);
|
|
if (effortMap) return effortMap;
|
|
if (isGemma4Model(modelId)) {
|
|
return { off: null, minimal: "MINIMAL", low: null, medium: null, high: "HIGH" };
|
|
}
|
|
return undefined;
|
|
}
|