Skip to content

Commit 5bd9418

Browse files
committed
fix: zoom without border AdminForth/1955/implement-ability-for-agent-pl
- the zoomed copy of ZoomableImage drops the border and the rounding of the thumbnail, which grew with the scale - system.html: the Opened tile without the radius - agent docs: view_image loads whole messages, one call per answer, the maxViewedPerTurn option
1 parent 65f8ff9 commit 5bd9418

3 files changed

Lines changed: 15 additions & 6 deletions

File tree

‎adminforth/design/system.html‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2633,9 +2633,9 @@ <h3 class="t-h3">Storage adapter</h3>
26332633
</div>
26342634
<div class="tile">
26352635
<div class="tile-stage" style="background: rgb(0 0 0 / 0.8); border-radius: 6px">
2636-
<span style="display: block; width: 180px; height: 102px; border-radius: 6px; background: linear-gradient(135deg, #D4D4D8, #A1A1AA); cursor: zoom-out"></span>
2636+
<span style="display: block; width: 180px; height: 102px; background: linear-gradient(135deg, #D4D4D8, #A1A1AA); cursor: zoom-out"></span>
26372637
</div>
2638-
<div class="tile-cap"><b>Opened</b><code>z-50 over the docked chat · click, scroll or Esc closes</code></div>
2638+
<div class="tile-cap"><b>Opened</b><code>z-50 over the docked chat · no border or radius of the thumbnail · click, scroll or Esc closes</code></div>
26392639
</div>
26402640
</div>
26412641
</section>

‎adminforth/spa/src/afcl/ZoomableImage.vue‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
.medium-zoom-image--opened {
1010
@apply z-50;
1111
}
12+
/* the zoomed image is a copy of the thumbnail scaled up with a transform, so a border or a rounding
13+
of the thumbnail would grow with it; `!` beats the classes the copy keeps */
14+
.medium-zoom-image--opened {
15+
@apply !border-0 !rounded-none;
16+
}
1217
</style>
1318

1419
<script setup lang="ts">

‎documentation/docs/tutorial/09-Plugins/01-agent.md‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,20 +359,24 @@ turnResource: {
359359
},
360360
```
361361

362-
Before the upload the browser scales an image down to fit 1920×1080 and converts it to WebP (to JPEG in a browser which can not encode WebP, e.g. Safari). The plugin accepts images up to 3.75 MB: the model gets them as base64, and the smallest per-image limit of the providers is 5 MB. Every image costs tokens on every model call, so the model sees an image for a while after it was sent, and only the latest few at once. Older images are replaced with a note, and the agent loads them again with the `view_image` tool when they matter for the answer.
362+
Before the upload the browser scales an image down to fit 1920×1080 and converts it to WebP (to JPEG in a browser which can not encode WebP, e.g. Safari). The plugin accepts images up to 3.75 MB: the model gets them as base64, and the smallest per-image limit of the providers is 5 MB. Every image costs tokens on every model call, so the model sees an image for a while after it was sent, and only the latest few at once. Older images of a message are replaced with one note, and the agent loads them again with the `view_image` tool before answering about them. With one call per answer it loads all images of the messages which may match the request, the most likely first: it sees all the loaded images for this answer and keeps the ones it picks for the next messages. When one answer needs more images than allowed, the agent asks which images matter.
363363

364364
The limits are options of the plugin, each a whole number from 1:
365365

366366
```ts
367367
new AdminForthAgent({
368368
// ...
369369
imageAttachments: {
370-
// images one message can have, 5 by default
370+
// images one message can have, 5 by default, at most maxViewedPerTurn
371371
maxPerMessage: 5,
372-
// minutes the model sees an image after it was sent or loaded again with view_image, 30 by default
372+
// minutes the model sees an image after it was sent or kept by view_image, 30 by default
373373
visibleMinutes: 30,
374-
// images the model sees at once, the latest ones, 5 by default
374+
// images the model keeps seeing, the latest ones, 5 by default; a view_image can keep more of the
375+
// images it loaded, up to maxViewedPerTurn, until the next images are sent or loaded
375376
maxVisible: 5,
377+
// images the model can load again with one view_image call per answer, whole messages, 10 by default;
378+
// it sees all of them for that answer and keeps the ones it picks for the next messages
379+
maxViewedPerTurn: 10,
376380
},
377381
}),
378382
```

0 commit comments

Comments
 (0)