本文档介绍了如何解决在 创建代理时可能遇到的错误。
内容生成错误
问题:
您收到类似于以下内容的错误消息:
ValueError: Cannot get the Candidate text.
Response candidate content part has no text.
可能的原因:
此错误可能是由于使用的 langchain-google-vertexai 版本与 google-cloud-aiplatform 不兼容所致。必须使用 langchain-google-vertexai 的 1.0.2 版或更高版本。如需检查您在使用的版本,请在终端中运行以下命令:
pip show langchain-google-vertexai推荐的解决方案:
安装 1.0.2 版 langchain-google-vertexai。此版本包含与 google-cloud-aiplatform 搭配使用所需的 LangChain 工具调用更新。如需更新 langchain-google-vertexai 的版本,请在终端运行以下命令:
pip install langchain-google-vertexai --upgrade运行该更新命令后,请在终端运行以下命令,以验证您使用的是否为 1.0.2 或更高版本:
pip show langchain-google-vertexai如果您在使用笔记本实例(例如 Jupyter、Colab 或 Workbench),则可能需要重启运行时才能使用更新后的软件包。
首次创建自带容器 (BYOC) 时出错
问题:
您首次在所在区域的 your Google Cloud project 中通过 BYOC 部署代理,并 收到类似于以下内容的错误消息:
Reasoning Engine resource <reasoning-engine-id> failed to start and cannot serve traffic.
可能的原因:
失败可能是由于 Gemini Enterprise Agent Platform 上的 Agent Runtime 内部 IAM 预配所致。相应更改需要一段时间才能完成并传播。
推荐的解决方案:
重试同一代理部署请求,该请求将会成功。