start_recommendation
async
¶
start_recommendation(
name: RecommendationName,
type: RecommendationType,
recommendation_config: RecommendationConfig,
*,
config_overrides: Optional[AsyncBedrockAgentCoreClientConfig] = None,
description: Optional[RecommendationDescription] = None,
kms_key_arn: Optional[KmsKeyArn] = None,
client_token: Optional[ClientToken] = None,
tags: Optional[TagsMap] = None,
) -> StartRecommendationResponse
Starts a recommendation job that analyzes agent traces and generates optimization suggestions for system prompts or tool descriptions to improve agent performance.
Parameters:
-
name(RecommendationName) –The name of the recommendation. Must be unique within your account.
-
description(Optional[RecommendationDescription], default:None) –The description of the recommendation.
-
type(RecommendationType) –The type of recommendation to generate. Valid values are
SYSTEM_PROMPT_RECOMMENDATIONfor system prompt optimization orTOOL_DESCRIPTION_RECOMMENDATIONfor tool description optimization. -
recommendation_config(RecommendationConfig) –The configuration for the recommendation, including the input to optimize, agent traces to analyze, and evaluation settings.
-
kms_key_arn(Optional[KmsKeyArn], default:None) –The ARN of the KMS key used to encrypt recommendation data. If provided, customer data is encrypted at rest with the specified key.
-
client_token(Optional[ClientToken], default:None) –A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, the service ignores the request, but does not return an error.
-
tags(Optional[TagsMap], default:None) –A map of tag keys and values to associate with the recommendation.
Raises:
-
AccessDeniedException–The exception that occurs when you do not have sufficient permissions to perform an action. Verify that your IAM policy includes the necessary permissions for the operation you are trying to perform.
-
ConflictException–The exception that occurs when the request conflicts with the current state of the resource. This can happen when trying to modify a resource that is currently being modified by another request, or when trying to create a resource that already exists.
-
InternalServerException–The exception that occurs when the service encounters an unexpected internal error. This is a temporary condition that will resolve itself with retries. We recommend implementing exponential backoff retry logic in your application.
-
ServiceQuotaExceededException–The exception that occurs when the request would cause a service quota to be exceeded. Review your service quotas and either reduce your request rate or request a quota increase.
-
ThrottlingException–The exception that occurs when the request was denied due to request throttling. This happens when you exceed the allowed request rate for an operation. Reduce the frequency of requests or implement exponential backoff retry logic in your application.
-
ValidationException–The exception that occurs when the input fails to satisfy the constraints specified by the service. Check the error message for details about which input parameter is invalid and correct your request.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_bedrock_agentcore/_services/async_bedrock_agent_core.py
3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 | |