The Developer Preview for Android 11 is now available; test it out and share your feedback.

ConversationActions.Request.Builder

public static final class ConversationActions.Request.Builder
extends Object

java.lang.Object
   ↳ androidx.textclassifier.ConversationActions.Request.Builder


Builder object to construct the ConversationActions.Request object.

Summary

Public constructors

ConversationActions.Request.Builder(List<ConversationActions.Message> conversation)

Constructs a builder.

Public methods

ConversationActions.Request build()

Builds the ConversationActions.Request object.

ConversationActions.Request.Builder setExtras(Bundle bundle)

Sets a set of extended data to the request.

ConversationActions.Request.Builder setHints(List<String> hints)

Sets the hints to help text classifier to generate actions.

ConversationActions.Request.Builder setMaxSuggestions(int maxSuggestions)

Sets the maximum number of suggestions you want.

ConversationActions.Request.Builder setTypeConfig(TextClassifier.EntityConfig typeConfig)

Sets the type config.

Inherited methods

Public constructors

ConversationActions.Request.Builder

public ConversationActions.Request.Builder (List<ConversationActions.Message> conversation)

Constructs a builder.

Parameters
conversation List: the conversation that the text classifier is going to generate actions for.

Public methods

setExtras

public ConversationActions.Request.Builder setExtras (Bundle bundle)

Sets a set of extended data to the request.

Parameters
bundle Bundle

Returns
ConversationActions.Request.Builder

setHints

public ConversationActions.Request.Builder setHints (List<String> hints)

Sets the hints to help text classifier to generate actions. It could be used to help text classifier to infer what types of actions the caller may be interested in.

Parameters
hints List

Returns
ConversationActions.Request.Builder

setMaxSuggestions

public ConversationActions.Request.Builder setMaxSuggestions (int maxSuggestions)

Sets the maximum number of suggestions you want. Value -1 means no restriction and this is the default.

Parameters
maxSuggestions int

Value is -1 or greater.

Returns
ConversationActions.Request.Builder

setTypeConfig

public ConversationActions.Request.Builder setTypeConfig (TextClassifier.EntityConfig typeConfig)

Sets the type config.

Parameters
typeConfig TextClassifier.EntityConfig

Returns
ConversationActions.Request.Builder