+
    ~j73                    D   ^ RI Ht ^ RIt^ RIt^ RIt^ RIt^ RIHtHtH	t	H
t
HtHtHtHtHt ^ RIHt ^ RIHtHt ^ RIHtHt ^ RIt^RIHtHtHtHtHt ]
! R4      t]
! R	]]R
3,          R7      t ]
! R]	]!]3,          R7      t"]
! R]],          R7      t#]
! R]R
]3,          R7      t$R R lt%RR/R R llt&R R lt'R R lt(R R lt)R R lt*R R lt+R R  lt,R! R" lt-R# R$ lt.R% R& lt/R' R( lt0R) R* lt1R+ R, lt2R-R.R/R0/R1 R2 llt3R3 R4 lt4R5 R6 lt5]
! R74      t6]
! R84      t7]R9 R: l4       t8]R; R< l4       t8]R= R> l4       t8R? R@ lt8RA RB lt9RC RD lt:RE RF lt;RG RH lt<RI RJ lt=RK RL lt>RM RN lt?RO RP lt@RQ RR ltARS RT ltBRU RV ltCRW^/RX RY lltDRZ R[ ltER# )\    )annotationsN)	AnyTupleMappingTypeVarCallableIterableSequencecastoverload)Path)datedatetime)	TypeGuardget_args)OmitNotGiven	FileTypesArrayFormatHeadersLike_T_TupleT.)bound	_MappingT
_SequenceT	CallableTc                    V ^8  d   QhRRRR/# )   tzIterable[Iterable[_T]]returnzlist[_T] )formats   "l/Users/mitch_tango/dev/rabbit-r1-livekit/agent/.venv/lib/python3.14/site-packages/anthropic/_utils/_utils.py__annotate__r$   !   s     7 7% 7( 7    c                D    V  UUu. uF  q F  q"NK  	  K  	  upp# u uppi Nr!   )r   sublistitems   &  r#   flattenr*   !   s"     !6WgdDgD666s   array_formatbracketsc               (    V ^8  d   QhRRRRRRRR/# )	r   queryzMapping[str, object]pathszSequence[Sequence[str]]r+   r   r    list[tuple[str, FileTypes]]r!   )r"   s   "r#   r$   r$   %   s4        
 #  !r%   c               X    . pV F!  pVP                  \        W^ RVR7      4       K#  	  V# )a  Recursively extract files from the given dictionary based on specified paths.

A path may look like this ['foo', 'files', '<array>', 'data'].

``array_format`` controls how ``<array>`` segments contribute to the emitted
field name. Supported values: ``"brackets"`` (``foo[]``), ``"repeat"`` and
``"comma"`` (``foo``), ``"indices"`` (``foo[0]``, ``foo[1]``).

Note: this mutates the given dictionary.
Nindexflattened_keyr+   )extend_extract_items)r.   r/   r+   filespaths   &$$  r#   extract_filesr9   %   s0    $ *,E^Eq[ghi Lr%   c               $    V ^8  d   QhRRRRRR/# )r   r+   r   array_indexintr    strr!   )r"   s   "r#   r$   r$   =   s!       # # r%   c           
         V R 8X  d   R# V R8X  d   RV R2# V R8X  g   V R8X  d   R# \        RV  R	R
P                  \        \        4      4       24      h)r,   z[]indices[]repeatcomma zUnknown array_format value: z, choose from , )NotImplementedErrorjoinr   r   )r+   r;   s   &&r#   _array_suffixrH   =   se    z!y ;-q!!x<7#: 

&|nN499XVaMbCcBde r%   c               0    V ^8  d   QhRRRRRRRRR	R
RR/# )r   objobjectr8   Sequence[str]r3   r<   r4   
str | Noner+   r   r    r0   r!   )r"   s   "r#   r$   r$   K   sL     N N	N
N 	N
 N N !Nr%   c                   W,          pT^,          p\        T 4      '       d    \        ;QJ d    R YR  4       F  '       d   K   RM	  RM! R YR  4       4      '       d   T P                  T4      pM	Y,          p Tf   TpMTRT R2,          p\        TTTTTR	7      # \	        T 4      '       dV   TR
8w  d   . # \        \        T 4       UUu. uF+  w  r\        TTTTe   TMR\        YH4      ,           TR	7      NK-  	  upp4      # . #   \          d    \        T 4      '       g   . u # ^RIHp Tf   Q h\	        T 4      '       db   . p\        T 4       FL  w  r\        YH4      p
T'       d	   Y:,           MT
pT! YR7       TP                  T\        \        T	4      34       KN  	  Tu # T! YR7       T\        \        T 4      3.u # i ; i  \         d    . u # i ; iu uppi )r   )assert_is_file_contentN)keyc              3  *   "   T F	  qR 8H  x  K  	  R# 5i)<array>Nr!   ).0ps   & r#   	<genexpr>!_extract_items.<locals>.<genexpr>q   s     8<a	><s   FTr@   rA   r2   rR   rD   )
IndexErroris_given_filesrO   is_list	enumeraterH   appendr   r   is_dictallpopKeyErrorr6   r*   )rJ   r8   r3   r4   r+   rP   rO   r7   r;   entrysuffixemitted_keyr)   s   &&$$$        r#   r6   r6   K   s   7k0 
QJEs||	 s84<8sss84<888wws|x  MqQZ'M'%
 	
 
)I *33 *8%K *7*C}]iOww!- *8
 	
  II  7}}I 	4 (((3<<13E&/n"&|A:G}5V&u>k4	5+ABC	 '5
 Ls6Y 4566+7@  	 I		*sL   D
 
G
 G
 G
 #G
 5G
 1G

G*A<G(GG
GGc                    V ^8  d   QhRRRR/# )r   rJ   z_T | NotGiven | Omitr    zTypeGuard[_T]r!   )r"   s   "r#   r$   r$      s     G G& G= Gr%   c                f    \        V \        4      '       * ;'       d    \        V \        4      '       * # r'   )
isinstancer   r   rJ   s   &r#   rX   rX      s$    #x((FFC1F-FFr%   c                    V ^8  d   QhRRRR/# )r   rJ   rK   r    zTypeGuard[tuple[object, ...]]r!   )r"   s   "r#   r$   r$      s     " "& ": "r%   c                "    \        V \        4      # r'   rf   tuplerg   s   &r#   is_tuplerl          c5!!r%   c                    V ^8  d   QhRRRR/# )r   rJ   z_TupleT | objectr    zTypeGuard[_TupleT]r!   )r"   s   "r#   r$   r$      s     " "$ "); "r%   c                "    \        V \        4      # r'   rj   rg   s   &r#   
is_tuple_trp      rm   r%   c                    V ^8  d   QhRRRR/# )r   rJ   rK   r    zTypeGuard[Sequence[object]]r!   )r"   s   "r#   r$   r$           % %V % ; %r%   c                "    \        V \        4      # r'   rf   r
   rg   s   &r#   is_sequenceru          c8$$r%   c                    V ^8  d   QhRRRR/# )r   rJ   z_SequenceT | objectr    zTypeGuard[_SequenceT]r!   )r"   s   "r#   r$   r$      s     % %* %/D %r%   c                "    \        V \        4      # r'   rt   rg   s   &r#   is_sequence_try      rv   r%   c                    V ^8  d   QhRRRR/# )r   rJ   rK   r    zTypeGuard[Mapping[str, object]]r!   )r"   s   "r#   r$   r$      s     $ $F $> $r%   c                "    \        V \        4      # r'   rf   r   rg   s   &r#   
is_mappingr}          c7##r%   c                    V ^8  d   QhRRRR/# )r   rJ   z_MappingT | objectr    zTypeGuard[_MappingT]r!   )r"   s   "r#   r$   r$      s     $ $( $-A $r%   c                "    \        V \        4      # r'   r|   rg   s   &r#   is_mapping_tr      r~   r%   c                    V ^8  d   QhRRRR/# )r   rJ   rK   r    zTypeGuard[dict[object, object]]r!   )r"   s   "r#   r$   r$      s     ! ! !; !r%   c                "    \        V \        4      # r'   )rf   dictrg   s   &r#   r]   r]          c4  r%   c                    V ^8  d   QhRRRR/# )r   rJ   rK   r    zTypeGuard[list[object]]r!   )r"   s   "r#   r$   r$      s     ! ! !3 !r%   c                "    \        V \        4      # r'   )rf   listrg   s   &r#   rZ   rZ      r   r%   c                    V ^8  d   QhRRRR/# )r   rJ   rK   r    zTypeGuard[Iterable[object]]r!   )r"   s   "r#   r$   r$      rr   r%   c                "    \        V \        4      # r'   )rf   r	   rg   s   &r#   is_iterabler      rv   r%   delimrE   finalorc               (    V ^8  d   QhRRRRRRRR/# )r   seqrL   r   r=   r   r    r!   )r"   s   "r#   r$   r$      s(     8 8M 8S 8 8s 8r%   c                   \        V 4      pV^ 8X  d   R# V^8X  d
   V ^ ,          # V^8X  d   V ^ ,           RV RV ^,           2# VP                  V RR 4      RV RV R,           2,           # )r   rD    N)lenrG   )r   r   r   sizes   &$$ r#   
human_joinr      sv    s8Dqyqy1vqya&5'3q6(++::c#2hAeWAc"gY"777r%   c                    V ^8  d   QhRRRR/# )r   stringr=   r    r!   )r"   s   "r#   r$   r$      s      # # r%   c                    RV  R2# )zOAdd single quotation marks around the given string. Does *not* do any escaping.'r!   )r   s   &r#   quoter      s    vha=r%   c                    V ^8  d   QhRRRR/# )r   variantsrL   r     Callable[[CallableT], CallableT]r!   )r"   s   "r#   r$   r$      s     H H] H/O Hr%   c                    a  R V 3R llpV# )a   Decorator to enforce a given set of arguments or variants of arguments are passed to the decorated function.

Useful for enforcing runtime validation of overloaded functions.

Example usage:
```py
@overload
def foo(*, a: str) -> str: ...


@overload
def foo(*, b: bool) -> str: ...


# This enforces the same constraints that a static type checker would
# i.e. that either a or b must be passed to the function
@required_args(["a"], ["b"])
def foo(*, a: str | None = None, b: bool | None = None) -> str: ...
```
c                    V ^8  d   QhRRRR/# )r   funcr   r    r!   )r"   s   "r#   r$   #required_args.<locals>.__annotate__   s     0 0I 0) 0r%   c                :  <a a \         P                  ! S 4      P                  pVP                  4        UUu. uF0  w  r#VP                  VP
                  VP                  09   g   K.  VNK2  	  uppo\        P                  ! S 4      R  V VV3R ll4       pV# u uppi )c               $    V ^8  d   QhRRRRRR/# )r   argsrK   kwargsr    r!   )r"   s   "r#   r$   2required_args.<locals>.inner.<locals>.__annotate__  s!     !	) !	)6 !	)V !	) !	)r%   c                   <a \        4       o\        V 4       F  w  r# SP                  SV,          4       K   	  VP                  4        F  pSP                  V4       K  	  S FG  p\        ;QJ d    V3R lV 4       F  '       d   K   RM	  RM! V3R lV 4       4      pV'       g   KG   M	  \        S4      ^8  dW   \        S UUu. uF7  pR\        V Uu. uF  p\        V4      NK  	  upRR	7      ,           R
,           NK9  	  upp4      pRV R2p	M\        S4      ^ 8  g   Q h\        \        S^ ,          4      S,
          4      p
\        V
4      ^8  d)   R\        V
 Uu. uF  p\        V4      NK  	  up4       2p	MR\        V
^ ,          4       2p	\	        V	4      hS! V / VB #   \         d3    \	        SP
                   R \        S4       R\        T 4       R24      Rhi ; iu upi u uppi u upi )z	() takes z argument(s) but z were givenNc              3  ,   <"   T F	  qS9   x  K  	  R # 5ir'   r!   )rS   paramgiven_paramss   & r#   rU   @required_args.<locals>.inner.<locals>.wrapper.<locals>.<genexpr>  s     J'4's   FT(and)r   )z,Missing required arguments; Expected either z arguments to be givenzMissing required arguments: zMissing required argument: )setr[   addrW   	TypeError__name__r   keysr^   r   r   r   )r   r   i_rP   variantmatchesarg
