feat(core): Migrate generateContent to model configs. (#12834)

This commit is contained in:
joshualitt
2025-11-11 08:10:50 -08:00
committed by GitHub
parent cbbf565121
commit a4415f15d3
15 changed files with 169 additions and 95 deletions
@@ -6,12 +6,8 @@
import { useState, useCallback, useRef, useEffect, useMemo } from 'react';
import type { Config } from '@google/gemini-cli-core';
import {
debugLogger,
DEFAULT_GEMINI_FLASH_LITE_MODEL,
getResponseText,
} from '@google/gemini-cli-core';
import type { Content, GenerateContentConfig } from '@google/genai';
import { debugLogger, getResponseText } from '@google/gemini-cli-core';
import type { Content } from '@google/genai';
import type { TextBuffer } from '../components/shared/text-buffer.js';
import { isSlashCommand } from '../utils/commandUtils.js';
@@ -110,19 +106,10 @@ export function usePromptCompletion({
},
];
const generationConfig: GenerateContentConfig = {
temperature: 0.3,
maxOutputTokens: 16000,
thinkingConfig: {
thinkingBudget: 0,
},
};
const response = await geminiClient.generateContent(
{ model: 'prompt-completion' },
contents,
generationConfig,
signal,
DEFAULT_GEMINI_FLASH_LITE_MODEL,
);
if (signal.aborted) {