An electronic device comprising: a touchscreen display; a microphone; at least one speaker; a wireless communication circuit; a processor electrically connected to the touchscreen display, the microphone, the at least one speaker, and the wireless communication circuit; and a memory electrically connected to the processor, wherein the memory stores instructions that, when executed, cause the processor to: receive (801, 1701, 2001) a user utterance through the microphone, wherein the user utterance includes a request for performing a task with the electronic device; transmit (802, 1702, 2002) data associated with the user utterance to an external server via the wireless communication circuit; receive (803, 1703, 2003) a response from the external server via the wireless communication circuit, wherein the response includes at least one path rule and a sample utterance corresponding to each of the at least one path rule, the at least one path rule and corresponding sample utterance having been selected or generated by the external server based on the user utterance; execute (1704, 2004) an action depending on one of the at least one received path rules; receive (1705, 2005) a feedback input through the microphone or the touchscreen display corresponding to feedback about the result of executing the action, depending on the one path rule; in case the feedback input is a negative input, display (1706, 2007) at least one sample utterance corresponding to at least one alternative path rule received from the external server, and receive (1707, 2008) a further user input for selecting one of the at least one displayed sample utterances through the microphone or the touchscreen display and execute (1708, 2009) an action depending on the path rule corresponding to the selected sample utterance. a touchscreen display; a microphone; at least one speaker; a wireless communication circuit; a processor electrically connected to the touchscreen display, the microphone, the at least one speaker, and the wireless communication circuit; and a memory electrically connected to the processor, wherein the memory stores instructions that, when executed, cause the processor to: receive (801, 1701, 2001) a user utterance through the microphone, wherein the user utterance includes a request for performing a task with the electronic device; transmit (802, 1702, 2002) data associated with the user utterance to an external server via the wireless communication circuit; receive (803, 1703, 2003) a response from the external server via the wireless communication circuit, wherein the response includes at least one path rule and a sample utterance corresponding to each of the at least one path rule, the at least one path rule and corresponding sample utterance having been selected or generated by the external server based on the user utterance; execute (1704, 2004) an action depending on one of the at least one received path rules; receive (1705, 2005) a feedback input through the microphone or the touchscreen display corresponding to feedback about the result of executing the action, depending on the one path rule; in case the feedback input is a negative input, display (1706, 2007) at least one sample utterance corresponding to at least one alternative path rule received from the external server, and receive (1707, 2008) a further user input for selecting one of the at least one displayed sample utterances through the microphone or the touchscreen display and execute (1708, 2009) an action depending on the path rule corresponding to the selected sample utterance. receive (801, 1701, 2001) a user utterance through the microphone, wherein the user utterance includes a request for performing a task with the electronic device; transmit (802, 1702, 2002) data associated with the user utterance to an external server via the wireless communication circuit; receive (803, 1703, 2003) a response from the external server via the wireless communication circuit, wherein the response includes at least one path rule and a sample utterance corresponding to each of the at least one path rule, the at least one path rule and corresponding sample utterance having been selected or generated by the external server based on the user utterance; execute (1704, 2004) an action depending on one of the at least one received path rules; receive (1705, 2005) a feedback input through the microphone or the touchscreen display corresponding to feedback about the result of executing the action, depending on the one path rule; in case the feedback input is a negative input, display (1706, 2007) at least one sample utterance corresponding to at least one alternative path rule received from the external server, and receive (1707, 2008) a further user input for selecting one of the at least one displayed sample utterances through the microphone or the touchscreen display and execute (1708, 2009) an action depending on the path rule corresponding to the selected sample utterance.