beautifier_agent = Agent(
model=“gemma-4-26b-a4b-it”,
name=“markdown_beautifier”,
description=“Cleans and structures raw documentation markdown”,
instruction=“”"
You are a markdown formatting expert.
Input: raw markdown extracted from documentation websites.
Your job:
Remove UI junk (breadcrumbs, navigation links like “Home”, “Back to top”)
Remove duplicated or irrelevant lines
Preserve ALL actual documentation content
Fix spacing and formatting
Ensure proper markdown structure:
headings (#, ##, ###)
lists
code blocks (with backticks)
Separate sections clearly with spacing
Do NOT remove useful content.
Do NOT summarize.
Do NOT remove any content.
Do not return your thinking.
IMPORTANT:
If you include anything other than markdown, the system will break.
Output:
Return ONLY clean, well-structured markdown.
“”",
)
This is my google-adk agent intialization. The agent is returning its thinking, even tho i told not to return it. Is there any way i stop this from happening?? I used gemini models, works perfectly, but gemma dosent.
Issue: “Gemma is returning its thinking” / “Disable thinking for Gemma 4”
The Problem: Users are seeing the model’s internal reasoning or “thought process” output directly into the final text generation.
The Fix: Reasoning models often output their logic block before the final answer, usually enclosed in specific tags (like and ).
Application-Side Parser: The most robust fix is to implement a regex or string-parsing function in the client code to automatically strip out any text between these tags before rendering the output to the end user.
API Flags: Check the specific endpoint documentation (Vertex AI or AI Studio) for generation configuration parameters. Some endpoints allow passing a flag such as include_thinking=false in the JSON payload to suppress the reasoning tokens at the server level.
If you have access to raw API, or SDK provides your parts and not text. You can just go through all parts and check if they have “thought” = true, and just ignore those
The problem with the prompt is the improper emphasis- and ill bet the format your presenting the input.
“”"
You are trimming and formating an agents activity log.
Transcribe the formatted content to your input.
Preserve all documentation and information from the source content precisely.
Omit any model responses, or system output thats unrelated.
Input as json line number keyed array.
give structured output string array.
Instruct model each string = line.
Hi @aaronshenny, Could you check if you have enable_thinking set in your configuration? If so, try setting it to False explicitly:
python
generate_content_config=types.GenerateContentConfig(
thinking_config=types.ThinkingConfig(
enable_thinking=False
)
)
If that does not stop the thinking output, try using ThinkingLevel.MINIMAL as an alternative:
python
from google.genai.types import ThinkingLevel
generate_content_config=types.GenerateContentConfig(
thinking_config=types.ThinkingConfig(
thinking_level=ThinkingLevel.NONE
)
)
This is similar to how thinking is suppressed via the REST API using the thinking_config parameter. If problem still persists could you help us with reproducible code. Thanks.