fix(知识服务): 修复创建知识库时未检查视觉模型存在的错误
当租户下没有可用的视觉模型时,抛出明确异常提示
This commit is contained in:
@@ -122,7 +122,8 @@ def create_knowledge(
|
|||||||
ModelConfig.is_active == True,
|
ModelConfig.is_active == True,
|
||||||
ModelConfig.is_composite == False
|
ModelConfig.is_composite == False
|
||||||
).order_by(ModelConfig.created_at.desc()).first()
|
).order_by(ModelConfig.created_at.desc()).first()
|
||||||
if model:
|
if not model:
|
||||||
|
raise Exception("租户下没有可用的视觉模型,创建知识库失败")
|
||||||
knowledge.image2text_id = model.id
|
knowledge.image2text_id = model.id
|
||||||
business_logger.debug(f"Auto-bind image2text model: {model.id}")
|
business_logger.debug(f"Auto-bind image2text model: {model.id}")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user