Hi everyone,
I’m a solo dev experimenting with the Gemini Pro API for a small game project, and I’ve hit a strange issue.
My goal is to generate creative, short descriptions for in-game power-up events. The inspiration for this merging mechanic came from a fun game I’ve been playing recently: https://modhello.com/merge-fellas/
The problem is, for one specific power-up named “Unlimited Shake,” the API consistently returns a weird, repetitive, and nonsensical output. For all other prompts, it works perfectly.
Here is my setup in Python (simplified):
import google.generativeai as genai
# Configure API key
genai.configure(api_key="YOUR_API_KEY")
model = genai.GenerativeModel('gemini-pro')
prompt = "Generate a short, exciting, in-game description for a power-up called 'Merge Fellas Unlimited Shake'. The description should be under 15 words."
try:
response = model.generate_content(prompt)
print(response.text)
except Exception as e:
print(f"An error occurred: {e}")
Expected Output:
Something creative like: “Fellas merge in a frenzy! An earthquake of unlimited power!”
Actual Output I Get:
Shake. Shake. Unlimited. The fellas shake. Merge the shake. Shake. Shake. Unlimited.
I’ve tried adjusting the prompt, but it seems like the combination of “unlimited” and “shake” is confusing the model. Has anyone encountered this kind of repetitive behavior with specific keyword combinations? Is this a prompt engineering failure on my part, or should I be looking at generation_config
like temperature/top_p to increase randomness?
Any advice would be greatly appreciated