/// <summary> /// Instructs the manager to update the current ConversationalAgentSessionState to the /// requested value and inform consumers of the change. /// Indicates ConversationalSessionState changes based on requests and responses to and from the Bot. /// </summary> /// <param name="newState"> The new, requested conversational agent state. </param> /// <returns> A task that completes once the state is updated and consumers are notified. </returns> private async Task ChangeAgentStateAsync(ConversationalAgentState newState) { var session = await this.agentSessionManager.GetSessionAsync(); var oldState = session.AgentState; this.logger.Log($"Changing agent state: [{oldState.ToString()}] -> [{newState.ToString()}]"); await session.RequestAgentStateChangeAsync(newState); this.DialogStateChanged?.Invoke(oldState, newState); }
/// <summary> /// Instructs the manager to update the current ConversationalAgentSessionState to the /// requested value and inform consumers of the change. /// Indicates ConversationalSessionState changes based on requests and responses to and from the Bot. /// </summary> /// <param name="newState"> The new, requested conversational agent state. </param> /// <returns> A task that completes once the state is updated and consumers are notified. </returns> private async Task ChangeAgentStateAsync(ConversationalAgentState newState) { var session = await this.agentSessionManager.GetSessionAsync(); var oldState = session.AgentState; Debug.WriteLine($"Changing agent state: [{oldState.ToString()}] -> [{newState.ToString()}]"); await session.RequestAgentStateChangeAsync(newState); this.signalDetectionHelper.DialogStateChangeDuringSignalVerification(oldState, newState); this.DialogStateChanged?.Invoke(oldState, newState); }