fix(workflow): properly throw exception when LLM node model ID is not configured

This commit is contained in:
Eternity
2026-02-09 10:50:16 +08:00
parent bca03f1365
commit 03bc8c8280
2 changed files with 6 additions and 14 deletions

View File

@@ -68,12 +68,13 @@ class LLMNode(BaseNode):
- ai/assistant: AI 消息AIMessage
"""
def _output_types(self) -> dict[str, VariableType]:
return {"output": VariableType.STRING}
def __init__(self, node_config: dict[str, Any], workflow_config: dict[str, Any]):
super().__init__(node_config, workflow_config)
self.typed_config: LLMNodeConfig | None = None
self.messages = []
def _output_types(self) -> dict[str, VariableType]:
return {"output": VariableType.STRING}
def _render_context(self, message: str, variable_pool: VariablePool):
context = f"<context>{self._render_template(self.typed_config.context, variable_pool)}</context>"