Class PromptConfiguration

java.lang.Object
software.amazon.awssdk.services.bedrockagentruntime.model.PromptConfiguration
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<PromptConfiguration.Builder,PromptConfiguration>

@Generated("software.amazon.awssdk:codegen") public final class PromptConfiguration extends Object implements SdkPojo, Serializable, ToCopyableBuilder<PromptConfiguration.Builder,PromptConfiguration>

Contains configurations to override a prompt template in one part of an agent sequence. For more information, see Advanced prompts.

See Also:
  • Method Details

    • additionalModelRequestFields

      public final Document additionalModelRequestFields()

      If the Converse or ConverseStream operations support the model, additionalModelRequestFields contains additional inference parameters, beyond the base set of inference parameters in the inferenceConfiguration field.

      For more information, see Inference request parameters and response fields for foundation models in the Amazon Bedrock user guide.

      Returns:
      If the Converse or ConverseStream operations support the model, additionalModelRequestFields contains additional inference parameters, beyond the base set of inference parameters in the inferenceConfiguration field.

      For more information, see Inference request parameters and response fields for foundation models in the Amazon Bedrock user guide.

    • basePromptTemplate

      public final String basePromptTemplate()

      Defines the prompt template with which to replace the default prompt template. You can use placeholder variables in the base prompt template to customize the prompt. For more information, see Prompt template placeholder variables. For more information, see Configure the prompt templates.

      Returns:
      Defines the prompt template with which to replace the default prompt template. You can use placeholder variables in the base prompt template to customize the prompt. For more information, see Prompt template placeholder variables. For more information, see Configure the prompt templates.
    • foundationModel

      public final String foundationModel()

      The foundation model to use.

      Returns:
      The foundation model to use.
    • inferenceConfiguration

      public final InferenceConfiguration inferenceConfiguration()

      Contains inference parameters to use when the agent invokes a foundation model in the part of the agent sequence defined by the promptType. For more information, see Inference parameters for foundation models.

      Returns:
      Contains inference parameters to use when the agent invokes a foundation model in the part of the agent sequence defined by the promptType. For more information, see Inference parameters for foundation models.
    • parserMode

      public final CreationMode parserMode()

      Specifies whether to override the default parser Lambda function when parsing the raw foundation model output in the part of the agent sequence defined by the promptType. If you set the field as OVERRIDDEN, the overrideLambda field in the PromptOverrideConfiguration must be specified with the ARN of a Lambda function.

      If the service returns an enum value that is not available in the current SDK version, parserMode will return CreationMode.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from parserModeAsString().

      Returns:
      Specifies whether to override the default parser Lambda function when parsing the raw foundation model output in the part of the agent sequence defined by the promptType. If you set the field as OVERRIDDEN, the overrideLambda field in the PromptOverrideConfiguration must be specified with the ARN of a Lambda function.
      See Also:
    • parserModeAsString

      public final String parserModeAsString()

      Specifies whether to override the default parser Lambda function when parsing the raw foundation model output in the part of the agent sequence defined by the promptType. If you set the field as OVERRIDDEN, the overrideLambda field in the PromptOverrideConfiguration must be specified with the ARN of a Lambda function.

      If the service returns an enum value that is not available in the current SDK version, parserMode will return CreationMode.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from parserModeAsString().

      Returns:
      Specifies whether to override the default parser Lambda function when parsing the raw foundation model output in the part of the agent sequence defined by the promptType. If you set the field as OVERRIDDEN, the overrideLambda field in the PromptOverrideConfiguration must be specified with the ARN of a Lambda function.
      See Also:
    • promptCreationMode

      public final CreationMode promptCreationMode()

      Specifies whether to override the default prompt template for this promptType. Set this value to OVERRIDDEN to use the prompt that you provide in the basePromptTemplate. If you leave it as DEFAULT, the agent uses a default prompt template.

      If the service returns an enum value that is not available in the current SDK version, promptCreationMode will return CreationMode.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from promptCreationModeAsString().

      Returns:
      Specifies whether to override the default prompt template for this promptType. Set this value to OVERRIDDEN to use the prompt that you provide in the basePromptTemplate. If you leave it as DEFAULT, the agent uses a default prompt template.
      See Also:
    • promptCreationModeAsString

      public final String promptCreationModeAsString()

      Specifies whether to override the default prompt template for this promptType. Set this value to OVERRIDDEN to use the prompt that you provide in the basePromptTemplate. If you leave it as DEFAULT, the agent uses a default prompt template.

      If the service returns an enum value that is not available in the current SDK version, promptCreationMode will return CreationMode.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from promptCreationModeAsString().

      Returns:
      Specifies whether to override the default prompt template for this promptType. Set this value to OVERRIDDEN to use the prompt that you provide in the basePromptTemplate. If you leave it as DEFAULT, the agent uses a default prompt template.
      See Also:
    • promptState

      public final PromptState promptState()

      Specifies whether to allow the inline agent to carry out the step specified in the promptType. If you set this value to DISABLED, the agent skips that step. The default state for each promptType is as follows.

      • PRE_PROCESSINGENABLED

      • ORCHESTRATIONENABLED

      • KNOWLEDGE_BASE_RESPONSE_GENERATIONENABLED

      • POST_PROCESSINGDISABLED

      If the service returns an enum value that is not available in the current SDK version, promptState will return PromptState.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from promptStateAsString().

      Returns:
      Specifies whether to allow the inline agent to carry out the step specified in the promptType. If you set this value to DISABLED, the agent skips that step. The default state for each promptType is as follows.

      • PRE_PROCESSINGENABLED

      • ORCHESTRATIONENABLED

      • KNOWLEDGE_BASE_RESPONSE_GENERATIONENABLED

      • POST_PROCESSINGDISABLED

      See Also:
    • promptStateAsString

      public final String promptStateAsString()

      Specifies whether to allow the inline agent to carry out the step specified in the promptType. If you set this value to DISABLED, the agent skips that step. The default state for each promptType is as follows.

      • PRE_PROCESSINGENABLED

      • ORCHESTRATIONENABLED

      • KNOWLEDGE_BASE_RESPONSE_GENERATIONENABLED

      • POST_PROCESSINGDISABLED

      If the service returns an enum value that is not available in the current SDK version, promptState will return PromptState.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from promptStateAsString().

      Returns:
      Specifies whether to allow the inline agent to carry out the step specified in the promptType. If you set this value to DISABLED, the agent skips that step. The default state for each promptType is as follows.

      • PRE_PROCESSINGENABLED

      • ORCHESTRATIONENABLED

      • KNOWLEDGE_BASE_RESPONSE_GENERATIONENABLED

      • POST_PROCESSINGDISABLED

      See Also:
    • promptType

      public final PromptType promptType()

      The step in the agent sequence that this prompt configuration applies to.

      If the service returns an enum value that is not available in the current SDK version, promptType will return PromptType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from promptTypeAsString().

      Returns:
      The step in the agent sequence that this prompt configuration applies to.
      See Also:
    • promptTypeAsString

      public final String promptTypeAsString()

      The step in the agent sequence that this prompt configuration applies to.

      If the service returns an enum value that is not available in the current SDK version, promptType will return PromptType.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from promptTypeAsString().

      Returns:
      The step in the agent sequence that this prompt configuration applies to.
      See Also:
    • toBuilder

      public PromptConfiguration.Builder toBuilder()
      Description copied from interface: ToCopyableBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToCopyableBuilder<PromptConfiguration.Builder,PromptConfiguration>
      Returns:
      a builder for type T
    • builder

      public static PromptConfiguration.Builder builder()
    • serializableBuilderClass

      public static Class<? extends PromptConfiguration.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      Description copied from interface: SdkPojo
      Indicates whether some other object is "equal to" this one by SDK fields. An SDK field is a modeled, non-inherited field in an SdkPojo class, and is generated based on a service model.

      If an SdkPojo class does not have any inherited fields, equalsBySdkFields and equals are essentially the same.

      Specified by:
      equalsBySdkFields in interface SdkPojo
      Parameters:
      obj - the object to be compared with
      Returns:
      true if the other object equals to this object by sdk fields, false otherwise.
    • toString

      public final String toString()
      Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
      Returns:
      List of SdkField in this POJO. May be empty list but should never be null.
    • sdkFieldNameToField

      public final Map<String,SdkField<?>> sdkFieldNameToField()
      Specified by:
      sdkFieldNameToField in interface SdkPojo
      Returns:
      The mapping between the field name and its corresponding field.