mirror of
https://github.com/linyqh/NarratoAI.git
synced 2026-07-04 21:35:04 +00:00
- 新增影视解说专属提示词模块,覆盖剧情分析、文案生成、片段规划、脚本匹配与修复全流程 - 注册影视解说模块到全局提示词系统,更新初始化加载逻辑 - 重构Tavily搜索服务,拆分通用搜索函数适配短剧和影视两类作品 - 更新WebUI界面,新增影视解说配置项、多语言翻译与版本号展示 - 升级项目版本号从0.7.9到0.8.1 - 调整LLM服务与适配器逻辑,支持自定义prompt分类适配不同解说类型 - 完善相关工具类与单元测试,覆盖影视解说场景调用流程
71 lines
1.5 KiB
Python
71 lines
1.5 KiB
Python
#!/usr/bin/env python
|
|
# -*- coding: UTF-8 -*-
|
|
|
|
"""
|
|
@Project: NarratoAI
|
|
@File : __init__.py
|
|
@Author : viccy同学
|
|
@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__ = "viccy同学"
|
|
|
|
# 导出的公共接口
|
|
__all__ = [
|
|
# 核心管理器
|
|
"PromptManager",
|
|
|
|
# 基础类
|
|
"BasePrompt",
|
|
"VisionPrompt",
|
|
"TextPrompt",
|
|
"ParameterizedPrompt",
|
|
|
|
# 工具类
|
|
"PromptRegistry",
|
|
"TemplateRenderer",
|
|
"PromptOutputValidator",
|
|
|
|
# 异常类
|
|
"PromptError",
|
|
"PromptNotFoundError",
|
|
"PromptValidationError",
|
|
"TemplateRenderError",
|
|
|
|
# 版本信息
|
|
"__version__",
|
|
"__author__"
|
|
]
|
|
|
|
# 模块初始化
|
|
def initialize_prompts():
|
|
"""初始化提示词模块,注册所有提示词"""
|
|
from . import documentary
|
|
from . import film_tv_narration
|
|
from . import short_drama_editing
|
|
from . import short_drama_narration
|
|
|
|
# 注册各模块的提示词
|
|
documentary.register_prompts()
|
|
film_tv_narration.register_prompts()
|
|
short_drama_editing.register_prompts()
|
|
short_drama_narration.register_prompts()
|
|
|
|
# 自动初始化
|
|
initialize_prompts()
|