Fix writer max_tokens (500→1000) for titles/tags, fix preview scrollbar height
This commit is contained in:
@@ -159,9 +159,9 @@
|
|||||||
<el-button v-if="editing" size="small" type="primary" @click="saveContent" :loading="savingContent">保存</el-button>
|
<el-button v-if="editing" size="small" type="primary" @click="saveContent" :loading="savingContent">保存</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="max-width: 1000px; margin: 0 auto; width: 100%; display: flex; flex-direction: column;">
|
<div style="width:100%;">
|
||||||
<div v-if="!editing" class="preview-body" style="flex:1; min-height:500px; max-height:calc(100vh - 310px); border:1px solid #ebeef5; border-radius:8px; background:#fff; padding:20px; overflow-y:auto; width:100%; line-height:1.8;" v-html="currentPreviewBody"></div>
|
<div v-if="!editing" class="preview-body" style="min-height:300px; height:68vh; border:1px solid #ebeef5; border-radius:8px; background:#fff; padding:20px; overflow-y:auto; width:100%; line-height:1.8;" v-html="currentPreviewBody"></div>
|
||||||
<div v-else ref="editor" contenteditable="true" style="flex:1; min-height:500px; max-height:calc(100vh - 310px); border:1px solid #409eff; border-radius:8px; background:#fff; padding:20px; overflow-y:auto; width:100%; line-height:1.8; outline:none; box-shadow:0 0 0 2px rgba(64,158,255,0.2);" @input="editContent = $event.target.innerHTML"></div>
|
<div v-else ref="editor" contenteditable="true" style="min-height:300px; height:68vh; border:1px solid #409eff; border-radius:8px; background:#fff; padding:20px; overflow-y:auto; width:100%; line-height:1.8; outline:none; box-shadow:0 0 0 2px rgba(64,158,255,0.2);" @input="editContent = $event.target.innerHTML"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
|
|||||||
+2
-2
@@ -246,7 +246,7 @@ class Writer:
|
|||||||
if HAVE_LLM:
|
if HAVE_LLM:
|
||||||
prompt = tag_prompts.get(platform, f"根据文章信息生成适合{platform}的标签。标题:{title} 领域:{field} 核心观点:{core} 直接输出标签,空格分隔。")
|
prompt = tag_prompts.get(platform, f"根据文章信息生成适合{platform}的标签。标题:{title} 领域:{field} 核心观点:{core} 直接输出标签,空格分隔。")
|
||||||
try:
|
try:
|
||||||
tags_text = call_llm(prompt, temperature=0.2, max_tokens=500)
|
tags_text = call_llm(prompt, temperature=0.2, max_tokens=1000)
|
||||||
if tags_text:
|
if tags_text:
|
||||||
tags = [t.strip('#') for t in tags_text.strip().split() if t.strip('#')]
|
tags = [t.strip('#') for t in tags_text.strip().split() if t.strip('#')]
|
||||||
if tags:
|
if tags:
|
||||||
@@ -342,7 +342,7 @@ class Writer:
|
|||||||
|
|
||||||
prompt = title_templates.get(platform, f"给以下文章改个吸引人的{platform}标题:{original}")
|
prompt = title_templates.get(platform, f"给以下文章改个吸引人的{platform}标题:{original}")
|
||||||
try:
|
try:
|
||||||
resp = call_llm(prompt, temperature=0.7, max_tokens=500)
|
resp = call_llm(prompt, temperature=0.7, max_tokens=1000)
|
||||||
titles = []
|
titles = []
|
||||||
for line in resp.strip().split('\n'):
|
for line in resp.strip().split('\n'):
|
||||||
line = line.strip()
|
line = line.strip()
|
||||||
|
|||||||
Reference in New Issue
Block a user