diff --git a/docs/CLINICAL_ASSISTANT.md b/docs/CLINICAL_ASSISTANT.md index 3a4a24c6..ec448696 100644 --- a/docs/CLINICAL_ASSISTANT.md +++ b/docs/CLINICAL_ASSISTANT.md @@ -95,14 +95,45 @@ Every message offers Translate with a target-language picker and a provider choi Important settings include: +All are stored in `settings` and edited under Admin → Clinical Assistant / +Learning, except the image roster, which is written by the Image Generation +card. Every one is read through `getSetting`, so an unset key falls back to the +default in the right-hand column. + | Setting | Purpose | |---|---| -| `clinical_assistant.chat_model` | Chat model used for answers | -| `clinical_assistant.image_model` | Image model used for explicit image generation | +| `clinical_assistant.chat_model` | Chat model for answers; falls back to `models.default` | +| `clinical_assistant.image_model` | Image model for explicit image generation; falls back to `CLINICAL_ASSISTANT_IMAGE_MODEL`, then `openai-gpt-image-1` | +| `clinical_assistant.fallback_image_model` | Single retry target when the image model fails | +| `clinical_assistant.allowed_models` | Comma-separated chat models a user may pick. Empty means no choice: the configured model is used. A non-empty list always includes the configured model; anything else is rejected with 400 `model_not_allowed` | +| `clinical_assistant.allowed_image_models` | The same, for image models | +| `clinical_assistant.image_model_roster` | Image models an admin added from Admin → Image Generation (**+ Add**). This is the pool the Image models tick-list offers; it is not itself an allowlist. Validated as up to 100 ids | | `clinical_assistant.search_limit` | Number of MCP results requested | | `clinical_assistant.context_chars` | Context characters requested from MCP | +| `clinical_assistant.conversation_chars` | Input budget in UTF-16 code units. Empty means use `CLINICAL_ASSISTANT_CONVERSATION_CHARS`; a value must be 1000-1000000 | +| `clinical_assistant.show_sources` | `true`/`false`. Display only: hides the Sources panel and the citation markers. The prompt, the retrieval and the stored answer are byte-for-byte identical either way, so it cannot bias an answer; turning it back on restores the citations | +| `clinical_assistant.preview_enabled` | `true`/`false`. Lets signed-out visitors try the assistant read-only; anything needing an account asks them to sign in | | `clinical_assistant.system_behavior` | Admin-editable assistant behavior guidance | -| `clinical_assistant.translate_provider` | Default translation provider: `libretranslate` or `deepl` | +| `clinical_assistant.image_behavior` | Guidance for the `generate_image` tool | +| `clinical_assistant.patient_takehome_behavior` | Guidance for patient take-home text | +| `clinical_assistant.prompt_model` | Model that generates the starter prompt pool | +| `clinical_assistant.translate_provider` | Translation provider. `libretranslate` is the only value the server accepts | +| `clinical_assistant.citations_enabled` | Legacy key, read only as a fallback for `show_sources` | + +## Choosing a model + +The composer shows a **Model** button rather than the model id, which can be as +long as `openrouter-gemini-3.1-flash-image-preview`; clicking it opens the list. +The button is a face for `#assistant-chat-model-select`, which stays in the DOM +as the state holder — so a choice made in the popup is saved by the same +delegated `change` listener as before, under an account-scoped storage key. The +whole control is hidden unless the allowlist offers more than one model. + +For an image model to reach a user, an admin does two things: **+ Add** it under +Admin → Image Generation (which puts it in `image_model_roster`), then tick it +in the Clinical Assistant's Image models list (which puts it in +`allowed_image_models`). Discovery lists what the gateway advertises with mode +`image_generation`; it never adds anything on its own. ## Testing Priorities diff --git a/public/components/settings.html b/public/components/settings.html index 70713147..b466cda9 100644 --- a/public/components/settings.html +++ b/public/components/settings.html @@ -151,7 +151,7 @@
Save reusable templates for physical exam, ROS, encounter format, etc. Only template categories are sent to AI when generating notes. You can reference them by saying "use my normal physical exam" in dictation.
+Save reusable templates for physical exam, ROS, encounter format, etc. Only template categories are sent to AI when generating notes — anything saved as Custom is never sent. Templates go out with Encounter HPI, Dictation HPI, SOAP, Sick Visit, Well Visit, ED Encounter and Hospital Course, and shape how a note is laid out and worded. The AI is told never to copy clinical content out of a template, so a template cannot supply findings you did not dictate: say them instead, for example “normal cardiac exam”, and they are documented.