
    g3fiW                        d Z ddlmZ ddlmZmZmZ ddlmZm	Z	 erddl
mZ  G d de	d	      Z G d
 de	      Z G d de      Z G d de      Zeez  Zy)z?Module contains typedefs that are used with `Runnable` objects.    )annotations)TYPE_CHECKINGAnyLiteral)NotRequired	TypedDict)Sequencec                  @    e Zd ZU dZded<   	 ded<   	 ded<   	 ded<   y)		EventDataz'Data associated with a streaming event.r   inputzNotRequired[BaseException]erroroutputchunkN__name__
__module____qualname____doc____annotations__     ]/var/www/auto_recruiter/arenv/lib/python3.12/site-packages/langchain_core/runnables/schema.pyr   r      s4    1J &% K Jr   r   F)totalc                  L    e Zd ZU dZded<   	 ded<   	 ded<   	 ded<   	 d	ed
<   y)BaseStreamEventa  Streaming event.

    Schema of a streaming event which is produced from the `astream_events` method.

    Example:
        ```python
        from langchain_core.runnables import RunnableLambda


        async def reverse(s: str) -> str:
            return s[::-1]


        chain = RunnableLambda(func=reverse)

        events = [event async for event in chain.astream_events("hello")]

        # Will produce the following events
        # (where some fields have been omitted for brevity):
        [
            {
                "data": {"input": "hello"},
                "event": "on_chain_start",
                "metadata": {},
                "name": "reverse",
                "tags": [],
            },
            {
                "data": {"chunk": "olleh"},
                "event": "on_chain_stream",
                "metadata": {},
                "name": "reverse",
                "tags": [],
            },
            {
                "data": {"output": "olleh"},
                "event": "on_chain_end",
                "metadata": {},
                "name": "reverse",
                "tags": [],
            },
        ]
        ```
    streventrun_idzNotRequired[list[str]]tagszNotRequired[dict[str, Any]]metadatazSequence[str]
parent_idsNr   r   r   r   r   r   2   sG    +Z J* K
 !  *)	 
r   r   c                  (    e Zd ZU dZded<   	 ded<   y)StandardStreamEventzIA standard stream event that follows LangChain convention for event data.r   datar   nameNr   r   r   r   r#   r#      s    S
O I>r   r#   c                  4    e Zd ZU dZded<   	 ded<   	 ded<   y)	CustomStreamEventz(Custom stream event created by the user.zLiteral['on_custom_event']r   r   r%   r   r$   Nr   r   r   r   r'   r'      s     2 &%
I*
ILr   r'   N)r   
__future__r   typingr   r   r   typing_extensionsr   r   collections.abcr	   r   r   r#   r'   StreamEventr   r   r   <module>r-      s_    E " . . 4("	 "Jii iX	?/ 	?	M 	M "$55r   