mirror of
https://github.com/langgenius/dify.git
synced 2026-04-05 16:50:39 +08:00
refactor(api): rename dify_graph to graphon (#34095)
This commit is contained in:
@@ -7,7 +7,7 @@ from pydantic import BaseModel, Field
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
from core.workflow.human_input_compat import DeliveryMethodType
|
||||
from dify_graph.nodes.human_input.enums import HumanInputFormKind, HumanInputFormStatus
|
||||
from graphon.nodes.human_input.enums import HumanInputFormKind, HumanInputFormStatus
|
||||
from libs.helper import generate_string
|
||||
|
||||
from .base import Base, DefaultFieldsMixin
|
||||
|
||||
@@ -21,10 +21,10 @@ from typing_extensions import TypedDict
|
||||
from configs import dify_config
|
||||
from constants import DEFAULT_FILE_NUMBER_LIMITS
|
||||
from core.tools.signature import sign_tool_file
|
||||
from dify_graph.enums import WorkflowExecutionStatus
|
||||
from dify_graph.file import FILE_MODEL_IDENTITY, File, FileTransferMethod, FileType
|
||||
from dify_graph.file import helpers as file_helpers
|
||||
from extensions.storage.storage_type import StorageType
|
||||
from graphon.enums import WorkflowExecutionStatus
|
||||
from graphon.file import FILE_MODEL_IDENTITY, File, FileTransferMethod, FileType
|
||||
from graphon.file import helpers as file_helpers
|
||||
from libs.helper import generate_string # type: ignore[import-not-found]
|
||||
from libs.uuid_utils import uuidv7
|
||||
from models.utils.file_input_compat import build_file_from_input_mapping
|
||||
@@ -1088,7 +1088,7 @@ class Conversation(Base):
|
||||
# Compatibility bridge: stored input payloads may come from before or after the
|
||||
# graph-layer file refactor. Newer rows may omit `tenant_id`, so keep tenant
|
||||
# resolution at the SQLAlchemy model boundary instead of pushing ownership back
|
||||
# into `dify_graph.file.File`.
|
||||
# into `graphon.file.File`.
|
||||
tenant_resolver = _build_app_tenant_resolver(
|
||||
app_id=self.app_id,
|
||||
owner_tenant_id=cast(str | None, getattr(self, "_owner_tenant_id", None)),
|
||||
|
||||
@@ -5,7 +5,7 @@ from functools import lru_cache
|
||||
from typing import Any
|
||||
|
||||
from core.workflow.file_reference import parse_file_reference
|
||||
from dify_graph.file import File, FileTransferMethod
|
||||
from graphon.file import File, FileTransferMethod
|
||||
|
||||
|
||||
@lru_cache(maxsize=1)
|
||||
@@ -98,7 +98,7 @@ def build_file_from_input_mapping(
|
||||
This compatibility layer exists because model JSON rows can outlive file payload
|
||||
schema changes. Legacy rows may carry `related_id` and `tenant_id`, while newer
|
||||
rows may only carry `reference`. Keep ownership resolution here, at the model
|
||||
boundary, instead of pushing tenant data back into `dify_graph.file.File`.
|
||||
boundary, instead of pushing tenant data back into `graphon.file.File`.
|
||||
"""
|
||||
|
||||
transfer_method = FileTransferMethod.value_of(file_mapping["transfer_method"])
|
||||
|
||||
@@ -29,15 +29,15 @@ from core.workflow.variable_prefixes import (
|
||||
CONVERSATION_VARIABLE_NODE_ID,
|
||||
SYSTEM_VARIABLE_NODE_ID,
|
||||
)
|
||||
from dify_graph.entities.graph_config import NodeConfigDict, NodeConfigDictAdapter
|
||||
from dify_graph.entities.pause_reason import HumanInputRequired, PauseReason, PauseReasonType, SchedulingPause
|
||||
from dify_graph.enums import BuiltinNodeTypes, NodeType, WorkflowExecutionStatus, WorkflowNodeExecutionMetadataKey
|
||||
from dify_graph.file.constants import maybe_file_object
|
||||
from dify_graph.file.models import File
|
||||
from dify_graph.variables import utils as variable_utils
|
||||
from dify_graph.variables.variables import FloatVariable, IntegerVariable, RAGPipelineVariable, StringVariable
|
||||
from extensions.ext_storage import Storage
|
||||
from factories.variable_factory import TypeMismatchError, build_segment_with_type
|
||||
from graphon.entities.graph_config import NodeConfigDict, NodeConfigDictAdapter
|
||||
from graphon.entities.pause_reason import HumanInputRequired, PauseReason, PauseReasonType, SchedulingPause
|
||||
from graphon.enums import BuiltinNodeTypes, NodeType, WorkflowExecutionStatus, WorkflowNodeExecutionMetadataKey
|
||||
from graphon.file.constants import maybe_file_object
|
||||
from graphon.file.models import File
|
||||
from graphon.variables import utils as variable_utils
|
||||
from graphon.variables.variables import FloatVariable, IntegerVariable, RAGPipelineVariable, StringVariable
|
||||
from libs.datetime_utils import naive_utc_now
|
||||
from libs.uuid_utils import uuidv7
|
||||
|
||||
@@ -49,8 +49,8 @@ if TYPE_CHECKING:
|
||||
|
||||
from constants import DEFAULT_FILE_NUMBER_LIMITS, HIDDEN_VALUE
|
||||
from core.helper import encrypter
|
||||
from dify_graph.variables import SecretVariable, Segment, SegmentType, VariableBase
|
||||
from factories import variable_factory
|
||||
from graphon.variables import SecretVariable, Segment, SegmentType, VariableBase
|
||||
from libs import helper
|
||||
|
||||
from .account import Account
|
||||
@@ -429,7 +429,7 @@ class Workflow(Base): # bug
|
||||
"selected": false,
|
||||
}
|
||||
|
||||
For specific node type, refer to `dify_graph.nodes`
|
||||
For specific node type, refer to `graphon.nodes`
|
||||
"""
|
||||
graph_dict = self.graph_dict
|
||||
if "nodes" not in graph_dict:
|
||||
@@ -1461,7 +1461,7 @@ class WorkflowDraftVariable(Base):
|
||||
# From `VARIABLE_PATTERN`, we may conclude that the length of a top level variable is less than
|
||||
# 80 chars.
|
||||
#
|
||||
# ref: api/dify_graph/entities/variable_pool.py:18
|
||||
# ref: api/graphon/entities/variable_pool.py:18
|
||||
name: Mapped[str] = mapped_column(sa.String(255), nullable=False)
|
||||
description: Mapped[str] = mapped_column(
|
||||
sa.String(255),
|
||||
|
||||
Reference in New Issue
Block a user