Ë
    kQêj»!  ã                   óä   — d dl mZmZ d dlmZ d dlmZmZ d dlm	Z	 ddl
mZ ddlmZmZmZmZmZ g d¢Ze G d	„ d
«      «       Ze G d„ d«      «       Ze G d„ d«      «       Ze G d„ d«      «       Zy)é    )Ú	dataclassÚfield)Ú	timedelta)ÚListÚOptional)Ú__version__é   )ÚHeaderProvider)ÚClientAuthMethodÚOAuthConfigÚOAuthFlowTypeÚOAuthSessionÚTokenCacheOptions)
ÚTimeoutConfigÚRetryConfigÚ	TlsConfigÚClientConfigr
   r   r   r   r   r   c                   ó„   — e Zd ZU dZdZee   ed<   dZee   ed<   dZ	ee   ed<   dZ
ee   ed<   edee   fd„«       Zd	„ Zy)
r   a¶  Timeout configuration for remote HTTP client.

    Attributes
    ----------
    timeout: Optional[timedelta]
        The overall timeout for the entire request. This includes connection,
        send, and read time. If the entire request doesn't complete within
        this time, it will fail. Default is None (no overall timeout).
        This can also be set via the environment variable
        `LANCE_CLIENT_TIMEOUT`, as an integer number of seconds.
    connect_timeout: Optional[timedelta]
        The timeout for establishing a connection. Default is 120 seconds (2 minutes).
        This can also be set via the environment variable
        `LANCE_CLIENT_CONNECT_TIMEOUT`, as an integer number of seconds.
    read_timeout: Optional[timedelta]
        The timeout for reading data from the server. Default is 300 seconds
        (5 minutes). This also applies while waiting for response headers during
        an upload. Increase it for large or slowly produced inputs to
        `create_table`, even if data is still being uploaded. This can also be
        set via the environment variable
        `LANCE_CLIENT_READ_TIMEOUT`, as an integer number of seconds.
    pool_idle_timeout: Optional[timedelta]
        The timeout for keeping idle connections in the connection pool. Default
        is 300 seconds (5 minutes). This can also be set via the environment variable
        `LANCE_CLIENT_CONNECTION_TIMEOUT`, as an integer number of seconds.
    NÚtimeoutÚconnect_timeoutÚread_timeoutÚpool_idle_timeoutÚreturnc                 óŽ   — | €y t        | t        «      r| S t        | t        t        f«      rt        | ¬«      S t	        d| › d�«      ‚)N)ÚsecondszInvalid value for timeout: z*, must be a timedelta or number of seconds)Ú
isinstancer   ÚintÚfloatÚ
ValueError)Úvalues    ú\/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/lancedb/remote/__init__.pyÚ__to_timedeltazTimeoutConfig.__to_timedeltaG   sP   € àˆ=ØÜ˜œyÔ)ØˆLÜ˜¤¤U˜|Ô,Ü UÔ+Ð+äØ-¨e¨Wð 5'ð 'óð ó    c                 ó  — | j                  | j                  «      | _        | j                  | j                  «      | _        | j                  | j                  «      | _        | j                  | j                  «      | _        y )N)Ú_TimeoutConfig__to_timedeltar   r   r   r   ©Úselfs    r!   Ú__post_init__zTimeoutConfig.__post_init__U   sc   € Ø×*Ñ*¨4¯<©<Ó8ˆŒØ#×2Ñ2°4×3GÑ3GÓHˆÔØ ×/Ñ/°×0AÑ0AÓBˆÔØ!%×!4Ñ!4°T×5KÑ5KÓ!LˆÕr#   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   Ú__annotations__r   r   r   Ústaticmethodr%   r(   © r#   r!   r   r   %   sj   … ñð6 $(€GˆX�iÑ Ó'Ø+/€O�X˜iÑ(Ó/Ø(,€L�(˜9Ñ%Ó,Ø-1Ð�x 	Ñ*Ó1àð ¨)Ñ!4ò ó ðóMr#   r   c                   ó�   — e Zd ZU dZdZee   ed<   dZee   ed<   dZ	ee   ed<   dZ
ee   ed<   dZee   ed<   dZeee      ed<   y)	r   an  Retry configuration for the remote HTTP client.

    Attributes
    ----------
    retries: Optional[int]
        The maximum number of retries for a request. Default is 3. You can also set this
        via the environment variable `LANCE_CLIENT_MAX_RETRIES`.
    connect_retries: Optional[int]
        The maximum number of retries for connection errors. Default is 3. You can also
        set this via the environment variable `LANCE_CLIENT_CONNECT_RETRIES`.
    read_retries: Optional[int]
        The maximum number of retries for read errors. Default is 3. You can also set
        this via the environment variable `LANCE_CLIENT_READ_RETRIES`.
    backoff_factor: Optional[float]
        The backoff factor to apply between retries. Default is 0.25. Between each retry
        the client will wait for the amount of seconds:
        `{backoff factor} * (2 ** ({number of previous retries}))`. So for the default
        of 0.25, the first retry will wait 0.25 seconds, the second retry will wait 0.5
        seconds, the third retry will wait 1 second, etc.

        You can also set this via the environment variable
        `LANCE_CLIENT_RETRY_BACKOFF_FACTOR`.
    backoff_jitter: Optional[float]
        The jitter to apply to the backoff factor, in seconds. Default is 0.25.

        A random value between 0 and `backoff_jitter` will be added to the backoff
        factor in seconds. So for the default of 0.25 seconds, between 0 and 250
        milliseconds will be added to the sleep between each retry.

        You can also set this via the environment variable
        `LANCE_CLIENT_RETRY_BACKOFF_JITTER`.
    statuses: Optional[List[int]
        The HTTP status codes for which to retry the request. Default is
        [429, 500, 502, 503].

        You can also set this via the environment variable
        `LANCE_CLIENT_RETRY_STATUSES`. Use a comma-separated list of integers.
    NÚretriesÚconnect_retriesÚread_retriesÚbackoff_factorÚbackoff_jitterÚstatuses)r)   r*   r+   r,   r1   r   r   r-   r2   r3   r4   r   r5   r6   r   r/   r#   r!   r   r   \   sc   … ñ%ðN "€GˆX�c‰]Ó!Ø%)€O�X˜c‘]Ó)Ø"&€L�(˜3‘-Ó&Ø&*€N�H˜U‘OÓ*Ø&*€N�H˜U‘OÓ*Ø$(€Hˆh�t˜C‘yÑ!Ô(r#   r   c                   ó\   — e Zd ZU dZdZee   ed<   dZee   ed<   dZ	ee   ed<   dZ
