Hope someone can help.
The sample code shows how to send multimodal prompt requests with locally stored images:
import vertexai
from vertexai.generative_models import GenerativeModel, Part, Image
model_id: str = "gemini-1.5-pro-preview-0409"
project_id: str = "YOUR_GCP_PROJECT"
region: str = "YOUR_GCP_REGION"
vertexai.init(project=project_id, location=region)
model: GenerativeModel = GenerativeModel(model_name=model_id)
response = model.generate_content([
Part.from_image(Image.load_from_file('image.jpg')),
"What is shown in this image?",])
print(response.text)
I need to do simlar taks, but with locally saved videos but i’ve been struggling with it.
Is there any alternative for Part.from_uri?
i found documentation in
from https://cloud.google.com/vertex-ai/generative-ai/docs/reference/python/1.59.0/vertexai.vision_models.Video#methods
but i failed to incorparate this
New contributor
user26612066 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.