griptape icon indicating copy to clipboard operation
griptape copied to clipboard

Feature Request: Addition of JSONLoader

Open basedavishkar opened this issue 2 years ago • 2 comments

Is your feature request related to a problem? Please describe. Currently, there is no JSONLoader class in Griptape. This makes it difficult to load and extract data from JSON files in a flexible and efficient manner.

Describe the solution you'd like JSONLoader will automatically parses nested JSON structures and returns a flattened version of the data. This would save a lot of time and reduce the risk of errors. it is in my opinion a better approach because it is designed specifically for handling JSON data and provides a more streamlined and efficient process compared to the default Python JSON library.

Describe alternatives you've considered I have considered using other JSON parsing libraries, such as JSON.parse() or UJSON. However, these libraries do not provide the same level of flexibility and control as a custom JSONLoader class. Additionally, they do not support the ability to extract data based on a jq schema.

Additional context This feature would be particularly useful for working with complex JSON data, such as the responses returned by many web APIs. Here's an example of the type of data I'm working with: { "key1": "value1", "key2": { "key3": "value3", "key4": "value4" } }. The ability to automatically parse and flatten this data would greatly improve the efficiency of my workflow.

basedavishkar avatar Nov 13 '23 12:11 basedavishkar

This would be great to have. Maybe we also introduce a JsonArtifact that contains a value: dict?

@ashkaaar can you please share more details around the jq schema?

collindutter avatar Nov 13 '23 16:11 collindutter

+1 - this would be really really useful!

Bergrebell avatar Feb 13 '24 15:02 Bergrebell