在 App Engine 上部署 GCP Vertex AI Agent 时出现“配置未授权”错误

问题描述 投票:0回答:1

我正在使用 GCP Vertex AI Agent Builder 构建一个搜索应用程序,并尝试将其部署在 App Engine 上。

这是我的 Vertex AI 搜索应用程序。

enter image description here

这是 Vertex AI 应用程序数据存储

enter image description here

这是我的 App Engine 代码:

main.py

from flask import Flask, render_template
import os

app = Flask(__name__)


@app.route("/", methods=['POST', 'GET'])
def root():
    return render_template("index.html")


if __name__ == '__main__':
    app.run(host="0.0.0.0", port=int(os.environ.get("PORT", 8080)), debug=True)

index.html

<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="UTF-8">
    <title>TTC Intranet</title>
  </head>
  <body>
    <h1>TTC Intranet Search</h1>
    <!-- Widget JavaScript bundle -->
    <script src="https://cloud.google.com/ai/gen-app-builder/client?hl=en_US"></script>

    <!-- Search widget element is not visible by default -->
    <gen-search-widget
      configId="21a52013-xxxx-xxxx-xxxx-xxxx80a5xxxx"
      triggerId="searchWidgetTrigger">
    </gen-search-widget>

    <!-- Element that opens the widget on click. It does not have to be an input -->
    <input placeholder="Search here" id="searchWidgetTrigger" />
  </body>
</html>

app.yaml

runtime: python39

应用程序正在启动,单击“在此处搜索”图标后,它会重定向到搜索代理页面。但随后出现以下错误。

“***.uc.r.appspot.com”上未授权配置

google-cloud-platform google-cloud-datastore google-cloud-vertex-ai google-cloud-ai vertex-ai-search
1个回答
0
投票

您必须在 Vertex Agent Builder 应用程序下配置授权域/子域才能使其正常工作。

Vertex AI Configuration

在您的情况下,您可以将 xxxx.xx.r.appspot.com(以及您正在使用的任何其他域)添加到授权列表中。

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.