activities
latest
false
重要 :
このコンテンツの一部は機械翻訳によって処理されており、完全な翻訳を保証するものではありません。 新しいコンテンツの翻訳は、およそ 1 ~ 2 週間で公開されます。
UiPath logo, featuring letters U and I in white

Integration Service のアクティビティ

最終更新日時 2025年11月18日

Google Vertex エージェントを実行

説明

Vertex AI Agents は、Google Cloud の Vertex AI プラットフォーム上の自律ソフトウェア システムであり、生成 AI を使用して、ユーザーや他のエージェントとのタスクを理解、推論、計画、完了します。

これらのエージェントの中核となるのは Vertex AI エージェント エンジンであり、運用環境でエージェントを開発、デプロイ、スケーリングするためのマネージド ランタイムを提供します。

このアクティビティでは、エージェント エンジンにデプロイされたエージェントを、Maestro がオーケストレーションする自動化プロセスの参加者として使用できます。

Vertex Agent を作成する

Vertex AI Agent Engine に基づくエージェントのデプロイ方法は常に進化しています。現在、これは Vertex AI のコードファーストの構成です。エージェント エンジンでサポートされているすべてのフレームワークは、Google Vertex コネクタでサポートされています。(例:google-adk)。Vertex AI エージェントが正常にデプロイされると、そのエージェントは Google Cloud プロジェクトの [Vertex AI > Agent Builder ] > Agent Engine の下に整理されます。UiPath との連携準備が整ったエージェントは、次のような URL の下にリソース名が割り当てられた状態で表示される必要があります。

projects/771273109380/locations/us-central1/reasoningEngines/7522902537708503040projects/771273109380/locations/us-central1/reasoningEngines/7522902537708503040
この例では、プロジェクト ID は 771273109380です。

ほとんどの Maestro のシナリオでは、JSON 構造の形式で出力を生成するようエージェントにプロンプトを送信します。例えば。{"sku1": "9735A45", "sku2": "1735A50"}です。

アクティビティの使用方法

このアクティビティを Maestro のエージェンティック プロセスで使用するには、以下の手順に従います。

  1. キャンバスにサービス タスク要素を追加し、タスクの [ プロパティ ] パネルを開きます。
  2. このサービス タスクの名前を Vertex Hello Worldとします。
  3. [ 実装 ] セクションの [ アクション ] ドロップダウン リストから、[ 外部エージェントを起動し、待機] を選択します。
  4. [Google Vertex] コネクタを選択します。
  5. 既存のコネクションを選択するか、新しいコネクションを作成します。詳細については、「 Google Vertex の認証」をご覧ください。
  6. [アクティビティ] から [Google Vertex エージェントを実行] を選択します。

  7. [ エージェント名] から、以前に Vertex AI で作成したエージェント (例:ORDERS_AGENT)。間違ったサービス アカウント キーを使用すると、予期しないエージェントを含むか、エージェントがまったく存在しないドロップダウンが表示されることに注意してください。

  8. [メッセージ] フィールドに「"What can you do?"」と入力します。プロンプトには必ず引用符を含めてください。
  9. [ユーザー ID] フィールドに「user」と入力します。
  10. 開始イベントをサービス タスクに接続し、サービス タスクをキャンバス上の終了イベント ノードに接続します。

  11. [ デバッグ] を選択して、このプロセスを実行します。実行が成功したら、グローバル変数を確認し、ソース の頂点 から{:} 応答 を探します。返信の構造に注意してください。たとえば、「何ができますか?」というプロンプトに対するエージェントの回答は次のようになります。

    {
      "usage_metadata": {
        "candidates_token_count": 404,
        "thoughts_token_count": 46,
        "total_token_count": 1229,
        "prompt_tokens_details": [
          {
            "token_count": 779,
            "modality": "TEXT"
          }
        ],
        "traffic_type": "ON_DEMAND",
        "candidates_tokens_details": [
          {
            "token_count": 404,
            "modality": "TEXT"
          }
        ],
        "prompt_token_count": 779
      },
      "author": "loan_eligibility_agent",
      "invocation_id": "e-a496b1b8-fb54-4120-9aa2-7fac34e1d04d",
      "session_id": "3080378032481894400",
      "id": "26G1y9He",
      "content": {
        "parts": [
          {
            "text": "I am a loan eligibility evaluation agent. My primary function is to assess whether a loan applicant is eligible for approval based on a predefined set of criteria.\n\nHere's what I can do:\n\n1.  **Receive Loan Application Details:** I expect loan application details in a JSON format. If I don't receive it, I will prompt you to provide it.\n2.  **Evaluate Against Criteria:** I will evaluate each field in the provided JSON against specific eligibility criteria, which include:\n    *   Age (21-60)\n    *   Employment status and duration (employed, min 12 months)\n    *   Monthly net income (min $2,500 USD)\n    *   Credit Score (min 650)\n    *   Debt-to-Income Ratio (monthly obligations <= 40% of income)\n    *   Residency Status (legal resident/citizen)\n    *   Loan Purpose (specific allowed purposes, no disallowed ones)\n3.  **Determine Eligibility:** Based on the evaluation, I will determine one of three outcomes:\n    *   `eligible`: If all standard criteria are met.\n    *   `not eligible`: If one or more core criteria are failed, and no compelling justification is provided.\n    *   `manual review: other_criteria`: If one or more core criteria are failed, but an \"other_criteria\" explanation is provided that might justify an exception (e.g., medical hardship, protected populations, employment transition).\n4.  **Provide Justification:** For every determination, I will provide a detailed explanation outlining how the decision was reached, referencing the specific parameters from the eligibility criteria and the applicant's data.\n5.  **Output in JSON:** My final output will always be a JSON object containing the `determination` and `justification`.\n\nEssentially, I automate the initial screening process for personal loan applications according to established rules."
          }
        ],
        "role": "model"
      },
      "timestamp": 1758552780.125623
    }{
      "usage_metadata": {
        "candidates_token_count": 404,
        "thoughts_token_count": 46,
        "total_token_count": 1229,
        "prompt_tokens_details": [
          {
            "token_count": 779,
            "modality": "TEXT"
          }
        ],
        "traffic_type": "ON_DEMAND",
        "candidates_tokens_details": [
          {
            "token_count": 404,
            "modality": "TEXT"
          }
        ],
        "prompt_token_count": 779
      },
      "author": "loan_eligibility_agent",
      "invocation_id": "e-a496b1b8-fb54-4120-9aa2-7fac34e1d04d",
      "session_id": "3080378032481894400",
      "id": "26G1y9He",
      "content": {
        "parts": [
          {
            "text": "I am a loan eligibility evaluation agent. My primary function is to assess whether a loan applicant is eligible for approval based on a predefined set of criteria.\n\nHere's what I can do:\n\n1.  **Receive Loan Application Details:** I expect loan application details in a JSON format. If I don't receive it, I will prompt you to provide it.\n2.  **Evaluate Against Criteria:** I will evaluate each field in the provided JSON against specific eligibility criteria, which include:\n    *   Age (21-60)\n    *   Employment status and duration (employed, min 12 months)\n    *   Monthly net income (min $2,500 USD)\n    *   Credit Score (min 650)\n    *   Debt-to-Income Ratio (monthly obligations <= 40% of income)\n    *   Residency Status (legal resident/citizen)\n    *   Loan Purpose (specific allowed purposes, no disallowed ones)\n3.  **Determine Eligibility:** Based on the evaluation, I will determine one of three outcomes:\n    *   `eligible`: If all standard criteria are met.\n    *   `not eligible`: If one or more core criteria are failed, and no compelling justification is provided.\n    *   `manual review: other_criteria`: If one or more core criteria are failed, but an \"other_criteria\" explanation is provided that might justify an exception (e.g., medical hardship, protected populations, employment transition).\n4.  **Provide Justification:** For every determination, I will provide a detailed explanation outlining how the decision was reached, referencing the specific parameters from the eligibility criteria and the applicant's data.\n5.  **Output in JSON:** My final output will always be a JSON object containing the `determination` and `justification`.\n\nEssentially, I automate the initial screening process for personal loan applications according to established rules."
          }
        ],
        "role": "model"
      },
      "timestamp": 1758552780.125623
    }

