googleapis / googleapis/python-aiplatform
support model_armor with disabling vertexai
- 主要语言
- Python
- 星标
- 905
- 派生
- 465
- 平均合并
- 1 天 13 小时
- 30 天内合并 PR
- 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}"
}
)
```
贡献指南
调研方向
首先跟踪 Python 客户端中的 vertexai=False 路径和 Generative Language API 调用,然后将其与 PredictionServiceClient 和 GenerateContentRequest 进行比较。验证在面向 Gemini API 平台时是否可以传递 model_armor_config,并确认变更完成后请求确实到达预期的平台。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- google-cloud, python
- 领域
- api, cloud
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100