Class: AWSCDK::Bedrock::CfnPromptVersion::ToolChoiceProperty

Inherits:
Jsii::Struct
  • Object
show all
Defined in:
bedrock/cfn_prompt_version.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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(any: nil, auto: nil, tool: nil) ⇒ ToolChoiceProperty

Returns a new instance of ToolChoiceProperty.

Parameters:



1338
1339
1340
1341
1342
1343
1344
1345
# File 'bedrock/cfn_prompt_version.rb', line 1338

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::CfnPromptVersion::SpecificToolChoiceProperty.new(**tool.transform_keys(&:to_sym)) : tool
  Jsii::Type.check_type(@tool, JSON.parse(Base64.strict_decode64("eyJ1bmlvbiI6eyJ0eXBlcyI6W3siZnFuIjoiYXdzLWNkay1saWIuSVJlc29sdmFibGUifSx7ImZxbiI6ImF3cy1jZGstbGliLmF3c19iZWRyb2NrLkNmblByb21wdFZlcnNpb24uU3BlY2lmaWNUb29sQ2hvaWNlUHJvcGVydHkifV19fQ==")), "tool") unless @tool.nil?
end

Instance Attribute Details

#anyObject? (readonly)

The model must request at least one tool (no text is generated).



1351
1352
1353
# File 'bedrock/cfn_prompt_version.rb', line 1351

def any
  @any
end

#autoObject? (readonly)

(Default).

The Model automatically decides if a tool should be called or whether to generate text instead.



1358
1359
1360
# File 'bedrock/cfn_prompt_version.rb', line 1358

def auto
  @auto
end

#toolAWSCDK::IResolvable, ... (readonly)

The Model must request the specified tool.

Only supported by Anthropic Claude 3 and Amazon Nova models.



1365
1366
1367
# File 'bedrock/cfn_prompt_version.rb', line 1365

def tool
  @tool
end

Class Method Details

.jsii_propertiesObject



1367
1368
1369
1370
1371
1372
1373
# File 'bedrock/cfn_prompt_version.rb', line 1367

def self.jsii_properties
  {
    :any => "any",
    :auto => "auto",
    :tool => "tool",
  }
end

Instance Method Details

#to_jsiiObject



1375
1376
1377
1378
1379
1380
1381
1382
1383
# File 'bedrock/cfn_prompt_version.rb', line 1375

def to_jsii
  result = {}
  result.merge!({
    "any" => @any,
    "auto" => @auto,
    "tool" => @tool,
  })
  result.compact
end