I am integrating vertex AI Gemini with big query, i have enabled vertex AI API from console, but first i am trying a python script to check But I am getting below error:An error occurred: 404 Publisher Model `projects/pm-data-lake-400215/locations/us-central/publishers/google/models/Gemini-1.0-pro` was not found or your project does not have access to it. Please ensure you are using a valid model version.
Pythonscript:
Import the Vertex AI library
import vertexai
from vertexai.generative_models import GenerativeModel
# --- Configuration ---
PROJECT_ID = "prm-data-lake-400215"
LOCATION = "us-central1"
MODEL_ID = "gemini-1.0-pro" # Also tried gemini-1.5-flash-001
# --- Initialize Vertex AI ---
vertexai.init(project=PROJECT_ID, location=LOCATION)
# --- Load the Gemini Model ---
model = GenerativeModel(MODEL_ID)
# --- Send a Prompt ---
prompt = "In simple terms, what is a large language model?"
print(f"Sending prompt: '{prompt}'")
try:
response = model.generate_content(prompt)
# --- Print the Response ---
print("\n--- Model Response ---")
if response.candidates and response.candidates[0].content.parts:
print(response.candidates[0].content.parts[0].text)
else:
print("No text content found in the response.")
# print(response) # Uncomment to see full response structure if needed
except Exception as e:
print(f"\nAn error occurred: {e}")
print("\n--- Script Finished ---")
I have tried all model versions but nothing is working for me, i have checked all the permissions and my user has owner access
Can you please assist on this