mirror of
https://github.com/langgenius/dify.git
synced 2026-05-05 01:48:04 +08:00
fix: mypy issues
This commit is contained in:
@ -84,6 +84,8 @@ class LargeLanguageModel(AIModel):
|
||||
callbacks=callbacks,
|
||||
)
|
||||
|
||||
result: Union[LLMResult, Generator[LLMResultChunk, None, None]]
|
||||
|
||||
try:
|
||||
plugin_model_manager = PluginModelManager()
|
||||
result = plugin_model_manager.invoke_llm(
|
||||
|
||||
@ -285,17 +285,17 @@ class ModelProviderFactory:
|
||||
}
|
||||
|
||||
if model_type == ModelType.LLM:
|
||||
return LargeLanguageModel(**init_params)
|
||||
return LargeLanguageModel(**init_params) # type: ignore
|
||||
elif model_type == ModelType.TEXT_EMBEDDING:
|
||||
return TextEmbeddingModel(**init_params)
|
||||
return TextEmbeddingModel(**init_params) # type: ignore
|
||||
elif model_type == ModelType.RERANK:
|
||||
return RerankModel(**init_params)
|
||||
return RerankModel(**init_params) # type: ignore
|
||||
elif model_type == ModelType.SPEECH2TEXT:
|
||||
return Speech2TextModel(**init_params)
|
||||
return Speech2TextModel(**init_params) # type: ignore
|
||||
elif model_type == ModelType.MODERATION:
|
||||
return ModerationModel(**init_params)
|
||||
return ModerationModel(**init_params) # type: ignore
|
||||
elif model_type == ModelType.TTS:
|
||||
return TTSModel(**init_params)
|
||||
return TTSModel(**init_params) # type: ignore
|
||||
|
||||
def get_provider_icon(self, provider: str, icon_type: str, lang: str) -> tuple[bytes, str]:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user