Skip to content

Commit dab40f1

Browse files
authored
Merge pull request #1142 from guardrails-ai/docs/strict-json
strict json mode doc
2 parents 8fd8fe7 + 7a08121 commit dab40f1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/how_to_guides/generate_structured_data.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,18 @@ response = guard(
130130
prompt_params={"chat_history": chat_history},
131131
response_format={ "type": "json_object" }
132132
)
133+
```
134+
135+
136+
### Strict JSON Mode
137+
For models that support strict JSON mode,
138+
139+
140+
```py
141+
response = guard(
142+
model="gpt-4o",
143+
messages=messages,
144+
prompt_params={"chat_history": chat_history},
145+
response_format=g.response_format_json_schema()
146+
)
133147
```

0 commit comments

Comments
 (0)