
    g3fi                     P    d Z ddlmZ dddddededeeegef   ded	ed
edefdZy)zUsage utilities.    )Callabled   defaultdepth	max_depthleftrightopr   r   r   returnc          	         ||k\  rd|d}t        |      i }t        |       j                  |      D ]  }t        | j	                  ||      t
              rMt        |j	                  ||      t
              r- || j	                  ||      |j	                  ||            ||<   qt        | j	                  |i       t              rXt        |j	                  |i       t              r8t        | j	                  |i       |j	                  |i       |||dz   |      ||<   | |fD 	cg c]  }	||	v st        |	|          }
}	d|
 d}t        |       |S c c}	w )a  Apply an integer operation to corresponding values in two dictionaries.

    Recursively combines two dictionaries by applying the given operation to integer
    values at matching keys.

    Supports nested dictionaries.

    Args:
        left: First dictionary to combine.
        right: Second dictionary to combine.
        op: Binary operation function to apply to integer values.
        default: Default value to use when a key is missing from a dictionary.
        depth: Current recursion depth (used internally).
        max_depth: Maximum recursion depth (to prevent infinite loops).

    Returns:
        A new dictionary with combined values.

    Raises:
        ValueError: If `max_depth` is exceeded or if value types are not supported.
    z
max_depth=z# exceeded, unable to combine dicts.   r   zUnknown value types: z). Only dict and int values are supported.)	
ValueErrorsetunion
isinstancegetintdict_dict_int_optype)r	   r
   r   r   r   r   msgcombinedkdtypess              X/var/www/auto_recruiter/arenv/lib/python3.12/site-packages/langchain_core/utils/usage.pyr   r      sN   < 	?@oHY__U# "dhhq'*C0ZIIa!36
 TXXa1599Q3HIHQKB.:eii2>NPT3U&B		!R ai#HQK +/AA!q&T!A$ZAEA'w.WX  S/!'"( O Bs   "	E,EN)__doc__collections.abcr   r   r   r        r   <module>r"      sj     $ 6
66 	#sS!6
 6 6 6 
6r!   