o
    i                     @  s   d Z ddlmZ ddlmZ ddlmZ ddlmZ ddl	m
Z
mZmZ eddd	Z	 ed
dd	Z	 eddd	Z	 G dd dee ZG dd dee ZeG dd deeef ZdS )zCore node types for graph construction and execution.

This module defines the fundamental node types used to build execution graphs,
including start/end nodes and fork nodes for parallel execution.
    )annotations)	dataclass)Generic)TypeVar)ForkIDJoinIDNodeIDStateTT)infer_varianceOutputTInputTc                   @  s   e Zd ZdZedZdS )	StartNodezqEntry point node for graph execution.

    The StartNode represents the beginning of a graph execution flow.
    	__start__N)__name__
__module____qualname____doc__r   id r   r   ^/var/www/html/karishye-ai-python/venv/lib/python3.10/site-packages/pydantic_graph/beta/node.pyr      s    r   c                   @  s$   e Zd ZdZedZ	 d
ddZd	S )EndNodezTerminal node representing the completion of graph execution.

    The EndNode marks the successful completion of a graph execution flow
    and can collect the final output data.
    __end__inputsr   returnNonec                 C     t d)a+  Force type variance for proper generic typing.

        This method exists solely for type checking purposes and should never be called.

        Args:
            inputs: Input data of type InputT.

        Raises:
            RuntimeError: Always, as this method should never be executed.
        KThis method should never be called, it is just defined for typing purposes.RuntimeErrorselfr   r   r   r   _force_variance.   s   zEndNode._force_varianceN)r   r   r   r   )r   r   r   r   r   r   r!   r   r   r   r   r   $   s
    r   c                   @  s:   e Zd ZU dZded< 	 ded< 	 ded< 	 dddZdS )Forka  Fork node that creates parallel execution branches.

    A Fork node splits the execution flow into multiple parallel branches,
    enabling concurrent execution of downstream nodes. It can either map
    a sequence across multiple branches or duplicate data to each branch.
    r   r   boolis_mapzJoinID | Nonedownstream_join_idr   r   r   r   c                 C  r   )as  Force type variance for proper generic typing.

        This method exists solely for type checking purposes and should never be called.

        Args:
            inputs: Input data to be forked.

        Returns:
            Output data type (never actually returned).

        Raises:
            RuntimeError: Always, as this method should never be executed.
        r   r   r   r   r   r   r!   Q   s   zFork._force_varianceN)r   r   r   r   )r   r   r   r   __annotations__r!   r   r   r   r   r"   <   s   
 r"   N)r   
__future__r   dataclassesr   typingr   typing_extensionsr   pydantic_graph.beta.id_typesr   r   r   r	   r   r   r   r   r"   r   r   r   r   <module>   s     
