ó
    ýÞ jÐr  ã                  ó¼   • S r SSKJr  SSKrSSKJrJrJr  SSKJ	r	J
r
Jr  SSKJr  SSKJr  SSKJr  SS	KJrJrJrJrJrJrJrJrJrJrJrJrJrJ r    " S
 S5      r!g)z/Async client for managing threads in LangGraph.é    )ÚannotationsN)ÚAsyncIteratorÚMappingÚSequence)ÚAnyÚLiteralÚoverload)Ú
HttpClient)ÚAsyncThreadStream)Ú_quote_path_param)Ú
CheckpointÚJsonÚOnConflictBehaviorÚPruneStrategyÚQueryParamTypesÚ	SortOrderÚ
StreamPartÚThreadÚThreadSelectFieldÚThreadSortByÚThreadStateÚThreadStatusÚThreadStreamModeÚThreadUpdateStateResponsec                  ón  • \ rS rSrSrS)S jrSSSS.         S*S jjrSSSSSSSSS.                 S+S jjr\SS	SSS
.             S,S jj5       r	\SSSS.             S-S jj5       r	\SSSS.             S.S jj5       r	SS	SSS
.             S.S jjr	SSS.       S/S jjr
SSSSSSSSSSSSS.                         S0S jjrSSSSSS.           S1S jjrSSS.       S/S jjrSSSS.         S2S jjr  S3S	SSS.             S4S jjjrSSSSSS.               S5S jjrSSSSSSS .               S6S! jjr S7SSS"S#.           S8S$ jjjrSS%SSS&.           S9S' jjrS(rg):ÚThreadsClienté   a©  Client for managing threads in LangGraph.

A thread maintains the state of a graph across multiple interactions/invocations (aka runs).
It accumulates and persists the graph's state, allowing for continuity between separate
invocations of the graph.

???+ example "Example"

    ```python
    client = get_client(url="http://localhost:2024"))
    new_thread = await client.threads.create(metadata={"user_id": "123"})
    ```
c                ó   • Xl         g ©N©Úhttp)Úselfr!   s     ÚV/var/www/html/gaurav/venv/lib/python3.13/site-packages/langgraph_sdk/_async/threads.pyÚ__init__ÚThreadsClient.__init__-   s   € Ø�	ó    N)ÚincludeÚheadersÚparamsc             ƒ  óè   #   • 0 nU(       a  SR                  U5      US'   U(       a  UR                  U5        U R                  R                  S[	        U5       3UU=(       d    SS9I Sh  v•N $  N7f)a2  Get a thread by ID.

Args:
    thread_id: The ID of the thread to get.
    include: Additional fields to include in the response.
        Supported values: `"ttl"`.
    headers: Optional custom headers to include with the request.
    params: Optional query parameters to include with the request.

Returns:
    Thread object.

???+ example "Example Usage"

    ```python
    client = get_client(url="http://localhost:2024")
    thread = await client.threads.get(
        thread_id="my_thread_id"
    )
    print(thread)
    ```

    ```shell
    -----------------------------------------------------

    {
        'thread_id': 'my_thread_id',
        'created_at': '2024-07-18T18:35:15.540834+00:00',
        'updated_at': '2024-07-18T18:35:15.540834+00:00',
        'metadata': {'graph_id': 'agent'}
    }
    ```

Ú,r'   ú	/threads/N©r(   r)   )ÚjoinÚupdater!   Úgetr   )r"   Ú	thread_idr'   r(   r)   Úquery_paramss         r#   r0   ÚThreadsClient.get0   st   é € ðT (*ˆÞØ&)§h¡h¨wÓ&7ˆL˜Ñ#ÞØ×Ñ Ô'Ø—Y‘Y—]‘]ØÔ)¨)Ó4Ð5Ð6ØØ×' 4ð #ð 
÷ 
ð 	
ñ 
ùs   ‚A)A2Á+A0Á,A2)Úmetadatar1   Ú	if_existsÚ
superstepsÚgraph_idÚttlr(   r)   c             ƒ  óÞ  #   • 0 n	U(       a  X)S'   U(       d  U(       a  0 U=(       d    0 EU(       a  SU0O0 EU	S'   U(       a  X9S'   U(       aE  U V
Vs/ sH3  n
SU
S    Vs/ sH  nUS   UR                  S5      US   S	.PM      sn0PM5     snn
U	S
'   Ub(  [        U[        [        45      (       a	  USS.U	S'   OXiS'   U R                  R                  SX—US9I Sh  v•N $ s  snf s  snn
f  N7f)a¾  Create a new thread.

