View a markdown version of this page

列出建議 - Amazon Bedrock AgentCore

列出建議

列出您帳戶中的所有建議。結果會分頁,並可依狀態篩選。

程式碼範例

範例
AgentCore CLI

列出過去的建議任務 (從服務重新整理執行中的任務):

agentcore view recommendation

依 ID 檢視單一建議:

agentcore view recommendation <recommendation-id>

--json 為機器可讀輸出新增 :

agentcore view recommendation --json
AWS SDK (boto3)
import boto3 client = boto3.client("bedrock-agentcore", region_name="us-west-2") # List all recommendations response = client.list_recommendations() for rec in response["recommendationSummaries"]: print(f"{rec['recommendationId']} | {rec['name']} | {rec['type']} | {rec['status']}")

依狀態篩選:

response = client.list_recommendations(statusFilter="COMPLETED") for rec in response["recommendationSummaries"]: print(f"{rec['recommendationId']} {rec['name']} {rec['status']}")

分頁所有結果:

paginator = client.get_paginator("list_recommendations") for page in paginator.paginate(statusFilter="COMPLETED"): for rec in page["recommendationSummaries"]: print(rec["recommendationId"])

請求參數

參數 Type 必要 說明

maxResults

Integer

每頁結果的數量上限。範圍:1–100。

nextToken

String

來自先前回應的分頁字符。

statusFilter

String

依狀態篩選。其中之一:PENDINGIN_PROGRESSCOMPLETEDFAILEDDELETING

回應

欄位 Type 說明

recommendationSummaries

清單

建議摘要的清單。

nextToken

String

下一頁的分頁字符。當沒有更多結果時不存在。

建議摘要欄位

欄位 Type Description

recommendationId

String

唯一識別符。

recommendationArn

String

建議的 ARN。

name

String

建議名稱。

description

String

如果提供,則為選用描述。

type

String

SYSTEM_PROMPT_RECOMMENDATIONTOOL_DESCRIPTION_RECOMMENDATION

status

String

目前狀態:PENDINGIN_PROGRESSCOMPLETEDFAILEDDELETING

createdAt

時間戳記

建立建議時。

updatedAt

時間戳記

上次更新建議的時間。

若要擷取建議的完整詳細資訊和結果,請使用 取得建議recommendationId

錯誤

錯誤 HTTP 狀態 說明

ValidationException

400

無效的分頁參數或狀態篩選條件值。

AccessDeniedException

403

許可不足。

ThrottlingException

429

超過請求率。

InternalServerException

500

服務端錯誤。