Skip to content

create_advanced_prompt_optimization_job

Operation

create_advanced_prompt_optimization_job

Creates an advanced prompt optimization job. The job optimizes your prompt templates for specific models using your evaluation dataset and criteria.

Parameters:

Name Type Description Default
request CreateAdvancedPromptOptimizationJobInput | CreateAdvancedPromptOptimizationJobInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[CreateAdvancedPromptOptimizationJobInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
CreateAdvancedPromptOptimizationJobOutput

An instance of CreateAdvancedPromptOptimizationJobOutput.

create_advanced_prompt_optimization_job async

Creates an advanced prompt optimization job. The job optimizes your prompt templates for specific models using your evaluation dataset and criteria.

Parameters:

Name Type Description Default
request CreateAdvancedPromptOptimizationJobInput | CreateAdvancedPromptOptimizationJobInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None
**kwargs Unpack[CreateAdvancedPromptOptimizationJobInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
CreateAdvancedPromptOptimizationJobOutput

An instance of CreateAdvancedPromptOptimizationJobOutput.

Input

Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.

CreateAdvancedPromptOptimizationJobInputDict

Bases: TypedDict

Dictionary form of CreateAdvancedPromptOptimizationJobInput.

Attributes

client_token instance-attribute
client_token: str | 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, Amazon Bedrock ignores the request but does not return an error.

This field is autopopulated if not provided.

encryption_key_arn instance-attribute
encryption_key_arn: str | None

The Amazon Resource Name (ARN) of the KMS key used for encrypting the output data. If not specified, the output is encrypted with an Amazon-owned KMS key.

input_config instance-attribute

Specifies the S3 location of your JSONL input file containing prompt templates and evaluation samples.

job_description instance-attribute
job_description: str | None

A description of the advanced prompt optimization job.

job_name instance-attribute
job_name: Required[str]

A name for the advanced prompt optimization job.

model_configurations instance-attribute

A list of model configurations specifying the target models for prompt optimization. You can specify up to 5 models.

output_config instance-attribute

Specifies the S3 location where optimization results will be stored.

tags instance-attribute
tags: Sequence[Tag | TagDict] | None

Tags to associate with the advanced prompt optimization job.

CreateAdvancedPromptOptimizationJobInput dataclass

Bases: _SerdeShape

Create Advanced Prompt Optimization Job Request

Attributes

client_token class-attribute instance-attribute
client_token: str | 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, Amazon Bedrock ignores the request but does not return an error.

This field is autopopulated if not provided.

encryption_key_arn class-attribute instance-attribute
encryption_key_arn: str | None = ...

The Amazon Resource Name (ARN) of the KMS key used for encrypting the output data. If not specified, the output is encrypted with an Amazon-owned KMS key.

input_config class-attribute instance-attribute
input_config: AdvancedPromptOptimizationInputConfig | None = ...

Specifies the S3 location of your JSONL input file containing prompt templates and evaluation samples.

job_description class-attribute instance-attribute
job_description: str | None = ...

A description of the advanced prompt optimization job.

job_name class-attribute instance-attribute
job_name: str | None = ...

A name for the advanced prompt optimization job.

model_configurations class-attribute instance-attribute
model_configurations: list[ModelConfiguration] | None = ...

A list of model configurations specifying the target models for prompt optimization. You can specify up to 5 models.

output_config class-attribute instance-attribute
output_config: AdvancedPromptOptimizationOutputConfig | None = ...

Specifies the S3 location where optimization results will be stored.

tags class-attribute instance-attribute
tags: list[Tag] | None = ...

Tags to associate with the advanced prompt optimization job.

Output

CreateAdvancedPromptOptimizationJobOutput dataclass

Bases: _SerdeShape

Create Advanced Prompt Optimization Job Response

Attributes

job_arn instance-attribute
job_arn: str

The Amazon Resource Name (ARN) of the created advanced prompt optimization job.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.