InferenceConfigurationProperty Struct
Base inference parameters to pass to a model in a call to Converse or ConverseStream . For more information, see Inference parameters for foundation models .
If you need to pass additional parameters that the model supports, use the additionalModelRequestFields request field in the call to Converse or ConverseStream . For more information, see Model parameters .
| Source | |
|---|---|
| Type last changed |
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_bedrock as bedrock } from 'aws-cdk-lib';
const inferenceConfigurationProperty: bedrock.CfnAgent.InferenceConfigurationProperty = {
maximumLength: 123,
stopSequences: ['stopSequences'],
temperature: 123,
topK: 123,
topP: 123,
};
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_bedrock as bedrock
inference_configuration_property = bedrock.CfnAgent.InferenceConfigurationProperty(
maximum_length=123,
stop_sequences=["stopSequences"],
temperature=123,
top_k=123,
top_p=123
)
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.bedrock.*;
InferenceConfigurationProperty inferenceConfigurationProperty = InferenceConfigurationProperty.builder()
.maximumLength(123)
.stopSequences(List.of("stopSequences"))
.temperature(123)
.topK(123)
.topP(123)
.build();
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.Bedrock;
var inferenceConfigurationProperty = new InferenceConfigurationProperty {
MaximumLength = 123,
StopSequences = new [] { "stopSequences" },
Temperature = 123,
TopK = 123,
TopP = 123
};
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
inferenceConfigurationProperty := &InferenceConfigurationProperty{
MaximumLength: jsii.Number(123),
StopSequences: []*string{
jsii.String("stopSequences"),
},
Temperature: jsii.Number(123),
TopK: jsii.Number(123),
TopP: jsii.Number(123),
}
Properties
maximumLengthoptionalnumbermaximum_lengthoptionalint | floatmaximumLengthoptionalNumberMaximumLengthoptionaldoubleMaximumLengthoptional*float64 #stopSequencesoptionalstring[]stop_sequencesoptionaltyping.List[str]stopSequencesoptionalList<String>StopSequencesoptionalstring[]StopSequencesoptional*[]*string #A stop sequence is a sequence of characters that causes the model to stop generating the response.
temperatureoptionalnumbertemperatureoptionalint | floattemperatureoptionalNumberTemperatureoptionaldoubleTemperatureoptional*float64 #notes
A lower value makes the model more likely to choose higher-probability options, while a higher value makes the model more likely to choose lower-probability options.
The default value is the default value for the model that you are using. For more information, see Inference parameters for foundation models .
topKoptionalnumbertop_koptionalint | floattopKoptionalNumberTopKoptionaldoubleTopKoptional*float64 #notes
The value that you set for topK is the number of most-likely candidates from which the model chooses the next token in the sequence. For example, if you set topK to 50, the model selects the next token from among the top 50 most likely choices.
topPoptionalnumbertop_poptionalint | floattopPoptionalNumberTopPoptionaldoubleTopPoptional*float64 #notes
For example, if you choose a value of 0.8 for topP , the model selects from the top 80% of the probability distribution of tokens that could be next in the sequence.
The default value is the default value for the model that you are using. For more information, see Inference parameters for foundation models .