Steamship
SteamshipFileReader #
Bases: BaseReader
Reads persistent Steamship Files and converts them to Documents.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
api_key
|
Optional[str]
|
Steamship API key. Defaults to STEAMSHIP_API_KEY value if not provided. |
None
|
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
).
Source code in llama-index-integrations/readers/llama-index-readers-steamship/llama_index/readers/steamship/base.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
|
load_data #
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:
Name | Type | Description | Default |
---|---|---|---|
workspace
|
str
|
the handle for a Steamship workspace (see: https://docs.steamship.com/workspaces/index.html) |
required |
query
|
Optional[str]
|
a Steamship tag query for retrieving files (ex: 'filetag and value("import-id")="import-001"') |
None
|
file_handles
|
Optional[List[str]]
|
a list of Steamship File handles
(ex: |
None
|
collapse_blocks
|
bool
|
whether to merge individual File Blocks into a single Document, or separate them. |
True
|
join_str
|
str
|
when collapse_blocks is True, this is how the block texts will be concatenated. |
'\n\n'
|
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).
Source code in llama-index-integrations/readers/llama-index-readers-steamship/llama_index/readers/steamship/base.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
|