diff --git a/api/core/app/workflow/layers/llm_quota.py b/api/core/app/workflow/layers/llm_quota.py index cf5a43eac2..be46fbab08 100644 --- a/api/core/app/workflow/layers/llm_quota.py +++ b/api/core/app/workflow/layers/llm_quota.py @@ -118,7 +118,7 @@ class LLMQuotaLayer(GraphEngineLayer): model_instance = cast("ParameterExtractorNode", node).model_instance case BuiltinNodeTypes.QUESTION_CLASSIFIER: typed_node: QuestionClassifierNode = cast("QuestionClassifierNode", node) - model_instance = cast(PreparedLLMProtocol, getattr(typed_node, "_model_instance")) + model_instance = cast(PreparedLLMProtocol, typed_node._model_instance) case _: return None except AttributeError: diff --git a/api/core/plugin/impl/model_runtime.py b/api/core/plugin/impl/model_runtime.py index 51df79b7ea..52c8eece61 100644 --- a/api/core/plugin/impl/model_runtime.py +++ b/api/core/plugin/impl/model_runtime.py @@ -254,7 +254,7 @@ class PluginModelRuntime(ModelRuntime): stop=list(stop) if stop else None, stream=stream, ) - + @overload def invoke_llm_with_structured_output( self, @@ -294,10 +294,7 @@ class PluginModelRuntime(ModelRuntime): prompt_messages: Sequence[PromptMessage], stop: Sequence[str] | None, stream: bool, - ) -> ( - LLMResultWithStructuredOutput - | Generator[LLMResultChunkWithStructuredOutput, None, None] - ): + ) -> LLMResultWithStructuredOutput | Generator[LLMResultChunkWithStructuredOutput, None, None]: # TODO: added to pass type check. # it is a new method from upstream that is not invoked at all. raise NotImplementedError