interface KnowledgeBaseFlowNodeConfigurationProperty
Language | Type name |
---|---|
![]() | Amazon.CDK.aws_bedrock.CfnFlow.KnowledgeBaseFlowNodeConfigurationProperty |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsbedrock#CfnFlow_KnowledgeBaseFlowNodeConfigurationProperty |
![]() | software.amazon.awscdk.services.bedrock.CfnFlow.KnowledgeBaseFlowNodeConfigurationProperty |
![]() | aws_cdk.aws_bedrock.CfnFlow.KnowledgeBaseFlowNodeConfigurationProperty |
![]() | aws-cdk-lib » aws_bedrock » CfnFlow » KnowledgeBaseFlowNodeConfigurationProperty |
Contains configurations for a knowledge base node in a flow.
This node takes a query as the input and returns, as the output, the retrieved responses directly (as an array) or a response generated based on the retrieved responses. For more information, see Node types in a flow in the Amazon Bedrock User Guide.
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';
declare const additionalModelRequestFields: any;
const knowledgeBaseFlowNodeConfigurationProperty: bedrock.CfnFlow.KnowledgeBaseFlowNodeConfigurationProperty = {
knowledgeBaseId: 'knowledgeBaseId',
// the properties below are optional
guardrailConfiguration: {
guardrailIdentifier: 'guardrailIdentifier',
guardrailVersion: 'guardrailVersion',
},
inferenceConfiguration: {
text: {
maxTokens: 123,
stopSequences: ['stopSequences'],
temperature: 123,
topP: 123,
},
},
modelId: 'modelId',
numberOfResults: 123,
orchestrationConfiguration: {
additionalModelRequestFields: additionalModelRequestFields,
inferenceConfig: {
text: {
maxTokens: 123,
stopSequences: ['stopSequences'],
temperature: 123,
topP: 123,
},
},
performanceConfig: {
latency: 'latency',
},
promptTemplate: {
textPromptTemplate: 'textPromptTemplate',
},
},
promptTemplate: {
textPromptTemplate: 'textPromptTemplate',
},
rerankingConfiguration: {
type: 'type',
// the properties below are optional
bedrockRerankingConfiguration: {
modelConfiguration: {
modelArn: 'modelArn',
// the properties below are optional
additionalModelRequestFields: additionalModelRequestFields,
},
// the properties below are optional
metadataConfiguration: {
selectionMode: 'selectionMode',
// the properties below are optional
selectiveModeConfiguration: {
fieldsToExclude: [{
fieldName: 'fieldName',
}],
fieldsToInclude: [{
fieldName: 'fieldName',
}],
},
},
numberOfRerankedResults: 123,
},
},
};
Properties
Name | Type | Description |
---|---|---|
knowledge | string | The unique identifier of the knowledge base to query. |
guardrail | IResolvable | Guardrail | Contains configurations for a guardrail to apply during query and response generation for the knowledge base in this configuration. |
inference | IResolvable | Prompt | Contains inference configurations for the prompt. |
model | string | The unique identifier of the model or inference profile to use to generate a response from the query results. Omit this field if you want to return the retrieved results as an array. |
number | number | The number of results to retrieve from the knowledge base. |
orchestration | IResolvable | Knowledge | The configuration for orchestrating the retrieval and generation process in the knowledge base node. |
prompt | IResolvable | Knowledge | A custom prompt template to use with the knowledge base for generating responses. |
reranking | IResolvable | Vector | The configuration for reranking the retrieved results from the knowledge base to improve relevance. |
knowledgeBaseId
Type:
string
The unique identifier of the knowledge base to query.
guardrailConfiguration?
Type:
IResolvable
|
Guardrail
(optional)
Contains configurations for a guardrail to apply during query and response generation for the knowledge base in this configuration.
inferenceConfiguration?
Type:
IResolvable
|
Prompt
(optional)
Contains inference configurations for the prompt.
modelId?
Type:
string
(optional)
The unique identifier of the model or inference profile to use to generate a response from the query results. Omit this field if you want to return the retrieved results as an array.
numberOfResults?
Type:
number
(optional)
The number of results to retrieve from the knowledge base.
orchestrationConfiguration?
Type:
IResolvable
|
Knowledge
(optional)
The configuration for orchestrating the retrieval and generation process in the knowledge base node.
promptTemplate?
Type:
IResolvable
|
Knowledge
(optional)
A custom prompt template to use with the knowledge base for generating responses.
rerankingConfiguration?
Type:
IResolvable
|
Vector
(optional)
The configuration for reranking the retrieved results from the knowledge base to improve relevance.