variationsmsgmissingr   r   
positionalr   s   *,         @r#   wrapper-required_args.<locals>.inner.<locals>.wrapper  s   %(UL!$  $$Z]3 ( {{}  % % $#J'J###J'JK7 $
 x=1$!+muvmubiz*I#5:*IQVWWZ]]]muv"J ITjkCx=1,,, #3x{#3l#BCG7|a' <Z_fHg_fX[s_fHg=h<ij ;E'!*<M;NOn$(((9 "  #==/3z?2CCTUXY]U^T__jk   +Jv Ihs)   F)	G.
G),G.
#G4
)=G&)G.
)	inspect	signature
parametersitemskindPOSITIONAL_ONLYPOSITIONAL_OR_KEYWORD	functoolswraps)r   paramsnamer   r   r   r   s   f    @r#   innerrequired_args.<locals>.inner   s    ""4(33  &||~
-zz%%++ D-

 
	!	) !	) 
!	)F ]
s   +B'Br!   )r   r   s   j r#   required_argsr      s    ,0 0d Lr%   _K_Vc                    V ^8  d   QhRRRR/# )r   rJ   Noner    r!   )r"   s   "r#   r$   r$   2  s     + + +$ +r%   c                    R # r'   r!   rg   s   &r#   strip_not_givenr   1  s    (+r%   c                    V ^8  d   QhRRRR/# )r   rJ   zMapping[_K, _V | NotGiven]r    zdict[_K, _V]r!   )r"   s   "r#   r$   r$   6  s     I I3 I Ir%   c                    R # r'   r!   rg   s   &r#   r   r   5  s    FIr%   c                    V ^8  d   QhRRRR/# )r   rJ   rK   r    r!   )r"   s   "r#   r$   r$   :  s     / / /F /r%   c                    R # r'   r!   rg   s   &r#   r   r   9  s    ,/r%   c                    V ^8  d   QhRRRR/# )r   rJ   zobject | Noner    rK   r!   )r"   s   "r#   r$   r$   =  s     Y Y Y6 Yr%   c                    V f   R# \        V 4      '       g   V # V P                  4        UUu/ uF  w  r\        V\        4      '       d   K  WbK!  	  upp# u uppi )zHRemove all top-level keys where their values are instances of `NotGiven`N)r}   r   rf   r   )rJ   rP   values   &  r#   r   r   =  sE    
{c??
),X:3Juh<WJCJXXXs   AAc                    V ^8  d   QhRRRR/# )r   valr=   r    r<   r!   )r"   s   "r#   r$   r$   H  s        r%   c                    \        V ^
R7      # )
   )base)r<   r   s   &r#   coerce_integerr   H  s    sr%   c                    V ^8  d   QhRRRR/# )r   r   r=   r    floatr!   )r"   s   "r#   r$   r$   L  s      c e r%   c                    \        V 4      # r'   )r   r   s   &r#   coerce_floatr   L  s    :r%   c                    V ^8  d   QhRRRR/# )r   r   r=   r    boolr!   )r"   s   "r#   r$   r$   P  s     6 6 6 6r%   c                @    V R 8H  ;'       g    V R8H  ;'       g    V R8H  # )true1onr!   r   s   &r#   coerce_booleanr   P  s$    &=55C3J55#+5r%   c                    V ^8  d   QhRRRR/# )r   r   rM   r    
