Class: AWSCDK::Bedrock::CfnPrompt::ToolConfigurationProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Bedrock::CfnPrompt::ToolConfigurationProperty
- Defined in:
- bedrock/cfn_prompt.rb
Overview
Configuration information for the tools that you pass to a model.
For more information, see Tool use (function calling) in the Amazon Bedrock User Guide.
Instance Attribute Summary collapse
-
#tool_choice ⇒ AWSCDK::IResolvable, ...
readonly
If supported by model, forces the model to request a tool.
-
#tools ⇒ AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::Bedrock::CfnPrompt::ToolProperty>
readonly
An array of tools that you want to pass to a model.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(tools:, tool_choice: nil) ⇒ ToolConfigurationProperty
constructor
A new instance of ToolConfigurationProperty.
- #to_jsii ⇒ Object
Constructor Details
#initialize(tools:, tool_choice: nil) ⇒ ToolConfigurationProperty
Returns a new instance of ToolConfigurationProperty.
1466 1467 1468 1469 1470 1471 |
# File 'bedrock/cfn_prompt.rb', line 1466 def initialize(tools:, tool_choice: nil) @tools = tools Jsii::Type.check_type(@tools, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9jay5DZm5Qcm9tcHQuVG9vbFByb3BlcnR5In1dfX0sImtpbmQiOiJhcnJheSJ9fV19fQ==")), "tools") @tool_choice = tool_choice.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnPrompt::ToolChoiceProperty.new(**tool_choice.transform_keys(&:to_sym)) : tool_choice Jsii::Type.check_type(@tool_choice, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmblByb21wdC5Ub29sQ2hvaWNlUHJvcGVydHkifV19fQ==")), "toolChoice") unless @tool_choice.nil? end |
Instance Attribute Details
#tool_choice ⇒ AWSCDK::IResolvable, ... (readonly)
If supported by model, forces the model to request a tool.
1482 1483 1484 |
# File 'bedrock/cfn_prompt.rb', line 1482 def tool_choice @tool_choice end |
#tools ⇒ AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::Bedrock::CfnPrompt::ToolProperty> (readonly)
An array of tools that you want to pass to a model.
1477 1478 1479 |
# File 'bedrock/cfn_prompt.rb', line 1477 def tools @tools end |
Class Method Details
.jsii_properties ⇒ Object
1484 1485 1486 1487 1488 1489 |
# File 'bedrock/cfn_prompt.rb', line 1484 def self.jsii_properties { :tools => "tools", :tool_choice => "toolChoice", } end |
Instance Method Details
#to_jsii ⇒ Object
1491 1492 1493 1494 1495 1496 1497 1498 |
# File 'bedrock/cfn_prompt.rb', line 1491 def to_jsii result = {} result.merge!({ "tools" => @tools, "toolChoice" => @tool_choice, }) result.compact end |