Skip to content

Commit

Permalink
Merge pull request #1142 from guardrails-ai/docs/strict-json
Browse files Browse the repository at this point in the history
strict json mode doc
  • Loading branch information
zsimjee authored Oct 24, 2024
2 parents 8fd8fe7 + 7a08121 commit dab40f1
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions docs/how_to_guides/generate_structured_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,18 @@ response = guard(
prompt_params={"chat_history": chat_history},
response_format={ "type": "json_object" }
)
```


### Strict JSON Mode
For models that support strict JSON mode,


```py
response = guard(
model="gpt-4o",
messages=messages,
prompt_params={"chat_history": chat_history},
response_format=g.response_format_json_schema()
)
```

0 comments on commit dab40f1

Please sign in to comment.