int | Noner!   )r"   s   "r#   r$   r$   T  s      j Z r%   c                $    V f   R # \        V 4      # r'   )r   r   s   &r#   maybe_coerce_integerr   T      
{#r%   c                    V ^8  d   QhRRRR/# )r   r   rM   r    zfloat | Noner!   )r"   s   "r#   r$   r$   Z  s      J < r%   c                $    V f   R # \        V 4      # r'   )r   r   s   &r#   maybe_coerce_floatr   Z  s    
{r%   c                    V ^8  d   QhRRRR/# )r   r   rM   r    zbool | Noner!   )r"   s   "r#   r$   r$   `  s      j [ r%   c                $    V f   R # \        V 4      # r'   )r   r   s   &r#   maybe_coerce_booleanr   `  r   r%   c               $    V ^8  d   QhRRRRRR/# )r   r   r=   prefixr    r!   )r"   s   "r#   r$   r$   f  !       c c r%   c                P    V P                  V4      '       d   V \        V4      R # V # )zPRemove a prefix from a string.

Backport of `str.removeprefix` for Python < 3.9
N)
startswithr   )r   r   s   &&r#   removeprefixr   f  s+    
   c&km$$Mr%   c               $    V ^8  d   QhRRRRRR/# )r   r   r=   rb   r    r!   )r"   s   "r#   r$   r$   p  r   r%   c                R    V P                  V4      '       d   V R\        V4      )  # V # )zPRemove a suffix from a string.

