NarratoAI/config.example.toml

178 lines
6.2 KiB
TOML
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.

[app]
project_version="0.7.5"
# LLM API 超时配置(秒)
llm_vision_timeout = 120 # 视觉模型基础超时时间
llm_text_timeout = 180 # 文本模型基础超时时间(解说文案生成等复杂任务需要更长时间)
llm_max_retries = 3 # API 重试次数LiteLLM 会自动处理重试)
##########################################
# 🚀 LLM 配置 - 使用 LiteLLM 统一接口
##########################################
# LiteLLM 是统一的 LLM 接口库,支持 100+ providers
# 优势:
# ✅ 代码量减少 80%,统一的 API 接口
# ✅ 自动重试和智能错误处理
# ✅ 内置成本追踪和 token 统计
# ✅ 支持更多 providersOpenAI, Anthropic, Gemini, Qwen, DeepSeek,
# Cohere, Together AI, Replicate, Groq, Mistral 等
#
# 文档https://docs.litellm.ai/
# 支持的模型https://docs.litellm.ai/docs/providers
# ===== 视觉模型配置 =====
vision_llm_provider = "litellm"
# 模型格式provider/model_name
# 常用视觉模型示例:
# - Gemini: gemini/gemini-2.0-flash-lite (推荐,速度快成本低)
# - Gemini: gemini/gemini-1.5-pro (高精度)
# - OpenAI: gpt-4o, gpt-4o-mini
# - Qwen: qwen/qwen2.5-vl-32b-instruct
# - SiliconFlow: siliconflow/Qwen/Qwen2.5-VL-32B-Instruct
vision_litellm_model_name = "gemini/gemini-2.0-flash-lite"
vision_litellm_api_key = "" # 填入对应 provider 的 API key
vision_litellm_base_url = "" # 可选:自定义 API base URL
# ===== 文本模型配置 =====
text_llm_provider = "litellm"
# 常用文本模型示例:
# - DeepSeek: deepseek/deepseek-chat (推荐,性价比高)
# - DeepSeek: deepseek/deepseek-reasoner (推理能力强)
# - Gemini: gemini/gemini-2.0-flash (速度快)
# - OpenAI: gpt-4o, gpt-4o-mini, gpt-4-turbo
# - Qwen: qwen/qwen-plus, qwen/qwen-turbo
# - SiliconFlow: siliconflow/deepseek-ai/DeepSeek-R1
# - Moonshot: moonshot/moonshot-v1-8k
text_litellm_model_name = "deepseek/deepseek-chat"
text_litellm_api_key = "" # 填入对应 provider 的 API key
text_litellm_base_url = "" # 可选:自定义 API base URL
# ===== API Keys 参考 =====
# 主流 LLM Providers API Key 获取地址:
#
# OpenAI: https://platform.openai.com/api-keys
# Gemini: https://makersuite.google.com/app/apikey
# DeepSeek: https://platform.deepseek.com/api_keys
# Qwen (阿里): https://bailian.console.aliyun.com/?tab=model#/api-key
# SiliconFlow: https://cloud.siliconflow.cn/account/ak (手机号注册)
# Moonshot: https://platform.moonshot.cn/console/api-keys
# Anthropic: https://console.anthropic.com/settings/keys
# Cohere: https://dashboard.cohere.com/api-keys
# Together AI: https://api.together.xyz/settings/api-keys
##########################################
# 🔧 高级配置(可选)
##########################################
# WebUI 界面是否显示配置项
hide_config = true
##########################################
# 📚 传统配置示例(仅供参考,不推荐使用)
##########################################
# 如果需要使用传统的单独 provider 实现,可以参考以下配置
# 但强烈推荐使用上面的 LiteLLM 配置
#
# 传统视觉模型配置示例:
# vision_llm_provider = "gemini" # 可选gemini, qwenvl, siliconflow
# vision_gemini_api_key = ""
# vision_gemini_model_name = "gemini-2.0-flash-lite"
#
# 传统文本模型配置示例:
# text_llm_provider = "openai" # 可选openai, gemini, qwen, deepseek, siliconflow, moonshot
# text_openai_api_key = ""
# text_openai_model_name = "gpt-4o-mini"
# text_openai_base_url = "https://api.openai.com/v1"
##########################################
# TTS (文本转语音) 配置
##########################################
[azure]
# Azure TTS 配置
# 获取密钥https://portal.azure.com
speech_key = ""
speech_region = ""
[tencent]
# 腾讯云 TTS 配置
# 访问 https://console.cloud.tencent.com/cam/capi 获取密钥
secret_id = ""
secret_key = ""
region = "ap-beijing" # 地域配置
[soulvoice]
# SoulVoice TTS API 配置
api_key = ""
voice_uri = "speech:mcg3fdnx:clzkyf4vy00e5qr6hywum4u84:bzznlkuhcjzpbosexitr"
api_url = "https://tts.scsmtech.cn/tts"
model = "FunAudioLLM/CosyVoice2-0.5B"
[tts_qwen]
# 通义千问 Qwen3 TTS 配置
# 访问 https://bailian.console.aliyun.com/?tab=model#/api-key 获取你的 API 密钥
api_key = ""
model_name = "qwen3-tts-flash"
[indextts2]
# IndexTTS2 语音克隆配置
# 这是一个开源的零样本语音克隆项目,需要自行部署
# 项目地址https://github.com/index-tts/index-tts
# 默认 API 地址(本地部署)
api_url = "http://127.0.0.1:8081/tts"
# 默认参考音频路径(可选)
# reference_audio = "/path/to/reference_audio.wav"
# 推理模式:普通推理 / 快速推理
infer_mode = "普通推理"
# 高级参数
temperature = 1.0
top_p = 0.8
top_k = 30
do_sample = true
num_beams = 3
repetition_penalty = 10.0
[ui]
# TTS 引擎选择
# 可选edge_tts, azure_speech, soulvoice, tencent_tts, tts_qwen
tts_engine = "edge_tts"
# Edge TTS 配置
edge_voice_name = "zh-CN-XiaoyiNeural-Female"
edge_volume = 80
edge_rate = 1.0
edge_pitch = 0
# Azure Speech Services 配置
azure_voice_name = "zh-CN-XiaoyiNeural-Female"
azure_volume = 80
azure_rate = 1.0
azure_pitch = 0
##########################################
# 代理和网络配置
##########################################
[proxy]
# HTTP/HTTPS 代理配置(如需要)
# clash 默认地址http://127.0.0.1:7890
http = ""
https = ""
enabled = false
##########################################
# 视频处理配置
##########################################
[frames]
# 提取关键帧的间隔时间(秒)
frame_interval_input = 3
# 大模型单次处理的关键帧数量
vision_batch_size = 10