选择您的 Cookie 首选项

我们使用必要 Cookie 和类似工具提供我们的网站和服务。我们使用性能 Cookie 收集匿名统计数据,以便我们可以了解客户如何使用我们的网站并进行改进。必要 Cookie 无法停用,但您可以单击“自定义”或“拒绝”来拒绝性能 Cookie。

如果您同意,AWS 和经批准的第三方还将使用 Cookie 提供有用的网站功能、记住您的首选项并显示相关内容,包括相关广告。要接受或拒绝所有非必要 Cookie,请单击“接受”或“拒绝”。要做出更详细的选择,请单击“自定义”。

与 AWS SDK PrepareAgent 配合使用 - AWS SDK 代码示例

文档 AWS SDK 示例 GitHub 存储库中还有更多 S AWS DK 示例

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

文档 AWS SDK 示例 GitHub 存储库中还有更多 S AWS DK 示例

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

与 AWS SDK PrepareAgent 配合使用

以下代码示例演示如何使用 PrepareAgent

操作示例是大型程序的代码摘录,必须在上下文中运行。在以下代码示例中,您可以查看此操作的上下文:

Python
适用于 Python 的 SDK(Boto3)
注意

还有更多相关信息 GitHub。查找完整示例,学习如何在 AWS 代码示例存储库中进行设置和运行。

为内部测试准备代理。

def prepare_agent(self, agent_id): """ Creates a DRAFT version of the agent that can be used for internal testing. :param agent_id: The unique identifier of the agent to prepare. :return: The response from Amazon Bedrock Agents if successful, otherwise raises an exception. """ try: prepared_agent_details = self.client.prepare_agent(agentId=agent_id) except ClientError as e: logger.error(f"Couldn't prepare agent. {e}") raise else: return prepared_agent_details
  • 有关 API 的详细信息,请参阅适用PrepareAgentPython 的AWS SDK (Boto3) API 参考

适用于 Python 的 SDK(Boto3)
注意

还有更多相关信息 GitHub。查找完整示例,学习如何在 AWS 代码示例存储库中进行设置和运行。

为内部测试准备代理。

def prepare_agent(self, agent_id): """ Creates a DRAFT version of the agent that can be used for internal testing. :param agent_id: The unique identifier of the agent to prepare. :return: The response from Amazon Bedrock Agents if successful, otherwise raises an exception. """ try: prepared_agent_details = self.client.prepare_agent(agentId=agent_id) except ClientError as e: logger.error(f"Couldn't prepare agent. {e}") raise else: return prepared_agent_details
  • 有关 API 的详细信息,请参阅适用PrepareAgentPython 的AWS SDK (Boto3) API 参考

下一主题:

场景

上一主题:

ListAgents
隐私网站条款Cookie 首选项
© 2025, Amazon Web Services, Inc. 或其附属公司。保留所有权利。