Skip to content

Commit 5631e06

Browse files
committed
fix: update image placeholder in prompt from "[图片]" to "[Image]"
1 parent 2f14ce4 commit 5631e06

6 files changed

Lines changed: 49 additions & 16 deletions

File tree

astrbot/core/agent/runners/tool_loop_agent_runner.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -237,12 +237,7 @@ async def reset(
237237
if isinstance(msg, dict) and msg.get("_no_save"):
238238
m._no_save = True
239239
messages.append(m)
240-
if (
241-
request.prompt is not None
242-
or request.image_urls
243-
or request.audio_urls
244-
or request.extra_user_content_parts
245-
):
240+
if request.prompt is not None:
246241
m = await request.assemble_context()
247242
messages.append(Message.model_validate(m))
248243
if request.system_prompt:

dashboard/src/components/provider/ProviderSourcesPanel.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ const emitDeleteSource = (source) => emit('delete-provider-source', source)
216216
}
217217
218218
.provider-sources-mobile {
219-
padding: 14px 18px 0;
219+
padding: 16px;
220220
}
221221
222222
.provider-sources-list-wrap {

dashboard/src/components/shared/AstrBotConfig.vue

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,21 @@ function hasVisibleItemsAfter(items, currentIndex) {
470470
padding: 8px 0;
471471
}
472472
473-
.property-info, .type-indicator, .config-input {
473+
.property-info {
474+
padding: 4px 4px;
475+
}
476+
477+
.property-info :deep(.v-list-item) {
478+
padding-inline: 0;
479+
}
480+
481+
.type-indicator,
482+
.config-input {
474483
padding: 4px;
475484
}
485+
486+
.config-divider {
487+
display: none;
488+
}
476489
}
477490
</style>

dashboard/src/components/shared/AstrBotConfigV4.vue

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -601,14 +601,17 @@ function getSpecialSubtype(value) {
601601
padding: 8px 0;
602602
}
603603
604-
.property-info,
605604
.type-indicator {
606605
padding: 4px 8px;
607606
}
608607
609608
.config-input {
610-
padding-left: 24px;
611-
padding-right: 24px;
609+
padding-left: 16px;
610+
padding-right: 16px;
611+
}
612+
613+
.config-divider {
614+
display: none;
612615
}
613616
}
614617
</style>

dashboard/src/components/shared/ConfigItemRenderer.vue

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171

7272
<div
7373
v-else-if="itemMeta?.type === 'list' && itemMeta?.options && itemMeta?.render_type === 'checkbox'"
74-
class="d-flex flex-wrap gap-20"
74+
class="checkbox-group d-flex flex-wrap"
7575
>
7676
<v-checkbox
7777
v-for="(option, optionIndex) in itemMeta.options"
@@ -80,8 +80,9 @@
8080
@update:model-value="emitUpdate"
8181
:label="getLabel(itemMeta, optionIndex, option)"
8282
:value="option"
83-
class="mr-2"
83+
class="config-checkbox"
8484
color="primary"
85+
density="compact"
8586
hide-details
8687
></v-checkbox>
8788
</div>
@@ -356,8 +357,29 @@ function getSpecialSubtype(value) {
356357
background-color: rgba(0, 0, 0, 0.5);
357358
}
358359
359-
.gap-20 {
360-
gap: 20px;
360+
.checkbox-group {
361+
gap: 6px 12px;
362+
}
363+
364+
.config-checkbox {
365+
margin-right: 0;
366+
}
367+
368+
.config-checkbox :deep(.v-selection-control) {
369+
min-height: 28px;
370+
}
371+
372+
.config-checkbox :deep(.v-selection-control__wrapper) {
373+
width: 18px;
374+
height: 18px;
375+
}
376+
377+
.config-checkbox :deep(.v-icon) {
378+
font-size: 18px;
379+
}
380+
381+
.config-checkbox :deep(.v-label) {
382+
font-size: 0.9rem;
361383
}
362384
363385
:deep(.v-field__input) {

tests/unit/test_astr_main_agent.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ def test_modalities_fix_image_not_supported(self, mock_provider):
675675

676676
module._modalities_fix(mock_provider, req)
677677

678-
assert "[图片]" in req.prompt
678+
assert "[Image]" in req.prompt
679679
assert req.image_urls == []
680680

681681
def test_modalities_fix_tool_not_supported(self, mock_provider):

0 commit comments

Comments
 (0)