An electronic device comprising: an input part; a communication part; a processor; and a memory, wherein the memory includes instructions for the processor to: control the communication part to request identification information, including a call word for using an artificial intelligence assistant function of another electronic device, from the other electronic device, based on an occurrence of an event at the electronic device for requesting configuration of a first mode in which an artificial intelligence assistant function of the other electronic device can be used, and receive the identification information from the other electronic device through the communication part in response to the request, and based on a user command being received during operation of the first mode of the artificial intelligence assistant, transmit the user command to the other electronic device based on the identification information, wherein the memory includes instructions for making the processor, based on the occurrence of the event for requesting configuration of the first mode, change a first communication method of the communication part to a second communication method, and request the identification information from the other electronic device by using the second communication method, wherein the first communication method is a wi-fi mode and the second communication method is an ad-hoc mode or a wi-fi direct mode. an input part; a communication part; a processor; and a memory, wherein the memory includes instructions for the processor to: control the communication part to request identification information, including a call word for using an artificial intelligence assistant function of another electronic device, from the other electronic device, based on an occurrence of an event at the electronic device for requesting configuration of a first mode in which an artificial intelligence assistant function of the other electronic device can be used, and receive the identification information from the other electronic device through the communication part in response to the request, and based on a user command being received during operation of the first mode of the artificial intelligence assistant, transmit the user command to the other electronic device based on the identification information, wherein the memory includes instructions for making the processor, based on the occurrence of the event for requesting configuration of the first mode, change a first communication method of the communication part to a second communication method, and request the identification information from the other electronic device by using the second communication method, wherein the first communication method is a wi-fi mode and the second communication method is an ad-hoc mode or a wi-fi direct mode. control the communication part to request identification information, including a call word for using an artificial intelligence assistant function of another electronic device, from the other electronic device, based on an occurrence of an event at the electronic device for requesting configuration of a first mode in which an artificial intelligence assistant function of the other electronic device can be used, and receive the identification information from the other electronic device through the communication part in response to the request, and based on a user command being received during operation of the first mode of the artificial intelligence assistant, transmit the user command to the other electronic device based on the identification information, wherein the memory includes instructions for making the processor, based on the occurrence of the event for requesting configuration of the first mode, change a first communication method of the communication part to a second communication method, and request the identification information from the other electronic device by using the second communication method, wherein the first communication method is a wi-fi mode and the second communication method is an ad-hoc mode or a wi-fi direct mode.