Skip to content

Commit 28fb1db

Browse files
authored
fix: 修复模型被删除时,节点报错提示 (#701)
1 parent 327b019 commit 28fb1db

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

apps/application/flow/step_node/ai_chat_step_node/impl/base_chat_node.py

+2
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ class BaseChatNode(IChatNode):
126126
def execute(self, model_id, system, prompt, dialogue_number, history_chat_record, stream, chat_id, chat_record_id,
127127
**kwargs) -> NodeResult:
128128
model = QuerySet(Model).filter(id=model_id).first()
129+
if model is None:
130+
raise Exception("模型不存在")
129131
chat_model = ModelProvideConstants[model.provider].value.get_model(model.model_type, model.model_name,
130132
json.loads(
131133
rsa_long_decrypt(model.credential)),

apps/application/flow/step_node/question_node/impl/base_question_node.py

+2
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ class BaseQuestionNode(IQuestionNode):
126126
def execute(self, model_id, system, prompt, dialogue_number, history_chat_record, stream, chat_id, chat_record_id,
127127
**kwargs) -> NodeResult:
128128
model = QuerySet(Model).filter(id=model_id).first()
129+
if model is None:
130+
raise Exception("模型不存在")
129131
chat_model = ModelProvideConstants[model.provider].value.get_model(model.model_type, model.model_name,
130132
json.loads(
131133
rsa_long_decrypt(model.credential)),

0 commit comments

Comments
 (0)