googleapis / googleapis/python-aiplatform

support model_armor with disabling vertexai

オープン
#6,276 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
api: vertex-ai
主要言語
Python
スター
905
フォーク
465
平均マージ
1日 13時間
マージ済み PR(30日)
44

説明

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}"
}
)
```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。