Class: AWSCDK::Bedrock::CfnIntelligentPromptRouterProps

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
bedrock/cfn_intelligent_prompt_router_props.rb

Overview

Properties for defining a CfnIntelligentPromptRouter.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fallback_model:, models:, prompt_router_name:, routing_criteria:, description: nil, tags: nil) ⇒ CfnIntelligentPromptRouterProps

Returns a new instance of CfnIntelligentPromptRouterProps.

Parameters:



15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'bedrock/cfn_intelligent_prompt_router_props.rb', line 15

def initialize(fallback_model:, models:, prompt_router_name:, routing_criteria:, description: nil, tags: nil)
  @fallback_model = fallback_model.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnIntelligentPromptRouter::PromptRouterTargetModelProperty.new(**fallback_model.transform_keys(&:to_sym)) : fallback_model
  Jsii::Type.check_type(@fallback_model, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmbkludGVsbGlnZW50UHJvbXB0Um91dGVyLlByb21wdFJvdXRlclRhcmdldE1vZGVsUHJvcGVydHkifV19fQ==")), "fallbackModel")
  @models = models
  Jsii::Type.check_type(@models, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9jay5DZm5JbnRlbGxpZ2VudFByb21wdFJvdXRlci5Qcm9tcHRSb3V0ZXJUYXJnZXRNb2RlbFByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "models")
  @prompt_router_name = prompt_router_name
  Jsii::Type.check_type(@prompt_router_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "promptRouterName")
  @routing_criteria = routing_criteria.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnIntelligentPromptRouter::RoutingCriteriaProperty.new(**routing_criteria.transform_keys(&:to_sym)) : routing_criteria
  Jsii::Type.check_type(@routing_criteria, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmbkludGVsbGlnZW50UHJvbXB0Um91dGVyLlJvdXRpbmdDcml0ZXJpYVByb3BlcnR5In1dfX0=")), "routingCriteria")
  @description = description
  Jsii::Type.check_type(@description, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "description") unless @description.nil?
  @tags = tags.is_a?(Array) ? tags.map { |jsii_v0| jsii_v0.is_a?(Hash) ? ::AWSCDK::CfnTag.new(**jsii_v0.transform_keys(&:to_sym)) : jsii_v0 } : tags
  Jsii::Type.check_type(@tags, JSON.parse(Base64.strict_decode64("eyJjb2xsZWN0aW9uIjp7ImVsZW1lbnR0eXBlIjp7ImZxbiI6ImF3cy1jZGstbGliLkNmblRhZyJ9LCJraW5kIjoiYXJyYXkifX0=")), "tags") unless @tags.nil?
end

Instance Attribute Details

#descriptionString? (readonly)

An optional description of the prompt router to help identify its purpose.



58
59
60
# File 'bedrock/cfn_intelligent_prompt_router_props.rb', line 58

def description
  @description
end

#fallback_modelAWSCDK::IResolvable, AWSCDK::Bedrock::CfnIntelligentPromptRouter::PromptRouterTargetModelProperty (readonly)

The default model to use when the routing criteria is not met.



34
35
36
# File 'bedrock/cfn_intelligent_prompt_router_props.rb', line 34

def fallback_model
  @fallback_model
end

#modelsAWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::Bedrock::CfnIntelligentPromptRouter::PromptRouterTargetModelProperty> (readonly)

A list of foundation models that the prompt router can route requests to.

At least one model must be specified.



41
42
43
# File 'bedrock/cfn_intelligent_prompt_router_props.rb', line 41

def models
  @models
end

#prompt_router_nameString (readonly)

The name of the prompt router.

The name must be unique within your AWS account in the current region.



48
49
50
# File 'bedrock/cfn_intelligent_prompt_router_props.rb', line 48

def prompt_router_name
  @prompt_router_name
end

#tagsArray<AWSCDK::CfnTag>? (readonly)

An array of key-value pairs to apply to this resource as tags.

You can use tags to categorize and manage your AWS resources.



65
66
67
# File 'bedrock/cfn_intelligent_prompt_router_props.rb', line 65

def tags
  @tags
end

Class Method Details

.jsii_propertiesObject



67
68
69
70
71
72
73
74
75
76
# File 'bedrock/cfn_intelligent_prompt_router_props.rb', line 67

def self.jsii_properties
  {
    :fallback_model => "fallbackModel",
    :models => "models",
    :prompt_router_name => "promptRouterName",
    :routing_criteria => "routingCriteria",
    :description => "description",
    :tags => "tags",
  }
end

Instance Method Details

#to_jsiiObject



78
79
80
81
82
83
84
85
86
87
88
89
# File 'bedrock/cfn_intelligent_prompt_router_props.rb', line 78

def to_jsii
  result = {}
  result.merge!({
    "fallbackModel" => @fallback_model,
    "models" => @models,
    "promptRouterName" => @prompt_router_name,
    "routingCriteria" => @routing_criteria,
    "description" => @description,
    "tags" => @tags,
  })
  result.compact
end