2026/05/14 - Amazon Bedrock - 5 new api methods
Changes Advanced Prompt Optimization (AdvPO) allows you to optimize and migrate your prompts for any model on Bedrock by automatically evaluating responses and rewriting prompts to improve performance. This release provides a programmatic way to create, get, list, stop, and delete AdvPO jobs.
Stops an in-progress advanced prompt optimization job.
See also: AWS API Documentation
Request Syntax
client.stop_advanced_prompt_optimization_job(
jobIdentifier='string'
)
string
[REQUIRED]
ARN or ID of the advanced prompt optimization job to stop.
dict
Response Syntax
{}
Response Structure
(dict) --
Stop Advanced Prompt Optimization Job Response
Batch delete the specified advanced prompt optimization jobs.
See also: AWS API Documentation
Request Syntax
client.batch_delete_advanced_prompt_optimization_job(
jobIdentifiers=[
'string',
]
)
list
[REQUIRED]
List of advanced prompt optimization job identifiers to delete.
(string) --
ARN or ID of the advanced prompt optimization job.
dict
Response Syntax
{
'errors': [
{
'jobIdentifier': 'string',
'code': 'string',
'message': 'string'
},
],
'advancedPromptOptimizationJobs': [
{
'jobIdentifier': 'string',
'jobStatus': 'InProgress'|'Completed'|'Failed'|'PartiallyCompleted'|'Stopping'|'Stopped'|'Deleting'
},
]
}
Response Structure
(dict) --
Batch Delete Advanced Prompt Optimization Jobs Response
errors (list) --
List of errors encountered during batch deletion.
(dict) --
Batch deletion error for an advanced prompt optimization job.
jobIdentifier (string) --
Identifier of the job that failed to delete.
code (string) --
Error code for the deletion failure.
message (string) --
Error message describing the deletion failure.
advancedPromptOptimizationJobs (list) --
List of successfully deleted advanced prompt optimization jobs.
(dict) --
Successfully deleted advanced prompt optimization job.
jobIdentifier (string) --
Identifier of the deleted job.
jobStatus (string) --
Status of the deleted job.
Creates an asynchronous batch job for advanced prompt optimization.
See also: AWS API Documentation
Request Syntax
client.create_advanced_prompt_optimization_job(
jobName='string',
jobDescription='string',
clientToken='string',
inputConfig={
's3Uri': 'string'
},
outputConfig={
's3Uri': 'string'
},
encryptionKeyArn='string',
tags=[
{
'key': 'string',
'value': 'string'
},
],
modelConfigurations=[
{
'modelId': 'string',
'inferenceConfig': {
'maxTokens': 123,
'temperature': ...,
'topP': ...,
'stopSequences': [
'string',
]
},
'additionalModelRequestFields': {
'string': {...}|[...]|123|123.4|'string'|True|None
}
},
]
)
string
[REQUIRED]
Name of the advanced prompt optimization job.
string
Description of the advanced prompt optimization job.
string
Idempotency token for the request.
This field is autopopulated if not provided.
dict
[REQUIRED]
Input data configuration for the advanced prompt optimization job.
s3Uri (string) -- [REQUIRED]
S3 URI of the input JSONL file.
dict
[REQUIRED]
Output data configuration for the advanced prompt optimization job.
s3Uri (string) -- [REQUIRED]
S3 URI prefix for the output location.
string
KMS key ARN for encrypting output data.
list
Tags to associate with the job.
(dict) --
Definition of the key/value pair for a tag.
key (string) -- [REQUIRED]
Key for the tag.
value (string) -- [REQUIRED]
Value for the tag.
list
[REQUIRED]
Model configurations for advanced prompt optimization.
(dict) --
Configuration for a model used in advanced prompt optimization.
modelId (string) -- [REQUIRED]
The model ID.
inferenceConfig (dict) --
Inference configuration for the model.
maxTokens (integer) --
The maximum number of tokens to generate.
temperature (float) --
The temperature for sampling.
topP (float) --
The top-p value for nucleus sampling.
stopSequences (list) --
Stop sequences that end generation.
(string) --
additionalModelRequestFields (dict) --
Additional model request fields.
(string) --
(:ref:`document<document>`) --
dict
Response Syntax
{
'jobArn': 'string'
}
Response Structure
(dict) --
Create Advanced Prompt Optimization Job Response
jobArn (string) --
ARN of the created advanced prompt optimization job.
Retrieves the details and status of an advanced prompt optimization job.
See also: AWS API Documentation
Request Syntax
client.get_advanced_prompt_optimization_job(
jobIdentifier='string'
)
string
[REQUIRED]
ARN or ID of the advanced prompt optimization job.
dict
Response Syntax
{
'jobArn': 'string',
'jobName': 'string',
'jobDescription': 'string',
'jobStatus': 'InProgress'|'Completed'|'Failed'|'PartiallyCompleted'|'Stopping'|'Stopped'|'Deleting',
'inputConfig': {
's3Uri': 'string'
},
'outputConfig': {
's3Uri': 'string'
},
'encryptionKeyArn': 'string',
'creationTime': datetime(2015, 1, 1),
'lastModifiedTime': datetime(2015, 1, 1),
'failureMessage': 'string',
'modelConfigurations': [
{
'modelId': 'string',
'inferenceConfig': {
'maxTokens': 123,
'temperature': ...,
'topP': ...,
'stopSequences': [
'string',
]
},
'additionalModelRequestFields': {
'string': {...}|[...]|123|123.4|'string'|True|None
}
},
]
}
Response Structure
(dict) --
Get Advanced Prompt Optimization Job Response
jobArn (string) --
ARN of the advanced prompt optimization job.
jobName (string) --
Name of the advanced prompt optimization job.
jobDescription (string) --
Description of the advanced prompt optimization job.
jobStatus (string) --
Status of the advanced prompt optimization job.
inputConfig (dict) --
Input data configuration for the advanced prompt optimization job.
s3Uri (string) --
S3 URI of the input JSONL file.
outputConfig (dict) --
Output data configuration for the advanced prompt optimization job.
s3Uri (string) --
S3 URI prefix for the output location.
encryptionKeyArn (string) --
KMS key ARN used for encrypting output data.
creationTime (datetime) --
Creation time of the advanced prompt optimization job.
lastModifiedTime (datetime) --
Last modified time of the advanced prompt optimization job.
failureMessage (string) --
Failure message if the advanced prompt optimization job failed.
modelConfigurations (list) --
Model configurations for advanced prompt optimization.
(dict) --
Configuration for a model used in advanced prompt optimization.
modelId (string) --
The model ID.
inferenceConfig (dict) --
Inference configuration for the model.
maxTokens (integer) --
The maximum number of tokens to generate.
temperature (float) --
The temperature for sampling.
topP (float) --
The top-p value for nucleus sampling.
stopSequences (list) --
Stop sequences that end generation.
(string) --
additionalModelRequestFields (dict) --
Additional model request fields.
(string) --
(:ref:`document<document>`) --
Lists all advanced prompt optimization jobs for the account.
See also: AWS API Documentation
Request Syntax
client.list_advanced_prompt_optimization_jobs(
maxResults=123,
nextToken='string',
sortBy='CreationTime',
sortOrder='Ascending'|'Descending'
)
integer
Maximum number of results to return.
string
Pagination token for the next page of results.
string
Field to sort by in the returned list of jobs.
string
Sort order for the results.
dict
Response Syntax
{
'jobSummaries': [
{
'jobArn': 'string',
'jobName': 'string',
'jobStatus': 'InProgress'|'Completed'|'Failed'|'PartiallyCompleted'|'Stopping'|'Stopped'|'Deleting',
'creationTime': datetime(2015, 1, 1),
'lastModifiedTime': datetime(2015, 1, 1)
},
],
'nextToken': 'string'
}
Response Structure
(dict) --
List Advanced Prompt Optimization Jobs Response
jobSummaries (list) --
List of advanced prompt optimization job summaries.
(dict) --
Summary of an advanced prompt optimization job.
jobArn (string) --
ARN of the advanced prompt optimization job.
jobName (string) --
Name of the advanced prompt optimization job.
jobStatus (string) --
Status of the advanced prompt optimization job.
creationTime (datetime) --
Creation time of the advanced prompt optimization job.
lastModifiedTime (datetime) --
Last modified time of the advanced prompt optimization job.
nextToken (string) --
Pagination token for the next page of results.