Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Gemini 1.5 Pro model returns the same joke when invoked by API

Hello Experts!

I recently started with Gemini and wrote a simple backend to query Gemini models to retrieve a joke/pun. However, the issue I see is the API always returns the same joke. This does not happen with Gemini chat app: https://gemini.google.com/

I tried to give context to the model using "System Instructions" and the prompt is as simple as "Tell me a joke".  Its the same joke that is returned every time - is this a bug?

PromptPrompt

Model: gemini-1.5-pro-001

Region: asia-south1

Any idea what am I doing wrong? How do I ensure that the joke is not repeated?

 

 

0 5 1,955