Share the readers' place, table-lookup and country helpers, unify the employment vocabulary, and list the enrich switch with the stages
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
ca80219bbb
commit
903b69b6d3
34 files changed
+290
-207
No files matched your search
+10
-4
@@ -13,8 +13,8 @@ finders ask it (`extract.extract_task`, `summarise.summarise_task`).
|
||||
asks no model and is on by default (`enrich.enabled`); its switch is
|
||||
`stage:enrich`, set the same way through `PUT /api/stages/enrich`.
|
||||
|
||||
`describe` is what `GET /api/stages` and `app stages` show: for each model
|
||||
stage whether it is on, where that comes from, the model it uses, and who
|
||||
`describe` is what `GET /api/stages` and `app stages` show: for each stage
|
||||
with a switch, the model stages and `enrich`, whether it is on, where that comes from, the model it uses, and who
|
||||
would answer.
|
||||
"""
|
||||
|
||||
@@ -33,6 +33,8 @@ NAMES = ("extract", "summarise")
|
||||
#: Every stage with a switch: the model stages and `enrich`.
|
||||
SWITCHES = (*NAMES, "enrich")
|
||||
|
||||
#: What `describe_one` says of a stage that asks no model.
|
||||
NO_ASK = "reads role pages, asks no model"
|
||||
NO_MODEL = ("no model is reachable: set ANTHROPIC_API_KEY or CLAUDE_CODE_OAUTH_TOKEN, "
|
||||
"see docs/llm-backends.md")
|
||||
ANSWERS = {
|
||||
@@ -42,7 +44,7 @@ ANSWERS = {
|
||||
|
||||
|
||||
class Stage(BaseModel):
|
||||
"""One model stage as the page shows it. `source` is "stored" when the
|
||||
"""One stage as the page shows it. `source` is "stored" when the
|
||||
switch set it and "config" when it is still config.yaml's default.
|
||||
`backend` is `agent.backend`'s answer, "" for nobody, and `answer` says
|
||||
it in words."""
|
||||
@@ -89,6 +91,10 @@ def answer(config: Config) -> tuple[str, str]:
|
||||
|
||||
|
||||
def describe_one(config: Config, store: Store, name: str) -> Stage:
|
||||
if name not in NAMES:
|
||||
return Stage(name=name, on=stage_on(config, store, name),
|
||||
source="config" if stored(store, name) is None else "stored",
|
||||
model="", backend="", answer=NO_ASK)
|
||||
backend, said = answer(config)
|
||||
return Stage(name=name, on=stage_on(config, store, name),
|
||||
source="config" if stored(store, name) is None else "stored",
|
||||
@@ -97,4 +103,4 @@ def describe_one(config: Config, store: Store, name: str) -> Stage:
|
||||
|
||||
|
||||
def describe(config: Config, store: Store) -> list[Stage]:
|
||||
return [describe_one(config, store, name) for name in NAMES]
|
||||
return [describe_one(config, store, name) for name in SWITCHES]
|
||||
Reference in new issue
Block a user