Skip to content

Output streamer

[BETA] Defines the base class for output streamers.

Authors

Henry Wicaksono (henry.wicaksono@gdplabs.id)

References

NONE

BaseOutputStreamer

Bases: ABC

[BETA] A base class for output streamers.

Attributes:

Name Type Description
state BaseModel | None

The state of the output streamer.

close() async

Closes the output streamer.

This method is used to close the output streamer. It is used to clean up the output streamer.

handle(data) abstractmethod async

Handles output events streamed from the model.

This method must be implemented by subclasses to define the logic for handling the output events.

Raises:

Type Description
NotImplementedError

If the method is not implemented in a subclass.

initialize(state) async

Initializes the output streamer.

Parameters:

Name Type Description Default
state BaseModel

The state of the output streamer.

required