googleapis / googleapis/python-aiplatform

support model_armor with disabling vertexai

Ouverte
#6,276 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
api: vertex-ai
Langage dominant
Python
Étoiles
905
Forks
465
Merge moyen
1 j 13 h
PR mergées (30 j)
44

Description

I would like to pass model_armor_config to the Generative Language API call, and it appears that the code below is currently the only way to invoke the API while including model_armor_config. Is there a way to make this work with the vertexai=False flag, to ensure that the request is sent to the Gemini API platform rather than Vertex AI?
```
client_options = {"api_endpoint": "us-east4-aiplatform.googleapis.com"}
client = aiplatform_v1beta1.PredictionServiceClient(client_options=client_options)

request = aiplatform_v1beta1.GenerateContentRequest(
model="gemini-2.0-flash-001",
contents=[content.Content(role="user", parts=[content.Part(text="Hello world")])],
model_armor_config={
"prompt_template_name": f"projects/{PROJECT_ID}/locations/{LOCATION}/templates/{TEMPLATE_ID}"
}
)
```

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.