SteamshipFileReader#

class llama_index.readers.SteamshipFileReader(api_key: Optional[str] = None)#

Bases: BaseReader

Reads persistent Steamship Files and converts them to Documents.

Parameters

api_key – Steamship API key. Defaults to STEAMSHIP_API_KEY value if not provided.

Note

Requires install of steamship package and an active Steamship API Key. To get a Steamship API Key, visit: https://steamship.com/account/api. Once you have an API Key, expose it via an environment variable named STEAMSHIP_API_KEY or pass it as an init argument (api_key).

Methods Summary

load_data(workspace[, query, file_handles, ...])

Load data from persistent Steamship Files into Documents.

Methods Documentation

load_data(workspace: str, query: Optional[str] = None, file_handles: Optional[List[str]] = None, collapse_blocks: bool = True, join_str: str = '\n\n') List[Document]#

Load data from persistent Steamship Files into Documents.

Parameters
  • workspace – the handle for a Steamship workspace (see: https://docs.steamship.com/workspaces/index.html)

  • query – a Steamship tag query for retrieving files (ex: ‘filetag and value(“import-id”)=”import-001”’)

  • file_handles – a list of Steamship File handles (ex: smooth-valley-9kbdr)

  • collapse_blocks – whether to merge individual File Blocks into a single Document, or separate them.

  • join_str – when collapse_blocks is True, this is how the block texts will be concatenated.

Note

The collection of Files from both query and file_handles will be combined. There is no (current) support for deconflicting the collections (meaning that if a file appears both in the result set of the query and as a handle in file_handles, it will be loaded twice).