§
    «˜ºhà  ã                   ó  — d dl mZ d dlmZ d dlmZ d dlmZmZmZm	Z	 d dl
mZ d dlmZ d dlmZ  G d„ d	ee¦  «        Ze G d
„ d¦  «        ¦   «         Ze G d„ d¦  «        ¦   «         Ze G d„ d¦  «        ¦   «         ZdS )é    )Ú	dataclass)Údatetime)ÚEnum)ÚAnyÚDictÚListÚOptional)Ú	constants)ÚSpaceHardware)Úparse_datetimec                   ó&   — e Zd ZdZdZdZdZdZdZdS )ÚJobStagea  
    Enumeration of possible stage of a Job on the Hub.

    Value can be compared to a string:
    ```py
    assert JobStage.COMPLETED == "COMPLETED"
    ```

    Taken from https://github.com/huggingface/moon-landing/blob/main/server/job_types/JobInfo.ts#L61 (private url).
    Ú	COMPLETEDÚCANCELEDÚERRORÚDELETEDÚRUNNINGN)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   © ó    úa/var/www/html/services/rag-service/venv/lib/python3.11/site-packages/huggingface_hub/_jobs_api.pyr   r      s3   € € € € € ð	ð 	ð €IØ€HØ€EØ€GØ€G€G€Gr   r   c                   ó0   — e Zd ZU eed<   ee         ed<   dS )Ú	JobStatusÚstageÚmessageN)r   r   r   r   Ú__annotations__r	   Ústrr   r   r   r   r   -   s+   € € € € € € à€O€O�OØ�cŒ]ÐÐÑÐÐr   r   c                   ó.   — e Zd ZU eed<   eed<   eed<   dS )ÚJobOwnerÚidÚnameÚtypeN)r   r   r   r    r   r   r   r   r"   r"   3   s+   € € € € € € à€G€G�GØ
€I€I�IØ
€I€I�I€I€Ir   r"   c                   ó6  — e Zd ZU dZeed<   ee         ed<   ee         ed<   ee         ed<   eee                  ed<   eee                  ed<   ee	ee
f                  ed<   ee	ee
f                  ed	<   ee         ed
<   eed<   eed<   eed<   eed<   dd„ZdS )ÚJobInfoa'	  
    Contains information about a Job.

    Args:
        id (`str`):
            Job ID.
        created_at (`datetime` or `None`):
            When the Job was created.
        docker_image (`str` or `None`):
            The Docker image from Docker Hub used for the Job.
            Can be None if space_id is present instead.
        space_id (`str` or `None`):
            The Docker image from Hugging Face Spaces used for the Job.
            Can be None if docker_image is present instead.
        command (`List[str]` or `None`):
            Command of the Job, e.g. `["python", "-c", "print('hello world')"]`
        arguments (`List[str]` or `None`):
            Arguments passed to the command
        environment (`Dict[str]` or `None`):
            Environment variables of the Job as a dictionary.
        secrets (`Dict[str]` or `None`):
            Secret environment variables of the Job (encrypted).
        flavor (`str` or `None`):
            Flavor for the hardware, as in Hugging Face Spaces. See [`SpaceHardware`] for possible values.
            E.g. `"cpu-basic"`.
        status: (`JobStatus` or `None`):
            Status of the Job, e.g. `JobStatus(stage="RUNNING", message=None)`
            See [`JobStage`] for possible stage values.
        status: (`JobOwner` or `None`):
            Owner of the Job, e.g. `JobOwner(id="5e9ecfc04957053f60648a3e", name="lhoestq", type="user")`

    Example:

    ```python
    >>> from huggingface_hub import run_job
    >>> job = run_job(
    ...     image="python:3.12",
    ...     command=["python", "-c", "print('Hello from the cloud!')"]
    ... )
    >>> job
    JobInfo(id='687fb701029421ae5549d998', created_at=datetime.datetime(2025, 7, 22, 16, 6, 25, 79000, tzinfo=datetime.timezone.utc), docker_image='python:3.12', space_id=None, command=['python', '-c', "print('Hello from the cloud!')"], arguments=[], environment={}, secrets={}, flavor='cpu-basic', status=JobStatus(stage='RUNNING', message=None), owner=JobOwner(id='5e9ecfc04957053f60648a3e', name='lhoestq', type='user'), endpoint='https://huggingface.co', url='https://huggingface.co/jobs/lhoestq/687fb701029421ae5549d998')
    >>> job.id
    '687fb701029421ae5549d998'
    >>> job.url
    'https://huggingface.co/jobs/lhoestq/687fb701029421ae5549d998'
    >>> job.status.stage
    'RUNNING'
    ```
    r#   Ú
