mirror of
https://git.pumpin.online/funkpower/catena.git
synced 2026-10-23 03:07:13 +00:00
bindings: colophon's own question, and the reply folded back in
colophon has composed the question about what its pages did not settle since it was written, and merged a reply back into the record it read. Both were reachable only from a terminal, so a pipeline wanting the same fallback would have had to write its own prompt — a second one, drifting from the first, asking for a shape merge does not accept. merge fills only the unsettled fields, so a model cannot overwrite what a book printed about itself. That is the property that makes asking one safe, and it belongs to colophon rather than to any caller.
This commit is contained in:
@@ -16,6 +16,7 @@ from ._catena import (
|
||||
chunk_markdown,
|
||||
citation_prompt,
|
||||
clean_record,
|
||||
colophon_prompt,
|
||||
clean_underscores,
|
||||
compose_subjects,
|
||||
count_tokens,
|
||||
@@ -30,6 +31,7 @@ from ._catena import (
|
||||
looks_like_footnote_citations,
|
||||
looks_like_person,
|
||||
merge_citation_reply,
|
||||
merge_colophon,
|
||||
needs_subject,
|
||||
pack_cues,
|
||||
parse_identifier,
|
||||
@@ -55,6 +57,7 @@ __all__ = [
|
||||
"chunk_markdown",
|
||||
"citation_prompt",
|
||||
"clean_record",
|
||||
"colophon_prompt",
|
||||
"clean_underscores",
|
||||
"compose_subjects",
|
||||
"count_tokens",
|
||||
@@ -69,6 +72,7 @@ __all__ = [
|
||||
"looks_like_footnote_citations",
|
||||
"looks_like_person",
|
||||
"merge_citation_reply",
|
||||
"merge_colophon",
|
||||
"needs_subject",
|
||||
"pack_cues",
|
||||
"parse_identifier",
|
||||
|
||||
@@ -102,3 +102,22 @@ def fetch_identifier(
|
||||
Blocks on the network. `None` when no register answers about that kind.
|
||||
"""
|
||||
...
|
||||
|
||||
def colophon_prompt(
|
||||
record: dict[str, Any], text: str, pages: int = ...
|
||||
) -> str | None:
|
||||
"""The question to put to a model about what the pages did not settle.
|
||||
|
||||
None when the pages settled everything. Nothing is sent anywhere.
|
||||
"""
|
||||
...
|
||||
|
||||
def merge_colophon(
|
||||
record: dict[str, Any], reply: str
|
||||
) -> tuple[dict[str, Any], int]:
|
||||
"""A model's reply folded in. Returns (record, fields_settled).
|
||||
|
||||
Only fills what the pages left unsettled; a model never overwrites what a
|
||||
book printed about itself.
|
||||
"""
|
||||
...
|
||||
|
||||
Reference in New Issue
Block a user