Has anyone found a way to influence the output of Gemini thinking?
For example, to make it output thoughts only in Russian?
Maybe someone has come up with some prompt.
Hey @AlexGoD
Welcome to the community!
Sorry for responding late.
Please find the below code snippet:
from google import genai
from google.genai import types
client = genai.Client(api_key="GOOGLE_API_KEY")
prompt = "What is the sum of the first 50 prime numbers? Generate Answer and Thought summary in Russian"
response = client.models.generate_content(
model="gemini-2.5-flash-preview-05-20",
contents=prompt,
config=types.GenerateContentConfig(
thinking_config=types.ThinkingConfig(
include_thoughts=True
)
)
)
for part in response.candidates[0].content.parts:
if not part.text:
continue
if part.thought:
print("Thought summary:")
print(part.text)
print()
else:
print("Answer:")
print(part.text)
print()
Feel free to explore different prompts.
Thank you!