本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。
调用终端节点
将模型部署到终端节点后,即可开始使用模型。您可以使用Converse
或InvokeModel
操作来调用模型。
有关Converse
操作支持的模型列表,请参阅模型兼容性。有关代理的信息,请参见使用 AI 代理自动执行应用程序中的任务。有关知识库的信息,请参阅使用 Amazon Bedrock 知识库检索数据并生成 AI 响应。
要使用模型
-
AWS Management Console 使用具有 Amazon Bedrock 权限的 IAM 角色登录。
-
在搜索栏中,指定 “Amazon Bedrock”,然后从下拉列表中选择 Amazon Bedrock。
-
选择你正在使用的工具。Pl@@ ay ground 是访问你部署的模型的最快方式。
-
选择 “选择型号”。
-
选择模型的端点。
您也可以使用以下示例 AWS Command Line Interface 命令来调用终端节点。
aws bedrock-runtime converse --model-id arn:aws:sagemaker:region:
111122223333
:endpoint/example-endpoint-name
--messages '[{"role": "user", "content": [{"text": "Describe the purpose of a \"hello world\" program in one line."}]}]'
aws bedrock-runtime invoke-model --model-id arn:aws:sagemaker:region:
111122223333
:endpoint/example-endpoint-name
--body '{"inputs": "Hello? How are you?", "parameters": {"details": true}}' --cli-binary-format raw-in-base64-out test.txt