---
schema_version: "1"
id: 59f85f0139d7cfaefd6c6c3a9fce208b2dbdc3b3b66d2a3f7adba6269b7e5ab1
title: AgentforceConversation
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/genai/agentforce-mobile-sdk/references/android/agentforce-conversation-android.md
canonical_url: https://developer.salesforce.com/docs/ai/agentforce-mobile-sdk/references/agentforce-mobile-sdk/agentforce-conversation-android.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 12ac8c0ec6f3a77020183715ec37bb8bf134f92cc1bcb8b19e4a27bba89afce1
products:
  - Agentforce Mobile SDK
  - Agentforce and Einstein Generative AI
---
# AgentforceConversation

```kotlin
class AgentforceConversation(
    agentId: String? = null,
    sessionId: String? = null,
    configuration: AgentforceConfiguration,
    connectionInfo: AgentforceConnectionInfo? = null,
    conversationService: ConversationService,
    logger: Logger? = null,
    conversationState: StateFlow<AgentforceConversationState> = MutableStateFlow(AgentforceConversationState.INITIALIZING),
    onSessionUpdated: (AgentforceConversation, String?) -> Unit = { _, _ -> }
) : AgentConversation
```

## Constructors

- `AgentforceConversation(String?, String?, AgentforceConfiguration, AgentforceConnectionInfo?, ConversationService, Logger?, StateFlow<AgentforceConversationState>, Function2<AgentforceConversation, String?, Unit>)`

## Properties

| Property              | Type                                   | Mutability | Description                                            |
| --------------------- | -------------------------------------- | ---------- | ------------------------------------------------------ |
| agentId               | String?                                | var        | The identifier of the agent handling this conversation |
| conversationManager   | ConversationManaging                   | var        | Internal conversation management interface             |
| conversationState     | StateFlow<AgentforceConversationState> | val        | Flow providing real-time conversation state updates    |
| id                    | String                                 | val        | Unique identifier for this conversation                |
| recommendedUtterances | StateFlow<List<String>>                | val        | Flow of recommended utterances                         |
| sessionId             | String?                                | var        | Session identifier for conversation continuity         |
| sessionScope          | CoroutineScope                         | var        | Coroutine scope for session operations                 |

## Functions

| Function                       | Signature                                                                        | Description                                                                                  |
| ------------------------------ | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| endConversation                | `suspend fun endConversation(): Unit`                                            | Ends the current conversation session                                                        |
| getCurrentAgent                | `fun getCurrentAgent(): AgentData`                                               | Get current agent data                                                                       |
| resetSession                   | `open override fun resetSession(): Unit`                                         | Resets the Agentforce session container                                                      |
| resetSession                   | `fun resetSession(String): Unit`                                                 |                                                                                              |
| retrieveTranscript             | `suspend fun retrieveTranscript(): InputStream`                                  | Retrieve conversation transcript as a PDF InputStream                                        |
| sendTypingIndicator            | `suspend fun sendTypingIndicator(): Unit`                                        | Sends a typing indicator for MIAW conversations when user is typing                          |
| sendUtterance                  | `open suspend override fun sendUtterance(String, AgentforceAttachment?): Unit`   | Send an utterance to Agentforce                                                              |
| setAdditionalContext           | `open suspend override fun setAdditionalContext(CopilotAdditionalContext): Unit` | Updates the current context variables that will be sent to Agentforce on subsequent messages |
| startSession                   | `suspend fun startSession(): Unit`                                               |                                                                                              |
| updateRecommendationUtterances | `open override fun updateRecommendationUtterances(List<String>): Unit`           |                                                                                              |

## Inherited Functions

- clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
