diff --git a/api/app/controllers/model_controller.py b/api/app/controllers/model_controller.py index e5a1cec3..d76f0b1d 100644 --- a/api/app/controllers/model_controller.py +++ b/api/app/controllers/model_controller.py @@ -326,6 +326,8 @@ async def update_composite_model( api_logger.info(f"更新组合模型请求: model_id={model_id}, 用户: {current_user.username}") try: + if model_data.type is not None: + raise BusinessException("不允许更改模型类型和供应商", BizCode.INVALID_PARAMETER) result_orm = await ModelConfigService.update_composite_model(db=db, model_id=model_id, model_data=model_data, tenant_id=current_user.tenant_id) api_logger.info(f"组合模型更新成功: {result_orm.name} (ID: {model_id})") diff --git a/api/app/core/models/scripts/dashscope_models.yaml b/api/app/core/models/scripts/dashscope_models.yaml index 24997728..c02ca2cb 100644 --- a/api/app/core/models/scripts/dashscope_models.yaml +++ b/api/app/core/models/scripts/dashscope_models.yaml @@ -767,26 +767,6 @@ models: tags: - 重排序模型 logo: dashscope -- name: paraformer-realtime-v1 - type: speech2text - provider: dashscope - description: paraformer-realtime-v1语音转文字模型,支持多格式音频/视频文件,文件上传限制100MB - is_deprecated: false - is_official: true - tags: - - 语音识别 - - 语音转文字 - logo: dashscope -- name: paraformer-realtime-v2 - type: speech2text - provider: dashscope - description: paraformer-realtime-v2语音转文字模型,支持多格式音频/视频文件,文件上传限制100MB - is_deprecated: false - is_official: true - tags: - - 语音识别 - - 语音转文字 - logo: dashscope - name: multimodal-embedding-v1 type: embedding provider: dashscope @@ -838,13 +818,3 @@ models: - 嵌入模型 - 文本嵌入 logo: dashscope -- name: tts-1 - type: tts - provider: dashscope - description: tts-1语音合成模型,默认音色知茹(新闻女声),支持多语言多音色,最大文本长度7000字,输出MP3格式 - is_deprecated: false - is_official: true - tags: - - 语音合成 - - 文字转语音 - logo: dashscope diff --git a/api/app/core/models/scripts/openai_models.yaml b/api/app/core/models/scripts/openai_models.yaml index 7ae2cfce..c114d53f 100644 --- a/api/app/core/models/scripts/openai_models.yaml +++ b/api/app/core/models/scripts/openai_models.yaml @@ -265,33 +265,6 @@ models: - stream-tool-call - structured-output logo: openai -- name: gpt-4o-mini-transcribe - type: speech2text - provider: openai - description: gpt-4o-mini-transcribe语音转文本模型,文件上传限制25MB,支持flac,mp3,mp4,mpeg,mpga,m4a,ogg,wav,webm格式 - is_deprecated: false - is_official: true - tags: - - 语音转文本模型 - logo: openai -- name: gpt-4o-transcribe - type: speech2text - provider: openai - description: gpt-4o-transcribe语音转文本模型,文件上传限制25MB,支持flac,mp3,mp4,mpeg,mpga,m4a,ogg,wav,webm格式 - is_deprecated: false - is_official: true - tags: - - 语音转文本模型 - logo: openai -- name: whisper-1 - type: speech2text - provider: openai - description: whisper-1语音转文本模型,文件上传限制25MB,支持flac,mp3,mp4,mpeg,mpga,m4a,ogg,wav,webm格式 - is_deprecated: false - is_official: true - tags: - - 语音转文本模型 - logo: openai - name: text-embedding-3-large type: embedding provider: openai @@ -319,30 +292,3 @@ models: tags: - 文本向量模型 logo: openai -- name: gpt-4o-mini-tts - type: tts - provider: openai - description: gpt-4o-mini-tts文本转语音模型,输出音频格式mp3,支持多语种语音,字数限制3500 - is_deprecated: false - is_official: true - tags: - - 文本转语音模型 - logo: openai -- name: tts-1-hd - type: tts - provider: openai - description: tts-1-hd高清文本转语音模型,输出音频格式mp3,支持多语种语音,字数限制3500 - is_deprecated: false - is_official: true - tags: - - 文本转语音模型 - logo: openai -- name: tts-1 - type: tts - provider: openai - description: tts-1文本转语音模型,输出音频格式mp3,支持多语种语音,字数限制3500 - is_deprecated: false - is_official: true - tags: - - 文本转语音模型 - logo: openai diff --git a/api/app/models/models_model.py b/api/app/models/models_model.py index 11a869a6..3e378f17 100644 --- a/api/app/models/models_model.py +++ b/api/app/models/models_model.py @@ -24,8 +24,8 @@ class ModelType(StrEnum): CHAT = "chat" EMBEDDING = "embedding" RERANK = "rerank" - TTS = "tts" - SPEECH2TEXT = "speech2text" + # TTS = "tts" + # SPEECH2TEXT = "speech2text" # IMAGE = "image" # AUDIO = "audio" # VISION = "vision" diff --git a/api/app/schemas/model_schema.py b/api/app/schemas/model_schema.py index 73f60936..a2d3650a 100644 --- a/api/app/schemas/model_schema.py +++ b/api/app/schemas/model_schema.py @@ -43,7 +43,7 @@ class ModelConfigCreate(ModelConfigBase): class CompositeModelCreate(BaseModel): """创建组合模型Schema""" name: str = Field(..., description="组合模型名称", max_length=255) - type: ModelType = Field(..., description="模型类型") + type: Optional[ModelType] = Field(None, description="模型类型") logo: Optional[str] = Field(None, description="模型logo图片URL", max_length=255) description: Optional[str] = Field(None, description="模型描述") config: Optional[Dict[str, Any]] = Field({}, description="模型配置参数") diff --git a/api/app/services/model_service.py b/api/app/services/model_service.py index 729fc192..ceb9cd70 100644 --- a/api/app/services/model_service.py +++ b/api/app/services/model_service.py @@ -382,7 +382,7 @@ class ModelConfigService: for model_config in api_key.model_configs: compatible_types = {ModelType.LLM, ModelType.CHAT} config_type = model_config.type - request_type = model_data.type + request_type = existing_model.type if not (config_type == request_type or (config_type in compatible_types and request_type in compatible_types)): @@ -393,7 +393,7 @@ class ModelConfigService: # 更新基本信息 existing_model.name = model_data.name - existing_model.type = model_data.type + # existing_model.type = model_data.type existing_model.logo = model_data.logo existing_model.description = model_data.description existing_model.config = model_data.config