Complete noob here following tutorials and frankenstaining something together.
I am creating a gemini AI chat bot and every time I want to open the script in VS code again I have to go to the folder where it's located and open git bash first, and run these commands:
Otherwise my code doesn't recognise google module (The error is: "import google.generativeai as genai
ModuleNotFoundError: No module named 'google'")
This is my code:
(I have concealed the API key and the prompt)
I am creating a gemini AI chat bot and every time I want to open the script in VS code again I have to go to the folder where it's located and open git bash first, and run these commands:
Output:python -m venv (folder name)
cd (folder name)/
. Scripts/activate
pip install google-generativeaiAs per this tutorial at 5:17: https://www.youtube.com/watch?v=w73nrTquxm0&t=331sOtherwise my code doesn't recognise google module (The error is: "import google.generativeai as genai
ModuleNotFoundError: No module named 'google'")
This is my code:
import google.generativeai as genai
API_KEY = ''
genai.configure(api_key=API_KEY)
model = genai.GenerativeModel("gemini-pro")
chat = model.start_chat()
while True:
message = "My custom prompt" + input("You: ")
if message.lower() == 'PanicMode80085':
print('Chatbot: Goodbye!')
break
response = chat.send_message(message)
print('Chatbot', response.text)How do I modify this code so that I don't have to re-install google-generativeai every time I want to open the script again?(I have concealed the API key and the prompt)
