parameters: (self, socket_id: Text, response: Any)
docstring: Sends a message to the recipient using the bot event.
docstring_summary: Sends a message to the recipient using the bot event.
docstring_tokens: Sends a message to the recipient using the bot event .
function: async def _send_message(self, socket_id: Text, response: Any) -> None:
          """Sends a message to the recipient using the bot event."""
  
          if response.get("text"):
            q = {
              'text': response['text']
            }
            if self.botium_speech_voice:
              q['voice'] = self.botium_speech_voice
  
            audioEndpoint = f"{self.botium_speech_url}/api/tts/{self.botium_speech_language}?{urlencode(q)}"
            audio = urlopen(audioEndpoint).read()
            logger.debug(f"_send_message- Calling Speech Endpoint: {audioEndpoint}")
  
            audioBase64 = base64.b64encode(audio).decode('ascii')
            audioUri = "data:audio/wav;base64," + audioBase64
            response['link'] = audioUri
  
          await self.sio.emit(self.bot_message_evt, response, room=socket_id)
function_tokens: async def _send_message ( self , socket_id : Text , response : Any ) -> None : if response . get ( "text" ) : q = { 'text' : response [ 'text' ] } if self . botium_speech_voice : q [ 'voice' ] = self . botium_speech_voice audioEndpoint = f"{self.botium_speech_url}/api/tts/{self.botium_speech_language}?{urlencode(q)}" audio = urlopen ( audioEndpoint ) . read ( ) logger . debug ( f"_send_message- Calling Speech Endpoint: {audioEndpoint}" ) audioBase64 = base64 . b64encode ( audio ) . decode ( 'ascii' ) audioUri = "data:audio/wav;base64," + audioBase64 response [ 'link' ] = audioUri await self . sio . emit ( self . bot_message_evt , response , room = socket_id )