Replies: 1 comment 3 replies
|
Hi @rantzo7! I'm Dosu and I’m helping the dify team. Dify's LLM node outputs the model response as a string in the To use structured data in subsequent nodes, insert a Template node after the LLM node. The Template node can convert the JSON string in File outputs are only populated if the model returns multimodal content (like images); otherwise, the Compared to Make or Zapier, which natively pass objects/arrays between steps, Dify's workflow currently requires manual conversion. However, comprehensive support for node-level structured output (object/array) is planned for reintroduction in version 1.2 [source]. For now, use Template nodes to bridge the gap and extract structured data for further processing or integration. If you need true file outputs, ensure your workflow or model is designed to produce them. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Uh oh!
There was an error while loading. Please reload this page.
Self Checks
1. Is this request related to a challenge you're experiencing? Tell me about your story.
I try to get a JSON output when using LLM node with Json schema enabled but it keeps giving a text response (string) even if the schema and the prompt is giving the desired output.
And overall, how do i get the JSON output in any node when it's available as most of the time it allow only to use text variables for the next node in the flow.
It shouldn't be that hard to get the JSON or file output. Using tools like Make or zapier, it's very easy to get an array or object.
2. Additional context or comments
Here is the output i get even if JSON Schema is enebled. I expect a object or array response as a JSON or file field.
{
"text": "{"products":[{"name":"Grigora","url":"https://appsumo.com/products/grigora/"},{"name":"Nexter","url":"https://appsumo.com/products/nexter/"},{"name":"Biyond","url":"https://appsumo.com/products/biyond/"},{"name":"Phygital+", "url":"https://appsumo.com/products/phygital/"},{"name":"Bestever","url":"https://appsumo.com/products/bestever/"},{"name":"SyncSignature - Plus Exclusive","url":"https://appsumo.com/products/syncsignature/"},{"name":"TeliportMe Virtual Tours","url":"https://appsumo.com/products/teliportme-virtual-tours/"},{"name":"Dialora","url":"https://appsumo.com/products/dialora/"},{"name":"ThriveDesk","url":"https://appsumo.com/products/thrivedesk/"},{"name":"Charla","url":"https://appsumo.com/products/charla/"},{"name":"Currents","url":"https://appsumo.com/products/currents/"},{"name":"Sherlock Al","url":"https://appsumo.com/products/sherlockai/"},{"name":"Dorin AI","url":"https://appsumo.com/products/dorin-ai/"}]}",
"usage": {
"prompt_tokens": 5174,
"prompt_unit_price": "1.25",
"prompt_price_unit": "0.000001",
"prompt_price": "0.0064675",
"completion_tokens": 2480,
"completion_unit_price": "10",
"completion_price_unit": "0.000001",
"completion_price": "0.0248",
"total_tokens": 7654,
"total_price": "0.0312675",
"currency": "USD",
"latency": 21.336650199024007
},
"finish_reason": "STOP",
"files": []
}
All reactions