我正在使用 GCP Vertex AI Agent Builder 构建一个搜索应用程序,并尝试将其部署在 App Engine 上。
这是我的 Vertex AI 搜索应用程序。
这是 Vertex AI 应用程序数据存储
这是我的 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”上未授权配置