created_atÚdocker_imageÚspace_idÚcommandÚ	argumentsÚenvironmentÚsecretsÚflavorÚstatusÚownerÚendpointÚurlÚreturnNc                 óü  — |d         | _         |                     d¦  «        p|                     d¦  «        }|rt          |¦  «        nd | _        |                     d¦  «        p|                     d¦  «        | _        |                     d¦  «        p|                     d¦  «        | _        |                     di ¦  «        }t          |d         |d	         |d
         ¬¦  «        | _        |                     d¦  «        | _        |                     d¦  «        | _	        |                     d¦  «        | _
        |                     d¦  «        | _        |                     d¦  «        | _        |                     di ¦  «        }t          |d         |                     d¦  «        ¬¦  «        | _        |                     dt          j        ¦  «        | _        | j        › d| j        j        › d| j         › �| _        d S )Nr#   Ú	createdAtr(   ÚdockerImager)   ÚspaceIdr*   r1   r$   r%   )r#   r$   r%   r+   r,   r-   r.   r/   r0   r   r   )r   r   r2   z/jobs/ú/)r#   Úgetr   r(   r)   r*   r"   r1   r+   r,   r-   r.   r/   r   r0   r
   ÚENDPOINTr2   r$   r3   )ÚselfÚkwargsr(   r1   r0   s        r   Ú__init__zJobInfo.__init__~   s   € Ø˜”,ˆŒØ—Z’Z Ñ,Ô,ÐH°·
²
¸<Ñ0HÔ0Hˆ
Ø8BÐL�.¨Ñ4Ô4Ð4ÈˆŒØ"ŸJšJ }Ñ5Ô5ÐS¸¿ºÀNÑ9SÔ9SˆÔØŸ
š
 9Ñ-Ô-ÐG°·²¸JÑ1GÔ1GˆŒØ—
’
˜7 BÑ'Ô'ˆÝ  t¤°5¸´=ÀuÈVÄ}ÐUÑUÔUˆŒ
Ø—z’z )Ñ,Ô,ˆŒØŸš KÑ0Ô0ˆŒØ!Ÿ:š: mÑ4Ô4ˆÔØ—z’z )Ñ,Ô,ˆŒØ—j’j Ñ*Ô*ˆŒØ—’˜H bÑ)Ô)ˆÝ f¨W¤o¸v¿zºzÈ)Ñ?TÔ?TÐUÑUÔUˆŒð Ÿ
š
 :­yÔ/AÑBÔBˆŒØ”mÐFÐF¨4¬:¬?ÐFÐF¸T¼WÐFÐFˆŒˆˆr   )r4   N)r   r   r   r   r    r   r	   r   r   r   r   r   r   r"   r>   r   r   r   r'   r'   :   s  € € € € € € ð0ð 0ðd 	€G€G�GØ˜Ô"Ð"Ð"Ñ"Ø˜3”-ÐÐÑØ�sŒmÐÐÑØ�d˜3”iÔ Ð Ð Ñ Ø˜˜Sœ	Ô"Ð"Ð"Ñ"Ø˜$˜s C˜xœ.Ô)Ð)Ð)Ñ)Ø�d˜3 ˜8”nÔ%Ð%Ð%Ñ%Ø�]Ô#Ð#Ð#Ñ#ØÐÐÑØ€O€O�Oð €M€M�MØ	€H€H�HðGð Gð Gð Gð Gð Gr   r'   N)Údataclassesr   r   Úenumr   Útypingr   r   r   r	   Úhuggingface_hubr
   Úhuggingface_hub._space_apir   Úhuggingface_hub.utils._datetimer   r    r   r   r"   r'   r   r   r   ú<module>rE      s}  ðð "Ð !Ð !Ð !Ð !Ð !Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,à %Ð %Ð %Ð %Ð %Ð %Ø 4Ð 4Ð 4Ð 4Ð 4Ð 4Ø :Ð :Ð :Ð :Ð :Ð :ðð ð ð ð ˆs�Dñ ô ð ð( ðð ð ð ð ñ ô ñ „ðð
 ðð ð ð ð ñ ô ñ „ðð ðUGð UGð UGð UGð UGñ UGô UGñ „ðUGð UGð UGr   