Class ToolChoice
- All Implemented Interfaces:
Serializable,SdkPojo,ToCopyableBuilder<ToolChoice.Builder,ToolChoice>
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.
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionfinal AnyToolChoiceany()The model must request at least one tool (no text is generated).final AutoToolChoiceauto()(Default).static ToolChoice.Builderbuilder()final booleanfinal booleanequalsBySdkFields(Object obj) static ToolChoiceCreate an instance of this class withany()initialized to the given value.static ToolChoicefromAny(AnyToolChoice any) Create an instance of this class withany()initialized to the given value.static ToolChoiceCreate an instance of this class withauto()initialized to the given value.static ToolChoicefromAuto(AutoToolChoice auto) Create an instance of this class withauto()initialized to the given value.static ToolChoiceCreate an instance of this class withtool()initialized to the given value.static ToolChoicefromTool(SpecificToolChoice tool) Create an instance of this class withtool()initialized to the given value.final <T> Optional<T>getValueForField(String fieldName, Class<T> clazz) final inthashCode()static Class<? extends ToolChoice.Builder>final SpecificToolChoicetool()The Model must request the specified tool.final StringtoString()Returns a string representation of this object.type()Retrieve an enum value representing which member of this object is populated.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.awssdk.utils.builder.ToCopyableBuilder
copy
-
Method Details
-
auto
(Default). The Model automatically decides if a tool should be called or whether to generate text instead.
- Returns:
- (Default). The Model automatically decides if a tool should be called or whether to generate text instead.
-
any
The model must request at least one tool (no text is generated).
- Returns:
- The model must request at least one tool (no text is generated).
-
tool
The Model must request the specified tool. Only supported by Anthropic Claude 3 and Amazon Nova models.
- Returns:
- The Model must request the specified tool. Only supported by Anthropic Claude 3 and Amazon Nova models.
-
toBuilder
- Specified by:
toBuilderin interfaceToCopyableBuilder<ToolChoice.Builder,ToolChoice>
-
builder
-
serializableBuilderClass
-
hashCode
public final int hashCode() -
equals
-
equalsBySdkFields
- Specified by:
equalsBySdkFieldsin interfaceSdkPojo
-
toString
Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value. -
getValueForField
-
fromAuto
Create an instance of this class withauto()initialized to the given value.(Default). The Model automatically decides if a tool should be called or whether to generate text instead.
- Parameters:
auto- (Default). The Model automatically decides if a tool should be called or whether to generate text instead.
-
fromAuto
Create an instance of this class withauto()initialized to the given value.(Default). The Model automatically decides if a tool should be called or whether to generate text instead.
- Parameters:
auto- (Default). The Model automatically decides if a tool should be called or whether to generate text instead.
-
fromAny
Create an instance of this class withany()initialized to the given value.The model must request at least one tool (no text is generated).
- Parameters:
any- The model must request at least one tool (no text is generated).
-
fromAny
Create an instance of this class withany()initialized to the given value.The model must request at least one tool (no text is generated).
- Parameters:
any- The model must request at least one tool (no text is generated).
-
fromTool
Create an instance of this class withtool()initialized to the given value.The Model must request the specified tool. Only supported by Anthropic Claude 3 and Amazon Nova models.
- Parameters:
tool- The Model must request the specified tool. Only supported by Anthropic Claude 3 and Amazon Nova models.
-
fromTool
Create an instance of this class withtool()initialized to the given value.The Model must request the specified tool. Only supported by Anthropic Claude 3 and Amazon Nova models.
- Parameters:
tool- The Model must request the specified tool. Only supported by Anthropic Claude 3 and Amazon Nova models.
-
type
Retrieve an enum value representing which member of this object is populated. When this class is returned in a service response, this will beToolChoice.Type.UNKNOWN_TO_SDK_VERSIONif the service returned a member that is only known to a newer SDK version. When this class is created directly in your code, this will beToolChoice.Type.UNKNOWN_TO_SDK_VERSIONif zero members are set, andnullif more than one member is set. -
sdkFields
-
sdkFieldNameToField
- Specified by:
sdkFieldNameToFieldin interfaceSdkPojo
-