xxy 43f3e0b746 Initial commit
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-05 18:41:06 +08:00

52 lines
1.2 KiB
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from __future__ import annotations
from typing import List, Optional
from pydantic import BaseModel
class TemplateSectionItem(BaseModel):
id: str
sectionKey: str
sectionTitle: str
# 复刻 eval_report章节提示词 / 输出合同 / 示例
sectionPrompt: Optional[str] = None
sectionOutputContract: Optional[str] = None
sectionOrder: int = 0
examples: Optional[str] = None
class TemplateItem(BaseModel):
id: str
name: str
description: Optional[str] = None
sourceFile: Optional[str] = None
createdAt: Optional[str] = None
updatedAt: Optional[str] = None
isDefault: bool = False
isActive: bool = True
sections: List[TemplateSectionItem] = []
class SectionReferenceItem(BaseModel):
id: str
templateId: Optional[str] = None
sourceFile: str
sectionKey: str
sectionTitle: str
sectionOrder: int = 0
contentLength: int = 0
content: str = ""
class UploadTemplateResult(BaseModel):
"""上传解析结果:模板(目录 + 声明)+ 入库的章节内容。"""
template: TemplateItem
sourceFile: str
markdownLength: int
totalSections: int
totalReferences: int
references: List[SectionReferenceItem] = []
parseWarnings: List[str] = []