エージェントの出力をプロセス変数に割り当てて、Maestro プロセスの進行状況に影響を与える必要があります。たとえば、Boolean 評価に基づいて決定を下す場合や、分類タスクの回答を使用する場合などです。

  1. デザイン モードで、デザイン キャンバスからエージェントを選択します。

  2. [プロパティ] を選択します。

  3. [出力] で [ 新規追加] を選択し、 agent_reponse という名前の String 型の変数を追加します。

  4. [値] で [ Vertex Hello World >の 応答 (オブジェクト)] > [ コンテンツ (オブジェクト)] > [ コンテンツ テキスト (文字列)] を選択します。

先端: 実際には、エージェントから選択した構造化された出力を指定し、式エディターを使用して Maestro 内で出力を評価し、プロセス フローに必要な出力の特定の部分を抽出します。

トラブルシューティングとチューニング

接続を確立するだけでなく、Vertex ワークスペースと Maestro からのプロンプトの両方でプロンプトをテストする必要があります。これにより、Maestro で使用し、変数に割り当てて、プロセス内の他のアクターに渡すのに最適な目的の出力が得られます。

詳細なプロンプトは、Vertex 内のエージェントの システム プロンプト 内に留まることをお勧めします。実行時に Maestro からエージェントに提供される ユーザー プロンプト は、簡潔で要点を押さえたものである必要があります。この役割の主な役割は、エージェントが特定のタスクを実行し、期待される一貫性のある出力を生成するために必要な関連変数を示すことです。

人間向けの出力 (エスカレーションの理由など) には、次のようなものがあります 人間にとって自然なテキストとして簡単に渡されます。に期待される出力 API/ロボット アクションは厳密に構成する必要があります。以下に、次のようなユーザー プロンプトを示します エージェントから特定の出力を生成します。Studio 内で C# の式エディターを使用する 変数を 必要。
"What is the quantity on inventory of Order ID " + vars.orderId_1 + "respond only with a JSON object with the quantity in the key Order_Quantity. No explanations, only JSON""What is the quantity on inventory of Order ID " + vars.orderId_1 + "respond only with a JSON object with the quantity in the key Order_Quantity. No explanations, only JSON"

エージェントは次のように返信します。

{"Order_Quantity":"100"}{"Order_Quantity":"100"}
エージェントへの要求と実際の応答の種類には特に注意してください。応答が JSON型のように見えても、実際には string型である可能性があります。

このページは役に立ちましたか?

サポートを受ける
RPA について学ぶ - オートメーション コース
UiPath コミュニティ フォーラム
Uipath Logo
信頼とセキュリティ
© 2005-2025 UiPath. All rights reserved.