Args:
    metadata: Metadata to add to thread.
    thread_id: ID of thread.
        If `None`, ID will be a randomly generated UUID.
    if_exists: How to handle duplicate creation. Defaults to 'raise' under the hood.
        Must be either 'raise' (raise error if duplicate), or 'do_nothing' (return existing thread).
    supersteps: Apply a list of supersteps when creating a thread, each containing a sequence of updates.
        Each update has `values` or `command` and `as_node`. Used for copying a thread between deployments.
    graph_id: Optional graph ID to associate with the thread.
    ttl: Optional time-to-live in minutes for the thread. You can pass an
        integer (minutes) or a mapping with keys `ttl` and optional
        `strategy` (defaults to "delete").
    headers: Optional custom headers to include with the request.
    params: Optional query parameters to include with the request.

Returns:
    The created thread.

???+ example "Example Usage"

    ```python
    client = get_client(url="http://localhost:2024")
    thread = await client.threads.create(
        metadata={"number":1},
        thread_id="my-thread-id",
        if_exists="raise"
    )
    ```
r1   r7   r4   r5   ÚupdatesÚvaluesÚcommandÚas_node)r;   r<   r=   r6   NÚdelete©r8   Ústrategyr8   z/threads©Újsonr(   r)   )r0   Ú
isinstanceÚintÚfloatr!   Úpost)r"   r4   r1   r5   r6   r7   r8   r(   r)   ÚpayloadÚsÚus               r#   ÚcreateÚThreadsClient.createe   s&  é € ðV #%ˆÞØ#,�KÑ Þ–xð#Ø—>˜rð#æ-5�J Ñ)¸2ð#ˆG�JÑö Ø#,�KÑ Þñ $ô%ñ $�Að ð "# 9¢ó ñ ".˜Að	 '(¨¡kØ'(§u¡u¨YÓ'7Ø'(¨¡|ôñ
 ".ñ ó	ñ $ò%ˆG�LÑ!ð ‰?Ü˜#¤¤U˜|×,Ñ,Ø),¸(Ñ!C�˜’à!$˜‘à—Y‘Y—^‘^Ø˜W¸fð $ð 
÷ 
ð 	
ùò# ùó%ñ&
ùs7   ‚AC-ÁC%Á$C ÂC%ÂAC-ÃC+ÃC-Ã C%Ã%C-F)r8   Úreturn_minimalr(   r)   c             ƒ  ó   #   • g 7fr   © ©r"   r1   r4   r8   rL   r(   r)   s          r#   r/   ÚThreadsClient.update²   s
   é € ð ùó   ‚)r8   r(   r)   c             ƒ  ó   #   • g 7fr   rN   rO   s          r#   r/   rP   ¾   s
   é € ð ùrQ   c             ƒ  ó   #   • g 7fr   rN   rO   s          r#   r/   rP   Ê   s
   é € ð ùrQ   c             ƒ  ó  #   • SU0nUb(  [        U[        [        45      (       a	  USS.US'   OX7S'   [        U=(       d    0 5      nU(       a  SUS'   U R                  R                  S[        U5       3UU=(       d    SUS	9I Sh  v•N $  N7f)
a7  Update a thread.

Args:
    thread_id: ID of thread to update.
    metadata: Metadata to merge with existing thread metadata.
    ttl: Optional time-to-live in minutes for the thread. You can pass an
        integer (minutes) or a mapping with keys `ttl` and optional
        `strategy` (defaults to "delete").
    return_minimal: If `True`, request a 204 response with no body.
    headers: Optional custom headers to include with the request.
    params: Optional query parameters to include with the request.

