Skip to content

Commit 2360cbd

Browse files
authored
feat(genapi): add recommendations for structured outputs usage
1 parent b5dc6d9 commit 2360cbd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pages/generative-apis/how-to/use-structured-outputs.mdx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,13 @@ Output example:
132132
}
133133
```
134134

135+
<Message type="tip">
136+
Structured outputs accuracy may vary between models. For instance, with Llama models, we suggest adding a description of the field looked for in `response_format` and in `system` or `user` messages. In our example this would mean adding a system prompt similar to:
137+
```bash
138+
"content": "The following is a voice message transcript. Provide the message title, summary and action items. Only answer in JSON using '{' as the first character.",
139+
```
140+
</Message>
141+
135142
### Using structured outputs with JSON schema (manual definition)
136143
137144
Alternatively, users can manually define the JSON schema inline when calling the model.

0 commit comments

Comments
 (0)