feat: add ai writing imitation mode
This commit is contained in:
1 parent
9268c73776
commit
bb6b9bd84b
22 files changed
+714
-30
No files matched your search
+27
-1
@@ -1,5 +1,5 @@
|
||||
from typing import Annotated, List, Literal, Optional, TypedDict
|
||||
import operator
|
||||
from typing import Annotated, List, Literal, Optional, TypedDict
|
||||
|
||||
# ── 素材 ──────────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -74,6 +74,23 @@ class DraftArticle(TypedDict):
|
||||
word_count: int
|
||||
revision_count: int
|
||||
|
||||
|
||||
# ── 样文仿写 ──────────────────────────────────────────────────────────────────
|
||||
|
||||
class SampleStyleProfile(TypedDict, total=False):
|
||||
summary: str
|
||||
article_type_guess: str
|
||||
tone: str
|
||||
structure: List[str]
|
||||
language_features: List[str]
|
||||
sentence_style: str
|
||||
opening_style: str
|
||||
ending_style: str
|
||||
imitation_guidance: List[str]
|
||||
avoid_copying: List[str]
|
||||
sample_outline: List[str]
|
||||
|
||||
|
||||
# ── 编辑审核 ──────────────────────────────────────────────────────────────────
|
||||
|
||||
class ReviewIssue(TypedDict):
|
||||
@@ -109,6 +126,7 @@ class UserInterventionPayload(TypedDict, total=False):
|
||||
# ── 主状态 ────────────────────────────────────────────────────────────────────
|
||||
|
||||
WritingStatus = Literal[
|
||||
"analyzing_sample",
|
||||
"researching", "awaiting_material_confirm",
|
||||
"writing_outline", "awaiting_outline_confirm",
|
||||
"writing_draft", "awaiting_section_help", "awaiting_draft_confirm",
|
||||
@@ -128,6 +146,14 @@ class AIWritingState(TypedDict):
|
||||
# 用户在写作表单粘贴的「已有大纲」原文(可选)。非空时 writer_outline 跳过 LLM 规划,
|
||||
# 直接解析这份大纲并按用户结构生成,做到「完全按我的大纲写」。留空走正常自动规划。
|
||||
user_outline_raw: str
|
||||
# 写作入口模式:normal=普通写作 / imitate=样文仿写。仿写模式下先分析 sample_text,
|
||||
# 得到 sample_style_profile,再将其注入大纲与草稿提示词。
|
||||
writing_mode_type: str
|
||||
sample_text: str
|
||||
sample_filename: str
|
||||
sample_style_profile: Optional[SampleStyleProfile]
|
||||
imitate_strength: str
|
||||
preserve_sample_structure: bool
|
||||
article_type: str
|
||||
# 当 article_type 是「已有类型库里没有」的新类型时,配置助手识别出的一句话特征说明。
|
||||
# 仅本次写作临时使用(不入库):在大纲生成时作为 hint 附在类型后,影响全文结构与侧重。
|
||||
|
||||
Reference in new issue
Block a user