Returns:
    The updated thread, or `None` when `return_minimal=True`.

???+ example "Example Usage"

    ```python
    client = get_client(url="http://localhost:2024")
    thread = await client.threads.update(
        thread_id="my-thread-id",
        metadata={"number":1},
        ttl=43_200,
    )
    ```
r4   Nr>   r?   r8   zreturn=minimalÚPreferr,   rA   )rC   rD   rE   Údictr!   Úpatchr   )	r"   r1   r4   r8   rL   r(   r)   rG   Úrequest_headerss	            r#   r/   rP   Ö   s›   é € ðH $.¨xÐ"8ˆØ‰?Ü˜#¤¤U˜|×,Ñ,Ø),¸(Ñ!C�˜’à!$˜‘Ü˜wŸ}¨"Ó-ˆÞØ(8ˆO˜HÑ%Ø—Y‘Y—_‘_ØÔ)¨)Ó4Ð5Ð6ØØ#×+ tØð	 %ð 
÷ 
ð 	
ñ 
ùs   ‚BBÂBÂBr-   c             ƒ  ól   #   • U R                   R                  S[        U5       3X#S9I Sh  v•N   g N7f)a’  Delete a thread.

Args:
    thread_id: The ID of the thread to delete.
    headers: Optional custom headers to include with the request.
    params: Optional query parameters to include with the request.

Returns:
    `None`

???+ example "Example Usage"

    ```python
    client = get_client(url="http://localhost2024)
    await client.threads.delete(
        thread_id="my_thread_id"
    )
    ```

r,   r-   N)r!   r>   r   ©r"   r1   r(   r)   s       r#   r>   ÚThreadsClient.delete
  s;   é € ð6 �i‰i×ÑØÔ)¨)Ó4Ð5Ð6Àð ð 
÷ 	
ó 	
ùs   ‚*4¬2­4é
   r   )r4   r;   ÚidsÚstatusÚlimitÚoffsetÚsort_byÚ
sort_orderÚselectÚextractr(   r)   c             ƒ  ó  #   • UUS.nU(       a  XS'   U(       a  X-S'   U(       a  X=S'   U(       a  XMS'   U(       a  X}S'   U(       a  X�S'   U	(       a  X�S'   U
(       a  X­S	'   U R                   R                  S
UUUS9I Sh  v•N $  N7f)aû  Search for threads.

Args:
    metadata: Thread metadata to filter on.
    values: State values to filter on.
    ids: List of thread IDs to filter by.
    status: Thread status to filter on.
        Must be one of 'idle', 'busy', 'interrupted' or 'error'.
    limit: Limit on number of threads to return.
    offset: Offset in threads table to start search from.
    sort_by: Sort by field.
    sort_order: Sort order.
    select: List of fields to include in the response.
    extract: Dictionary mapping aliases to JSONB paths to extract
        from thread data. Paths use dot notation for nested keys and
        bracket notation for array indices (e.g.,
        `{"last_msg": "values.messages[-1]"}`). Extracted values are
        returned in an `extracted` field on each thread. Maximum 10
        paths per request.
    headers: Optional custom headers to include with the request.
    params: Optional query parameters to include with the request.

Returns:
    List of the threads matching the search parameters.

???+ example "Example Usage"

    ```python
    client = get_client(url="http://localhost:2024")
    threads = await client.threads.search(
        metadata={"number":1},
        status="interrupted",
        limit=15,
        offset=5
    )
    ```

)r_   r`   r4   r;   r]   r^   ra   rb   rc   rd   z/threads/searchrA   N©r!   rF   )r"   r4   r;   r]   r^   r_   r`   ra   rb   rc   rd   r(   r)   rG   s                 r#   ÚsearchÚThreadsClient.search)  sž   é € ðn Øñ#
ˆö Ø"*�JÑÞØ &�HÑÞØ �E‰NÞØ &�HÑÞØ!(�IÑÞØ$.�LÑ!ÞØ &�HÑÞØ!(�IÑØ—Y‘Y—^‘^ØØØØð	 $ð 
÷ 
ð 	
ñ 
ùs   ‚A=BÁ?BÂ B)r4   r;   r^   r(   r)   c             ƒ  óš   #   • 0 nU(       a  XS'   U(       a  X&S'   U(       a  X6S'   U R                   R                  SXdUS9I Sh  v•N $  N7f)ac  Count threads matching filters.

