AgentforceConversation

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