|
|
Gemini 2.0 Flash Thinking - Extended Reasoning Mode
Author: Venkata Sudhakar
Gemini 2.0 Flash Thinking is a reasoning-focused variant of Gemini 2.0 Flash that exposes its internal chain-of-thought before producing a final answer. This extended reasoning mode is designed for tasks that benefit from step-by-step deliberation: complex maths, multi-step logic, code debugging, and business decision analysis where showing the reasoning process is as important as the answer itself.
To use thinking mode, set the model to gemini-2.0-flash-thinking-exp and access the thought content from the response candidates. The model returns both its internal reasoning steps and the final answer, allowing you to verify the logic path and build more trustworthy applications.
The below example shows how ShopMax India uses Gemini Flash Thinking to analyse a complex pricing decision, exposing the reasoning steps before presenting the final recommendation.
It gives the following output,
--- REASONING ---
Let me calculate the profit in both scenarios.
Current scenario (no discount):
- Selling price: Rs 85,000
- Variable cost: Rs 62,000
- Contribution per unit: Rs 85,000 - Rs 62,000 = Rs 23,000
- Monthly volume: 200 units
- Total contribution: 200 x Rs 23,000 = Rs 46,00,000
- Fixed costs: Rs 8,00,000
- Monthly profit: Rs 46,00,000 - Rs 8,00,000 = Rs 38,00,000
Discount scenario (15% off):
- Discounted price: Rs 85,000 x 0.85 = Rs 72,250
- Contribution per unit: Rs 72,250 - Rs 62,000 = Rs 10,250
- New volume: 200 x 1.4 = 280 units
- Total contribution: 280 x Rs 10,250 = Rs 28,70,000
- Fixed costs: Rs 8,00,000
- Monthly profit: Rs 28,70,000 - Rs 8,00,000 = Rs 20,70,000
...
--- FINAL ANSWER ---
The 15% Diwali discount is NOT recommended.
Without discount: Monthly profit = Rs 38,00,000 (200 units at Rs 85,000)
With 15% discount: Monthly profit = Rs 20,70,000 (280 units at Rs 72,250)
The discount reduces profit by Rs 17,30,000 per month despite the 40% volume increase.
The contribution margin drops from Rs 23,000 to Rs 10,250 per unit - a 55% fall.
Consider a smaller 5-8% discount or bundle offer instead to drive volume without
destroying margin.
It gives the following output,
Bug found: gst_rate is being passed as 18 (integer) instead of 0.18 (decimal).
The function logic is correct but the caller passes 18 instead of 0.18.
Fix option 1 - normalize inside the function:
def gst_price(base, gst_rate):
rate = gst_rate / 100 if gst_rate > 1 else gst_rate
return base + base * rate
Fix option 2 - document expected format and fix caller:
def gst_price(base, gst_rate_decimal):
# gst_rate_decimal: pass 0.18 for 18% GST
return base + base * gst_rate_decimal
gst_price(1000, 0.18) # returns 1180.0 correctly
Gemini Flash Thinking is most valuable when your application needs to show its work - financial analysis, legal reasoning, scientific problem solving, and complex debugging. The thinking_budget parameter controls how many tokens the model uses for internal reasoning before producing the final answer. Higher budgets improve accuracy on hard problems but increase latency and cost. For ShopMax India, limiting the budget to 4000-8000 tokens balances reasoning quality with response time for business analysis tasks.
|
|