diff --git a/api/core/plugin/impl/model_runtime.py b/api/core/plugin/impl/model_runtime.py index 7d0f7fd5ba..51df79b7ea 100644 --- a/api/core/plugin/impl/model_runtime.py +++ b/api/core/plugin/impl/model_runtime.py @@ -298,6 +298,8 @@ class PluginModelRuntime(ModelRuntime): 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 def get_llm_num_tokens( diff --git a/api/services/workflow_draft_variable_service.py b/api/services/workflow_draft_variable_service.py index fa0b6fa3fa..aed3819f18 100644 --- a/api/services/workflow_draft_variable_service.py +++ b/api/services/workflow_draft_variable_service.py @@ -5,7 +5,7 @@ from collections.abc import Mapping, Sequence from concurrent.futures import ThreadPoolExecutor from datetime import datetime from enum import StrEnum -from typing import Any, ClassVar, NotRequired, TypedDict, cast +from typing import Any, ClassVar, NotRequired, TypedDict from sqlalchemy import Engine, delete, orm, select from sqlalchemy.dialects.mysql import insert as mysql_insert @@ -32,7 +32,7 @@ from graphon.file import File from graphon.nodes import BuiltinNodeTypes from graphon.nodes.variable_assigner.common.helpers import get_updated_variables from graphon.variable_loader import VariableLoader -from graphon.variables import Segment, StringSegment, VariableBase +from graphon.variables import Segment, StringSegment, Variable, VariableBase from graphon.variables.consts import SELECTORS_LENGTH from graphon.variables.segments import ( ArrayFileSegment, @@ -162,7 +162,7 @@ class DraftVarLoader(VariableLoader): return list(variable_by_selector.values()) - def _load_offloaded_variable(self, draft_var: WorkflowDraftVariable) -> tuple[tuple[str, str], VariableBase]: + def _load_offloaded_variable(self, draft_var: WorkflowDraftVariable) -> tuple[tuple[str, str], Variable]: # This logic is closely tied to `WorkflowDraftVaribleService._try_offload_large_variable` # and must remain synchronized with it. # Ideally, these should be co-located for better maintainability.