Gemini: Add config.yaml setting for thought signatures (#5025)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user