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
130 lines
6.7 KiB
HTML
130 lines
6.7 KiB
HTML
<div class="card">
|
|
<div class="card-header">
|
|
<h3><i class="fas fa-folder-open"></i> My Resources</h3>
|
|
<span style="font-size:12px;color:var(--g500);">Private to you</span>
|
|
</div>
|
|
<div style="padding:16px;display:flex;flex-direction:column;gap:14px;">
|
|
<p style="margin:0;padding:8px 10px;background:var(--g100);border-radius:6px;font-size:12px;color:var(--g600);">
|
|
Teaching material you generate for yourself — a deck for tomorrow's session, a
|
|
handout, a summary. Nobody else sees these. Published Learning Hub content is separate
|
|
and stays with the moderators.
|
|
</p>
|
|
|
|
<div class="admin-row">
|
|
<label for="mr-topic" class="admin-row-label">Topic</label>
|
|
<input id="mr-topic" type="text" class="admin-control" placeholder="e.g. febrile seizures in under-fives" maxlength="300">
|
|
</div>
|
|
|
|
<div class="admin-row">
|
|
<label for="mr-kind" class="admin-row-label">Format</label>
|
|
<div style="flex:1;display:flex;gap:10px;align-items:center;flex-wrap:wrap;min-width:0;">
|
|
<select id="mr-kind" class="admin-control" style="max-width:220px;">
|
|
<option value="presentation">Presentation (slides)</option>
|
|
<option value="article">Article (prose)</option>
|
|
</select>
|
|
<label style="font-size:12px;color:var(--g600);display:flex;align-items:center;gap:6px;">
|
|
Slides
|
|
<input id="mr-slide-count" type="number" min="3" max="30" value="8" style="width:70px;font-size:13px;padding:5px 8px;border:1px solid var(--g300);border-radius:6px;">
|
|
</label>
|
|
<label style="font-size:12px;color:var(--g600);display:flex;align-items:center;gap:6px;" id="mr-word-wrap" hidden>
|
|
Words
|
|
<input id="mr-word-count" type="number" min="200" max="3000" step="100" value="800" style="width:90px;font-size:13px;padding:5px 8px;border:1px solid var(--g300);border-radius:6px;">
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="admin-row">
|
|
<strong class="admin-row-label">Clinical library</strong>
|
|
<div style="flex:1;display:flex;flex-direction:column;gap:4px;min-width:0;">
|
|
<label style="display:flex;align-items:center;gap:8px;font-size:13px;">
|
|
<input type="checkbox" id="mr-use-corpus" checked>
|
|
Write from the indexed clinical library
|
|
</label>
|
|
<p style="margin:0;font-size:12px;color:var(--g500);">
|
|
Searches the corpus for your topic and writes from those excerpts, preferring them
|
|
over the model's own recall, and ends with a References section. Turn this off for a
|
|
topic the library does not cover.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="admin-row" id="mr-model-row" hidden>
|
|
<label for="mr-model" class="admin-row-label">Model</label>
|
|
<div style="flex:1;display:flex;flex-direction:column;gap:4px;min-width:0;">
|
|
<select id="mr-model" class="admin-control" style="max-width:320px;"></select>
|
|
<p style="margin:0;font-size:12px;color:var(--g500);">
|
|
Only shown when an administrator has approved more than one. Otherwise the
|
|
configured model is used.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="admin-row" id="mr-images-row" hidden>
|
|
<strong class="admin-row-label">Illustrations</strong>
|
|
<div style="flex:1;display:flex;flex-direction:column;gap:4px;min-width:0;">
|
|
<label style="display:flex;align-items:center;gap:8px;font-size:13px;">
|
|
<input type="checkbox" id="mr-with-images">
|
|
Let the model add an image where one genuinely helps
|
|
</label>
|
|
<p style="margin:0;font-size:12px;color:var(--g500);">
|
|
Off by default: a model handed a drawing tool will find a reason to use it, and
|
|
most teaching material does not want one. Images appear in your image history.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="admin-row" id="mr-web-row" hidden>
|
|
<strong class="admin-row-label">Web search</strong>
|
|
<div style="flex:1;display:flex;flex-direction:column;gap:4px;min-width:0;">
|
|
<label style="display:flex;align-items:center;gap:8px;font-size:13px;">
|
|
<input type="checkbox" id="mr-web-search">
|
|
Let the model look something up online
|
|
</label>
|
|
<p style="margin:0;font-size:12px;color:var(--g500);">
|
|
For something newer than the library — a guideline published this year, a recent
|
|
approval. <strong>The search query leaves this network</strong> and reaches the provider
|
|
your administrator configured; the library excerpts and the resource itself never do.
|
|
Do not put anything identifying in the topic if you turn this on.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="admin-row" id="mr-pubmed-row" hidden>
|
|
<strong class="admin-row-label">PubMed</strong>
|
|
<div style="flex:1;display:flex;flex-direction:column;gap:4px;min-width:0;">
|
|
<label style="display:flex;align-items:center;gap:8px;font-size:13px;">
|
|
<input type="checkbox" id="mr-pubmed">
|
|
Let the model cite published literature
|
|
</label>
|
|
<p style="margin:0;font-size:12px;color:var(--g500);">
|
|
Searches PubMed and returns structured records, so a reference carries a PMID somebody
|
|
can look up. <strong>The search query goes to NCBI</strong>; the library excerpts and
|
|
the resource itself do not.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="admin-row" style="align-items:flex-start;">
|
|
<label for="mr-refinement" class="admin-row-label">Instructions <span style="color:var(--g400);font-weight:400;">(optional)</span></label>
|
|
<textarea id="mr-refinement" class="admin-control" style="min-height:70px;resize:vertical;font-family:inherit;" placeholder="e.g. for FY1s, case-based, emphasise red flags"></textarea>
|
|
</div>
|
|
|
|
<div style="border-top:1px solid var(--g100);padding-top:12px;display:flex;align-items:center;gap:10px;flex-wrap:wrap;">
|
|
<button id="btn-mr-generate" class="btn-sm btn-primary" type="button"><i class="fas fa-wand-magic-sparkles"></i> Generate</button>
|
|
<span id="mr-status" role="status" style="font-size:12px;color:var(--g600);"></span>
|
|
</div>
|
|
|
|
<!-- An illustration the model asked for. It renders here rather than in an
|
|
image history, because this feature does not have one and telling
|
|
someone to look somewhere that does not exist is worse than silence. -->
|
|
<div id="mr-images" style="display:flex;flex-direction:column;gap:10px;"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card" style="margin-top:14px;">
|
|
<div class="card-header">
|
|
<h3><i class="fas fa-book"></i> Library</h3>
|
|
<button id="btn-mr-refresh" class="btn-sm btn-ghost" type="button"><i class="fas fa-rotate"></i> Refresh</button>
|
|
</div>
|
|
<div id="mr-list" style="padding:12px 16px;display:flex;flex-direction:column;gap:6px;"></div>
|
|
</div>
|