Skip to content

Commit

Permalink
Merge branch 'dev' into docs/gtc-structure-as-transform
Browse files Browse the repository at this point in the history
  • Loading branch information
emjay07 authored Sep 17, 2024
2 parents 9759f74 + c3f5d49 commit 58d27f2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/griptape-framework/structures/rulesets.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ A [Ruleset](../../reference/griptape/rules/ruleset.md) can be used to define [Ru
This is particularly useful when you need the LLM to return well-formed data, such as JSON objects, with specific fields and data types.

!!! warning
`JsonSchemaRule` may break [ToolkitTask](../structures/tasks.md#toolkittask) which relies on a specific [output token](https://github.com/griptape-ai/griptape/blob/e6a04c7b88cf9fa5d6bcf4c833ffebfab89a3258/griptape/tasks/toolkit_task.py#L28).
`JsonSchemaRule` may break [ToolkitTask](../structures/tasks.md#toolkit) which relies on a specific [output token](https://github.com/griptape-ai/griptape/blob/e6a04c7b88cf9fa5d6bcf4c833ffebfab89a3258/griptape/tasks/toolkit_task.py#L28).


```python
Expand Down
3 changes: 2 additions & 1 deletion griptape/templates/rules/json_schema.j2
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
You must respond with a JSON object that successfully validates against the following schema: {{json_schema}}
Output valid JSON that matches this schema: {{ json_schema }}
No markdown, code snippets, code blocks, or backticks.
2 changes: 1 addition & 1 deletion tests/unit/rules/test_json_schema_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test_to_text(self):
rule = JsonSchemaRule(json_schema)
assert (
rule.to_text()
== f"You must respond with a JSON object that successfully validates against the following schema: {json.dumps(json_schema)}"
== f"Output valid JSON that matches this schema: {json.dumps(json_schema)}\nNo markdown, code snippets, code blocks, or backticks."
)

def test___str__(self):
Expand Down

0 comments on commit 58d27f2

Please sign in to comment.