ó
    ±"³j:
  ã                   ó˜   • S SK r S SKJr  S SKJr  SSKJr  SrS\SS4S	 jrS
\	S\
S-  SS4S jrSSSS.S
\	S\\	   S\\	   S\
SS4
S jjrg)é    N)ÚSequence)Ú	UserErroré   )ÚImageGenerationSettingszGImage generation `dimensions` and `aspect_ratio` are mutually exclusiveÚsettingsÚreturnc                 óü   • U R                  S5      nUc  gU R                  S5      b  [        [        5      e[        U[        5      (       a&  [        U5      S:w  d  [        S U 5       5      (       a  [        S5      eg)zBValidate provider-independent image generation setting invariants.Ú
dimensionsNÚaspect_ratioé   c              3   ó’   #   • U  H=  n[        U[        5      (       + =(       d    [        U[        5      =(       d    US :*  v •  M?     g7f)r   N)Ú
isinstanceÚintÚbool)Ú.0Úvalues     Ú[/home/mande/repo/quber/.venv/lib/python3.13/site-packages/pydantic_ai/images/_validation.pyÚ	<genexpr>Ú5validate_image_generation_settings.<locals>.<genexpr>   s6   é € ÐkÒ`jÐW\”:˜e¤SÓ)Ô)×R¬Z¸¼tÓ-D×RÈÐQRÉ
ÔRÒ`jùs   ‚AAzTImage generation `dimensions` must be a `(width, height)` tuple of positive integers)Úgetr   Ú DIMENSIONS_ASPECT_RATIO_CONFLICTr   ÚtupleÚlenÚany)r   r
   s     r   Ú"validate_image_generation_settingsr      ss   € à—‘˜lÓ+€JØÑØà‡|�|�NÓ#Ñ/ÜÔ8Ó9Ð9ô �z¤5×)Ñ)Üˆz‹?˜aÓÜÑkÑ`jÓk×kÑkäÐnÓoÐoð ló    ÚproviderÚnc                 óˆ   • Ub?  [        U[        5      (       a  [        U[        5      (       d  US::  a  [        U  S35      egg)zVReject a count the request cannot carry at all; the provider owns its own upper bound.Nr   z2 image generation count must be a positive integer)r   r   r   r   )r   r   s     r   Úvalidate_image_countr       sB   € à�}œj¨¬C×0Ñ0´J¸qÄ$×4GÑ4GÈ1ÐPQË6Ü˜8˜*Ð$VÐWÓXÐXð LR€}r   © r   )ÚignoredÚ	conflictsÚ
stacklevelr"   r#   r$   c                óŒ  • / nU(       a?  SR                  S [        R                  U5       5       5      nUR                  SU 35        U(       a?  SR                  S [        R                  U5       5       5      nUR                  SU 35        U(       a/  [        R
                  " U  SSR                  U5       3[        US9  g	g	)
u  Emit one warning for settings ignored or overridden by a provider adapter.

`stacklevel` selects the frame the warning points at. The default `2` is the adapter's own
`generate()` call (adapter â†’ `warn`), deliberately chosen over the user's call site: the
distance from `generate()` to user code is unbounded, because `ImageGenerator` and any number
of [`WrapperImageGenerationModel`][pydantic_ai.images.WrapperImageGenerationModel] layers can
sit in between, so the adapter that resolved the settings is the only frame always worth naming.
z, c              3   ó.   #   • U  H  nS U S 3v •  M     g7f©Ú`Nr!   ©r   Únames     r   r   Ú1warn_image_generation_settings.<locals>.<genexpr>4   s   é € ÐIÒ2H¨$˜A˜d˜V 1�+Ò2Hùó   ‚zignored unsupported settings: c              3   ó.   #   • U  H  nS U S 3v •  M     g7fr'   r!   r)   s     r   r   r+   7   s   é € ÐKÒ2J¨$˜A˜d˜V 1�+Ò2Jùr,   z,used provider-specific settings instead of: z image generation z; )r$   N)ÚjoinÚdictÚfromkeysÚappendÚwarningsÚwarnÚUserWarning)r   r"   r#   r$   Úwarning_partsÚnamess         r   Úwarn_image_generation_settingsr7   #   s¥   € ð  "€MÞØ—	‘	ÑI´$·-±-ÀÔ2HÓIÓIˆØ×ÑÐ=¸e¸WÐEÔFÞØ—	‘	ÑK´$·-±-À	Ô2JÓKÓKˆØ×ÑÐKÈEÈ7ÐSÔTÞÜ�Š˜˜
Ð"4°T·Y±Y¸}Ó5MÐ4NÐOÔQ\ÐisÓtð r   )r2   Úcollections.abcr   Úpydantic_ai.exceptionsr   r   r   r   r   Ústrr   r    r7   r!   r   r   Ú<module>r;      s¡   ðÛ Ý $å ,å -ð $mÐ  ðpÐ1Hð pÈTô pð"Y 3ð Y¨3°©:ð Y¸$ô Yð  Ø!ØòuØðuð �c‰]ðuð ˜‰}ð	uð
 ðuð 
öur   