Interface SampleConfig.Builder

  • Method Details

    • prompt

      The input prompt to send to the model for text generation.

      Parameters:
      prompt - The input prompt to send to the model for text generation.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • prompt

      The input prompt to send to the model for text generation.

      This is a convenience method that creates an instance of the ModelInput.Builder avoiding the need to create one manually via ModelInput.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to prompt(ModelInput).

      Parameters:
      prompt - a consumer that will call methods on ModelInput.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • numSamples

      SampleConfig.Builder numSamples(Integer numSamples)

      The number of independent samples to generate for the prompt.

      Parameters:
      numSamples - The number of independent samples to generate for the prompt.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • samplingParams

      SampleConfig.Builder samplingParams(SamplingParams samplingParams)

      The parameters controlling the sampling strategy.

      Parameters:
      samplingParams - The parameters controlling the sampling strategy.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • samplingParams

      default SampleConfig.Builder samplingParams(Consumer<SamplingParams.Builder> samplingParams)

      The parameters controlling the sampling strategy.

      This is a convenience method that creates an instance of the SamplingParams.Builder avoiding the need to create one manually via SamplingParams.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to samplingParams(SamplingParams).

      Parameters:
      samplingParams - a consumer that will call methods on SamplingParams.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • includePromptLogprobs

      SampleConfig.Builder includePromptLogprobs(Boolean includePromptLogprobs)

      Specifies whether to include per-token log-probabilities for the input prompt in the response.

      Parameters:
      includePromptLogprobs - Specifies whether to include per-token log-probabilities for the input prompt in the response.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • topkPromptLogprobs

      SampleConfig.Builder topkPromptLogprobs(Integer topkPromptLogprobs)

      The number of top-k log-probabilities to return per prompt token.

      Parameters:
      topkPromptLogprobs - The number of top-k log-probabilities to return per prompt token.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • modelPackageArn

      SampleConfig.Builder modelPackageArn(String modelPackageArn)

      The ARN of the model package whose checkpoint this sample should run against. Must be a valid SageMaker model package ARN in the format arn:aws:sagemaker:REGION:ACCOUNT:model-package/PACKAGE_NAME/VERSION. When absent, the sample runs against the session's latest checkpoint.

      Parameters:
      modelPackageArn - The ARN of the model package whose checkpoint this sample should run against. Must be a valid SageMaker model package ARN in the format arn:aws:sagemaker:REGION:ACCOUNT:model-package/PACKAGE_NAME/VERSION. When absent, the sample runs against the session's latest checkpoint.
      Returns:
      Returns a reference to this object so that method calls can be chained together.