
    =Kir                        S r SSKJr  SSKJr  SSKJr  SSKr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KJr  SSKJr  SSKJr  S\SSS.         SS jjr " S S5      rg)zSync LangGraph client.    )annotations)Mapping)TracebackTypeN)TimeoutTypes)NOT_PROVIDED_get_headers)SyncAssistantsClient)SyncCronClient)SyncHttpClient)SyncRunsClient)SyncStoreClient)SyncThreadsClient)urlapi_keyheaderstimeoutSyncLangGraphClientc                    U c  Sn [         R                  " SS9n[         R                  " U UUb  [         R                  " U5      O[         R                  " SSSSS9[	        X5      S9n[        U5      $ )a  Get a synchronous LangGraphClient instance.

Args:
    url: The URL of the LangGraph API.
    api_key: API key for authentication. Can be:
        - A string: use this exact API key
        - `None`: explicitly skip loading from environment variables
        - Not provided (default): auto-load from environment in this order:
            1. `LANGGRAPH_API_KEY`
            2. `LANGSMITH_API_KEY`
            3. `LANGCHAIN_API_KEY`
    headers: Optional custom headers
    timeout: Optional timeout configuration for the HTTP client.
        Accepts an httpx.Timeout instance, a float (seconds), or a tuple of timeouts.
        Tuple format is (connect, read, write, pool)
        If not provided, defaults to connect=5s, read=300s, write=300s, and pool=5s.
Returns:
    SyncLangGraphClient: The top-level synchronous client for accessing AssistantsClient,
    ThreadsClient, RunsClient, and CronClient.

???+ example "Example"

    ```python
    from langgraph_sdk import get_sync_client

    # get top-level synchronous LangGraphClient
    client = get_sync_client(url="http://localhost:8123")

    # example usage: client.<model>.<method_name>()
    assistant = client.assistants.get(assistant_id="some_uuid")
    ```

???+ example "Skip auto-loading API key from environment:"

    ```python
    from langgraph_sdk import get_sync_client

    # Don't load API key from environment variables
    client = get_sync_client(
        url="http://localhost:8123",
        api_key=None
    )
    ```
zhttp://localhost:8123   )retriesi,  )connectreadwritepool)base_url	transportr   r   )httpxHTTPTransportClientTimeoutr   r   )r   r   r   r   r   clients         \/var/www/html/dynamic-report/venv/lib/python3.13/site-packages/langgraph_sdk/_sync/client.pyget_sync_clientr#      sp    h {%##A.I\\ " MM'"qs#AFW.	F v&&    c                  P    \ rS rSrSrS	S jrS
S jr        SS jrSS jrSr	g)r   Y   a^  Synchronous client for interacting with the LangGraph API.

This class provides synchronous access to LangGraph API endpoints for managing
assistants, threads, runs, cron jobs, and data storage.

???+ example "Example"

    ```python
    client = get_sync_client(url="http://localhost:2024")
    assistant = client.assistants.get("asst_123")
    ```
c                (   [        U5      U l        [        U R                  5      U l        [	        U R                  5      U l        [        U R                  5      U l        [        U R                  5      U l	        [        U R                  5      U l        g )N)r   httpr	   
assistantsr   threadsr   runsr
   cronsr   store)selfr!   s     r"   __init__SyncLangGraphClient.__init__g   s^    "6*	.tyy9(3"499-	#DII.
$TYY/
r$   c                    U $ )zEnter the sync context manager. r.   s    r"   	__enter__SyncLangGraphClient.__enter__o   s    r$   c                $    U R                  5         g)zExit the sync context manager.N)close)r.   exc_typeexc_valexc_tbs       r"   __exit__SyncLangGraphClient.__exit__s   s     	

r$   c                p    [        U S5      (       a%  U R                  R                  R                  5         gg)z!Close the underlying HTTP client.r(   N)hasattrr(   r!   r7   r3   s    r"   r7   SyncLangGraphClient.close|   s*    4  II""$ !r$   )r)   r,   r(   r+   r-   r*   N)r!   zhttpx.ClientreturnNone)r@   r   )r8   ztype[BaseException] | Noner9   zBaseException | Noner:   zTracebackType | Noner@   rA   )r@   rA   )
__name__
__module____qualname____firstlineno____doc__r/   r4   r;   r7   __static_attributes__r2   r$   r"   r   r   Y   sA    0, & %	
 
%r$   )
r   
str | Noner   rH   r   zMapping[str, str] | Noner   zTimeoutTypes | Noner@   r   )rF   
__future__r   collections.abcr   typesr   r   langgraph_sdk._shared.typesr   langgraph_sdk._shared.utilitiesr   r   langgraph_sdk._sync.assistantsr	   langgraph_sdk._sync.cronr
   langgraph_sdk._sync.httpr   langgraph_sdk._sync.runsr   langgraph_sdk._sync.storer   langgraph_sdk._sync.threadsr   r#   r   r2   r$   r"   <module>rT      s     " #   4 F ? 3 3 3 5 9
 &(,#'B'	B' B' &	B'
 !B' B'J&% &%r$   