Skip to content

Commit

Permalink
Fix extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
collindutter committed Aug 14, 2024
1 parent f6e3554 commit 2a61f43
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion griptape/engines/extraction/json_extraction_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

@define
class JsonExtractionEngine(BaseExtractionEngine):
JSON_PATTERN = r"(?s)[^\[]*(\[.*\])"
JSON_PATTERN = r"(?s)(\{.*?\}|\[.*?\])"

template_schema: dict = field(default=Factory(dict), kw_only=True)
system_template_generator: J2 = field(
Expand Down
4 changes: 2 additions & 2 deletions griptape/templates/engines/extraction/json/user.j2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Extract information from the Text based on the Extraction Template JSON Schema into an array of JSON objects.
Extract information from the Text based on the Extraction Template JSON Schema into valid JSON.
Text: """{{ text }}"""

JSON array:
JSON:

0 comments on commit 2a61f43

Please sign in to comment.