I've resuscitated a project I was working on years ago.
I was tired of having nested `flat_map` making my code basically unreadable just to fetch a simple value. The idea is to make simple & readable the traversing of deeply nested structures like JSON responses, while staying in Ruby & keeping its flexibility. Here it goes:
graphql_response.then(&'[data][repository][issues][edges]*([node][title])')
# => ["Support negative indexes", "Document aggregates"]
github_prs_response.then(&'*[draft].any?')
# => true
It's different from jq or JSONPath in that:
- it's a Ruby block so you can use it with `map`, `find`, etc.
- you can call Ruby method from it
- it doesn't automatically flatten arrays, you decide
- it raises on `nil` by default (unless you use `&`, i.e. `[customer][address]&[city]`)Obviously, it has drawbacks: - it's yet another syntax to learn - it monkey-patches `String` which might be a blocker for some
I'm really looking for feedback here, what do you think? Is it worth releasing a gem with this value proposition?
by hendler ·
I am the founder of Human Assisted Intelligence and I believe AI can be used to reduce polarization and improve the way people communicate and reach agreement.
At https://mediationbench.com/, there are many frontier LLMs tested, but it is difficult to keep up. I've been trying to get more free openrouter or huggingface credits. Azure for OpenAI and Anthropic have both provided token credits. (Thank You!)
The research paper is there as well.
There have been efforts to use LLMs to lie and play diplomacy, which are excellent compliments to this work.
In v4, the test will get harder as Claude nearly saturated the test. Astra was surprisingly low, perhaps because of alignment or safety efforts.
I'd love to get feedback and hear from all of you. I've been working on related ideas for 20 years, so it's definitely a passion project with too much time in isolation.
Anvil is an AI app builder focused on premium UI/UX without the premium price tags. Build polished websites by using natural language with with real project execution, live previews and automated error correction. Plans starts at $1 for 7 days with 1M tokens. Built independently from Africa in Zambia.