Class: AWSCDK::Bedrock::CfnFlow::KnowledgeBaseFlowNodeConfigurationProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Bedrock::CfnFlow::KnowledgeBaseFlowNodeConfigurationProperty
- Defined in:
- bedrock/cfn_flow.rb
Overview
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.
Instance Attribute Summary collapse
-
#guardrail_configuration ⇒ AWSCDK::IResolvable, ...
readonly
Contains configurations for a guardrail to apply during query and response generation for the knowledge base in this configuration.
-
#inference_configuration ⇒ AWSCDK::IResolvable, ...
readonly
Contains inference configurations for the prompt.
-
#knowledge_base_id ⇒ String
readonly
The unique identifier of the knowledge base to query.
-
#model_id ⇒ String?
readonly
The unique identifier of the model or inference profile to use to generate a response from the query results.
-
#number_of_results ⇒ Numeric?
readonly
The number of results to retrieve from the knowledge base.
-
#orchestration_configuration ⇒ AWSCDK::IResolvable, ...
readonly
The configuration for orchestrating the retrieval and generation process in the knowledge base node.
-
#prompt_template ⇒ AWSCDK::IResolvable, ...
readonly
A custom prompt template to use with the knowledge base for generating responses.
-
#reranking_configuration ⇒ AWSCDK::IResolvable, ...
readonly
The configuration for reranking the retrieved results from the knowledge base to improve relevance.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(knowledge_base_id:, guardrail_configuration: nil, inference_configuration: nil, model_id: nil, number_of_results: nil, orchestration_configuration: nil, prompt_template: nil, reranking_configuration: nil) ⇒ KnowledgeBaseFlowNodeConfigurationProperty
constructor
A new instance of KnowledgeBaseFlowNodeConfigurationProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(knowledge_base_id:, guardrail_configuration: nil, inference_configuration: nil, model_id: nil, number_of_results: nil, orchestration_configuration: nil, prompt_template: nil, reranking_configuration: nil) ⇒ KnowledgeBaseFlowNodeConfigurationProperty
Returns a new instance of KnowledgeBaseFlowNodeConfigurationProperty.
1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 |
# File 'bedrock/cfn_flow.rb', line 1634 def initialize(knowledge_base_id:, guardrail_configuration: nil, inference_configuration: nil, model_id: nil, number_of_results: nil, orchestration_configuration: nil, prompt_template: nil, reranking_configuration: nil) @knowledge_base_id = knowledge_base_id Jsii::Type.check_type(@knowledge_base_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "knowledgeBaseId") @guardrail_configuration = guardrail_configuration.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnFlow::GuardrailConfigurationProperty.new(**guardrail_configuration.transform_keys(&:to_sym)) : guardrail_configuration Jsii::Type.check_type(@guardrail_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmbkZsb3cuR3VhcmRyYWlsQ29uZmlndXJhdGlvblByb3BlcnR5In1dfX0=")), "guardrailConfiguration") unless @guardrail_configuration.nil? @inference_configuration = inference_configuration.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnFlow::PromptInferenceConfigurationProperty.new(**inference_configuration.transform_keys(&:to_sym)) : inference_configuration Jsii::Type.check_type(@inference_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmbkZsb3cuUHJvbXB0SW5mZXJlbmNlQ29uZmlndXJhdGlvblByb3BlcnR5In1dfX0=")), "inferenceConfiguration") unless @inference_configuration.nil? @model_id = model_id Jsii::Type.check_type(@model_id, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "modelId") unless @model_id.nil? @number_of_results = number_of_results Jsii::Type.check_type(@number_of_results, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJudW1iZXIifQ==")), "numberOfResults") unless @number_of_results.nil? @orchestration_configuration = orchestration_configuration.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnFlow::KnowledgeBaseOrchestrationConfigurationProperty.new(**orchestration_configuration.transform_keys(&:to_sym)) : orchestration_configuration Jsii::Type.check_type(@orchestration_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmbkZsb3cuS25vd2xlZGdlQmFzZU9yY2hlc3RyYXRpb25Db25maWd1cmF0aW9uUHJvcGVydHkifV19fQ==")), "orchestrationConfiguration") unless @orchestration_configuration.nil? @prompt_template = prompt_template.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnFlow::KnowledgeBasePromptTemplateProperty.new(**prompt_template.transform_keys(&:to_sym)) : prompt_template Jsii::Type.check_type(@prompt_template, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmbkZsb3cuS25vd2xlZGdlQmFzZVByb21wdFRlbXBsYXRlUHJvcGVydHkifV19fQ==")), "promptTemplate") unless @prompt_template.nil? @reranking_configuration = reranking_configuration.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnFlow::VectorSearchRerankingConfigurationProperty.new(**reranking_configuration.transform_keys(&:to_sym)) : reranking_configuration Jsii::Type.check_type(@reranking_configuration, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmbkZsb3cuVmVjdG9yU2VhcmNoUmVyYW5raW5nQ29uZmlndXJhdGlvblByb3BlcnR5In1dfX0=")), "rerankingConfiguration") unless @reranking_configuration.nil? end |
Instance Attribute Details
#guardrail_configuration ⇒ AWSCDK::IResolvable, ... (readonly)
Contains configurations for a guardrail to apply during query and response generation for the knowledge base in this configuration.
1662 1663 1664 |
# File 'bedrock/cfn_flow.rb', line 1662 def guardrail_configuration @guardrail_configuration end |
#inference_configuration ⇒ AWSCDK::IResolvable, ... (readonly)
Contains inference configurations for the prompt.
1667 1668 1669 |
# File 'bedrock/cfn_flow.rb', line 1667 def inference_configuration @inference_configuration end |
#knowledge_base_id ⇒ String (readonly)
The unique identifier of the knowledge base to query.
1657 1658 1659 |
# File 'bedrock/cfn_flow.rb', line 1657 def knowledge_base_id @knowledge_base_id end |
#model_id ⇒ String? (readonly)
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.
1672 1673 1674 |
# File 'bedrock/cfn_flow.rb', line 1672 def model_id @model_id end |
#number_of_results ⇒ Numeric? (readonly)
The number of results to retrieve from the knowledge base.
1677 1678 1679 |
# File 'bedrock/cfn_flow.rb', line 1677 def number_of_results @number_of_results end |
#orchestration_configuration ⇒ AWSCDK::IResolvable, ... (readonly)
The configuration for orchestrating the retrieval and generation process in the knowledge base node.
1682 1683 1684 |
# File 'bedrock/cfn_flow.rb', line 1682 def orchestration_configuration @orchestration_configuration end |
#prompt_template ⇒ AWSCDK::IResolvable, ... (readonly)
A custom prompt template to use with the knowledge base for generating responses.
1687 1688 1689 |
# File 'bedrock/cfn_flow.rb', line 1687 def prompt_template @prompt_template end |
#reranking_configuration ⇒ AWSCDK::IResolvable, ... (readonly)
The configuration for reranking the retrieved results from the knowledge base to improve relevance.
1692 1693 1694 |
# File 'bedrock/cfn_flow.rb', line 1692 def reranking_configuration @reranking_configuration end |
Class Method Details
.jsii_properties ⇒ Object
1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 |
# File 'bedrock/cfn_flow.rb', line 1694 def self.jsii_properties { :knowledge_base_id => "knowledgeBaseId", :guardrail_configuration => "guardrailConfiguration", :inference_configuration => "inferenceConfiguration", :model_id => "modelId", :number_of_results => "numberOfResults", :orchestration_configuration => "orchestrationConfiguration", :prompt_template => "promptTemplate", :reranking_configuration => "rerankingConfiguration", } end |
Instance Method Details
#to_jsii ⇒ Object
1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 |
# File 'bedrock/cfn_flow.rb', line 1707 def to_jsii result = {} result.merge!({ "knowledgeBaseId" => @knowledge_base_id, "guardrailConfiguration" => @guardrail_configuration, "inferenceConfiguration" => @inference_configuration, "modelId" => @model_id, "numberOfResults" => @number_of_results, "orchestrationConfiguration" => @orchestration_configuration, "promptTemplate" => @prompt_template, "rerankingConfiguration" => @reranking_configuration, }) result.compact end |