mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: 修复模型被删除时,节点报错提示 (#701)
This commit is contained in:
parent
327b0190d0
commit
28fb1db715
|
|
@ -126,6 +126,8 @@ class BaseChatNode(IChatNode):
|
|||
def execute(self, model_id, system, prompt, dialogue_number, history_chat_record, stream, chat_id, chat_record_id,
|
||||
**kwargs) -> NodeResult:
|
||||
model = QuerySet(Model).filter(id=model_id).first()
|
||||
if model is None:
|
||||
raise Exception("模型不存在")
|
||||
chat_model = ModelProvideConstants[model.provider].value.get_model(model.model_type, model.model_name,
|
||||
json.loads(
|
||||
rsa_long_decrypt(model.credential)),
|
||||
|
|
|
|||
|
|
@ -126,6 +126,8 @@ class BaseQuestionNode(IQuestionNode):
|
|||
def execute(self, model_id, system, prompt, dialogue_number, history_chat_record, stream, chat_id, chat_record_id,
|
||||
**kwargs) -> NodeResult:
|
||||
model = QuerySet(Model).filter(id=model_id).first()
|
||||
if model is None:
|
||||
raise Exception("模型不存在")
|
||||
chat_model = ModelProvideConstants[model.provider].value.get_model(model.model_type, model.model_name,
|
||||
json.loads(
|
||||
rsa_long_decrypt(model.credential)),
|
||||
|
|
|
|||
Loading…
Reference in New Issue