Open johnsinco opened 9 months ago
https://jinja.palletsprojects.com/en/2.11.x/templates/#list-of-builtin-filters @johnsinco from_json seems not a built-in filter, what is your proposal?
There seems to be the idea that eventually node inputs would be strongly typed as suggested by the VSC UI here ->
If that is planned and one of the types could be a JSON object of some sort that would be ideal. Otherwise a method to use 3rd party jinja
filters such as the load_json
filter provided by Ansible would also make this scenario much easier for us.
Hi @johnsinco, thank you for your feedback!
Strong type value in prompt is not in our plan now.
As for load_json
filter, we will discuss on this feature.
We will keep this item open and update the plan if we have some conclusion.
Please use another node as the workaround now, sorry for the inconvenience.
Hi, we're sending this friendly reminder because we haven't heard back from you in 30 days. We need more information about this issue to help address it. Please be sure to give us your input. If we don't hear back from you within 7 days of this comment, the issue will be automatically closed. Thank you!
Is your feature request related to a problem? Please describe. We are trying to use a JSON string output by the LLM as data for a downstream node within the
jinja2
template. We have tried using the built-in and add-on jinja "filter" mechanism as below, but it doesnt appear to be available or supported within PromptFlow{% set data = tables|from_json %}
<-- Gives an errorDescribe the solution you'd like There seems to be some idea that strong-typing of inputs and outputs to nodes may be supported in the future? We are unable to determine how either automatic parsing of a JSON string into an object or parsing within the jinja tempates can be done.
Describe alternatives you've considered We could create a separate node to manually parse the string into JSON object within the flow. We will use this workaround but an automatic facility would be much better