From 0788847db19eacc4b0d12bacd2c20530760167da Mon Sep 17 00:00:00 2001 From: Collin Dutter Date: Fri, 4 Oct 2024 14:32:48 -0700 Subject: [PATCH] Fix type error that slipped through --- .../engines/src/extraction_engines_2.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/griptape-framework/engines/src/extraction_engines_2.py b/docs/griptape-framework/engines/src/extraction_engines_2.py index 35bbe53cd..ee34f779d 100644 --- a/docs/griptape-framework/engines/src/extraction_engines_2.py +++ b/docs/griptape-framework/engines/src/extraction_engines_2.py @@ -2,7 +2,8 @@ from schema import Literal, Schema -from griptape.artifacts import ErrorArtifact, ListArtifact +from griptape.artifacts import ListArtifact +from griptape.chunkers import TextChunker from griptape.drivers import OpenAiChatPromptDriver from griptape.engines import JsonExtractionEngine from griptape.loaders import WebLoader @@ -20,12 +21,11 @@ # Load data from the web web_data = WebLoader().load("https://en.wikipedia.org/wiki/Large_language_model") +chunks = TextChunker().chunk(web_data) -if isinstance(web_data, ErrorArtifact): - raise Exception(web_data.value) # Extract data using the engine -result = json_engine.extract_artifacts(ListArtifact(web_data)) +result = json_engine.extract_artifacts(ListArtifact(chunks)) for artifact in result: print(json.dumps(artifact.value, indent=2))