Class: AWSCDK::Bedrock::CfnPromptVersion::ToolConfigurationProperty
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::Bedrock::CfnPromptVersion::ToolConfigurationProperty
- Defined in:
- bedrock/cfn_prompt_version.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::CfnPromptVersion::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.
1396 1397 1398 1399 1400 1401 |
# File 'bedrock/cfn_prompt_version.rb', line 1396 def initialize(tools:, tool_choice: nil) @tools = tools Jsii::Type.check_type(@tools, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImNvbGxlY3Rpb24iOnsiZWxlbWVudHR5cGUiOnsidW5pb24iOnsidHlwZXMiOlt7ImZxbiI6ImF3cy1jZGstbGliLklSZXNvbHZhYmxlIn0seyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfYmVkcm9jay5DZm5Qcm9tcHRWZXJzaW9uLlRvb2xQcm9wZXJ0eSJ9XX19LCJraW5kIjoiYXJyYXkifX1dfX0=")), "tools") @tool_choice = tool_choice.is_a?(Hash) ? ::AWSCDK::Bedrock::CfnPromptVersion::ToolChoiceProperty.new(**tool_choice.transform_keys(&:to_sym)) : tool_choice Jsii::Type.check_type(@tool_choice, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmblByb21wdFZlcnNpb24uVG9vbENob2ljZVByb3BlcnR5In1dfX0=")), "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.
1412 1413 1414 |
# File 'bedrock/cfn_prompt_version.rb', line 1412 def tool_choice @tool_choice end |
#tools ⇒ AWSCDK::IResolvable, Array<AWSCDK::IResolvable, AWSCDK::Bedrock::CfnPromptVersion::ToolProperty> (readonly)
An array of tools that you want to pass to a model.
1407 1408 1409 |
# File 'bedrock/cfn_prompt_version.rb', line 1407 def tools @tools end |
Class Method Details
.jsii_properties ⇒ Object
1414 1415 1416 1417 1418 1419 |
# File 'bedrock/cfn_prompt_version.rb', line 1414 def self.jsii_properties { :tools => "tools", :tool_choice => "toolChoice", } end |
Instance Method Details
#to_jsii ⇒ Object
1421 1422 1423 1424 1425 1426 1427 1428 |
# File 'bedrock/cfn_prompt_version.rb', line 1421 def to_jsii result = {} result.merge!({ "tools" => @tools, "toolChoice" => @tool_choice, }) result.compact end |