Backport of `str.removesuffix` for Python < 3.9
N)endswithr   )r   rb   s   &&r#   removesuffixr  p  s+    
 vnV%%Mr%   c                    V ^8  d   QhRRRR/# )r   r8   r=   r    r   r!   )r"   s   "r#   r$   r$   z  s     ! ! ! !r%   c                x    \        V 4      P                  4       p\        P                  P	                  V 4      pW!3# r'   )r   
read_bytesosr8   basename)r8   contents	file_names   &  r#   file_from_pathr	  z  s1    Dz$$&H  &I  r%   c               $    V ^8  d   QhRRRRRR/# )r   headersr   headerr=   r    r!   )r"   s   "r#   r$   r$     s!     8 8 8c 8c 8r%   c                   VP                  4       p\        V 4      '       dK   V P                  4        F6  w  r4VP                  4       V8X  g   K  \        V\        4      '       g   K4  Vu # 	  \
        P                  ! R R VP                  4       4      pWVP                  4       V3 F   pV P                  V4      pV'       g   K  Vu # 	  \        RV R24      h)z([^\w])(\w)c                l    V P                  ^4      V P                  ^4      P                  4       ,           # )   )groupupper)pats   &r#   <lambda>%get_required_header.<locals>.<lambda>  s#    #))A,STI[I[I]:]r%   zCould not find z header)lowerr   r   rf   r=   resub
capitalizer  get
ValueError)r  r  lower_headerkvintercaps_headernormalized_headerr   s   &&      r#   get_required_headerr     s    <<>LGMMODAwwyL(Z3-?-? $
 vvn.]_e_p_p_rs$FLLNDTU-.5L V
 vhg6
77r%   c                   V ^8  d   QhRR/# )r   r    r=   r!   )r"   s   "r#   r$   r$     s      3 r%   c                 R     \         P                  ! 4       #   \         d     R # i ; i)false)sniffiocurrent_async_library	Exceptionr!   r%   r#   get_async_libraryr'    s(    ,,.. s    &&maxsizec                    V ^8  d   QhRRRR/# )r   r(  r   r    r   r!   )r"   s   "r#   r$   r$     s      * /O r%   c                P    \         P                  ! V R7      p\        \        V4      # )zeA version of functools.lru_cache that retains the type signature
for the wrapped function arguments.
)r(  )r   	lru_cacher   r   )r(  r   s   $ r#   r+  r+    s&     !!G Wr%   c                    V ^8  d   QhRRRR/# )r   datarK   r    r!   )r"   s   "r#   r$   r$     s      F v r%   c                   \        V 4      '       d8   V P                  4        UUu/ uF  w  r\        V4      \        V4      bK  	  upp# \        V 4      '       d=   \	        V \
        \        \        34      '       g   V  Uu. uF  p\        V4      NK  	  up# \	        V \        \        34      '       d   V P                  4       # V # u uppi u upi )znTranslates a mapping / sequence recursively in the same fashion
as `pydantic` v2's `model_dump(mode="json")`.
)r}   r   	json_safer   rf   r=   bytes	bytearrayr   r   	isoformat)r-  rP   r   r)   s   &   r#   r/  r/    s     $CG::<P<ZS	#	% 00<PP4D3y2I!J!J,01DD	$D11$4())~~K Q 2s    C?C
)F
__future__r   r  r  r   r   typingr   r   r   r   r   r	   r
   r   r   pathlibr   r   r   typing_extensionsr   r   r$  _typesr   r   r   r   r   r   rK   r   r=   r   r   r   r*   r9   rH   r6   rX   rl   rp   ru   ry   r}   r   r]   rZ   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r	  r   r'  r+  r/  r!   r%   r#   <module>r8     s   " 	 	  
 
 
  # 1  H HT]
)5#5
6KwsF{';<	\&)9:
KxS'9:	7 !+0NbG""%%$$!!%
84 8d 8
HV T]T] 
 + 
 + 
 I 
 I 
 / 
 /Y6!8&s r%   