import google.generativeai as genai
genai.configure(api_key) # Enter your API key here as a string
model = genai.GenerativeModel('gemini-1.5-flash')
context = "In physics, a state of matter is one of the distinct forms in which matter can exist. Four states of matter are observable in everyday life: solid, liquid, gas, and plasma."
question = "How many states of matter are there?"
prompt = f"The context provided is: {context}. The question is: {question}. What is the answer?"
response = model.generate_content(prompt)
print(response)
- Get your API key [here](https://[aistudio.google.com/app/apikey](https://aistudio.google.com/app/apikey)).
Description
Route
Suggested Implementation
model = genai.GenerativeModel('gemini-1.5-flash')
context = "In physics, a state of matter is one of the distinct forms in which matter can exist. Four states of matter are observable in everyday life: solid, liquid, gas, and plasma."
question = "How many states of matter are there?"
prompt = f"The context provided is: {context}. The question is: {question}. What is the answer?"
response = model.generate_content(prompt)
print(response)