Args:
    metadata: Thread metadata to filter on.
    values: State values to filter on.
    status: Thread status to filter on.
    headers: Optional custom headers to include with the request.
    params: Optional query parameters to include with the request.

Returns:
    int: Number of threads matching the criteria.
r4   r;   r^   z/threads/countrA   Nrf   )r"   r4   r;   r^   r(   r)   rG   s          r#   ÚcountÚThreadsClient.countz  sX   é € ð* #%ˆÞØ"*�JÑÞØ &�HÑÞØ &�HÑØ—Y‘Y—^‘^Ø 7ÀFð $ð 
÷ 
ð 	
ñ 
ùs   ‚AAÁA	ÁAc             ƒ  óp   #   • U R                   R                  S[        U5       S3SUUS9I Sh  v•N $  N7f)a�  Copy a thread.

Args:
    thread_id: The ID of the thread to copy.
    headers: Optional custom headers to include with the request.
    params: Optional query parameters to include with the request.

Returns:
    `None`

???+ example "Example Usage"

    ```python
    client = get_client(url="http://localhost:2024)
    await client.threads.copy(
        thread_id="my_thread_id"
    )
    ```

r,   z/copyNrA   ©r!   rF   r   rZ   s       r#   ÚcopyÚThreadsClient.copyš  sG   é € ð6 —Y‘Y—^‘^ØÔ)¨)Ó4Ð5°UÐ;ØØØð	 $ð 
÷ 
ð 	
ñ 
ùó   ‚-6¯4°6r>   )r@   r(   r)   c             ƒ  óp   #   • SU0nUS:w  a  X%S'   U R                   R                  SXSUS9I Sh  v•N $  N7f)aÉ  Prune threads by ID.

Args:
    thread_ids: List of thread IDs to prune.
    strategy: The prune strategy. `"delete"` removes threads entirely.
        `"keep_latest"` prunes old checkpoints but keeps threads and their
        latest state. Defaults to `"delete"`.
    headers: Optional custom headers to include with the request.
    params: Optional query parameters to include with the request.

Returns:
    A dict containing `pruned_count` (number of threads pruned).

???+ example "Example Usage"

    ```python
    client = get_client(url="http://localhost:2024")
    result = await client.threads.prune(
        thread_ids=["thread_1", "thread_2"],
    )
    print(result)  # {'pruned_count': 2}
    ```

Ú
thread_idsr>   r@   z/threads/prunerA   Nrf   )r"   rr   r@   r(   r)   rG   s         r#   ÚpruneÚThreadsClient.prune¼  sQ   é € ðB ˜*ð#
ˆð �xÓØ"*�JÑØ—Y‘Y—^‘^Ø 7ÀFð $ð 
÷ 
ð 	
ñ 
ùrp   )Ú	subgraphsr(   r)   c             ƒ  óÖ  #   • U(       a3  U R                   R                  S[        U5       S3X$S.UUS9I Sh  v•N $ U(       aU  SU0nU(       a  0 UE[        U5      EnU R                   R	                  S[        U5       S[        U5       3UUS9I Sh  v•N $ SU0nU(       a  0 UE[        U5      EnU R                   R	                  S[        U5       S	3UUS9I Sh  v•N $  Nª NP N7f)
a  Get the state of a thread.

Args:
    thread_id: The ID of the thread to get the state of.
    checkpoint: The checkpoint to get the state of.
    checkpoint_id: (deprecated) The checkpoint ID to get the state of.
    subgraphs: Include subgraphs states.
    headers: Optional custom headers to include with the request.
    params: Optional query parameters to include with the request.

Returns:
    The thread of the state.

