diff --git a/astrbot/core/config/default.py b/astrbot/core/config/default.py index 33ebbfa3..9fde3c36 100644 --- a/astrbot/core/config/default.py +++ b/astrbot/core/config/default.py @@ -497,6 +497,7 @@ CONFIG_METADATA_2 = { "OpenAI": { "id": "openai", "type": "openai_chat_completion", + "provider_type": "chat_completion", "enable": True, "key": [], "api_base": "https://api.openai.com/v1", @@ -508,6 +509,7 @@ CONFIG_METADATA_2 = { "Azure_OpenAI": { "id": "azure", "type": "openai_chat_completion", + "provider_type": "chat_completion", "enable": True, "api_version": "2024-05-01-preview", "key": [], @@ -520,6 +522,7 @@ CONFIG_METADATA_2 = { "xAI(grok)": { "id": "xai", "type": "openai_chat_completion", + "provider_type": "chat_completion", "enable": True, "key": [], "api_base": "https://api.x.ai/v1", @@ -531,6 +534,7 @@ CONFIG_METADATA_2 = { "Anthropic(claude)": { "id": "claude", "type": "anthropic_chat_completion", + "provider_type": "chat_completion", "enable": True, "key": [], "api_base": "https://api.anthropic.com/v1", @@ -543,6 +547,7 @@ CONFIG_METADATA_2 = { "Ollama": { "id": "ollama_default", "type": "openai_chat_completion", + "provider_type": "chat_completion", "enable": True, "key": ["ollama"], # ollama 的 key 默认是 ollama "api_base": "http://localhost:11434/v1", @@ -553,6 +558,7 @@ CONFIG_METADATA_2 = { "LM_Studio": { "id": "lm_studio", "type": "openai_chat_completion", + "provider_type": "chat_completion", "enable": True, "key": ["lmstudio"], "api_base": "http://localhost:1234/v1", @@ -563,6 +569,7 @@ CONFIG_METADATA_2 = { "Gemini(OpenAI兼容)": { "id": "gemini_default", "type": "openai_chat_completion", + "provider_type": "chat_completion", "enable": True, "key": [], "api_base": "https://generativelanguage.googleapis.com/v1beta/openai/", @@ -574,6 +581,7 @@ CONFIG_METADATA_2 = { "Gemini(googlegenai原生)": { "id": "gemini_default", "type": "googlegenai_chat_completion", + "provider_type": "chat_completion", "enable": True, "key": [], "api_base": "https://generativelanguage.googleapis.com/", @@ -597,6 +605,7 @@ CONFIG_METADATA_2 = { "DeepSeek": { "id": "deepseek_default", "type": "openai_chat_completion", + "provider_type": "chat_completion", "enable": True, "key": [], "api_base": "https://api.deepseek.com/v1", @@ -608,6 +617,7 @@ CONFIG_METADATA_2 = { "Zhipu(智谱)": { "id": "zhipu_default", "type": "zhipu_chat_completion", + "provider_type": "chat_completion", "enable": True, "key": [], "timeout": 120, @@ -619,6 +629,7 @@ CONFIG_METADATA_2 = { "SiliconFlow(硅基流动)": { "id": "siliconflow", "type": "openai_chat_completion", + "provider_type": "chat_completion", "enable": True, "key": [], "timeout": 120, @@ -630,6 +641,7 @@ CONFIG_METADATA_2 = { "MoonShot(Kimi)": { "id": "moonshot", "type": "openai_chat_completion", + "provider_type": "chat_completion", "enable": True, "key": [], "timeout": 120, @@ -641,6 +653,7 @@ CONFIG_METADATA_2 = { "LLMTuner": { "id": "llmtuner_default", "type": "llm_tuner", + "provider_type": "chat_completion", "enable": True, "base_model_path": "", "adapter_model_path": "", @@ -651,6 +664,7 @@ CONFIG_METADATA_2 = { "Dify": { "id": "dify_app_default", "type": "dify", + "provider_type": "chat_completion", "enable": True, "dify_api_type": "chat", "dify_api_key": "", @@ -663,6 +677,7 @@ CONFIG_METADATA_2 = { "Dashscope(阿里云百炼应用)": { "id": "dashscope", "type": "dashscope", + "provider_type": "chat_completion", "enable": True, "dashscope_app_type": "agent", "dashscope_api_key": "", @@ -678,6 +693,7 @@ CONFIG_METADATA_2 = { "FastGPT": { "id": "fastgpt", "type": "openai_chat_completion", + "provider_type": "chat_completion", "enable": True, "key": [], "api_base": "https://api.fastgpt.in/api/v1", @@ -686,6 +702,7 @@ CONFIG_METADATA_2 = { "Whisper(API)": { "id": "whisper", "type": "openai_whisper_api", + "provider_type": "speech_to_text", "enable": False, "api_key": "", "api_base": "", @@ -693,22 +710,25 @@ CONFIG_METADATA_2 = { }, "Whisper(本地加载)": { "whisper_hint": "(不用修改我)", + "type": "openai_whisper_selfhost", + "provider_type": "speech_to_text", "enable": False, "id": "whisper", - "type": "openai_whisper_selfhost", "model": "tiny", }, "sensevoice(本地加载)": { "sensevoice_hint": "(不用修改我)", + "type": "sensevoice_stt_selfhost", + "provider_type": "speech_to_text", "enable": False, "id": "sensevoice", - "type": "sensevoice_stt_selfhost", "stt_model": "iic/SenseVoiceSmall", "is_emotion": False, }, "OpenAI_TTS(API)": { "id": "openai_tts", "type": "openai_tts_api", + "provider_type": "text_to_speech", "enable": False, "api_key": "", "api_base": "", @@ -720,6 +740,7 @@ CONFIG_METADATA_2 = { "edgetts_hint": "提示:使用这个服务前需要安装有 ffmpeg,并且可以直接在终端调用 ffmpeg 指令。", "id": "edge_tts", "type": "edge_tts", + "provider_type": "text_to_speech", "enable": False, "edge-tts-voice": "zh-CN-XiaoxiaoNeural", "timeout": 20, @@ -727,6 +748,7 @@ CONFIG_METADATA_2 = { "GSVI_TTS(API)": { "id": "gsvi_tts", "type": "gsvi_tts_api", + "provider_type": "text_to_speech", "api_base": "http://127.0.0.1:5000", "character": "", "emotion": "default", @@ -736,6 +758,7 @@ CONFIG_METADATA_2 = { "FishAudio_TTS(API)": { "id": "fishaudio_tts", "type": "fishaudio_tts_api", + "provider_type": "text_to_speech", "enable": False, "api_key": "", "api_base": "https://api.fish.audio/v1", @@ -745,6 +768,7 @@ CONFIG_METADATA_2 = { "阿里云百炼_TTS(API)": { "id": "dashscope_tts", "type": "dashscope_tts", + "provider_type": "text_to_speech", "enable": False, "api_key": "", "model": "cosyvoice-v1", @@ -754,6 +778,7 @@ CONFIG_METADATA_2 = { "Azure_TTS": { "id": "azure_tts", "type": "azure_tts", + "provider_type": "text_to_speech", "enable": True, "azure_tts_voice": "zh-CN-YunxiaNeural", "azure_tts_style": "cheerful", @@ -983,7 +1008,12 @@ CONFIG_METADATA_2 = { "hint": "ID 不能和其它的服务提供商重复,否则将发生严重冲突。", }, "type": { - "description": "模型提供商类型", + "description": "模型提供商种类", + "type": "string", + "invisible": True, + }, + "provider_type": { + "description": "模型提供商能力种类", "type": "string", "invisible": True, },