
    bi                        d Z ddlmZ ddlmZmZ ddlmZmZ e G d d             Z	e G d d             Z
e G d	 d
             Ze G d d             Ze G d d             Ze G d d             Zy)z#Data models for the sandbox client.    )annotations)	dataclassfield)AnyOptionalc                  B    e Zd ZU dZded<   ded<   ded<   ed	d       Zy)
ExecutionResultz+Result of executing a command in a sandbox.strstdoutstderrint	exit_codec                     | j                   dk(  S )z.Return True if the command exited with code 0.r   )r   )selfs    c/home/obispo/Crisostomo_bridge/mision_env/lib/python3.12/site-packages/langsmith/sandbox/_models.pysuccesszExecutionResult.success   s     ~~""    N)returnbool)__name__
__module____qualname____doc____annotations__propertyr    r   r   r	   r	   	   s&    5KKN# #r   r	   c                  <    e Zd ZU dZdZded<   dZded<   dZded	<   y)
ResourceSpecz%Resource specification for a sandbox.500mr
   cpu512MimemoryNOptional[str]storage)r   r   r   r   r    r   r"   r$   r   r   r   r   r      s#    /CFC!G]!r   r   c                  l    e Zd ZU dZded<   ded<   ded<   dZded<   dZded	<   dZded
<   edd       Z	y)Volumea@  Represents a persistent volume.

    Volumes are persistent storage that can be mounted in sandboxes.

    Attributes:
        id: Unique identifier (UUID). Remains constant even if name changes.
            May be None for resources created before ID support was added.
        name: Display name (can be updated).
    r
   namesizestorage_classNr#   id
created_at
updated_atc           
          | |j                  dd      |j                  dd      |j                  dd      |j                  d      |j                  d      |j                  d	      
      S )z'Create a Volume from API response dict.r'    r(   unknownr)   defaultr*   r+   r,   )r'   r(   r)   r*   r+   r,   getclsdatas     r   	from_dictzVolume.from_dict3   s^     &"%&),((?I>xx~xx-xx-
 	
r   )r5   dict[str, Any]r   r&   
r   r   r   r   r   r*   r+   r,   classmethodr6   r   r   r   r&   r&       sI     I
IB $J$ $J$	
 	
r   r&   c                  &    e Zd ZU dZded<   ded<   y)VolumeMountSpecz:Specification for mounting a volume in a sandbox template.r
   volume_name
mount_pathN)r   r   r   r   r   r   r   r   r;   r;   @   s    DOr   r;   c                      e Zd ZU dZded<   ded<   ded<    ee      Zded	<   d
Zded<   d
Z	ded<   d
Z
ded<   edd       Zy
)SandboxTemplatea  Represents a SandboxTemplate.

    Templates define the image, resource limits, and volume mounts for sandboxes.
    All other container details are handled by the server with secure defaults.

    Attributes:
        id: Unique identifier (UUID). Remains constant even if name changes.
            May be None for resources created before ID support was added.
        name: Display name (can be updated).
    r
   r'   imager   	resources)default_factoryzlist[VolumeMountSpec]volume_mountsNr#   r*   r+   r,   c                   |j                  di       }|j                  dg       } | |j                  dd      |j                  dd      t        |j                  dd      |j                  d	d
      |j                  d            |D cg c]/  }t        |j                  dd      |j                  dd            1 c}|j                  d      |j                  d      |j                  d            S c c}w )z0Create a SandboxTemplate from API response dict.rA   rC   r'   r.   r@   r/   r    r   r"   r!   r$   )r    r"   r$   r<   r=   )r<   r=   r*   r+   r,   )r'   r@   rA   rC   r*   r+   r,   )r2   r   r;   )r4   r5   resources_datavolume_mounts_datavms        r   r6   zSandboxTemplate.from_dict]   s     +r2!XXor:&"%((7I.""&&uf5%))(G<&**95 -
 	   "}b 9!vvlB7 xx~xx-xx-#
 	
s   	4C5)r5   r7   r   r?   )r   r   r   r   r   r   listrC   r*   r+   r,   r9   r6   r   r   r   r?   r?   H   sY    	 IJ+0+FM(FB $J$ $J$
 
r   r?   c                  l    e Zd ZU dZded<   ded<   ded<   dZded	<   dZded
<   dZded<   edd       Z	y)Poola  Represents a Sandbox Pool for pre-provisioned sandboxes.

    Pools pre-provision sandboxes from a template for faster startup.
    Instead of waiting for a new sandbox to be created, sandboxes can
    be served from a pre-warmed pool.

    Note: Templates with volume mounts cannot be used in pools.

    Attributes:
        id: Unique identifier (UUID). Remains constant even if name changes.
            May be None for resources created before ID support was added.
        name: Display name (can be updated).
    r
   r'   template_namer   replicasNr#   r*   r+   r,   c           
          | |j                  dd      |j                  dd      |j                  dd      |j                  d      |j                  d      |j                  d      	      S )
z%Create a Pool from API response dict.r'   r.   rK   rL   r   r*   r+   r,   )r'   rK   rL   r*   r+   r,   r1   r3   s     r   r6   zPool.from_dict   s^     &"%((?B7XXj!,xx~xx-xx-
 	
r   )r5   r7   r   rJ   r8   r   r   r   rJ   rJ   w   sI     IMB $J$ $J$	
 	
r   rJ   N)r   
__future__r   dataclassesr   r   typingr   r   r	   r   r&   r;   r?   rJ   r   r   r   <module>rQ      s    ) " (   
# 
# 
# " " " 
 
 
>    +
 +
 +
\  
  
  
r   