メインコンテンツまでスキップ

Gemini Enterprise Agent Platform(Vertex AI)

Gemini、Claude、self-deployed Model Garden model を含む、Google Cloud の Gemini Enterprise Agent Platform(旧 Vertex AI)上の model に AI agent を接続します。​

概要​

Gemini Enterprise Agent Platform connector を使用すると、Squid AI agent は独自の Google Cloud project で実行する model を使用できます。これは infrastructure が GCP 上にあり、独自の quota と billing で managed model access を使用したい場合、または Model Garden の self-deployed open-weight model を含む、platform を通じて利用できる model が必要な場合に役立ちます。

connector は以下をサポートします。

  • 3 つの model family による chat completion: first-party Gemini model、Vertex 上の Anthropic Claude、Vertex AI Endpoint から提供される self-deployed Model Garden model(Llama、Qwen、Mistral など)
  • Function calling(tool use)

GCP 側の前提条件​

  • project で Vertex AI API(aiplatform.googleapis.com)を有効にします。
  • service account を作成し、JSON key を download します。2 つの auth mode がサポートされます。
    • Service Account JSON(direct): key を持つ service account が Vertex を直接 call し、project の Vertex AI User role(roles/aiplatform.user)が必要です。
    • Impersonation: key を持つ service account は、Vertex permission を持つ target service account を impersonate する low-privilege source account です。source account に必要なのは、target 上の Service Account Token Creator role のみです。これにより保存済み key が漏洩した場合の blast radius を制限します。
  • self-deployed model では、model を Vertex AI Endpoint に deploy し、endpoint ID(gcloud ai endpoints list)を確認します。dedicated endpoint には、dedicated DNS domain(gcloud ai endpoints describe の dedicatedEndpointDns)も必要です。

Connector の設定​

  1. Squid Console に移動し、application を選択します。
  2. Connectors tab をクリックします。
  3. Available Connectors をクリックし、Gemini Enterprise Agent Platform connector を見つけます。次に Add Connector をクリックします。
  4. 次の detail を指定します。
  • Connector ID: 任意の unique ID(例: my-vertex)。これは code で参照する integrationId です。
  • GCP Project ID: Vertex AI resource が存在する Google Cloud project。Impersonation mode では、target service account の project です。
  • Location: Vertex AI location/region(例: global、us-central1、us-east5)。
  • Auth Mode: Service Account JSON(direct) または Impersonation。
  • Service Account Credentials: service account の JSON key を含む Squid secret。
  • Service Account Email: Impersonation mode でのみ使用。impersonate する target service account の email。
  • Models Configuration: この connector を通じて利用可能な model を定義する JSON array。各 model には以下の field が必要です。
FieldType説明
modelNamestringmodel identifier(例: gemini-2.5-pro)
displayNamestringmodel の human-readable name
maxOutputTokensnumbermodel が response で生成できる token の最大数
contextWindowTokensnumbertoken 単位の total context window size
modelFamilystringgemini、anthropic、self_deployed のいずれか
endpointIdstringself_deployed model で必須: Vertex AI Endpoint resource ID
endpointDomainstringdedicated Model Garden endpoint で optional: endpoint の dedicated DNS hostname

例:

[
{
"modelName": "gemini-2.5-pro",
"displayName": "Gemini 2.5 Pro",
"maxOutputTokens": 65536,
"contextWindowTokens": 1048576,
"modelFamily": "gemini"
}
]
  1. Add Connector をクリックします。

Connector の使用​

構成した後、connector ID と model name を指定して、AI agent と connector を使用します。

Client code
await squid.ai().agent('my-agent').updateModel({
integrationId: 'my-vertex',
model: 'gemini-2.5-pro',
});

request ごとに model を override することもできます。

Client code
const response = await squid
.ai()
.agent('my-agent')
.ask('Summarize our Q4 report', {
model: {
integrationId: 'my-vertex',
model: 'gemini-2.5-pro',
},
});

構成済み model は Squid Console の model picker にも connector ID の label とともに表示されます。

注記

connector は chat model のみを提供し、embedding model は追加しません。custom embedding endpoint を使用するには、OpenAI Compatible Embedding connectorを参照してください。