Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Error using Vertex GenerativeModel example

Trying to run the system_instruction example on this page and getting unexpected keyword argument error.  New to Vertex AI , so not sure where to start. 

https://github.com/googleapis/python-aiplatform/tree/main/vertexai/generative_models

 

model = generative_models.GenerativeModel(
"gemini-1.0-pro",
system_instruction=[
"Talk like a pirate.",
"Don't use rude words.",
],
)
print(model.generate_content("Why is sky blue?"))
 
 
 
TypeError: _GenerativeModel.__init__() got an unexpected keyword argument 'system_instruction'
 
Solved Solved
0 4 7,144
1 ACCEPTED SOLUTION

Try to reinstall the sdk, run:

pip install --upgrade google-cloud-aiplatform

View solution in original post

4 REPLIES 4