-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
af07071
commit cd88b5c
Showing
73 changed files
with
425 additions
and
759 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
from pathlib import Path | ||
|
||
from griptape.loaders import AudioLoader | ||
from griptape.utils import load_file | ||
|
||
# Load an image from disk | ||
audio_artifact = AudioLoader().load(Path("tests/resources/sentences.wav").read_bytes()) | ||
AudioLoader().load("tests/resources/sentences.wav") | ||
|
||
# You can also use the load_file utility function | ||
AudioLoader().load(load_file("tests/resources/sentences.wav")) | ||
# You can also pass a Path object | ||
AudioLoader().load(Path("tests/resources/sentences.wav")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,11 @@ | ||
from pathlib import Path | ||
|
||
from griptape.loaders import CsvLoader | ||
from griptape.utils import load_file, load_files | ||
|
||
# Load a single CSV file | ||
CsvLoader().load(Path("tests/resources/cities.csv").read_text()) | ||
# You can also use the load_file utility function | ||
CsvLoader().load(load_file("tests/resources/cities.csv")) | ||
CsvLoader().load("tests/resources/cities.csv") | ||
# You can also pass a Path object | ||
CsvLoader().load(Path("tests/resources/cities.csv")) | ||
|
||
# Load multiple CSV files | ||
CsvLoader().load_collection( | ||
[Path("tests/resources/cities.csv").read_text(), Path("tests/resources/addresses.csv").read_text()] | ||
) | ||
# You can also use the load_files utility function | ||
CsvLoader().load_collection(list(load_files(["tests/resources/cities.csv", "tests/resources/addresses.csv"]).values())) | ||
CsvLoader().load_collection([Path("tests/resources/cities.csv"), "tests/resources/addresses.csv"]) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
from pathlib import Path | ||
|
||
from griptape.loaders import ImageLoader | ||
from griptape.utils import load_file | ||
|
||
# Load an image from disk | ||
disk_image_artifact = ImageLoader().load(Path("tests/resources/mountain.png").read_bytes()) | ||
# You can also use the load_file utility function | ||
ImageLoader().load(load_file("tests/resources/mountain.png")) | ||
ImageLoader().load("tests/resources/mountain.png") | ||
|
||
# You can also pass a Path object | ||
ImageLoader().load(Path("tests/resources/mountain.png")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,11 @@ | ||
from pathlib import Path | ||
|
||
from griptape.loaders import ImageLoader | ||
from griptape.utils import load_file, load_files | ||
|
||
# Load a single image in BMP format | ||
image_artifact_jpeg = ImageLoader(format="bmp").load(Path("tests/resources/mountain.png").read_bytes()) | ||
# You can also use the load_file utility function | ||
ImageLoader(format="bmp").load(load_file("tests/resources/mountain.png")) | ||
ImageLoader(format="bmp").load("tests/resources/mountain.png") | ||
# You can also pass a Path object | ||
ImageLoader(format="bmp").load(Path("tests/resources/mountain.png")) | ||
|
||
# Load multiple images in BMP format | ||
ImageLoader().load_collection( | ||
[Path("tests/resources/mountain.png").read_bytes(), Path("tests/resources/cow.png").read_bytes()] | ||
) | ||
# You can also use the load_files utility function | ||
ImageLoader().load_collection(list(load_files(["tests/resources/mountain.png", "tests/resources/cow.png"]).values())) | ||
ImageLoader().load_collection([Path("tests/resources/mountain.png"), "tests/resources/cow.png"]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.