Join us for ⁠#Android11: The Beta Launch Show on June 3!

Request

class Request
kotlin.Any
   ↳ androidx.textclassifier.ConversationActions.Request

A request object for generating conversation action suggestions.

Summary

Nested classes

Builder object to construct the Request object.

Constants

static String

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

static String

To indicate the generated actions will be used for notification.

Public methods

static ConversationActions.Request
createFromBundle(@NonNull bundle: Bundle)

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

MutableList<ConversationActions.Message!>

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

Bundle

Returns the extended data related to this request.

MutableList<String!>

Returns an immutable list of hints

Int

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

TextClassifier.EntityConfig

Returns the type config.

Bundle

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

Constants

HINT_FOR_IN_APP

static val HINT_FOR_IN_APP: String

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

Value: "in_app"

HINT_FOR_NOTIFICATION

static val HINT_FOR_NOTIFICATION: String

To indicate the generated actions will be used for notification.

Value: "notification"

Public methods

createFromBundle

@NonNull static fun createFromBundle(@NonNull bundle: Bundle): ConversationActions.Request

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

getConversation

@NonNull fun getConversation(): MutableList<ConversationActions.Message!>

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

getExtras

@NonNull fun getExtras(): Bundle

Returns the extended data related to this request.

NOTE: Do not modify this bundle.

getHints

@NonNull fun getHints(): MutableList<String!>

Returns an immutable list of hints

getMaxSuggestions

@IntRange(-1) fun getMaxSuggestions(): Int

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

getTypeConfig

@NonNull fun getTypeConfig(): TextClassifier.EntityConfig

Returns the type config.

toBundle

@NonNull fun toBundle(): Bundle

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