Some checks failed
Forgejo Android APK / Root app tests (push) Successful in 46s
Forgejo Docker Build / Root app tests (push) Successful in 47s
Forgejo Android APK / Build signed APK (push) Successful in 1m56s
Forgejo Docker Build / Build Docker image (push) Successful in 18s
Forgejo Docker Build / Deploy to the host (push) Failing after 0s
PubMed joins web search as an optional source for a generated resource: a
literature search on the topic, with abstracts, cited by PMID in References.
Off by default, admin-enabled, with its own optional API key (NCBI raises the
rate limit from 3/sec to 10/sec; it works without one).
Neither search is a tool any more, and that is the point. Offering them as
function calls meant the model decided whether to search, and with a prompt
ending "Output ONLY Pandoc markdown" it decided not to — every time, with and
without corpus grounding, no matter how the tool description was worded.
Calling callAI with the tool directly produced a correct pubmed_search call, so
the plumbing was never the problem. The search only ever needed the topic, and
the route knows the topic before it calls the model, so both searches now run up
front and their results go into the prompt as findings, exactly the way corpus
excerpts do. Ticking the box now means the search happened.
Verified live against deepseek-v4-flash: 30 corpus excerpts and 6 PubMed
results, and a References slide carrying both the library sources and four real
PMIDs (29562151, 38506440, 35721052, 28814254).
Three fixes to illustration, which had never once fired:
- The dispatch call had been lost in a refactor. The tool was still offered, the
model still called it, and the call was dropped, so no job was ever enqueued.
- imageContext was passed as a bare topic string where dispatch expects
{ request, history }, which made the bound request undefined.
- The prompt never mentioned the tool existed while explicitly demanding only
markdown — the same suppression that killed the searches. It now says an
illustration is available and that calling it is not a violation of that rule.
my_resources is its own image workflow rather than a reuse of learning_hub,
because generated_image_links only accepts learning_hub assets, and that is
exactly the barrier that keeps a private illustration out of published content.
The illustration renders in the panel, rather than a toast pointing at an image
history this feature does not have.
Verified end to end: job queued, rendered, and the asset served to its owner as
a correctly labelled subglottic-anatomy teaching diagram.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dv6sqaY6Vq3ChZHMem3cnU
24 lines
1.3 KiB
JavaScript
24 lines
1.3 KiB
JavaScript
// Illustration for a person's own resources.
|
|
//
|
|
// A third image workflow rather than a reuse of learning_hub, because the two
|
|
// have opposite visibility rules. A learning_hub asset can be linked into
|
|
// published content and served to everyone; generated_image_links enforces
|
|
// that by requiring workflow='learning_hub', which is exactly the guarantee
|
|
// this feature needs to keep. Filing a private illustration under learning_hub
|
|
// would make it linkable into published content by anyone who knew its id.
|
|
//
|
|
// Nothing else is needed to serve them: asset() already grants the owner, so a
|
|
// my_resources image is visible to the person who made it and to nobody else.
|
|
|
|
exports.up = pgm => pgm.sql(`
|
|
ALTER TABLE generated_image_jobs DROP CONSTRAINT IF EXISTS generated_image_jobs_workflow_check;
|
|
ALTER TABLE generated_image_jobs ADD CONSTRAINT generated_image_jobs_workflow_check
|
|
CHECK (workflow IN ('clinical_assistant', 'learning_hub', 'my_resources'));
|
|
`);
|
|
|
|
exports.down = pgm => pgm.sql(`
|
|
DELETE FROM generated_image_jobs WHERE workflow='my_resources';
|
|
ALTER TABLE generated_image_jobs DROP CONSTRAINT IF EXISTS generated_image_jobs_workflow_check;
|
|
ALTER TABLE generated_image_jobs ADD CONSTRAINT generated_image_jobs_workflow_check
|
|
CHECK (workflow IN ('clinical_assistant', 'learning_hub'));
|
|
`);
|