mirror of
https://github.com/linyqh/NarratoAI.git
synced 2025-12-11 10:32:49 +00:00
更新generate_narration_script.py、short_drama_explanation.py和step1_subtitle_analyzer_openai.py文件,集成新的提示词管理系统,提升解说文案和短剧分析的生成效率与准确性。通过使用PromptManager简化提示词构建过程,增强系统的灵活性和可维护性。
69 lines
1.4 KiB
Python
69 lines
1.4 KiB
Python
#!/usr/bin/env python
|
|
# -*- coding: UTF-8 -*-
|
|
|
|
"""
|
|
@Project: NarratoAI
|
|
@File : __init__.py
|
|
@Author : AI Assistant
|
|
@Date : 2025/1/7
|
|
@Description: 统一提示词管理模块
|
|
"""
|
|
|
|
from .manager import PromptManager
|
|
from .base import BasePrompt, VisionPrompt, TextPrompt, ParameterizedPrompt
|
|
from .registry import PromptRegistry
|
|
from .template import TemplateRenderer
|
|
from .validators import PromptOutputValidator
|
|
from .exceptions import (
|
|
PromptError,
|
|
PromptNotFoundError,
|
|
PromptValidationError,
|
|
TemplateRenderError
|
|
)
|
|
|
|
# 版本信息
|
|
__version__ = "1.0.0"
|
|
__author__ = "AI Assistant"
|
|
|
|
# 导出的公共接口
|
|
__all__ = [
|
|
# 核心管理器
|
|
"PromptManager",
|
|
|
|
# 基础类
|
|
"BasePrompt",
|
|
"VisionPrompt",
|
|
"TextPrompt",
|
|
"ParameterizedPrompt",
|
|
|
|
# 工具类
|
|
"PromptRegistry",
|
|
"TemplateRenderer",
|
|
"PromptOutputValidator",
|
|
|
|
# 异常类
|
|
"PromptError",
|
|
"PromptNotFoundError",
|
|
"PromptValidationError",
|
|
"TemplateRenderError",
|
|
|
|
# 版本信息
|
|
"__version__",
|
|
"__author__"
|
|
]
|
|
|
|
# 模块初始化
|
|
def initialize_prompts():
|
|
"""初始化提示词模块,注册所有提示词"""
|
|
from . import documentary
|
|
from . import short_drama_editing
|
|
from . import short_drama_narration
|
|
|
|
# 注册各模块的提示词
|
|
documentary.register_prompts()
|
|
short_drama_editing.register_prompts()
|
|
short_drama_narration.register_prompts()
|
|
|
|
# 自动初始化
|
|
initialize_prompts()
|