Class: AWSCDK::Bedrock::CfnPrompt::ToolChoiceProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Bedrock::CfnPrompt::ToolChoiceProperty
- Defined in:
- bedrock/cfn_prompt.rb
Overview
Determines which tools the model should request in a call to Converse or ConverseStream .
For more information, see Call a tool with the Converse API in the Amazon Bedrock User Guide.
Instance Attribute Summary collapse
-
#any ⇒ Object?
readonly
The model must request at least one tool (no text is generated).
-
#auto ⇒ Object?
readonly
(Default).
-
#tool ⇒ AWSCDK::IResolvable, ...
readonly
The Model must request the specified tool.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(any: nil, auto: nil, tool: nil) ⇒ ToolChoiceProperty
constructor
A new instance of ToolChoiceProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(any: nil, auto: nil, tool: nil) ⇒ ToolChoiceProperty
Returns a new instance of ToolChoiceProperty.
1408 1409 1410 1411 1412 1413 1414 1415 |
# File 'bedrock/cfn_prompt.rb', line 1408 def initialize(any: nil, auto: nil, tool: nil) @any = any Jsii::Type.check_type(@any, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "any") unless @any.nil? @auto = auto Jsii::Type.check_type(@auto, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJhbnkifQ==")), "auto") unless @auto.nil? @tool = tool.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnPrompt::SpecificToolChoiceProperty.new(**tool.transform_keys(&:to_sym)) : tool Jsii::Type.check_type(@tool, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmblByb21wdC5TcGVjaWZpY1Rvb2xDaG9pY2VQcm9wZXJ0eSJ9XX19")), "tool") unless @tool.nil? end |
Instance Attribute Details
#any ⇒ Object? (readonly)
The model must request at least one tool (no text is generated).
1421 1422 1423 |
# File 'bedrock/cfn_prompt.rb', line 1421 def any @any end |
#auto ⇒ Object? (readonly)
(Default).
The Model automatically decides if a tool should be called or whether to generate text instead.
1428 1429 1430 |
# File 'bedrock/cfn_prompt.rb', line 1428 def auto @auto end |
#tool ⇒ AWSCDK::IResolvable, ... (readonly)
The Model must request the specified tool.
Only supported by Anthropic Claude 3 and Amazon Nova models.
1435 1436 1437 |
# File 'bedrock/cfn_prompt.rb', line 1435 def tool @tool end |
Class Method Details
.jsii_properties ⇒ Object
1437 1438 1439 1440 1441 1442 1443 |
# File 'bedrock/cfn_prompt.rb', line 1437 def self.jsii_properties { :any => "any", :auto => "auto", :tool => "tool", } end |
Instance Method Details
#to_jsii ⇒ Object
1445 1446 1447 1448 1449 1450 1451 1452 1453 |
# File 'bedrock/cfn_prompt.rb', line 1445 def to_jsii result = {} result.merge!({ "any" => @any, "auto" => @auto, "tool" => @tool, }) result.compact end |