Skip to content
v2.275.0

Experimental

@aws-cdk/aws-bedrock-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

PromptPreProcessingConfigCustomParser Struct ​

Configuration for the pre-processing step.

Example ​

ts
const parserFunction = new lambda.Function(this, 'ParserFunction', {
  runtime: lambda.Runtime.PYTHON_3_10,
  handler: 'index.handler',
  code: lambda.Code.fromAsset('lambda'),
});

const agent = new bedrock.Agent(this, 'Agent', {
  foundationModel: bedrock.BedrockFoundationModel.AMAZON_NOVA_LITE_V1,
  instruction: 'You are a helpful assistant.',
  promptOverrideConfiguration: bedrock.PromptOverrideConfiguration.withCustomParser({
    parser: parserFunction,
    preProcessingStep: {
      stepType: bedrock.AgentStepType.PRE_PROCESSING,
      useCustomParser: true
    }
  })
});

Properties ​

customPromptTemplateoptionalstringcustom_prompt_templateoptionalstrcustomPromptTemplateoptionalStringCustomPromptTemplateoptionalstringCustomPromptTemplateoptional*string#
The custom prompt template to be used.

Default: The default prompt template will be used.

inferenceConfigoptionalInferenceConfigurationinference_configoptionalInferenceConfigurationinferenceConfigoptionalInferenceConfigurationInferenceConfigoptionalInferenceConfigurationInferenceConfigoptionalInferenceConfiguration#
The inference configuration parameters to use.

Default: undefined - Default inference configuration will be used

stepEnabledoptionalbooleanstep_enabledoptionalboolstepEnabledoptionalBooleanStepEnabledoptionalboolStepEnabledoptional*bool#
Whether to enable or skip this step in the agent sequence.

Default: The default state for each step type is as follows. PRE_PROCESSING – ENABLED ORCHESTRATION – ENABLED KNOWLEDGE_BASE_RESPONSE_GENERATION – ENABLED POST_PROCESSING – DISABLED

stepTypeAgentStepTypestep_typeAgentStepTypestepTypeAgentStepTypeStepTypeAgentStepTypeStepTypeAgentStepTyperequired#
The type of step this configuration applies to.
useCustomParseroptionalbooleanuse_custom_parseroptionalbooluseCustomParseroptionalBooleanUseCustomParseroptionalboolUseCustomParseroptional*bool= false#
Whether to use the custom Lambda parser defined for the sequence.