The interface speaks Slovak
969 strings, an instance default and a per-person choice, and no half-done corner: the admin prose is translated too. Design and reasoning: LLeMbas.wiki/Translations. KEYED BY THE ENGLISH SENTENCE A missing entry renders the key, which is the English -- so an untranslated string looks as it always did, an English instance is byte-for-byte 1.6.0, and a half-finished catalogue is a half-translated page rather than a page of dotted key names. The cost is that editing an English sentence orphans its translation silently, which is what tests/test_translations.py asserts in both directions. No gettext: .po -> .mo is a build step and this project does not have one. A JINJA GLOBAL, AND THEREFORE A CONTEXTVAR `t()` is a global for the reason `brand` already documents -- render() is bypassed by 25 TemplateResponse calls and 8 get_template().render() calls, the latter being the SSE frames, which have no Request at all. A global is bound once at import and the language is per person, so the active language is a ContextVar set per request. 🚨 `get_current_user` had to become `async def`. FastAPI runs a sync dependency in a threadpool, and anyio copies the context in and discards it on the way out -- so the language was set where nothing could see it and every page rendered in the instance's language whatever anybody had chosen, with no error anywhere. NOT TRANSLATED, ON PURPOSE Everything a model reads: the 60 prompt fragments, and the dates in harness.py, schedule/runner.py and schedule/compile.py. Only `i18n.stamp` is localised, and only where a person reads it -- with the *format* translatable as well as the words, because "26. septembra 2026" is a different pattern rather than the same one with different words in it. A process locale is not an option: global, not thread-safe, two people's pages at once. A second fragment telling models to answer in the reader's language was written during this work and removed: `core.style` has said it since long before, and test_an_empty_override_turns_a_fragment_off caught the duplicate. THE BULK PASS 1213 sites wrapped by a one-off script that only touched patterns it could not misread. It got three wrong in a way that mattered -- `t('…')` inside `attr="…"` where the sentence held an apostrophe, closing the Jinja string and 500ing two pages whose partials no test renders. tests/test_translations.py now compiles all 110 templates. It also wrapped the product's own name, an SSH key header, a keystroke hint and an example URL, all taken back out: a string is not translatable just because it is a string. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -10,7 +10,7 @@
|
||||
<span class="attach-chip__name">{{ filename }}</span>
|
||||
<span class="attach-chip__warning">{{ error }}</span>
|
||||
</span>
|
||||
<button class="btn btn--icon btn--sm" type="button" aria-label="Dismiss"
|
||||
<button class="btn btn--icon btn--sm" type="button" aria-label="{{ t('Dismiss') }}"
|
||||
onclick="this.closest('.attach-chip').remove()">
|
||||
{{ icon("x", "icon--sm") }}
|
||||
</button>
|
||||
|
||||
@@ -14,6 +14,6 @@
|
||||
<span class="attach-chip__icon">{{ icon("archive", "icon--sm") }}</span>
|
||||
<span class="attach-chip__body">
|
||||
<span class="attach-chip__name" title="{{ base.name }}">{{ base.name }}</span>
|
||||
<span class="attach-chip__meta">This chat now searches only the bases it is attached to</span>
|
||||
<span class="attach-chip__meta">{{ t("This chat now searches only the bases it is attached to") }}</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
path allowed to emit HTML), or into a <textarea>, whose contents Jinja escapes
|
||||
and which cannot contain markup by construction.
|
||||
#}
|
||||
<aside class="canvas" id="canvas" hidden aria-label="Canvas"
|
||||
<aside class="canvas" id="canvas" hidden aria-label="{{ t('Canvas') }}"
|
||||
data-canvas
|
||||
data-chat="{{ chat.id if chat else "" }}"
|
||||
data-resize-target>
|
||||
@@ -23,7 +23,7 @@
|
||||
mouse and the grip is a focus trap that does nothing. #}
|
||||
<div class="panel-resize" data-resize="--canvas-width" data-resize-min="384"
|
||||
role="separator" aria-orientation="vertical" tabindex="0"
|
||||
aria-label="Resize the canvas">
|
||||
aria-label="{{ t('Resize the canvas') }}">
|
||||
{{ icon("grip", "icon--sm") }}
|
||||
</div>
|
||||
|
||||
@@ -44,15 +44,15 @@
|
||||
<div class="panel-head">
|
||||
<h2 class="panel-head__title">
|
||||
{{ icon("file-text", "icon--sm") }}
|
||||
<span>Canvas</span>
|
||||
<span>{{ t("Canvas") }}</span>
|
||||
</h2>
|
||||
<button class="btn btn--icon btn--sm" type="button" data-toggle="#canvas"
|
||||
aria-label="Close canvas">
|
||||
aria-label="{{ t('Close canvas') }}">
|
||||
{{ icon("x", "icon--sm") }}
|
||||
</button>
|
||||
</div>
|
||||
<div class="canvas__body">
|
||||
<p class="canvas__empty">Opening…</p>
|
||||
<p class="canvas__empty">{{ t("Opening…") }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
</div>
|
||||
|
||||
<details class="canvas__theirs">
|
||||
<summary>What is there now</summary>
|
||||
<summary>{{ t("What is there now") }}</summary>
|
||||
<pre class="canvas__code"><code>{{ conflict.text }}</code></pre>
|
||||
</details>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
regardless, which is exactly what Overwrite means -- somebody has now
|
||||
been shown both versions and chosen. #}
|
||||
<input type="hidden" name="revision" value="">
|
||||
<label class="visually-hidden" for="canvas-mine">Your version</label>
|
||||
<label class="visually-hidden" for="canvas-mine">{{ t("Your version") }}</label>
|
||||
<textarea class="canvas__editor" id="canvas-mine" name="text"
|
||||
spellcheck="false" data-canvas-editor>{{ mine }}</textarea>
|
||||
<div class="canvas__actions">
|
||||
@@ -44,9 +44,7 @@
|
||||
<button class="btn btn--sm" type="button"
|
||||
hx-post="/api/chats/{{ chat.id }}/canvas/tabs"
|
||||
hx-vals='{"key": {{ conflict.key | tojson }}}'
|
||||
hx-target="#canvas-inner" hx-swap="innerHTML">
|
||||
Discard mine and reload
|
||||
</button>
|
||||
hx-target="#canvas-inner" hx-swap="innerHTML">{{ t("Discard mine and reload") }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
{% if rendered %}
|
||||
{{ rendered | safe }}
|
||||
{% else %}
|
||||
<p class="canvas__empty">This file is empty.</p>
|
||||
<p class="canvas__empty">{{ t("This file is empty.") }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -66,8 +66,8 @@
|
||||
<button class="btn btn--primary btn--sm" type="submit">
|
||||
{{ icon("check", "icon--sm") }} Save
|
||||
</button>
|
||||
<button class="btn btn--sm" type="button" @click="editing = false">Cancel</button>
|
||||
<span class="canvas__hint">No colour while you type. Tab inserts a tab.</span>
|
||||
<button class="btn btn--sm" type="button" @click="editing = false">{{ t("Cancel") }}</button>
|
||||
<span class="canvas__hint">{{ t("No colour while you type. Tab inserts a tab.") }}</span>
|
||||
</div>
|
||||
</form>
|
||||
{% endif %}
|
||||
|
||||
@@ -23,13 +23,13 @@
|
||||
hx-post="/api/files/from-scratch"
|
||||
hx-vals='{"chat_id": "{{ chat.id }}"}'
|
||||
hx-target="#attachments" hx-swap="beforeend"
|
||||
title="Put this in the message box as an attachment">
|
||||
title="{{ t('Put this in the message box as an attachment') }}">
|
||||
{{ icon("attach", "icon--sm") }} Attach
|
||||
</button>
|
||||
{% endif %}
|
||||
|
||||
<button class="btn btn--icon btn--sm" type="button" data-toggle="#canvas"
|
||||
aria-label="Close canvas">
|
||||
aria-label="{{ t('Close canvas') }}">
|
||||
{{ icon("x", "icon--sm") }}
|
||||
</button>
|
||||
</div>
|
||||
@@ -66,7 +66,7 @@
|
||||
hx-post="/api/chats/{{ chat.id }}/canvas/tabs"
|
||||
hx-vals='{"key": "scratch:{{ chat.id }}"}'
|
||||
hx-target="#canvas-inner" hx-swap="innerHTML"
|
||||
title="This chat's own working document">
|
||||
title="{{ t('This chat\'s own working document') }}">
|
||||
{{ icon("file-text", "icon--sm") }} Scratch
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -106,7 +106,7 @@
|
||||
<textarea class="composer__input" name="content" rows="1"
|
||||
data-autosize data-max-height="320" data-composer-input
|
||||
placeholder="{% if chat %}Send a message…{% else %}Ask anything…{% endif %}"
|
||||
aria-label="Message" {{ 'autofocus' if not chat }}></textarea>
|
||||
aria-label="{{ t('Message') }}" {{ 'autofocus' if not chat }}></textarea>
|
||||
</div>
|
||||
|
||||
<div class="composer__toolbar">
|
||||
@@ -118,34 +118,34 @@
|
||||
<div class="picker picker--up" data-picker>
|
||||
<button class="btn btn--icon composer__btn" type="button" data-picker-toggle
|
||||
aria-haspopup="menu" aria-expanded="false"
|
||||
aria-label="Attach" title="Attach">
|
||||
aria-label="{{ t('Attach') }}" title="{{ t('Attach') }}">
|
||||
{{ icon("attach") }}
|
||||
</button>
|
||||
|
||||
<div class="picker__menu picker__menu--compact" data-picker-menu role="menu"
|
||||
hidden aria-label="Attach">
|
||||
hidden aria-label="{{ t('Attach') }}">
|
||||
<button class="picker__option" type="button" role="menuitem"
|
||||
data-attach="file">
|
||||
{{ icon("attach", "icon--sm") }}
|
||||
<span class="picker__option-body">
|
||||
<span class="picker__option-name">File</span>
|
||||
<span class="picker__option-note">PDF, text, code</span>
|
||||
<span class="picker__option-name">{{ t("File") }}</span>
|
||||
<span class="picker__option-note">{{ t("PDF, text, code") }}</span>
|
||||
</span>
|
||||
</button>
|
||||
<button class="picker__option" type="button" role="menuitem"
|
||||
data-attach="image">
|
||||
{{ icon("image", "icon--sm") }}
|
||||
<span class="picker__option-body">
|
||||
<span class="picker__option-name">Image</span>
|
||||
<span class="picker__option-note">Sent only to vision models</span>
|
||||
<span class="picker__option-name">{{ t("Image") }}</span>
|
||||
<span class="picker__option-note">{{ t("Sent only to vision models") }}</span>
|
||||
</span>
|
||||
</button>
|
||||
<button class="picker__option" type="button" role="menuitem"
|
||||
data-attach="link">
|
||||
{{ icon("link", "icon--sm") }}
|
||||
<span class="picker__option-body">
|
||||
<span class="picker__option-name">Link</span>
|
||||
<span class="picker__option-note">Fetch a page and attach its text</span>
|
||||
<span class="picker__option-name">{{ t("Link") }}</span>
|
||||
<span class="picker__option-note">{{ t("Fetch a page and attach its text") }}</span>
|
||||
</span>
|
||||
</button>
|
||||
{% if can.get("library.use") %}
|
||||
@@ -153,8 +153,8 @@
|
||||
data-attach="knowledge">
|
||||
{{ icon("archive", "icon--sm") }}
|
||||
<span class="picker__option-body">
|
||||
<span class="picker__option-name">Knowledge</span>
|
||||
<span class="picker__option-note">From your library</span>
|
||||
<span class="picker__option-name">{{ t("Knowledge") }}</span>
|
||||
<span class="picker__option-note">{{ t("From your library") }}</span>
|
||||
</span>
|
||||
</button>
|
||||
{% endif %}
|
||||
@@ -209,20 +209,18 @@
|
||||
<div class="picker picker--up" data-picker>
|
||||
<button class="btn btn--icon composer__btn" type="button" data-picker-toggle
|
||||
aria-haspopup="menu" aria-expanded="false"
|
||||
aria-label="Toggle" title="Toggle">
|
||||
aria-label="{{ t('Toggle') }}" title="{{ t('Toggle') }}">
|
||||
{{ icon("sliders") }}
|
||||
</button>
|
||||
|
||||
<div class="picker__menu picker__menu--scope" data-picker-menu role="menu"
|
||||
hidden aria-label="Toggle">
|
||||
hidden aria-label="{{ t('Toggle') }}">
|
||||
{% if has_scope %}
|
||||
<p class="picker__lede">
|
||||
Switched off here only. Everything is on unless you say otherwise.
|
||||
</p>
|
||||
<p class="picker__lede">{{ t("Switched off here only. Everything is on unless you say otherwise.") }}</p>
|
||||
{% endif %}
|
||||
|
||||
{% if scope_families %}
|
||||
<p class="picker__group">Tools</p>
|
||||
<p class="picker__group">{{ t("Tools") }}</p>
|
||||
{% for family in scope_families %}
|
||||
<label class="picker__option picker__option--toggle">
|
||||
{% if scope_prospective %}
|
||||
@@ -243,7 +241,7 @@
|
||||
{% endif %}
|
||||
|
||||
{% if scope_skills %}
|
||||
<p class="picker__group">Skills</p>
|
||||
<p class="picker__group">{{ t("Skills") }}</p>
|
||||
{% for skill in scope_skills %}
|
||||
<label class="picker__option picker__option--toggle">
|
||||
{% if scope_prospective %}
|
||||
@@ -277,7 +275,7 @@
|
||||
empty body. #}
|
||||
{% if scope_allow %}
|
||||
<div class="picker__allow">
|
||||
<p class="picker__group">Always allowed here</p>
|
||||
<p class="picker__group">{{ t("Always allowed here") }}</p>
|
||||
{% for entry in scope_allow %}
|
||||
<p class="picker__allow-entry">{{ entry }}</p>
|
||||
{% endfor %}
|
||||
@@ -286,7 +284,7 @@
|
||||
hx-target="closest .picker__allow" hx-swap="outerHTML">
|
||||
{{ icon("trash", "icon--sm") }}
|
||||
<span class="picker__option-body">
|
||||
<span class="picker__option-name">Ask me about these again</span>
|
||||
<span class="picker__option-name">{{ t("Ask me about these again") }}</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
@@ -316,7 +314,7 @@
|
||||
<input type="hidden" name="kind" value="{{ starting_kind | default('chat') }}"
|
||||
id="chat-kind">
|
||||
|
||||
<div class="segmented" role="group" aria-label="Kind of chat">
|
||||
<div class="segmented" role="group" aria-label="{{ t('Kind of chat') }}">
|
||||
<label class="segmented__option">
|
||||
<input type="radio" name="kind_choice" value="chat"
|
||||
{{ '' if starting_kind == 'agent' else 'checked' }}>
|
||||
@@ -331,7 +329,7 @@
|
||||
|
||||
<span class="composer__agent" data-agent-extra hidden>
|
||||
<select class="select select--sm composer__connection"
|
||||
name="ssh_profile_id" aria-label="Connection">
|
||||
name="ssh_profile_id" aria-label="{{ t('Connection') }}">
|
||||
{% for profile in agent_profiles %}
|
||||
<option value="{{ profile.id }}" data-dir="{{ profile.default_dir }}"
|
||||
{{ 'disabled' if not profile.verified }}>
|
||||
@@ -346,14 +344,14 @@
|
||||
is also something you would rather find than spell. #}
|
||||
<input type="hidden" name="project_dir" value="" data-dir-value>
|
||||
<button class="btn btn--sm composer__dir" type="button" data-dir-browse
|
||||
aria-label="Project directory"
|
||||
title="Choose the directory this chat works in">
|
||||
aria-label="{{ t('Project directory') }}"
|
||||
title="{{ t('Choose the directory this chat works in') }}">
|
||||
{{ icon("folder", "icon--sm") }}
|
||||
<span class="composer__dir-path" data-dir-label>/</span>
|
||||
</button>
|
||||
|
||||
{% if agent_modes %}
|
||||
<select class="select select--sm" name="agent_mode" aria-label="Approval mode">
|
||||
<select class="select select--sm" name="agent_mode" aria-label="{{ t('Approval mode') }}">
|
||||
{% for value, label, hint in agent_modes %}
|
||||
<option value="{{ value }}" title="{{ hint }}">{{ label }}</option>
|
||||
{% endfor %}
|
||||
@@ -376,7 +374,7 @@
|
||||
through this element's *ancestors* -- which a sibling form is not.
|
||||
`form=` scopes the values, and only the values. #}
|
||||
<div class="composer__context">
|
||||
<select class="select select--sm" name="agent_mode" aria-label="Approval mode"
|
||||
<select class="select select--sm" name="agent_mode" aria-label="{{ t('Approval mode') }}"
|
||||
form="agent-mode-form"
|
||||
hx-patch="/api/chats/{{ chat.id }}" hx-swap="none">
|
||||
{% for value, label, hint in agent_modes %}
|
||||
@@ -428,7 +426,7 @@
|
||||
#}
|
||||
{% if current_model and current_model.capabilities_json.get("reasoning") %}
|
||||
<select class="select select--sm" name="reasoning_effort" data-effort
|
||||
aria-label="Reasoning effort" title="How hard this model should think"
|
||||
aria-label="{{ t('Reasoning effort') }}" title="{{ t('How hard this model should think') }}"
|
||||
{% if chat %}
|
||||
form="chat-params-form"
|
||||
hx-patch="/api/chats/{{ chat.id }}" hx-swap="none"
|
||||
@@ -449,7 +447,7 @@
|
||||
#}
|
||||
{% set chosen = resolved_effort if chat
|
||||
else (current_model.params_json or {}).get('reasoning_effort') %}
|
||||
<option value="off" {{ 'selected' if chosen not in efforts }}>Effort: off</option>
|
||||
<option value="off" {{ 'selected' if chosen not in efforts }}>{{ t("Effort: off") }}</option>
|
||||
{% for value in efforts %}
|
||||
<option value="{{ value }}" {{ 'selected' if chosen == value }}>
|
||||
Effort: {{ value }}
|
||||
@@ -464,7 +462,7 @@
|
||||
data-mic-state and the icon with it. #}
|
||||
<button class="btn btn--icon composer__btn composer__mic" type="button"
|
||||
data-mic data-mic-state="idle"
|
||||
aria-label="Dictate a message" title="Dictate a message">
|
||||
aria-label="{{ t('Dictate a message') }}" title="{{ t('Dictate a message') }}">
|
||||
<span class="composer__icon composer__icon--mic">{{ icon("mic") }}</span>
|
||||
<span class="composer__icon composer__icon--recording" aria-hidden="true">
|
||||
{{ icon("stop-circle") }}
|
||||
@@ -483,7 +481,7 @@
|
||||
layout and cannot flash an empty button.
|
||||
#}
|
||||
<button class="btn btn--primary btn--icon composer__btn" type="submit"
|
||||
data-composer-action="send" aria-label="Send">
|
||||
data-composer-action="send" aria-label="{{ t('Send') }}">
|
||||
<span class="composer__icon composer__icon--send">{{ icon("send") }}</span>
|
||||
<span class="composer__icon composer__icon--stop" aria-hidden="true">
|
||||
<span class="composer__stop-square"></span>
|
||||
@@ -514,9 +512,7 @@
|
||||
<p class="composer__hint">
|
||||
Enter to send, Shift+Enter for a new line.
|
||||
<button class="composer__hint-link" type="button"
|
||||
onclick="window.lembasCommands && window.lembasCommands.help()">
|
||||
/ for commands
|
||||
</button>,
|
||||
onclick="window.lembasCommands && window.lembasCommands.help()">{{ t("/ for commands") }}</button>,
|
||||
@ for files.
|
||||
{% if can.get("files.upload") %}
|
||||
Drag files in, or paste an image.
|
||||
@@ -531,7 +527,7 @@
|
||||
{% if can.get("files.upload") %}
|
||||
<div class="dropzone-overlay" aria-hidden="true">
|
||||
{{ icon("attach", "icon--lg") }}
|
||||
<span>Drop to attach</span>
|
||||
<span>{{ t("Drop to attach") }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -14,17 +14,17 @@
|
||||
<div class="msg__main">
|
||||
<header class="msg__meta">
|
||||
<span class="msg__author">{{ user.name or "You" }}</span>
|
||||
<span class="msg__model">editing</span>
|
||||
<span class="msg__model">{{ t("editing") }}</span>
|
||||
</header>
|
||||
|
||||
<form class="edit-form"
|
||||
hx-post="/api/chats/{{ chat.id }}/messages/{{ message.id }}/edit"
|
||||
hx-target="#thread" hx-swap="innerHTML"
|
||||
hx-confirm="Rewind here? The {{ following }} message{{ '' if following == 1 else 's' }} after this one will be deleted."
|
||||
data-confirm-title="Rewind the conversation"
|
||||
data-confirm-label="Rewind and send">
|
||||
data-confirm-title="{{ t('Rewind the conversation') }}"
|
||||
data-confirm-label="{{ t('Rewind and send') }}">
|
||||
<textarea class="textarea" name="content" rows="3" data-autosize
|
||||
data-max-height="320" aria-label="Edit message"
|
||||
data-max-height="320" aria-label="{{ t('Edit message') }}"
|
||||
autofocus>{{ message.content }}</textarea>
|
||||
|
||||
<div class="btn-row">
|
||||
@@ -34,9 +34,7 @@
|
||||
</button>
|
||||
<button class="btn" type="button"
|
||||
hx-get="/api/chats/{{ chat.id }}/messages/{{ message.id }}/cancel-edit"
|
||||
hx-target="#msg-{{ message.id }}" hx-swap="outerHTML">
|
||||
Cancel
|
||||
</button>
|
||||
hx-target="#msg-{{ message.id }}" hx-swap="outerHTML">{{ t("Cancel") }}</button>
|
||||
{% if following %}
|
||||
<span class="text-xs faint">
|
||||
{{ following }} later message{{ '' if following == 1 else 's' }} will be discarded.
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
never intersects the viewport, so the request fires the first time it is
|
||||
opened and never on a page load nobody looked at.
|
||||
#}
|
||||
<aside class="inspector" id="inspector" hidden aria-label="Request inspector">
|
||||
<aside class="inspector" id="inspector" hidden aria-label="{{ t('Request inspector') }}">
|
||||
<div class="panel-head">
|
||||
<h2 class="panel-head__title">{{ icon("search", "icon--sm") }} Inspector</h2>
|
||||
<button class="btn btn--icon btn--sm" type="button" data-toggle="#inspector"
|
||||
aria-label="Close inspector">
|
||||
aria-label="{{ t('Close inspector') }}">
|
||||
{{ icon("x", "icon--sm") }}
|
||||
</button>
|
||||
</div>
|
||||
@@ -19,6 +19,6 @@
|
||||
<div class="inspector__body" id="inspector-body"
|
||||
hx-get="/api/chats/{{ chat.id }}/inspect"
|
||||
hx-trigger="intersect once" hx-target="this" hx-swap="innerHTML">
|
||||
<p class="inspector__note">Opening…</p>
|
||||
<p class="inspector__note">{{ t("Opening…") }}</p>
|
||||
</div>
|
||||
</aside>
|
||||
|
||||
@@ -4,11 +4,7 @@
|
||||
JSON is full of model output, search results and uploaded documents -- hard
|
||||
rule 6 applies here exactly as it does to a chat bubble.
|
||||
#}
|
||||
<p class="inspector__note">
|
||||
Rebuilt now against the current configuration. This is not a recording of the
|
||||
request that produced the last reply — if a prompt or a setting has changed
|
||||
since, this shows what would be sent today.
|
||||
</p>
|
||||
<p class="inspector__note">{{ t("Rebuilt now against the current configuration. This is not a recording of the request that produced the last reply — if a prompt or a setting has changed since, this shows what would be sent today.") }}</p>
|
||||
|
||||
<div class="btn-row">
|
||||
<button class="btn btn--sm" type="button"
|
||||
@@ -18,7 +14,7 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<h3 class="inspector__heading">This chat</h3>
|
||||
<h3 class="inspector__heading">{{ t("This chat") }}</h3>
|
||||
<dl class="inspector__facts">
|
||||
<dt>Model</dt><dd>{{ chat.model_id or "—" }}</dd>
|
||||
<dt>Context</dt>
|
||||
@@ -34,7 +30,7 @@
|
||||
{% if chat.temporary %}<dt>Lifetime</dt><dd>temporary</dd>{% endif %}
|
||||
</dl>
|
||||
|
||||
<h3 class="inspector__heading">Last reply</h3>
|
||||
<h3 class="inspector__heading">{{ t("Last reply") }}</h3>
|
||||
{% if row %}
|
||||
<dl class="inspector__facts">
|
||||
<dt>Tokens</dt>
|
||||
@@ -42,7 +38,7 @@
|
||||
{% if metrics.has_anything %}
|
||||
{% if metrics.estimated %}~{% endif %}{{ metrics.prompt_tokens }} in,
|
||||
{% if metrics.estimated %}~{% endif %}{{ metrics.completion_tokens }} out
|
||||
{% if metrics.estimated %}<span class="badge">estimated</span>{% endif %}
|
||||
{% if metrics.estimated %}<span class="badge">{{ t("estimated") }}</span>{% endif %}
|
||||
{% else %}
|
||||
not reported
|
||||
{% endif %}
|
||||
@@ -53,24 +49,24 @@
|
||||
<dt>Rounds</dt><dd>{{ metrics.rounds }}</dd>
|
||||
<dt>State</dt>
|
||||
<dd>
|
||||
{% if row.error %}<span class="badge badge--danger">error</span>
|
||||
{% elif row.stopped %}<span class="badge badge--warning">stopped</span>
|
||||
{% elif not row.complete %}<span class="badge">writing</span>
|
||||
{% else %}<span class="badge badge--success">complete</span>{% endif %}
|
||||
{% if row.error %}<span class="badge badge--danger">{{ t("error") }}</span>
|
||||
{% elif row.stopped %}<span class="badge badge--warning">{{ t("stopped") }}</span>
|
||||
{% elif not row.complete %}<span class="badge">{{ t("writing") }}</span>
|
||||
{% else %}<span class="badge badge--success">{{ t("complete") }}</span>{% endif %}
|
||||
</dd>
|
||||
</dl>
|
||||
{% if row.error %}
|
||||
<p class="inspector__note">{{ row.error }}</p>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<p class="inspector__note">Nothing has been answered in this chat yet.</p>
|
||||
<p class="inspector__note">{{ t("Nothing has been answered in this chat yet.") }}</p>
|
||||
{% endif %}
|
||||
|
||||
<h3 class="inspector__heading">System message</h3>
|
||||
<h3 class="inspector__heading">{{ t("System message") }}</h3>
|
||||
{% if system %}
|
||||
<pre class="inspector__json">{{ system }}</pre>
|
||||
{% else %}
|
||||
<p class="inspector__note">None is being sent.</p>
|
||||
<p class="inspector__note">{{ t("None is being sent.") }}</p>
|
||||
{% endif %}
|
||||
|
||||
<h3 class="inspector__heading">
|
||||
@@ -80,11 +76,8 @@
|
||||
{% if tool_names %}
|
||||
<p class="inspector__note mono">{{ tool_names | join(", ") }}</p>
|
||||
{% else %}
|
||||
<p class="inspector__note">
|
||||
None. A model has to be marked as supporting tools, the user needs the
|
||||
permission, and the tool itself has to be turned on.
|
||||
</p>
|
||||
<p class="inspector__note">{{ t("None. A model has to be marked as supporting tools, the user needs the permission, and the tool itself has to be turned on.") }}</p>
|
||||
{% endif %}
|
||||
|
||||
<h3 class="inspector__heading">Request body</h3>
|
||||
<h3 class="inspector__heading">{{ t("Request body") }}</h3>
|
||||
<pre class="inspector__json">{{ request_json }}</pre>
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<div class="interaction interaction--{{ ask.kind }}">
|
||||
<p class="interaction__from">
|
||||
{{ icon("sparkle", "icon--sm") }}
|
||||
<span>The model is asking you</span>
|
||||
<span>{{ t("The model is asking you") }}</span>
|
||||
</p>
|
||||
|
||||
<form class="interaction__form"
|
||||
@@ -70,13 +70,13 @@
|
||||
<input type="{{ 'checkbox' if item.multiple else 'radio' }}"
|
||||
name="choice.{{ item.key }}" value="{{ other_value }}">
|
||||
<span class="interaction__option-body">
|
||||
<span class="interaction__option-name">Something else</span>
|
||||
<span class="interaction__option-name">{{ t("Something else") }}</span>
|
||||
{# Never type="password". A model talked into asking for a
|
||||
credential must not be handed a field that looks built for one,
|
||||
and a chat transcript is not a place to keep secrets. #}
|
||||
<input class="input interaction__other-input" type="text"
|
||||
name="text.{{ item.key }}" autocomplete="off"
|
||||
placeholder="Your own answer…">
|
||||
placeholder="{{ t('Your own answer…') }}">
|
||||
</span>
|
||||
</label>
|
||||
{% endif %}
|
||||
@@ -130,17 +130,12 @@
|
||||
</button>
|
||||
</div>
|
||||
<div x-show="editing" x-cloak>
|
||||
<label class="visually-hidden" for="edit-{{ item.key }}">
|
||||
Change this before it runs
|
||||
</label>
|
||||
<label class="visually-hidden" for="edit-{{ item.key }}">{{ t("Change this before it runs") }}</label>
|
||||
<textarea class="textarea interaction__edit" id="edit-{{ item.key }}"
|
||||
name="text.{{ item.key }}" rows="3" spellcheck="false"
|
||||
x-ref="edit{{ item.key }}"
|
||||
:disabled="!editing">{{ item.detail }}</textarea>
|
||||
<p class="interaction__reason">
|
||||
Allow runs what is in the box. It is not checked against this
|
||||
chat's rules again — you typed it.
|
||||
</p>
|
||||
<p class="interaction__reason">{{ t("Allow runs what is in the box. It is not checked against this chat's rules again — you typed it.") }}</p>
|
||||
</div>
|
||||
{% else %}
|
||||
<pre class="interaction__detail">{{ item.detail }}</pre>
|
||||
@@ -172,9 +167,7 @@
|
||||
<button class="btn btn--primary" type="submit" name="verdict" value="allow">
|
||||
{{ icon("check", "icon--sm") }} Allow
|
||||
</button>
|
||||
<button class="btn" type="submit" name="verdict" value="allow_always">
|
||||
Always allow this
|
||||
</button>
|
||||
<button class="btn" type="submit" name="verdict" value="allow_always">{{ t("Always allow this") }}</button>
|
||||
<button class="btn btn--danger" type="submit" name="verdict" value="deny"
|
||||
x-show="!explaining">
|
||||
{{ icon("x", "icon--sm") }} Don't
|
||||
@@ -185,9 +178,7 @@
|
||||
</button>
|
||||
|
||||
<div class="interaction__deny" x-show="explaining" x-cloak>
|
||||
<label class="visually-hidden" for="deny-reason">
|
||||
Why not, and what to do instead
|
||||
</label>
|
||||
<label class="visually-hidden" for="deny-reason">{{ t("Why not, and what to do instead") }}</label>
|
||||
{# Never type="password", for the reason the "Something else" box
|
||||
above states: a chat transcript is not a place to keep secrets. #}
|
||||
{# `--deny-input` and not `--reason`: `.interaction__reason` already
|
||||
@@ -195,14 +186,12 @@
|
||||
<textarea class="textarea interaction__deny-input" id="deny-reason"
|
||||
name="reason" rows="2" spellcheck="false" x-ref="reason"
|
||||
:disabled="!explaining"
|
||||
placeholder="Why not, and what to do instead…"></textarea>
|
||||
placeholder="{{ t('Why not, and what to do instead…') }}"></textarea>
|
||||
<div class="interaction__deny-actions">
|
||||
<button class="btn btn--danger" type="submit" name="verdict" value="deny">
|
||||
{{ icon("x", "icon--sm") }} Don't, and tell it why
|
||||
</button>
|
||||
<button class="btn btn--sm" type="button" @click="explaining = false">
|
||||
Cancel
|
||||
</button>
|
||||
<button class="btn btn--sm" type="button" @click="explaining = false">{{ t("Cancel") }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
seconds. Rendering it inside the poll would fetch output nobody has
|
||||
opened, on a loop. #}
|
||||
<div class="picker__menu picker__menu--jobs" data-picker-menu role="menu"
|
||||
hidden aria-label="Background jobs" id="jobs-panel"></div>
|
||||
hidden aria-label="{{ t('Background jobs') }}" id="jobs-panel"></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
@@ -15,9 +15,9 @@
|
||||
most of them.
|
||||
#}
|
||||
{% if not jobs %}
|
||||
<p class="picker__lede">Nothing is running.</p>
|
||||
<p class="picker__lede">{{ t("Nothing is running.") }}</p>
|
||||
{% else %}
|
||||
<p class="picker__group">Background jobs</p>
|
||||
<p class="picker__group">{{ t("Background jobs") }}</p>
|
||||
|
||||
{% for job in jobs %}
|
||||
<div class="jobs__row{{ ' jobs__row--open' if open_job == job.id }}">
|
||||
@@ -42,9 +42,7 @@
|
||||
<button class="btn btn--sm btn--danger jobs__stop" type="button"
|
||||
hx-post="/api/chats/{{ chat.id }}/jobs/{{ job.id }}/stop"
|
||||
hx-target="#jobs-panel" hx-swap="innerHTML"
|
||||
data-confirm-button="Stop this job? It and everything it started are killed.">
|
||||
Stop
|
||||
</button>
|
||||
data-confirm-button="{{ t('Stop this job? It and everything it started are killed.') }}">{{ t("Stop") }}</button>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
|
||||
@@ -23,14 +23,14 @@
|
||||
{% else %}
|
||||
|
||||
{% if website %}
|
||||
<p class="picker__group">A page to read</p>
|
||||
<p class="picker__group">{{ t("A page to read") }}</p>
|
||||
<ul class="picker__list">
|
||||
<li>
|
||||
<button class="picker__option" type="button"
|
||||
data-mention-url="{{ website }}" data-mention-token="{{ website }}">
|
||||
{{ icon("link", "icon--sm") }}
|
||||
<span class="picker__option-body">
|
||||
<span class="picker__option-name">Fetch this page</span>
|
||||
<span class="picker__option-name">{{ t("Fetch this page") }}</span>
|
||||
<span class="picker__option-note mono">{{ website }}</span>
|
||||
</span>
|
||||
</button>
|
||||
@@ -39,7 +39,7 @@
|
||||
{% endif %}
|
||||
|
||||
{% if files %}
|
||||
<p class="picker__group">In the project</p>
|
||||
<p class="picker__group">{{ t("In the project") }}</p>
|
||||
<ul class="picker__list">
|
||||
{% for file in files %}
|
||||
<li>
|
||||
@@ -57,7 +57,7 @@
|
||||
{% endif %}
|
||||
|
||||
{% if documents %}
|
||||
<p class="picker__group">In your library</p>
|
||||
<p class="picker__group">{{ t("In your library") }}</p>
|
||||
<ul class="picker__list">
|
||||
{% for document in documents %}
|
||||
<li>
|
||||
@@ -79,7 +79,7 @@
|
||||
{% endif %}
|
||||
|
||||
{% if notes %}
|
||||
<p class="picker__group">Notes</p>
|
||||
<p class="picker__group">{{ t("Notes") }}</p>
|
||||
<ul class="picker__list">
|
||||
{% for note in notes %}
|
||||
<li>
|
||||
@@ -99,7 +99,7 @@
|
||||
{% endif %}
|
||||
|
||||
{% if skills %}
|
||||
<p class="picker__group">Skills</p>
|
||||
<p class="picker__group">{{ t("Skills") }}</p>
|
||||
<ul class="picker__list">
|
||||
{% for skill in skills %}
|
||||
<li>
|
||||
@@ -119,7 +119,7 @@
|
||||
{% if bases %}
|
||||
{# A base is a reference and not a copy: choosing one narrows what this chat
|
||||
may search rather than putting anything into the message. #}
|
||||
<p class="picker__group">Search only these</p>
|
||||
<p class="picker__group">{{ t("Search only these") }}</p>
|
||||
<ul class="picker__list">
|
||||
{% for base in bases %}
|
||||
<li>
|
||||
@@ -128,7 +128,7 @@
|
||||
{{ icon("archive", "icon--sm") }}
|
||||
<span class="picker__option-body">
|
||||
<span class="picker__option-name">{{ base.name }}</span>
|
||||
<span class="picker__option-note">Scope this chat to this knowledge base</span>
|
||||
<span class="picker__option-note">{{ t("Scope this chat to this knowledge base") }}</span>
|
||||
</span>
|
||||
</button>
|
||||
</li>
|
||||
@@ -137,7 +137,7 @@
|
||||
{% endif %}
|
||||
|
||||
{% if attachments %}
|
||||
<p class="picker__group">Already in this chat</p>
|
||||
<p class="picker__group">{{ t("Already in this chat") }}</p>
|
||||
<ul class="picker__list">
|
||||
{% for attachment in attachments %}
|
||||
<li>
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
{% if crowd.get("stopped") %}
|
||||
{# Why a round ended, where it ended. Without this a crowd that ran out of
|
||||
rounds or time simply stops, which reads as the feature failing. #}
|
||||
<span class="badge badge--warning" title="The round ended here">
|
||||
<span class="badge badge--warning" title="{{ t('The round ended here') }}">
|
||||
{% if crowd.get("stopped") == "rounds" %}
|
||||
no rounds left
|
||||
{% elif crowd.get("stopped") == "time" %}
|
||||
@@ -176,7 +176,7 @@
|
||||
<summary class="reasoning__summary">
|
||||
{{ icon("sparkle", "icon--sm reasoning__icon") }}
|
||||
<span class="reasoning__label">
|
||||
<span class="reasoning__working">Thinking</span>
|
||||
<span class="reasoning__working">{{ t("Thinking") }}</span>
|
||||
<span class="reasoning__stats" sse-swap="think" hx-swap="innerHTML"></span>
|
||||
</span>
|
||||
{{ icon("chevron-down", "icon--sm reasoning__chevron") }}
|
||||
@@ -237,7 +237,7 @@
|
||||
<div class="alert alert--error msg__error" role="alert">
|
||||
{{ icon("warning", "alert__icon") }}
|
||||
<div>
|
||||
<strong>The reply could not be completed.</strong>
|
||||
<strong>{{ t("The reply could not be completed.") }}</strong>
|
||||
<div class="text-sm" style="margin-top: var(--sp-1)">{{ message.error }}</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -291,22 +291,22 @@
|
||||
holds a job's output, which is the one waiting bubble somebody actually
|
||||
wants to paste somewhere. The hidden source div is already below. #}
|
||||
<button class="btn btn--icon btn--sm" type="button"
|
||||
data-copy="msg-body-{{ message.id }}" aria-label="Copy message">
|
||||
data-copy="msg-body-{{ message.id }}" aria-label="{{ t('Copy message') }}">
|
||||
{{ icon("copy", "icon--sm") }}
|
||||
</button>
|
||||
<button class="btn btn--sm" type="button"
|
||||
hx-post="/api/chats/{{ chat.id }}/messages/{{ message.id }}/send-now"
|
||||
hx-target="#thread" hx-swap="innerHTML">Send now</button>
|
||||
hx-target="#thread" hx-swap="innerHTML">{{ t("Send now") }}</button>
|
||||
<button class="btn btn--sm" type="button"
|
||||
hx-post="/api/chats/{{ chat.id }}/messages/{{ message.id }}/discard"
|
||||
hx-target="#msg-{{ message.id }}" hx-swap="outerHTML"
|
||||
data-confirm-button="Discard this message?">Discard</button>
|
||||
data-confirm-button="{{ t('Discard this message?') }}">{{ t("Discard") }}</button>
|
||||
</footer>
|
||||
<div hidden id="msg-body-{{ message.id }}">{{ message.content }}</div>
|
||||
{% elif not streaming %}
|
||||
<footer class="msg__actions">
|
||||
<button class="btn btn--icon btn--sm" type="button"
|
||||
data-copy="msg-body-{{ message.id }}" aria-label="Copy message">
|
||||
data-copy="msg-body-{{ message.id }}" aria-label="{{ t('Copy message') }}">
|
||||
{{ icon("copy", "icon--sm") }}
|
||||
</button>
|
||||
{# Not on a machine event: editing rewinds the transcript and starts a
|
||||
@@ -318,7 +318,7 @@
|
||||
hx-get="/api/chats/{{ chat.id }}/messages/{{ message.id }}/edit"
|
||||
hx-target="#msg-{{ message.id }}" hx-swap="outerHTML"
|
||||
data-edit-message
|
||||
aria-label="Edit and retry from here">
|
||||
aria-label="{{ t('Edit and retry from here') }}">
|
||||
{{ icon("pencil", "icon--sm") }}
|
||||
</button>
|
||||
{% endif %}
|
||||
@@ -326,7 +326,7 @@
|
||||
<button class="btn btn--icon btn--sm" type="button"
|
||||
hx-post="/api/chats/{{ chat.id }}/messages/{{ message.id }}/regenerate"
|
||||
hx-target="#msg-{{ message.id }}" hx-swap="outerHTML"
|
||||
aria-label="Regenerate reply">
|
||||
aria-label="{{ t('Regenerate reply') }}">
|
||||
{{ icon("refresh", "icon--sm") }}
|
||||
</button>
|
||||
{% if can_listen | default(false) and message.content and not message.error %}
|
||||
@@ -339,7 +339,7 @@
|
||||
<button class="btn btn--icon btn--sm" type="button"
|
||||
data-speak="/api/audio/speech/{{ chat.id }}/{{ message.id }}"
|
||||
{% if audio_autoplay | default(false) and just_finished | default(false) %}data-speak-auto{% endif %}
|
||||
aria-label="Read this reply aloud">
|
||||
aria-label="{{ t('Read this reply aloud') }}">
|
||||
<span class="speak__icon speak__icon--play">{{ icon("speaker", "icon--sm") }}</span>
|
||||
<span class="speak__icon speak__icon--stop">{{ icon("stop-circle", "icon--sm") }}</span>
|
||||
</button>
|
||||
|
||||
@@ -17,17 +17,17 @@
|
||||
{{ model_avatar(current_model, cls="picker__avatar") }}
|
||||
<span class="picker__label">{{ current_model.label }}</span>
|
||||
{% else %}
|
||||
<span class="picker__label">Choose a model</span>
|
||||
<span class="picker__label">{{ t("Choose a model") }}</span>
|
||||
{% endif %}
|
||||
{{ icon("chevron-down", "icon--sm picker__chevron") }}
|
||||
</button>
|
||||
|
||||
<div class="picker__menu" data-picker-menu role="listbox" hidden
|
||||
aria-label="Models">
|
||||
aria-label="{{ t('Models') }}">
|
||||
{% if models|length > 8 %}
|
||||
<div class="picker__search">
|
||||
<input class="input input--sm" type="search" data-picker-filter
|
||||
placeholder="Filter models…" aria-label="Filter models">
|
||||
placeholder="{{ t('Filter models…') }}" aria-label="{{ t('Filter models') }}">
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
</button>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<p class="picker__empty" data-picker-empty hidden>No model matches that.</p>
|
||||
<p class="picker__empty" data-picker-empty hidden>{{ t("No model matches that.") }}</p>
|
||||
</div>
|
||||
|
||||
{% if chat %}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
{% if plan.findings %}
|
||||
<div class="plan__section">
|
||||
<h4 class="plan__heading">What was found</h4>
|
||||
<h4 class="plan__heading">{{ t("What was found") }}</h4>
|
||||
<ul class="plan__findings">
|
||||
{% for finding in plan.findings %}
|
||||
<li>{{ finding.text }}</li>
|
||||
@@ -46,7 +46,7 @@
|
||||
|
||||
{% if plan.objectives %}
|
||||
<div class="plan__section">
|
||||
<h4 class="plan__heading">What it is for</h4>
|
||||
<h4 class="plan__heading">{{ t("What it is for") }}</h4>
|
||||
<ul class="plan__objectives">
|
||||
{% for objective in plan.objectives %}
|
||||
<li class="plan__item plan__item--{{ objective.status }}">{{ objective.text }}</li>
|
||||
@@ -79,11 +79,11 @@
|
||||
hx-post="/api/chats/{{ chat.id }}/messages/{{ message.id }}/execute-plan"
|
||||
hx-target="#thread" hx-swap="beforeend"
|
||||
hx-confirm="Switch this chat to Edit mode and carry out this plan? Every command will still be shown to you before it runs."
|
||||
data-confirm-label="Carry it out"
|
||||
data-confirm-label="{{ t('Carry it out') }}"
|
||||
data-confirm-danger="false">
|
||||
{{ icon("send", "icon--sm") }} Carry out this plan
|
||||
</button>
|
||||
<span class="plan__note">Switches to Edit — commands still ask.</span>
|
||||
<span class="plan__note">{{ t("Switches to Edit — commands still ask.") }}</span>
|
||||
</div>
|
||||
{% endif %}
|
||||
</section>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
the person at the keyboard holds the credential and could open the same shell
|
||||
with an ssh client.
|
||||
#}
|
||||
<aside class="terminal" id="terminal" hidden aria-label="Terminal"
|
||||
<aside class="terminal" id="terminal" hidden aria-label="{{ t('Terminal') }}"
|
||||
data-terminal
|
||||
{# Empty before a chat exists: `draft.js` writes a draft id in as soon as
|
||||
the composer has a connection selected. Explicit rather than relying on
|
||||
@@ -26,7 +26,7 @@
|
||||
#}
|
||||
<div class="panel-resize" data-resize="--terminal-width" data-resize-min="384"
|
||||
role="separator" aria-orientation="vertical" tabindex="0"
|
||||
aria-label="Resize the terminal">
|
||||
aria-label="{{ t('Resize the terminal') }}">
|
||||
{{ icon("grip", "icon--sm") }}
|
||||
</div>
|
||||
|
||||
@@ -44,13 +44,13 @@
|
||||
message is worse than nothing attached at all.
|
||||
#}
|
||||
<button class="btn btn--icon btn--sm" type="button" data-terminal-copy
|
||||
title="Copy the last command and its output"
|
||||
aria-label="Copy the last command and its output">
|
||||
title="{{ t('Copy the last command and its output') }}"
|
||||
aria-label="{{ t('Copy the last command and its output') }}">
|
||||
{{ icon("copy", "icon--sm") }}
|
||||
</button>
|
||||
<button class="btn btn--icon btn--sm" type="button" data-terminal-send
|
||||
title="Put the last command and its output into the message box"
|
||||
aria-label="Send to chat">
|
||||
title="{{ t('Put the last command and its output into the message box') }}"
|
||||
aria-label="{{ t('Send to chat') }}">
|
||||
{{ icon("arrow-up", "icon--sm") }}
|
||||
</button>
|
||||
{#
|
||||
@@ -62,14 +62,14 @@
|
||||
command you run to a model is not something to inherit from last week.
|
||||
#}
|
||||
<select class="select select--sm" data-terminal-auto
|
||||
aria-label="What to do when a command finishes"
|
||||
title="What to do with each command you run">
|
||||
<option value="off" selected>Auto: off</option>
|
||||
<option value="copy">Auto: copy</option>
|
||||
<option value="send">Auto: send</option>
|
||||
aria-label="{{ t('What to do when a command finishes') }}"
|
||||
title="{{ t('What to do with each command you run') }}">
|
||||
<option value="off" selected>{{ t("Auto: off") }}</option>
|
||||
<option value="copy">{{ t("Auto: copy") }}</option>
|
||||
<option value="send">{{ t("Auto: send") }}</option>
|
||||
</select>
|
||||
<button class="btn btn--icon btn--sm" type="button" data-toggle="#terminal"
|
||||
aria-label="Close terminal">
|
||||
aria-label="{{ t('Close terminal') }}">
|
||||
{{ icon("x", "icon--sm") }}
|
||||
</button>
|
||||
</div>
|
||||
@@ -77,7 +77,7 @@
|
||||
<div class="terminal__screen" data-terminal-screen></div>
|
||||
|
||||
<div class="terminal__status">
|
||||
<span class="terminal__message" data-terminal-message>Connecting…</span>
|
||||
<span class="terminal__message" data-terminal-message>{{ t("Connecting…") }}</span>
|
||||
<span class="terminal__last" data-terminal-last></span>
|
||||
<span>Ctrl+Shift+C / V</span>
|
||||
</div>
|
||||
|
||||
@@ -19,10 +19,7 @@
|
||||
<span>{{ compacted | length }} earlier messages, summarised</span>
|
||||
{{ icon("chevron-down", "icon--sm reasoning__chevron") }}
|
||||
</summary>
|
||||
<p class="compacted__note">
|
||||
These are no longer sent to the model; a summary of them goes instead. They
|
||||
are kept here so nothing is lost.
|
||||
</p>
|
||||
<p class="compacted__note">{{ t("These are no longer sent to the model; a summary of them goes instead. They are kept here so nothing is lost.") }}</p>
|
||||
<div class="compacted__body">
|
||||
{% for message in compacted %}
|
||||
{% include "chat/_message.html" %}
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
left to be inferred: attributing somebody's own typing to a model is
|
||||
the same misattribution as the other way round, and a transcript read
|
||||
back a week later has nothing else to go on. #}
|
||||
<span class="badge">edited by you</span>
|
||||
<span class="badge">{{ t("edited by you") }}</span>
|
||||
{% endif %}
|
||||
|
||||
{% if event.why %}
|
||||
@@ -107,7 +107,7 @@
|
||||
{% if event.error %}
|
||||
<p class="tool-activity__error">{{ event.error }}</p>
|
||||
{% elif not event.results and not event.text and not event.image %}
|
||||
<p class="tool-activity__error">Nothing was found.</p>
|
||||
<p class="tool-activity__error">{{ t("Nothing was found.") }}</p>
|
||||
{% endif %}
|
||||
|
||||
{% if event.image and event.image.id %}
|
||||
@@ -125,7 +125,7 @@
|
||||
#}
|
||||
<a class="tool-image" href="/api/files/{{ event.image.id }}/content"
|
||||
target="_blank" rel="noopener">
|
||||
<img src="/api/files/{{ event.image.id }}/content" alt="The generated image"
|
||||
<img src="/api/files/{{ event.image.id }}/content" alt="{{ t('The generated image') }}"
|
||||
loading="lazy"
|
||||
{% if event.image.width %}width="{{ event.image.width }}"{% endif %}
|
||||
{% if event.image.height %}height="{{ event.image.height }}"{% endif %}>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<table class="sheet">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>In the window now</td>
|
||||
<td>{{ t("In the window now") }}</td>
|
||||
<td>
|
||||
{% if metrics.context_tokens %}
|
||||
{{ '~' if metrics.estimated }}{{ '{:,}'.format(metrics.context_tokens) }} tokens
|
||||
@@ -33,7 +33,7 @@
|
||||
the percentage is omitted rather than computed, and automatic
|
||||
compaction never fires. #}
|
||||
<tr>
|
||||
<td>Window size</td>
|
||||
<td>{{ t("Window size") }}</td>
|
||||
<td>
|
||||
Not recorded for {{ model.label if model else "this model" }}, so there is
|
||||
no percentage and this chat will never compact itself.
|
||||
@@ -45,35 +45,32 @@
|
||||
{% endif %}
|
||||
|
||||
<tr>
|
||||
<td>Spent in total</td>
|
||||
<td>{{ t("Spent in total") }}</td>
|
||||
<td>
|
||||
{{ '~' if estimated }}{{ '{:,}'.format(totals.total) }} tokens
|
||||
across {{ replies }} repl{{ 'y' if replies == 1 else 'ies' }}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Of which sent</td>
|
||||
<td>{{ t("Of which sent") }}</td>
|
||||
<td>{{ '~' if estimated }}{{ '{:,}'.format(totals.prompt) }} tokens</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Of which written</td>
|
||||
<td>{{ t("Of which written") }}</td>
|
||||
<td>{{ '~' if estimated }}{{ '{:,}'.format(totals.completion) }} tokens</td>
|
||||
</tr>
|
||||
|
||||
{% if metrics.tokens_per_second %}
|
||||
<tr>
|
||||
<td>Last reply</td>
|
||||
<td>{{ t("Last reply") }}</td>
|
||||
<td>{{ '%.1f'|format(metrics.tokens_per_second) }} tokens/second</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
||||
{% if chat.compact_summary %}
|
||||
<tr>
|
||||
<td>Compacted</td>
|
||||
<td>
|
||||
Earlier turns are summarised. They are still in the transcript; they
|
||||
just stop being sent.
|
||||
</td>
|
||||
<td>{{ t("Compacted") }}</td>
|
||||
<td>{{ t("Earlier turns are summarised. They are still in the transcript; they just stop being sent.") }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
|
||||
@@ -33,9 +33,9 @@
|
||||
<button class="btn btn--icon btn--sm topbar__rename" type="button"
|
||||
hx-patch="/api/chats/{{ chat.id }}" hx-swap="none"
|
||||
data-prompt="What should this chat be called?"
|
||||
data-prompt-title="Rename chat" data-prompt-field="title"
|
||||
data-prompt-title="{{ t('Rename chat') }}" data-prompt-field="title"
|
||||
data-prompt-value="{{ chat.title }}"
|
||||
aria-label="Rename chat" title="Rename chat">
|
||||
aria-label="{{ t('Rename chat') }}" title="{{ t('Rename chat') }}">
|
||||
{{ icon("pencil", "icon--sm") }}
|
||||
</button>
|
||||
{% endif %}
|
||||
@@ -43,9 +43,7 @@
|
||||
it. The way out of it is Keep, in the overflow menu. #}
|
||||
{% if chat and chat.temporary %}
|
||||
<span class="badge badge--warning"
|
||||
title="Not listed in the sidebar, and removed 24 hours after the last message.">
|
||||
Temporary
|
||||
</span>
|
||||
title="{{ t('Not listed in the sidebar, and removed 24 hours after the last message.') }}">{{ t("Temporary") }}</span>
|
||||
{% endif %}
|
||||
</h1>
|
||||
|
||||
@@ -72,7 +70,7 @@
|
||||
{% if not chat and can.get("chat.create") %}
|
||||
<a class="btn btn--icon {{ 'is-active' if starting_temporary }}"
|
||||
href="{{ '/chat' if starting_temporary else '/chat?temporary=1' }}"
|
||||
aria-label="Temporary chat"
|
||||
aria-label="{{ t('Temporary chat') }}"
|
||||
title="{% if starting_temporary %}Starting a temporary chat. Click to go back to a normal one.{% else %}Start a temporary chat: not listed in the sidebar, and removed after a day.{% endif %}">
|
||||
{{ icon("clock") }}
|
||||
</a>
|
||||
@@ -97,8 +95,8 @@
|
||||
most likely to be open beside it. All three share one slot: at
|
||||
1280px the sidebar plus two panels leaves about seventy pixels of
|
||||
chat. #}
|
||||
<button class="btn btn--icon" type="button" aria-label="Canvas"
|
||||
title="Open a file beside the conversation"
|
||||
<button class="btn btn--icon" type="button" aria-label="{{ t('Canvas') }}"
|
||||
title="{{ t('Open a file beside the conversation') }}"
|
||||
{% if not chat %}data-agent-only hidden{% endif %}
|
||||
aria-expanded="false" data-toggle="#canvas" data-toggle-group="side">
|
||||
{{ icon("file-text") }}
|
||||
@@ -108,7 +106,7 @@
|
||||
{% if terminal_enabled %}
|
||||
{# To the left of the inspector, and never open beside it: see the
|
||||
toggle group in app.js. #}
|
||||
<button class="btn btn--icon" type="button" aria-label="Terminal"
|
||||
<button class="btn btn--icon" type="button" aria-label="{{ t('Terminal') }}"
|
||||
title="Open a shell on {{ agent_profile.name if agent_profile else 'this connection' }}"
|
||||
{% if not chat %}data-agent-only hidden{% endif %}
|
||||
aria-expanded="false" data-toggle="#terminal" data-toggle-group="side">
|
||||
@@ -117,8 +115,8 @@
|
||||
{% endif %}
|
||||
|
||||
{% if chat and user.is_admin %}
|
||||
<button class="btn btn--icon" type="button" aria-label="Inspect this chat"
|
||||
title="Inspect this chat" aria-expanded="false" data-toggle="#inspector"
|
||||
<button class="btn btn--icon" type="button" aria-label="{{ t('Inspect this chat') }}"
|
||||
title="{{ t('Inspect this chat') }}" aria-expanded="false" data-toggle="#inspector"
|
||||
data-toggle-group="side">
|
||||
{{ icon("search") }}
|
||||
</button>
|
||||
@@ -136,21 +134,19 @@
|
||||
<div class="picker" data-picker>
|
||||
<button class="btn btn--icon" type="button" data-picker-toggle
|
||||
aria-haspopup="menu" aria-expanded="false"
|
||||
aria-label="More" title="More">
|
||||
aria-label="{{ t('More') }}" title="{{ t('More') }}">
|
||||
{{ icon("dots") }}
|
||||
</button>
|
||||
|
||||
<div class="picker__menu picker__menu--compact" data-picker-menu role="menu"
|
||||
hidden aria-label="More">
|
||||
hidden aria-label="{{ t('More') }}">
|
||||
{% if chat.temporary %}
|
||||
<button class="picker__option" type="button" role="menuitem"
|
||||
hx-post="/api/chats/{{ chat.id }}/keep" hx-swap="none">
|
||||
{{ icon("pin", "icon--sm") }}
|
||||
<span class="picker__option-body">
|
||||
<span class="picker__option-name">Keep this chat</span>
|
||||
<span class="picker__option-note">
|
||||
Temporary — removed 24 hours after the last message
|
||||
</span>
|
||||
<span class="picker__option-name">{{ t("Keep this chat") }}</span>
|
||||
<span class="picker__option-note">{{ t("Temporary — removed 24 hours after the last message") }}</span>
|
||||
</span>
|
||||
</button>
|
||||
{% endif %}
|
||||
@@ -160,8 +156,8 @@
|
||||
data-toggle="#chat-settings">
|
||||
{{ icon("sliders", "icon--sm") }}
|
||||
<span class="picker__option-body">
|
||||
<span class="picker__option-name">Chat settings</span>
|
||||
<span class="picker__option-note">Prompt, knowledge, sampling</span>
|
||||
<span class="picker__option-name">{{ t("Chat settings") }}</span>
|
||||
<span class="picker__option-note">{{ t("Prompt, knowledge, sampling") }}</span>
|
||||
</span>
|
||||
</button>
|
||||
{% endif %}
|
||||
@@ -174,10 +170,8 @@
|
||||
onclick="window.lembasCommands && window.lembasCommands.run('compact')">
|
||||
{{ icon("archive", "icon--sm") }}
|
||||
<span class="picker__option-body">
|
||||
<span class="picker__option-name">Compact</span>
|
||||
<span class="picker__option-note">
|
||||
Summarise the earlier turns so they stop costing context
|
||||
</span>
|
||||
<span class="picker__option-name">{{ t("Compact") }}</span>
|
||||
<span class="picker__option-note">{{ t("Summarise the earlier turns so they stop costing context") }}</span>
|
||||
</span>
|
||||
</button>
|
||||
{% endif %}
|
||||
@@ -198,7 +192,7 @@
|
||||
|
||||
{% if can.get("chat.system_prompt") %}
|
||||
<div class="field">
|
||||
<label class="field__label" for="system-prompt">System prompt</label>
|
||||
<label class="field__label" for="system-prompt">{{ t("System prompt") }}</label>
|
||||
<textarea class="textarea" id="system-prompt" name="system_prompt" rows="3"
|
||||
placeholder="{{ inherited_prompt or 'Instructions that apply to every message in this chat.' }}"
|
||||
hx-patch="/api/chats/{{ chat.id }}" hx-swap="none"
|
||||
@@ -217,7 +211,7 @@
|
||||
{# Which bases this chat draws on. None ticked means everything you can
|
||||
see, which is what a chat with nothing chosen should do. #}
|
||||
<div class="field">
|
||||
<label class="field__label">Knowledge</label>
|
||||
<label class="field__label">{{ t("Knowledge") }}</label>
|
||||
<form hx-patch="/api/chats/{{ chat.id }}" hx-swap="none" hx-trigger="change">
|
||||
{# Always submitted, so unticking the last box still says something.
|
||||
An absent checkbox carries no signal of its own. #}
|
||||
@@ -247,7 +241,7 @@
|
||||
{# Who else answers. Nothing ticked is every chat that has ever existed:
|
||||
one model, answering on its own. #}
|
||||
<div class="field">
|
||||
<label class="field__label">Crowd</label>
|
||||
<label class="field__label">{{ t("Crowd") }}</label>
|
||||
<form hx-patch="/api/chats/{{ chat.id }}" hx-swap="none" hx-trigger="change">
|
||||
{# Always submitted, for the reason the bases above are. #}
|
||||
<input type="hidden" name="crowd_model_ids" value="">
|
||||
@@ -292,31 +286,28 @@
|
||||
{% if can.get("chat.params") %}
|
||||
<div class="grid grid--3">
|
||||
<div class="field">
|
||||
<label class="field__label" for="temperature">Temperature</label>
|
||||
<label class="field__label" for="temperature">{{ t("Temperature") }}</label>
|
||||
<input class="input" id="temperature" name="temperature" type="number"
|
||||
min="0" max="2" step="0.05" placeholder="default"
|
||||
min="0" max="2" step="0.05" placeholder="{{ t('default') }}"
|
||||
value="{{ chat.params_json.get('temperature') if chat.params_json.get('temperature') is not none else '' }}"
|
||||
hx-patch="/api/chats/{{ chat.id }}" hx-swap="none" hx-trigger="change">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="field__label" for="top-p">Top-p</label>
|
||||
<label class="field__label" for="top-p">{{ t("Top-p") }}</label>
|
||||
<input class="input" id="top-p" name="top_p" type="number"
|
||||
min="0" max="1" step="0.05" placeholder="default"
|
||||
min="0" max="1" step="0.05" placeholder="{{ t('default') }}"
|
||||
value="{{ chat.params_json.get('top_p') if chat.params_json.get('top_p') is not none else '' }}"
|
||||
hx-patch="/api/chats/{{ chat.id }}" hx-swap="none" hx-trigger="change">
|
||||
</div>
|
||||
<div class="field">
|
||||
<label class="field__label" for="max-tokens">Max tokens</label>
|
||||
<label class="field__label" for="max-tokens">{{ t("Max tokens") }}</label>
|
||||
<input class="input" id="max-tokens" name="max_tokens" type="number"
|
||||
min="1" step="1" placeholder="default"
|
||||
min="1" step="1" placeholder="{{ t('default') }}"
|
||||
value="{{ chat.params_json.get('max_tokens') if chat.params_json.get('max_tokens') is not none else '' }}"
|
||||
hx-patch="/api/chats/{{ chat.id }}" hx-swap="none" hx-trigger="change">
|
||||
</div>
|
||||
</div>
|
||||
<p class="field__hint">
|
||||
Leave a field empty to let the provider decide. Values outside the
|
||||
allowed range are ignored rather than clamped.
|
||||
</p>
|
||||
<p class="field__hint">{{ t("Leave a field empty to let the provider decide. Values outside the allowed range are ignored rather than clamped.") }}</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</section>
|
||||
@@ -326,7 +317,7 @@
|
||||
{# Every fresh install lands here, so it points at the fix. #}
|
||||
<div class="empty">
|
||||
{{ icon("server", "empty__mark") }}
|
||||
<h2 class="empty__title">No models available</h2>
|
||||
<h2 class="empty__title">{{ t("No models available") }}</h2>
|
||||
<p class="empty__text">
|
||||
{% if user.is_admin %}
|
||||
Add an OpenAI-compatible connection and {{ brand.name }} will load its models.
|
||||
@@ -347,7 +338,7 @@
|
||||
{% if not messages %}
|
||||
<div class="thread__intro">
|
||||
{{ mark(cls="empty__mark", uid="intro") }}
|
||||
<h2 class="empty__title">What would you ask?</h2>
|
||||
<h2 class="empty__title">{{ t("What would you ask?") }}</h2>
|
||||
<p class="empty__text">{{ brand.text.chat_empty }}</p>
|
||||
|
||||
{# Only on a chat that does not exist yet. An empty chat someone
|
||||
|
||||
Reference in New Issue
Block a user