Skip to content
Changelog

Text, Markdown and labeled CSV readers accept text streams

September 16, 20261 min read

Agno's TextReader, MarkdownReader and FieldLabeledCSVReader now decode only bytes and accept text as it is. They used to decode every input as bytes, so a text stream raised an error inside the reader, which caught it and handed you an empty list:

from io import StringIO
 
from agno.knowledge.reader.text_reader import TextReader
 
documents = TextReader(chunk=False).read(StringIO("Refunds are processed within 5 business days."))
# Before: []
# Now: one document with the text

async_read() works the same way, with or without chunking. The readers still decode binary streams with their configured encoding, UTF-8 by default.

Learn more about readers, the Markdown reader and the field-labeled CSV reader in the documentation.

Frequently asked questions

TextReader, MarkdownReader and FieldLabeledCSVReader always decoded their input as bytes. A text stream raised an error inside the reader, which caught it and returned an empty list. The three readers now accept text as it is.

Yes. TextReader, MarkdownReader and FieldLabeledCSVReader read a StringIO or a text-mode file with read() and async_read(), with or without chunking.

Agno readers decode binary streams with the reader's configured encoding, which is UTF-8 by default.

Shipped around the same time