Google 致力于为黑人社区推动种族平等。查看具体举措

ConversationActions.Request

public static final class ConversationActions.Request
extends Object

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


A request object for generating conversation action suggestions.

Summary

Nested classes

class ConversationActions.Request.Builder

Builder object to construct the ConversationActions.Request object. 

Constants

String HINT_FOR_IN_APP

To indicate the generated actions will be used within the app.

String HINT_FOR_NOTIFICATION

To indicate the generated actions will be used for notification.

Public methods

static ConversationActions.Request createFromBundle(Bundle bundle)

Converts a bundle that was created using toBundle() to a ConversationActions.Request.

List<ConversationActions.Message> getConversation()

Returns an immutable list of messages that make up the conversation.

Bundle getExtras()

Returns the extended data related to this request.

List<String> getHints()

Returns an immutable list of hints

int getMaxSuggestions()

Return the maximal number of suggestions the caller wants, value -1 means no restriction and this is the default.

TextClassifier.EntityConfig getTypeConfig()

Returns the type config.

Bundle toBundle()

Adds this object to a Bundle that can be read back with the same parameters to createFromBundle(Bundle).

Inherited methods

Constants

HINT_FOR_IN_APP

public static final String HINT_FOR_IN_APP

To indicate the generated actions will be used within the app.

Constant Value: "in_app"

HINT_FOR_NOTIFICATION

public static final String HINT_FOR_NOTIFICATION

To indicate the generated actions will be used for notification.

Constant Value: "notification"

Public methods

createFromBundle

public static ConversationActions.Request createFromBundle (Bundle bundle)

Converts a bundle that was created using toBundle() to a ConversationActions.Request.

Parameters
bundle Bundle

Returns
ConversationActions.Request

getConversation

public List<ConversationActions.Message> getConversation ()

Returns an immutable list of messages that make up the conversation.

Returns
List<ConversationActions.Message>

getExtras

public Bundle getExtras ()

Returns the extended data related to this request.

NOTE: Do not modify this bundle.

Returns
Bundle

getHints

public List<String> getHints ()

Returns an immutable list of hints

Returns
List<String>

getMaxSuggestions

public int getMaxSuggestions ()

Return the maximal number of suggestions the caller wants, value -1 means no restriction and this is the default.

Returns
int

Value is -1 or greater.

getTypeConfig

public TextClassifier.EntityConfig getTypeConfig ()

Returns the type config.

Returns
TextClassifier.EntityConfig

toBundle

public Bundle toBundle ()

Adds this object to a Bundle that can be read back with the same parameters to createFromBundle(Bundle).

Returns
Bundle