Tool

Convert string lists into LlamaIndex document objects

Turn any iterable of strings into LlamaIndex documents with a single call.

Works with llamaindexlangchain

71
Spark score
out of 100
Updated 2 days ago
Version 0.14.23

Add to Favorites

Why it matters

Transform collections of text strings into structured document objects that can be indexed and queried within LlamaIndex pipelines or used as tools in LangChain agents.

Outcomes

What it gets done

01

Load data from Python iterables containing text strings

02

Convert raw text strings into LlamaIndex document format

03

Prepare string data for RAG indexing workflows

04

Bridge string collections into LangChain agent tools

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/li-reader-readers-string-iterable | bash

Overview

LlamaIndex Readers Integration: StringIterable

A LlamaIndex reader that wraps an iterable of in-memory strings into documents with a single load_data call. Use when text content already exists as Python strings and needs the fastest path into LlamaIndex's document format.

What it does

The StringIterable Reader converts an iterable of strings into a list of LlamaIndex documents. It is a simple utility for quickly creating documents directly from a list of text strings already in memory, without reading from a file or an external source first.

StringIterableReader is instantiated with no configuration, and load_data takes a texts argument - any iterable of strings, such as a Python list - and returns each string wrapped as a document, ready to be indexed like documents loaded from any other source.

When to use - and when NOT to

Use it when you already have text content as Python strings - generated programmatically, pulled from an API response, or assembled from some other in-memory source - and want to get it into LlamaIndex's document format without writing the text to a file first just to read it back in. Do not use it when your source is a file, database, or external API with its own dedicated LlamaIndex reader; those readers handle fetching and parsing directly, while this one only wraps strings you already have on hand.

Capabilities

load_data takes any iterable of strings and returns each one as a LlamaIndex document, with no parsing or transformation beyond the wrapping itself.

How to install

from llama_index.readers.string_iterable import StringIterableReader

reader = StringIterableReader()

documents = reader.load_data(
    texts=["I went to the store", "I bought an apple"]
)

Who it's for

Developers who already have text content as in-memory Python strings and need the fastest path to turning it into LlamaIndex documents, without an intermediate file or a dedicated source-specific reader.

Source README

LlamaIndex Readers Integration: StringIterable

Overview

The StringIterable Reader converts an iterable of strings into a list of documents. It's a simple utility to quickly create documents from a list of text strings.

Installation

You can install String Iterable Reader via pip:

pip install llama-index-readers-string-iterable

Usage

from llama_index.readers.string_iterable import StringIterableReader

### Initialize StringIterableReader
reader = StringIterableReader()

### Load data from an iterable of strings
documents = reader.load_data(
    texts=["I went to the store", "I bought an apple"]
)

This loader is designed to be used as a way to load data into
LlamaIndex and/or subsequently
used as a Tool in a LangChain Agent.

FAQ

Common questions

Discussion

Questions & comments · 0

Sign In Sign in to leave a comment.