Message Boards Message Boards

How can I define Structured Outputs in LLMSynthesize?

Posted 1 day ago

Is there any way to work with structured outputs in LLMSynthesize? I couldn't find it in the documentation. I would like to specify the JSON format of the result, for example, to ensure the output follows a structure like:

[{"name": ..., "role": ..., "company": ...}, ...]

Any tips?

Below is the OpenAI documentation on the topic: https://platform.openai.com/docs/guides/structured-outputs

POSTED BY: Rodrigo Murta
3 Replies

You’ll have to use the API directly to get structured outputs. Here’s the chain of thought example from https://platform.openai.com/docs/guides/structured-outputs#chain-of-thought converted to a ServiceExecute call https://www.wolframcloud.com/obj/e36bc8e4-ac00-4872-84df-43714b38e29e

POSTED BY: Avery Davis

One way is to use the prompt "NothingElse". You might also consider using ImportString for the obtained JSON text. See the attached notebook.


enter image description here

Attachments:
POSTED BY: Anton Antonov

Also, shameless plug, more workflows like the ones above are discussed here:

enter image description here

POSTED BY: Anton Antonov
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract