提示词最大限制

This commit is contained in:
2026-07-02 08:51:49 +08:00
parent 803ce31a86
commit 1de4fe99ca
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -38,7 +38,7 @@ var (
ErrInvalidAPIKey = errors.New("invalid api key")
ErrUnknownModel = errors.New("unknown model")
ErrUnsupportedParams = errors.New("unsupported or unpriced parameters for this model")
ErrPromptTooLong = errors.New("prompt too long (max 2000 characters)")
ErrPromptTooLong = errors.New("prompt too long (max 1500 characters)")
ErrInsufficientFunds = errors.New("insufficient credits")
ErrGenerationPending = errors.New("generation executor not implemented yet")
ErrProviderAuth = errors.New("provider token invalid or expired")
@@ -61,7 +61,7 @@ var (
// maxPromptRunes caps prompt length (counted as characters, so Chinese = 1),
// matching the 画图台 counter. Enforced for both 画图台 and API-key calls.
const maxPromptRunes = 2000
const maxPromptRunes = 1500
// maxReferenceImageBytes bounds a single decoded reference image. 8 MB
// comfortably covers real photos/screenshots; anything larger is almost
+2 -2
View File
@@ -526,9 +526,9 @@ onUnmounted(() => {
<div>
<div class="flex items-center justify-between mb-1.5">
<label class="block text-xs font-medium text-slate-500">提示词</label>
<span class="text-[11px] tabular-nums" :class="prompt.length >= 2000 ? 'text-rose-500' : 'text-slate-400'">{{ prompt.length }}/2000</span>
<span class="text-[11px] tabular-nums" :class="prompt.length >= 1500 ? 'text-rose-500' : 'text-slate-400'">{{ prompt.length }}/1500</span>
</div>
<textarea v-model="prompt" rows="4" maxlength="2000" class="field resize-none disabled:opacity-60 disabled:cursor-not-allowed"
<textarea v-model="prompt" rows="4" maxlength="1500" class="field resize-none disabled:opacity-60 disabled:cursor-not-allowed"
placeholder="描述想要的画面…如:黄昏时分,金色麦田里奔跑的金毛猎犬,电影感"></textarea>
</div>