Guía de inicio rápido: Envía solicitudes a la API de Vertex AI para Gemini  |  Generative AI on Vertex AI  |  Google Cloud

PHOTO EMBED

Mon Jul 08 2024 09:43:27 GMT+0000 (Coordinated Universal Time)

Saved by @Spsypg #python

import vertexai
from vertexai.generative_models import GenerativeModel

# TODO(developer): Update and un-comment below line
# project_id = "PROJECT_ID"

vertexai.init(project=project_id, location="us-central1")

model = GenerativeModel(model_name="gemini-1.5-flash-001")

response = model.generate_content(
    "What's a good name for a flower shop that specializes in selling bouquets of dried flowers?"
)

print(response.text)
content_copyCOPY

https://cloud.google.com/vertex-ai/generative-ai/docs/start/quickstarts/quickstart-multimodal?hl