gemini-2.0-flash-thinking-exp model answers most of the time but also incorrect 1 out 5 runs:
for example with the following code fragment,
MODEL_ID = "gemini-2.0-flash-thinking-exp"
client = genai.Client(http_options={'api_version':'v1alpha'})
img = Image.open("pool.png")
display(img)
thoughts_header_displayed = False
answer_header_displayed = False
for chunk in client.models.generate_content_stream(model=MODEL_ID, contents=[img, "How do I use three of these numbers to sum up to 30"]):
for part in chunk.candidates[0].content.parts:
if part.thought:
if not thoughts_header_displayed:
display(Markdown("## Thoughts"))
thoughts_header_displayed = True
else:
if not answer_header_displayed:
display(Markdown("## Answer"))
answer_header_displayed = True
display(Markdown(part.text))
it gets correct answer
You can use the numbers 11, 13, and by turning
the number 9 upside down to make it a 6.
11 + 13 + 6 = 30
but some times, it returns like this:
It's not possible to use three of these numbers (7, 9, 11
, 13) to sum up to exactly 30 using standard addition. Let's check all the combinations:
* 7 + 9 + 11 = 27
* 7 + 9 + 13 = 29
* 7 + 11 +
13 = 31
* 9 + 11 + 13 = 33
None of these combinations result in a sum of 30. Perhaps this is a bit of a trick question!