File utils
load_file(path)
Load a file from the given path and return its content as bytes.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path |
str
|
The path to the file to load. |
required |
Returns:
Type | Description |
---|---|
bytes
|
The content of the file. |
Source code in griptape/utils/file_utils.py
load_files(paths, futures_executor=None)
Load multiple files concurrently and return a dictionary of their content.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
paths |
list[str]
|
The paths to the files to load. |
required |
futures_executor |
Optional[ThreadPoolExecutor]
|
The executor to use for concurrent loading. If None, a new ThreadPoolExecutor will be created. |
None
|
Returns:
Type | Description |
---|---|
dict[str, bytes]
|
A dictionary where the keys are a hash of the path and the values are the content of the files. |