|
|
|
|
|
by petercooper
330 days ago
|
|
Not anywhere near as sophisticated as yours but I have something vaguely similar for simplifying JSON documents (while maintaining what the data also looks like) for feeding to LLMs to help them code against: jq 'walk(if type == "array" then (if length > 0 then [.[0]] else . end) else . end)'
So that 70,000+ line Amazon example of yours would boil down to: {
"syncToken": "1753114994",
"createDate": "2025-07-21-16-23-14",
"prefixes": [
{
"ip_prefix": "3.4.12.4/32",
"region": "eu-west-1",
"service": "AMAZON",
"network_border_group": "eu-west-1"
}
],
"ipv6_prefixes": [
{
"ipv6_prefix": "2600:1f69:7400::/40",
"region": "mx-central-1",
"service": "AMAZON",
"network_border_group": "mx-central-1"
}
]
}
.. which is easier/cheaper to feed to an LLM for getting it to write code to process, etc. than the multi-megabyte original. |
|