diff --git a/src/config.ts b/src/config.ts index 495635b..1ec695b 100644 --- a/src/config.ts +++ b/src/config.ts @@ -148,6 +148,7 @@ export interface PromptConfig { placement?: Computed<'before' | 'after'> latinOnly?: Computed translator?: boolean + lowerCase?: boolean maxWords?: Computed } @@ -163,6 +164,7 @@ export const PromptConfig: Schema = Schema.object({ ]), options).description('默认附加标签的位置。').default('after'), translator: Schema.boolean().description('是否启用自动翻译。').default(true), latinOnly: Schema.computed(Schema.boolean(), options).description('是否只接受英文输入。').default(false), + lowerCase: Schema.boolean().description('是否将输入的标签转换为小写。').default(true), maxWords: Schema.computed(Schema.natural(), options).description('允许的最大单词数量。').default(0), }).description('输入设置') @@ -422,7 +424,8 @@ export function parseInput(session: Session, input: string, config: Config, over const tags = input.split(/,\s*/g) if (placement === 'before') tags.reverse() for (let tag of tags) { - tag = tag.trim().toLowerCase() + tag = tag.trim() + if (config.lowerCase) tag = tag.toLowerCase() if (!tag || words.includes(tag)) continue if (placement === 'before') { words.unshift(tag)