---
schema_version: "1"
id: 33ebe9464fbd82a27a45ac124f782788d14f82403f0d18e74e62d31307c7df18
title: AgentforceMessage
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/genai/agentforce-mobile-sdk/references/android/agentforce-message-android.md
canonical_url: https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/references/agentforce-mobile-sdk/agentforce-message-android.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 26f21ac8a82a642891d78892127d1abb9d80d02ac838b01a325d4c1963c7b204
products:
  - Agentforce Mobile SDK
  - Agentforce and Einstein Generative AI
---
# AgentforceMessage

`@Serializable data class AgentforceMessage`

Data class representing a message in the Agentforce SDK with serialization support.

## Constructors

| Constructor         | Signature                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `AgentforceMessage` | `constructor(id: String, message: String? = null, text: String? = null, type: String, messageType: String? = null, feedbackId: String? = null, widget: String? = null, result: List<ResourceTypeMessage>? = null, confirm: List<ResourceTypeMessage>? = null, collect: List<CollectMessage>? = null, choices: List<ChoicesMessage>? = null, failureCode: String? = null, errors: List<String>? = null, isContentSafe: Boolean? = true, citedReferences: List<CitedReferences>? = null, lightningType: String? = null, isPartial: Boolean = false, value: String? = null, offset: Int = 0, timeStamp: Long = Date().time, language: String? = null, reason: String = "")` |

## Properties

| Property          | Signature                                            |
| ----------------- | ---------------------------------------------------- |
| `choices`         | `val choices: List<ChoicesMessage>? = null`          |
| `citedReferences` | `val citedReferences: List<CitedReferences>? = null` |
| `collect`         | `val collect: List<CollectMessage>? = null`          |
| `confirm`         | `val confirm: List<ResourceTypeMessage>? = null`     |
| `errors`          | `val errors: List<String>? = null`                   |
| `failureCode`     | `val failureCode: String? = null`                    |
| `feedbackId`      | `val feedbackId: String? = null`                     |
| `id`              | `val id: String`                                     |
| `isContentSafe`   | `val isContentSafe: Boolean? = true`                 |
| `isPartial`       | `@Transient val isPartial: Boolean = false`          |
| `language`        | `val language: String? = null`                       |
| `lightningType`   | `val lightningType: String? = null`                  |
| `message`         | `var message: String?`                               |
| `messageType`     | `val messageType: String? = null`                    |
| `offset`          | `val offset: Int = 0`                                |
| `reason`          | `val reason: String`                                 |
| `result`          | `val result: List<ResourceTypeMessage>? = null`      |
| `text`            | `val text: String? = null`                           |
| `timeStamp`       | `val timeStamp: Long`                                |
| `type`            | `val type: String`                                   |
| `value`           | `val value: String? = null`                          |
| `widget`          | `val widget: String? = null`                         |

## Functions

| Function         | Signature                                            |
| ---------------- | ---------------------------------------------------- |
| `getComponents`  | `fun getComponents(): List<AgentforceMessageValue>?` |
| `getMessageType` | `fun getMessageType(): MessageType?`                 |

## Related Documentation

- [AgentforceAttachment](https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/references/android/agentforce-attachment-android.md)
- [AgentforceConversation](https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/references/agentforce-mobile-sdk/agentforce-conversation-android.md)
