
    dh                        S SK Jr  S SKJrJr  S SKJr  S SKJr  S SK	J
r
   " S S\5      r " S S	\5      r " S
 S\5      rg)    )annotations)ListUnion)Document)Serializable)Fieldc                  H    \ rS rSr% SrS\S'   S rS\S'   \" \S9r	S\S	'   S
r
g)Node
   a  Represents a node in a graph with associated properties.

Attributes:
    id (Union[str, int]): A unique identifier for the node.
    type (str): The type or label of the node, default is "Node".
    properties (dict): Additional properties and metadata associated with the node.
zUnion[str, int]idstrtypedefault_factorydict
properties N)__name__
__module____qualname____firstlineno____doc____annotations__r   r   r   r   __static_attributes__r       a/var/www/html/shao/venv/lib/python3.13/site-packages/langchain_community/graphs/graph_document.pyr
   r
   
   s(     	D#T2J2r   r
   c                  N    \ rS rSr% SrS\S'   S\S'   S\S'   \" \S9rS	\S
'   Sr	g)Relationship   a;  Represents a directed relationship between two nodes in a graph.

Attributes:
    source (Node): The source node of the relationship.
    target (Node): The target node of the relationship.
    type (str): The type of the relationship.
    properties (dict): Additional properties associated with the relationship.
r
   sourcetargetr   r   r   r   r   r   N)
r   r   r   r   r   r   r   r   r   r   r   r   r   r   r      s'     LL
IT2J2r   r   c                  8    \ rS rSr% SrS\S'   S\S'   S\S'   S	rg
)GraphDocument(   a%  Represents a graph document consisting of nodes and relationships.

Attributes:
    nodes (List[Node]): A list of nodes in the graph.
    relationships (List[Relationship]): A list of relationships in the graph.
    source (Document): The document from which the graph information is derived.
z
List[Node]nodeszList[Relationship]relationshipsr   r    r   N)r   r   r   r   r   r   r   r   r   r   r#   r#   (   s     %%r   r#   N)
__future__r   typingr   r   langchain_core.documentsr    langchain_core.load.serializabler   pydanticr   r
   r   r#   r   r   r   <module>r,      s8    "  - 9 3< 33< 3 L r   