???+ example "Example Usage"

    ```python
    client = get_client(url="http://localhost:2024)
    thread_state = await client.threads.get_state(
        thread_id="my_thread_id",
        checkpoint_id="my_checkpoint_id"
    )
    print(thread_state)
    ```

    ```shell
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------

    {
        'values': {
            'messages': [
                {
                    'content': 'how are you?',
                    'additional_kwargs': {},
                    'response_metadata': {},
                    'type': 'human',
                    'name': None,
                    'id': 'fe0a5778-cfe9-42ee-b807-0adaa1873c10',
                    'example': False
                },
                {
                    'content': "I'm doing well, thanks for asking! I'm an AI assistant created by Anthropic to be helpful, honest, and harmless.",
                    'additional_kwargs': {},
                    'response_metadata': {},
                    'type': 'ai',
                    'name': None,
                    'id': 'run-159b782c-b679-4830-83c6-cef87798fe8b',
                    'example': False,
                    'tool_calls': [],
                    'invalid_tool_calls': [],
                    'usage_metadata': None
                }
            ]
        },
        'next': [],
        'checkpoint':
            {
                'thread_id': 'e2496803-ecd5-4e0c-a779-3226296181c2',
                'checkpoint_ns': '',
                'checkpoint_id': '1ef4a9b8-e6fb-67b1-8001-abd5184439d1'
            }
        'metadata':
            {
                'step': 1,
                'run_id': '1ef4a9b8-d7da-679a-a45a-872054341df2',
                'source': 'loop',
                'writes':
                    {
                        'agent':
                            {
                                'messages': [
                                    {
                                        'id': 'run-159b782c-b679-4830-83c6-cef87798fe8b',
                                        'name': None,
                                        'type': 'ai',
                                        'content': "I'm doing well, thanks for asking! I'm an AI assistant created by Anthropic to be helpful, honest, and harmless.",
                                        'example': False,
                                        'tool_calls': [],
                                        'usage_metadata': None,
                                        'additional_kwargs': {},
                                        'response_metadata': {},
                                        'invalid_tool_calls': []
                                    }
                                ]
                            }
                    },
        'user_id': None,
        'graph_id': 'agent',
        'thread_id': 'e2496803-ecd5-4e0c-a779-3226296181c2',
        'created_by': 'system',
        'assistant_id': 'fe096781-5601-53d2-b2f6-0d3403f7e9ca'},
        'created_at': '2024-07-25T15:35:44.184703+00:00',
        'parent_config':
            {
                'thread_id': 'e2496803-ecd5-4e0c-a779-3226296181c2',
                'checkpoint_ns': '',
                'checkpoint_id': '1ef4a9b8-d80d-6fa7-8000-9300467fad0f'
            }
    }
    ```
