Replies: 1 comment
-
|
I need this |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
我希望能够使用 API Key,而不仅是使用 Service Account JSON (saJSON) 生成 Bearer Token (Authorization: Bearer ...)进行认证,通过
aiplatform.googleapis.com端点来调用 Vertex AI 模型,正如官方文档中所述:Vertex AI Quickstart (API Key)。目前的
GeminiVertexExecutor实现存在逻辑限制:一旦检测到 API Key,它就默认目标是 Google AI Studio (generativelanguage.googleapis.com) 的通用格式,无法为 Vertex AI 构造正确的请求路径。期望的解决方案
我希望
GeminiVertexExecutor能够支持一种配置方式,允许我提供base_url(指向aiplatform.googleapis.com)和api_key,同时能够正确地在 URL 路径中包含project_id和location信息。技术背景与代码分析
基于文件
internal/runtime/executor/gemini_vertex_executor.go的分析:Execute方法严格根据是否存在 API Key 来拆分逻辑分支,导致 Vertex AI 的相关逻辑(如项目ID和位置的处理)无法与 API Key 认证结合使用:executeWithAPIKey方法构造的是简化版的 URL,适用于 AI Studio,缺少了 Vertex AI 必须的 Project 和 Location 字段:Vertex AI 所需的正确 URL 格式:
https://{LOCATION}-aiplatform.googleapis.com/v1/projects/{PROJECT_ID}/locations/{LOCATION}/publishers/google/models/{MODEL_ID}:{ACTION}补充信息
当前的实现阻碍了用户通过更简便的 API Key 认证方式来使用 Vertex AI 资源。
Beta Was this translation helpful? Give feedback.
All reactions