pipecat.utility module¶
Convenience functions for working with data sources.
-
pipecat.utility.
add_field
(source, key, value)¶ Adds a key-value pair to every record returned from a source.
Parameters: - source (Record generator, required)
- key (Record key, required)
- value (any value.)
-
pipecat.utility.
add_timestamp
(source, key='timestamp')¶ Add a timestamp to every record returned from a source.
Parameters: - source (Record generator, required)
- key (Record key, required)
-
pipecat.utility.
readline
(fobj)¶ Extract lines from a file or file-like object.
Parameters: fobj (file-like object, required) – This could be an open file, instance of io.StringIO
, a serial connection, or any other object that returns lines of text during iteration.
-
pipecat.utility.
trace
(source, name=None)¶ Log the behavior of a source for debugging.
Parameters: source (Record generator, required)