r,   z/state/checkpoint)Ú
checkpointru   rA   Nru   z/state/)r)   r(   ú/state)r!   rF   r   rV   r0   )r"   r1   rw   Úcheckpoint_idru   r(   r)   Ú
get_paramss           r#   Ú	get_stateÚThreadsClient.get_stateå  s  é € ö\ ØŸ™Ÿ™ØÔ-¨iÓ8Ð9Ð9JÐKØ$.ÑGØØð	 (ð ÷ ð ö Ø% yÐ1ˆJÞØ; 
Ð;¬d°6«lÐ;�
ØŸ™Ÿ™ØÔ-¨iÓ8Ð9¸ÔARÐS`ÓAaÐ@bÐcØ!Øð 'ð ÷ ð ð & yÐ1ˆJÞØ; 
Ð;¬d°6«lÐ;�
ØŸ™Ÿ™ØÔ-¨iÓ8Ð9¸Ð@Ø!Øð 'ð ÷ ð ñ'ññùs5   ‚6C)¸C#¹AC)ÂC%ÂA	C)ÃC'ÃC)Ã%C)Ã'C))r=   rw   ry   r(   r)   c             ƒ  óº   #   • SU0nU(       a  XXS'   U(       a  XHS'   U(       a  X8S'   U R                   R                  S[        U5       S3UUUS9I Sh  v•N $  N7f)	aó  Update the state of a thread.

Args:
    thread_id: The ID of the thread to update.
    values: The values to update the state with.
    as_node: Update the state as if this node had just executed.
    checkpoint: The checkpoint to update the state of.
    checkpoint_id: (deprecated) The checkpoint ID to update the state of.
    headers: Optional custom headers to include with the request.
    params: Optional query parameters to include with the request.

Returns:
    Response after updating a thread's state.

???+ example "Example Usage"

    ```python
    client = get_client(url="http://localhost:2024)
    response = await client.threads.update_state(
        thread_id="my_thread_id",
        values={"messages":[{"role": "user", "content": "hello!"}]},
        as_node="my_node",
    )
    print(response)
    ```
    ```shell

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------

    {
        'checkpoint': {
            'thread_id': 'e2496803-ecd5-4e0c-a779-3226296181c2',
            'checkpoint_ns': '',
            'checkpoint_id': '1ef4a9b8-e6fb-67b1-8001-abd5184439d1',
            'checkpoint_map': {}
        }
    }
    ```
r;   ry   rw   r=   r,   rx   rA   Nrm   )	r"   r1   r;   r=   rw   ry   r(   r)   rG   s	            r#   Úupdate_stateÚThreadsClient.update_statem  sw   é € ðf �fð#
ˆö Ø'4�OÑ$ÞØ$.�LÑ!ÞØ!(�IÑØ—Y‘Y—^‘^ØÔ)¨)Ó4Ð5°VÐ<ØØØð	 $ð 
÷ 
ð 	
ñ 
ùó   ‚AAÁAÁA)r_   Úbeforer4   rw   r(   r)   c             ƒ  óº   #   • SU0nU(       a  X8S'   U(       a  XHS'   U(       a  XXS'   U R                   R                  S[        U5       S3UUUS9I Sh  v•N $  N7f)	aâ  Get the state history of a thread.

Args:
    thread_id: The ID of the thread to get the state history for.
    checkpoint: Return states for this subgraph. If empty defaults to root.
    limit: The maximum number of states to return.
    before: Return states before this checkpoint.
    metadata: Filter states by metadata key-value pairs.
    headers: Optional custom headers to include with the request.
    params: Optional query parameters to include with the request.

Returns:
    The state history of the thread.

???+ example "Example Usage"

    ```python
    client = get_client(url="http://localhost:2024)
    thread_state = await client.threads.get_history(
        thread_id="my_thread_id",
        limit=5,
    )
    ```

r_   r�   r4   rw   r,   z/historyrA   Nrm   )	r"   r1   r_   r�   r4   rw   r(   r)   rG   s	            r#   Úget_historyÚThreadsClient.get_history¯  sw   é € ðJ �Uð#
ˆö Ø &�HÑÞØ"*�JÑÞØ$.�LÑ!Ø—Y‘Y—^‘^ØÔ)¨)Ó4Ð5°XÐ>ØØØð	 $ð 
÷ 
ð 	
ñ 
ùr€   Ússe)r(   Úrun_start_timeoutÚ	transportc          
     óœ   • US;  a  [        S5      e[        U R                  Ub  UO[        [        R
                  " 5       5      UUUUSLUS9$ )u  Open a v3 thread-centric streaming session.

When `thread_id` is None, a fresh UUIDv4 is minted client-side and
included in the URL of subsequent `POST /threads/{thread_id}/...`
calls. The server creates the thread row lazily on the first
`run.start` (internal server detail â€” the SDK does not send any
`if_not_exists` flag). The v3 protocol response carries only
`run_id`, never `thread_id` â€” that's why the SDK mints the id
client-side.

Args:
    thread_id: optional explicit thread identifier. Defaults to a
        fresh UUIDv4.
    assistant_id: assistant the run will use. Required.
    headers: optional headers forwarded on every command and event
        request for this stream session.
    run_start_timeout: optional seconds to wait for an in-flight
        `run.start` before subscribing operations raise
        `asyncio.TimeoutError`. Defaults to `None` (wait forever).
    transport: event transport to use â€” `"sse"` (default) or
        `"websocket"`.

Returns:
    An `AsyncThreadStream` to use as an async context manager.
)r…   Ú	websocketz'transport must be 'sse' or 'websocket'.N)r!   r1   Úassistant_idr(   r†   Úexplicit_thread_idÚtransport_kind)Ú
ValueErrorr   r!   ÚstrÚuuidÚuuid4)r"   r1   rŠ   r(   r†   r‡   s         r#   ÚstreamÚThreadsClient.streamã  sW   € ðD Ð0Ó0ÜÐFÓGÐGÜ Ø—‘Ø#,Ñ#8‘i¼cÄ$Ç*Â*Ã,Ó>OØ%ØØ/Ø(°Ð4Ø$ñ
ð 	
r&   Ú	run_modes)Úlast_event_idÚstream_moder(   r)   c             ƒ  óÄ   #   • SU0nU(       a  UR                  U5        U R                  R                  S[        U5       S3S0 U(       a  SU0O0 EU=(       d    0 EUS9$ 7f)a  Get a stream of events for a thread.

Args:
    thread_id: The ID of the thread to get the stream for.
    last_event_id: The ID of the last event to get.
    headers: Optional custom headers to include with the request.
    params: Optional query parameters to include with the request.

Returns:
    An iterator of stream parts.

???+ example "Example Usage"

    ```python

    for chunk in client.threads.join_stream(
        thread_id="my_thread_id",
        last_event_id="my_event_id",
    ):
        print(chunk)
    ```

r•   r,   z/streamÚGETzLast-Event-IDr-   )r/   r!   r‘   r   )r"   r1   r”   r•   r(   r)   r2   s          r#   Újoin_streamÚThreadsClient.join_stream  s€   é € ðB ˜;ð
ˆö Ø×Ñ Ô'Ø�y‰y×ÑØÔ)¨)Ó4Ð5°WÐ=ØðÞ7D�O ]Ñ3È"ðà—=˜bðð  ð  ð 
ð 	
ùs   ‚AA r    )r!   r
   ÚreturnÚNone)
r1   rŽ   r'   úSequence[str] | Noner(   úMapping[str, str] | Noner)   úQueryParamTypes | Nonerš   r   )r4   r   r1   ú
str | Noner5   zOnConflictBehavior | Noner6   z4Sequence[dict[str, Sequence[dict[str, Any]]]] | Noner7   rŸ   r8   úint | Mapping[str, Any] | Noner(   r�   r)   rž   rš   r   )r1   rŽ   r4   úMapping[str, Any]r8   r    rL   zLiteral[False]r(   r�   r)   rž   rš   r   )r1   rŽ   r4   r¡   r8   r    rL   zLiteral[True]r(   r�   r)   rž   rš   r›   )r1   rŽ   r4   r¡   r8   r    rL   Úboolr(   r�   r)   rž   rš   zThread | None)r1   rŽ   r(   r�   r)   rž   rš   r›   )r4   r   r;   r   r]   rœ   r^   úThreadStatus | Noner_   rD   r`   rD   ra   zThreadSortBy | Nonerb   zSortOrder | Nonerc   zlist[ThreadSelectField] | Nonerd   zdict[str, str] | Noner(   r�   r)   rž   rš   zlist[Thread])r4   r   r;   r   r^   r£   r(   r�   r)   rž   rš   rD   )
rr   zSequence[str]r@   r   r(   r�   r)   rž   rš   zdict[str, Any])NN)r1   rŽ   rw   úCheckpoint | Nonery   rŸ   ru   r¢   r(   r�   r)   rž   rš   r   )r1   rŽ   r;   z&dict[str, Any] | Sequence[dict] | Noner=   rŸ   rw   r¤   ry   rŸ   r(   r�   r)   rž   rš   r   )r1   rŽ   r_   rD   r�   zstr | Checkpoint | Noner4   zMapping[str, Any] | Nonerw   r¤   r(   r�   r)   rž   rš   zlist[ThreadState]r   )r1   rŸ   rŠ   rŽ   r(   r�   r†   zfloat | Noner‡   zLiteral['sse', 'websocket']rš   r   )r1   rŽ   r”   rŸ   r•   z-ThreadStreamMode | Sequence[ThreadStreamMode]r(   r�   r)   rž   rš   zAsyncIterator[StreamPart])Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r$   r0   rJ   r	   r/   r>   rg   rj   rn   rs   r{   r~   rƒ   r‘   r˜   Ú__static_attributes__rN   r&   r#   r   r      s÷  † ñôð )-Ø,0Ø)-ñ3
àð3
ð &ð	3
ð
 *ð3
ð 'ð3
ð 
õ3
ðp Ø $Ø/3ØKOØ#Ø.2Ø,0Ø)-ñK
ð ðK
ð ð	K
ð
 -ðK
ð IðK
ð ðK
ð ,ðK
ð *ðK
ð 'ðK
ð 
õK
ðZ ð /3Ø).Ø,0Ø)-ñ	àð	ð $ð		ð
 ,ð	ð 'ð	ð *ð	ð 'ð	ð 
ô	ó ð	ð ð /3à,0Ø)-ñ	àð	ð $ð		ð
 ,ð	ð &ð	ð *ð	ð 'ð	ð 
ô	ó ð	ð ð /3à,0Ø)-ñ	àð	ð $ð		ð
 ,ð	ð ð	ð *ð	ð 'ð	ð 
ô	ó ð	ð  /3Ø$Ø,0Ø)-ñ2
àð2
ð $ð	2
ð
 ,ð2
ð ð2
ð *ð2
ð 'ð2
ð 
õ2
ðp -1Ø)-ñ
àð
ð *ð	
ð
 'ð
ð 
õ
ðD ØØ$(Ø&*ØØØ'+Ø'+Ø15Ø)-Ø,0Ø)-ñO
ð ðO
ð ð	O
ð
 "ðO
ð $ðO
ð ðO
ð ðO
ð %ðO
ð %ðO
ð /ðO
ð 'ðO
ð *ðO
ð 'ðO
ð 
õO
ðh ØØ&*Ø,0Ø)-ñ
ð ð
ð ð	
ð
 $ð
ð *ð
ð 'ð
ð 
õ
ðH -1Ø)-ñ 
àð 
ð *ð	 
ð
 'ð 
ð 
õ 
ðL #+Ø,0Ø)-ñ'
à!ð'
ð  ð	'
ð
 *ð'
ð 'ð'
ð 
õ'
ðX )-Ø$(ð	Fð  Ø,0Ø)-ñFàðFð &ðFð "ð	Fð ðFð *ðFð 'ðFð 
öFðZ #Ø(,Ø$(Ø,0Ø)-ñ@
àð@
ð 7ð@
ð
 ð@
ð &ð@
ð "ð@
ð *ð@
ð 'ð@
ð 
#õ@
ðL Ø*.Ø-1Ø(,Ø,0Ø)-ñ2
àð2
ð ð	2
ð
 (ð2
ð +ð2
ð &ð2
ð *ð2
ð 'ð2
ð 
õ2
ðl !%ð,
ð
 -1Ø*.Ø16ñ,
àð,
ð ð	,
ð
 *ð,
ð (ð,
ð /ð,
ð 
ö,
ðd %)ØEPØ,0Ø)-ñ-
àð-
ð "ð	-
ð
 Cð-
ð *ð-
ð 'ð-
ð 
#÷-
ð -
r&   r   )"r©   Ú
__future__r   r�   Úcollections.abcr   r   r   Útypingr   r   r	   Úlanggraph_sdk._async.httpr
   Úlanggraph_sdk._async.streamr   Úlanggraph_sdk._shared.utilitiesr   Úlanggraph_sdk.schemar   r   r   r   r   r   r   r   r   r   r   r   r   r   r   rN   r&   r#   Ú<module>r²      sC   ðÙ 5å "ã ß <Ñ <ß )Ñ )å 0Ý 9Ý =÷÷ ÷ ÷ ÷$`
ò `
r&   