Class ToolChoice
- All Implemented Interfaces:
Serializable,SdkPojo,ToCopyableBuilder<ToolChoice.Builder,ToolChoice>
Defines which tools the model should request when invoked. For more information, see Use a tool to complete an Amazon Bedrock model response.
- See Also:
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionfinal AnyToolChoiceany()Defines tools, at least one of which must be requested by the model.final AutoToolChoiceauto()Defines tools.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()Defines a specific tool that the model must request.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
Defines tools. The model automatically decides whether to call a tool or to generate text instead.
- Returns:
- Defines tools. The model automatically decides whether to call a tool or to generate text instead.
-
any
Defines tools, at least one of which must be requested by the model. No text is generated but the results of tool use are sent back to the model to help generate a response.
- Returns:
- Defines tools, at least one of which must be requested by the model. No text is generated but the results of tool use are sent back to the model to help generate a response.
-
tool
Defines a specific tool that the model must request. No text is generated but the results of tool use are sent back to the model to help generate a response.
- Returns:
- Defines a specific tool that the model must request. No text is generated but the results of tool use are sent back to the model to help generate a response.
-
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.Defines tools. The model automatically decides whether to call a tool or to generate text instead.
- Parameters:
auto- Defines tools. The model automatically decides whether to call a tool or to generate text instead.
-
fromAuto
Create an instance of this class withauto()initialized to the given value.Defines tools. The model automatically decides whether to call a tool or to generate text instead.
- Parameters:
auto- Defines tools. The model automatically decides whether to call a tool or to generate text instead.
-
fromAny
Create an instance of this class withany()initialized to the given value.Defines tools, at least one of which must be requested by the model. No text is generated but the results of tool use are sent back to the model to help generate a response.
- Parameters:
any- Defines tools, at least one of which must be requested by the model. No text is generated but the results of tool use are sent back to the model to help generate a response.
-
fromAny
Create an instance of this class withany()initialized to the given value.Defines tools, at least one of which must be requested by the model. No text is generated but the results of tool use are sent back to the model to help generate a response.
- Parameters:
any- Defines tools, at least one of which must be requested by the model. No text is generated but the results of tool use are sent back to the model to help generate a response.
-
fromTool
Create an instance of this class withtool()initialized to the given value.Defines a specific tool that the model must request. No text is generated but the results of tool use are sent back to the model to help generate a response.
- Parameters:
tool- Defines a specific tool that the model must request. No text is generated but the results of tool use are sent back to the model to help generate a response.
-
fromTool
Create an instance of this class withtool()initialized to the given value.Defines a specific tool that the model must request. No text is generated but the results of tool use are sent back to the model to help generate a response.
- Parameters:
tool- Defines a specific tool that the model must request. No text is generated but the results of tool use are sent back to the model to help generate a response.
-
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
-