docs: overhaul example

This commit is contained in:
Johann Schopplich
2025-11-16 19:00:18 +01:00
parent 1a652d239d
commit bfdfbd87c6

View File

@@ -41,31 +41,89 @@ AI is becoming cheaper and more accessible, but larger context windows allow for
```json ```json
{ {
"users": [ "context": {
{ "id": 1, "name": "Alice", "role": "admin" }, "task": "Our favorite hikes together",
{ "id": 2, "name": "Bob", "role": "user" } "homeBase": "Boulder",
"season": "spring_2025"
},
"friends": ["ana", "luis", "sam"],
"hikes": [
{
"id": 1,
"name": "Blue Lake Trail",
"distanceKm": 7.5,
"elevationGain": 320,
"companion": "ana",
"wasSunny": true
},
{
"id": 2,
"name": "Ridge Overlook",
"distanceKm": 9.2,
"elevationGain": 540,
"companion": "luis",
"wasSunny": false
},
{
"id": 3,
"name": "Wildflower Loop",
"distanceKm": 5.1,
"elevationGain": 180,
"companion": "sam",
"wasSunny": true
}
] ]
} }
``` ```
YAML conveys the same infromation with **fewer tokens**: YAML conveys the same information with **fewer tokens**:
```yaml ```yaml
users: context:
task: Our favorite hikes together
homeBase: Boulder
season: spring_2025
friends:
- ana
- luis
- sam
hikes:
- id: 1 - id: 1
name: Alice name: Blue Lake Trail
role: admin distanceKm: 7.5
elevationGain: 320
companion: ana
wasSunny: true
- id: 2 - id: 2
name: Bob name: Ridge Overlook
role: user distanceKm: 9.2
elevationGain: 540
companion: luis
wasSunny: false
- id: 3
name: Wildflower Loop
distanceKm: 5.1
elevationGain: 180
companion: sam
wasSunny: true
``` ```
TOON conveys the same information with **even fewer tokens**: TOON conveys the same information with **even fewer tokens**, while keeping the hikes in a clear tabular layout:
``` ```toon
users[2]{id,name,role}: context:
1,Alice,admin task: Our favorite hikes together
2,Bob,user homeBase: Boulder
season: spring_2025
friends[3]: ana,luis,sam
hikes[3]{id,name,distanceKm,elevationGain,companion,wasSunny}:
1,Blue Lake Trail,7.5,320,ana,true
2,Ridge Overlook,9.2,540,luis,false
3,Wildflower Loop,5.1,180,sam,true
``` ```
## Key Features ## Key Features