mirror of
https://github.com/langgenius/dify.git
synced 2026-03-27 20:00:35 -04:00
24 lines
587 B
Python
24 lines
587 B
Python
from __future__ import annotations
|
|
|
|
import sys
|
|
|
|
from pydantic import TypeAdapter, with_config
|
|
|
|
from graphon.entities.base_node_data import BaseNodeData
|
|
|
|
if sys.version_info >= (3, 12):
|
|
from typing import TypedDict
|
|
else:
|
|
from typing_extensions import TypedDict
|
|
|
|
|
|
@with_config(extra="allow")
|
|
class NodeConfigDict(TypedDict):
|
|
id: str
|
|
# This is the permissive raw graph boundary. Node factories re-validate `data`
|
|
# with the concrete `NodeData` subtype after resolving the node implementation.
|
|
data: BaseNodeData
|
|
|
|
|
|
NodeConfigDictAdapter = TypeAdapter(NodeConfigDict)
|