ConsumerProcessor

class pipecat.processors.consumer_processor.ConsumerProcessor(*, producer, transformer=<function identity_transformer>, direction=FrameDirection.DOWNSTREAM, **kwargs)[source]

Bases: FrameProcessor

This class passes-through frames and also consumes frames from a producer’s queue. When a frame from a producer queue is received it will be pushed to the specified direction. The frames can be transformed into a different type of frame before being pushed.

Parameters:
  • producer (ProducerProcessor)

  • transformer (Callable[[Frame], Awaitable[Frame]])

  • direction (FrameDirection)

async process_frame(frame, direction)[source]
Parameters:
  • frame (Frame)

  • direction (FrameDirection)