Gemini: Add config.yaml setting for thought signatures (#5025)

This commit is contained in:
Cohee
2026-01-16 23:23:39 +02:00
committed by GitHub
parent 9d36b19ef9
commit 06691e8b9d
2 changed files with 5 additions and 1 deletions
+2
View File
@@ -287,6 +287,8 @@ claude:
gemini:
# API endpoint version ("v1beta" or "v1alpha")
apiVersion: 'v1beta'
# Adds thought signatures to requests (if available). Only for Gemini 3 and above.
thoughtSignatures: true
# Enables caching of the system prompt (if supported). Only for OpenRouter.
# -- IMPORTANT! --
# Use only when the prompt before the chat history is static and doesn't change between requests
+3 -1
View File
@@ -31,6 +31,8 @@ const GEMINI_MEDIA_RESOLUTION = {
high: 'media_resolution_high',
};
const enableThoughtSignatures = !!getConfigValue('gemini.thoughtSignatures', true, 'boolean');
/**
* @typedef {object} PromptNames
* @property {string} charName Character name
@@ -574,7 +576,7 @@ export function convertGooglePrompt(messages, model, useSysPrompt, names) {
const textSignature = message.signature;
parts.forEach((part) => {
if (textSignature && typeof part.text === 'string') {
if (enableThoughtSignatures && textSignature && typeof part.text === 'string') {
part.thoughtSignature = textSignature;
} else if (/gemini-3/.test(model)) {
// Gemini 3: Fall back to bypass magic for function calls (mandatory) and images