murta
(Rodrigo Murta)
December 26, 2024, 9:57pm
1
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
averyd
(Avery Davis)
December 27, 2024, 3:38pm
2
You’ll have to use the API directly to get structured outputs.
Here’s the chain of thought example from Structured model outputs | OpenAI API converted to a ServiceExecute call
https://www.wolframcloud.com/obj/e36bc8e4-ac00-4872-84df-43714b38e29e
antononcube
(Anton Antonov)
December 27, 2024, 5:00pm
3
One way is to use the prompt “NothingElse”. You might also consider using ImportString for the obtained JSON text. See the attached notebook.
LLMSynthesize-for-structural-output.nb (154 KB)
antononcube
(Anton Antonov)
December 27, 2024, 5:04pm
4
Also, shameless plug, more workflows like the ones above are discussed here: