Skip to main content

What is the Events Manager

The Events Manager consumes realtime events during conversations - it provides a framework to consume and take action on these events asychronously.

Current Event Types

The current event types include:
  1. TRANSCRIPT: Indicates a partial transcript for the conversation has been received.
  2. TRANSCRIPT_COMPLETE: Indicates the transcript is complete (ie conversation has ended).
  3. ACTION: Indicates that a Vocode action has begun or completed.
  4. PHONE_CALL_CONNECTED: Indicates a phone call has been connected (only gets sent during PhoneConversations)
  5. PHONE_CALL_ENDED: Indicates a phone call has ended.

Usage

Using the events manager to take particular action when events fire requires that you subclass vocode.streaming.utils.EventsManager and override the handle_event method. You can also configure which events your EventsManager is subscribed to by using the subscriptions property (see example).

Example

In this example, we create a custom EventsManager subclass is created with a subscription to the TRANSCRIPT_COMPLETE event and then print the transcript when we receive the event. To use CustomEventsManager, you can pass it into any Conversation, e.g.
You can also pass it into a TelephonyServer, like: