btnexus-node-python.btStreamingNode module

A Node which accepts audio streams and forwards them to the speech to text service of your choice and publishes the transcript on the transcript topic

class btStreamingNode.StreamingNode(language=None, personalityId=None, integrationId=None, sessionId=None, **kwargs)[source]

Bases: btNode.Node

Constructor sets up the NexusConnector.

Parameters
  • token (String) – AccessToken for the btNexus

  • axonURL (String) – URL for the Axon(InstanceURL)

  • debug (bool) – switch for debug messages

  • logger (Logger) – a logger object to log to

  • personalityId (String) – Id of your Personality

  • integrationId (String) – Id of the integration this Node belongs to

connect(**kwargs)[source]

connect the Axon and start the reactor for twisted. This will always block because of the reactor pattern

getSessionId()[source]

return the sessionId this needs to be implemented for a service node

handshake()[source]

Do the Handshake with the Service and retry until it works.

onStreamReady()[source]

Start your stream with self.stream(stream) - this will stream data from the given stream to the SpeechService.

setSessionId(response)[source]

callback for the sessionAccessRequest

stream(stream)[source]

This takes a stream and streams it to the Service

streamTo(host, port)[source]

This reacts to the message from the Service telling where to connect to with twisted.