You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- pyproject: version 2.2.2 -> 2.3.0 (was out of sync with __init__.py),
Documentation URL -> https://gcformat.com/ (was a stale github.io link),
Development Status Beta -> Production/Stable, description mentions
multi-turn delta, keywords += delta/multi-turn/agents.
- README: document the new generic-profile delta (§10a) and the re-anchor
session helper (§10a.8) with examples; add them to the API and Types tables.
These were the headline v2.3.0 features and were previously undocumented.
- CI: fix the conformance step that never actually ran (the runner resolves
a sibling ../gcf, but CI checked the fixtures repo out to a subdir). Now
checks out gcf-python and gcf as siblings with working-directory: gcf-python.
- CHANGELOG: finalize v2.3.0 date.
Copy file name to clipboardExpand all lines: README.md
+46-2Lines changed: 46 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -157,6 +157,44 @@ Output:
157
157
158
158
Works on dicts, lists, and primitives. Lists of uniform dicts get tabular rows. Nested dicts use `## key` section headers.
159
159
160
+
## Generic-Profile Delta (multi-turn)
161
+
162
+
In an agent loop the same keyed table gets re-queried turn after turn. Instead of re-sending the whole table each time, send only the changed rows (SPEC §10a):
163
+
164
+
```python
165
+
from gcf import GenericSet, diff_generic_sets, encode_generic_delta, verify_generic_delta
166
+
167
+
base = GenericSet(key="id", fields=["id", "status"], rows=[
Opt-in and bilateral, keyed on content-addressed pack roots. By the 5th overlapping call, ~97% fewer tokens than re-sending JSON.
182
+
183
+
### Re-anchor session helper
184
+
185
+
`GenericDeltaSession` manages the delta/re-anchor cadence for you: each `next()` returns either a compact delta or, on its cadence, a full re-anchor (which re-grounds the consumer), updating its held base.
186
+
187
+
```python
188
+
from gcf import GenericDeltaSession, fixed_n, size_guard
wire = sess.current_full() # transmit the base once to establish it
192
+
for snapshot in stream: # each turn's current GenericSet
193
+
wire, is_full = sess.next(snapshot) # a compact delta, or a periodic full re-anchor
194
+
```
195
+
196
+
`fixed_n(15)` re-anchors every N turns; `size_guard()` (recommended) re-anchors once the cumulative delta reaches a full payload's size. It introduces no new wire syntax and the decoder stays cadence-agnostic, so a re-anchor is just the protocol's "full" outcome on a schedule.
197
+
160
198
## API
161
199
162
200
| Function | Description |
@@ -165,7 +203,11 @@ Works on dicts, lists, and primitives. Lists of uniform dicts get tabular rows.
165
203
|`encode_generic(data: Any) -> str`| Encode any value to GCF tabular format |
166
204
|`decode(input_text: str) -> Payload`| Parse GCF text back to a Payload |
description = "The AI-native wire format for structured data. 50-92% fewer tokens than JSON. 100% comprehension on every frontier model. Zero dependencies."
7
+
version = "2.3.0"
8
+
description = "The AI-native wire format for structured data. 50-92% fewer tokens than JSON, with multi-turn delta encoding for agent loops. 100% comprehension on every frontier model. Zero dependencies."
0 commit comments