eed<   y)r   aY  TLS/mTLS configuration for the remote HTTP client.

    Attributes
    ----------
    cert_file: Optional[str]
        Path to the client certificate file (PEM format) for mTLS authentication.
    key_file: Optional[str]
        Path to the client private key file (PEM format) for mTLS authentication.
    ssl_ca_cert: Optional[str]
        Path to the CA certificate file (PEM format) for server verification.
    assert_hostname: bool
        Whether to verify the hostname in the server's certificate. Default is True.
        Set to False to disable hostname verification (use with caution).
    NÚ	cert_fileÚkey_fileÚssl_ca_certTÚassert_hostname)r)   r*   r+   r,   r8   r   Ústrr-   r9   r:   r;   Úboolr/   r#   r!   r   r   �   s=   … ñð  $€Iˆx˜‰}Ó#Ø"€Hˆh�s‰mÓ"Ø!%€K�˜#‘Ó%Ø €O�TÔ r#   r   c                   óâ   — e Zd ZU dZde› �Zeed<    ee	¬«      Z
e	ed<    ee¬«      Zee   ed<   dZee   ed<   dZee   ed	<   dZee   ed
<   dZee   ed<   dZed   ed<   dZee   ed<   d„ Zy)r   aà  Configuration for the LanceDB Cloud HTTP client.

    Attributes
    ----------
    user_agent: str
        User agent string sent with requests.
    retry_config: RetryConfig
        Configuration for retrying failed requests.
    timeout_config: Optional[TimeoutConfig]
        Configuration for request timeouts.
    blob_request_concurrency: Optional[int]
        Maximum concurrent blob HTTP requests across all handles on this
        connection. Defaults to 8. Set a positive integer here or via
        `LANCE_CLIENT_BLOB_REQUEST_CONCURRENCY`.
    extra_headers: Optional[dict]
        Additional headers to include in requests.
    id_delimiter: Optional[str]
        The delimiter joining a namespace path and a name into one object
        identifier. ``"$"`` is the only supported value, and leaving this
        unset is how to get it; anything else is rejected when the connection
        is created.
    tls_config: Optional[TlsConfig]
        TLS/mTLS configuration for secure connections.
    header_provider: Optional[HeaderProvider]
        Provider for dynamic headers to be added to each request.
    user_id: Optional[str]
        User identifier for tracking purposes. This is sent as the
        `x-lancedb-user-id` header in requests to LanceDB Cloud/Enterprise.

        This can also be set via the `LANCEDB_USER_ID` environment variable.
        Alternatively, set `LANCEDB_USER_ID_ENV_KEY` to specify another
        environment variable that contains the user ID value.
    zLanceDB-Python-Client/Ú
user_agent)Údefault_factoryÚretry_configÚtimeout_configNÚblob_request_concurrencyÚextra_headersÚid_delimiterÚ
tls_configr
   Úheader_providerÚuser_idc                 ó>  — t        | j                  t        «      rt        di | j                  ¤Ž| _        t        | j                  t        «      rt        di | j                  ¤Ž| _        t        | j                  t        «      rt        di | j                  ¤Ž| _        y y )Nr/   )r   rA   Údictr   rB   r   rF   r   r&   s    r!   r(   zClientConfig.__post_init__Ò   st   € Ü�d×'Ñ'¬Ô.Ü +Ñ @¨d×.?Ñ.?Ñ @ˆDÔÜ�d×)Ñ)¬4Ô0Ü"/Ñ"F°$×2EÑ2EÑ"FˆDÔÜ�d—o‘o¤tÔ,Ü'Ñ:¨$¯/©/Ñ:ˆD�Oð -r#   )r)   r*   r+   r,   r   r?   r<   r-   r   r   rA   r   rB   r   rC   r   rD   rJ   rE   rF   r   rG   rH   r(   r/   r#   r!   r   r   ¤   s›   … ñ ðD /¨{¨mÐ<€J�Ó<Ù %°kÔ B€L�+ÓBÙ.3ÀMÔ.R€N�H˜]Ñ+ÓRØ.2Ð˜h s™mÓ2Ø$(€M�8˜D‘>Ó(Ø"&€L�(˜3‘-Ó&Ø&*€J�˜Ñ#Ó*Ø26€O�XÐ.Ñ/Ó6Ø!€GˆX�c‰]Ó!ó;r#   r   N)Údataclassesr   r   Údatetimer   Útypingr   r   Úlancedbr   Úheaderr
   Úoauthr   r   r   r   r   Ú__all__r   r   r   r   r/   r#   r!   ú<module>rR      s�   ð÷
 )Ý ß !å å "÷õ ò€ð ÷3Mð 3Mó ð3Mðl ÷-)ð -)ó ð-)ð` ÷!ð !ó ð!ð, ÷3;ð 3;ó ñ3;r#   