Error while using the gemini model

This is resolved. The error was caused due to a bug in my code.