ó
    ±"³jñ¢  ã                  ó  • S SK Jr  S SKrS SKJrJrJr  S SKJrJ	r	  S SK
Jr  S SKJrJrJrJr  S SKJr  S SKJr  S S	KJr  S S
KJrJrJrJr  S SKJrJrJrJ r J!r!  S SK"J#r#  S SK$J%r%  S SK&J'r'J(r(J)r)  S SK*J+r+J,r,J-r-J.r.J/r/  S SK0J1r1J2r2J3r3J4r4  S SK5J6r6  S SK7J8r8  SSK9J:r:  SSK;J<r<  SSK=J>r>  \(       a  S SK?J@r@JArA  \B" \" \/5      5      rC\B" \" \,5      5      rDSrESrF\" SS9 " S S5      5       rG\" SS9 " S  S!\>\1   5      5       rHg)"é    )ÚannotationsN)Ú	AwaitableÚCallableÚSequence)Ú	dataclassÚreplace)Úcached_property)ÚTYPE_CHECKINGÚAnyÚLiteralÚget_args)Ú
deprecated)Úreplace_no_init)ÚPydanticAIDeprecationWarning)ÚContentFilterErrorÚ
ModelRetryÚUnexpectedModelBehaviorÚ	UserError)ÚImageDimensionsÚImageGenerationAspectRatioÚImageGenerationModelÚImageGenerationSettingsÚImageGenerator)Ú DIMENSIONS_ASPECT_RATIO_CONFLICT)ÚBinaryImage)ÚAbstractModelÚKnownModelNameÚModel)ÚSUPPORTED_NATIVE_TOOLSÚImageAspectRatioÚImageGenerationModelNameÚImageGenerationToolÚ	ImageSize)Ú
AgentDepsTÚ
RunContextÚToolÚToolDefinition)ÚAbstractToolset)ÚPreparedToolseté   )Úcheck_deprecated_fallback_model)ÚAbstractCapability)ÚNativeOrLocalTool)ÚImageGenerationFallbackModelÚImageGenerationNativeToolzÒThe direct `ImageGeneration` fallback cannot honor `action="edit"` because the `generate_image` tool does not receive reference images. Use `ImageGenerator.generate(..., images=...)` directly for image editing.z¸The direct `ImageGeneration` fallback ignored native-tool setting(s): {settings}. Configure provider-specific direct settings on the `ImageGenerator` or `ImageGenerationModel` instead.T)Úkw_onlyc                  óL   • \ rS rSr% SrS\S'   S\S'   S\S'   S	\S
'   SS jrSrg)Ú_DirectImageGenerationToolé>   zBLocal capability tool backed directly by the image generation API.ú%ImageGenerator | ImageGenerationModelÚ	generatorr   Úsettingsú*Literal['generate', 'edit', 'auto'] | NoneÚactionúImageGenerationModelName | NoneÚimage_modelc              ƒ  óÎ  #   • U R                   S:X  a  [        [        5      eU R                  b  [        R
                  " S[        SS9   U R                  R                  XR                  S9I S h  v•N n[        UR                  5      S:w  a"  [        S[        UR                  5       S35      eUR                   $  NK! [         a  n[        [        U5      5      UeS nAff = f7f)	NÚeditzˆDirect `ImageGeneration` fallback ignored `image_model`; the direct image model is already selected by `local` or `fallback_image_model`é   ©Ú
stacklevel©r6   r*   z*Direct image generation fallback returned z¹ images; expected exactly one. If the generator asks for more than one image per call through a provider-specific image count setting, call `ImageGenerator.generate()` directly instead.)r8   r   Ú_EDIT_ACTION_UNSUPPORTEDr:   ÚwarningsÚwarnÚUserWarningr5   Úgenerater6   r   r   ÚstrÚlenÚimagesr   Úimage)ÚselfÚpromptÚresultÚes       Úf/home/mande/repo/quber/.venv/lib/python3.13/site-packages/pydantic_ai/capabilities/image_generation.pyÚ__call__Ú#_DirectImageGenerationTool.__call__G   sØ   é € Ø�;‰;˜&Ó ô
 Ô4Ó5Ð5Ø×ÑÑ'Ü�MŠMðbäØò	ð	,ØŸ>™>×2Ñ2°6ÇMÁMÐ2ÐR×RˆFô ˆv�}‰}Ó Ó"Ü)Ø<¼SÀÇÁÓ=OÐ<Pð QZð Zóð ð
 �|‰|Ðñ SøÜ!ó 	,ô
 œS ›VÓ$¨!Ð+ûð	,üs=   ‚AC%Á
&B> Á0B<Á1B> Á5AC%Â<B> Â>
C"ÃCÃC"Ã"C%© N)rK   rF   Úreturnr   )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__annotations__rO   Ú__static_attributes__rQ   ó    rN   r2   r2   >   s"   ‡ áLà4Ó4Ø%Ó%Ø6Ó6Ø0Ó0÷rZ   r2   F)Úinitc                  ó.  ^ • \ rS rSr% SrSrS\S'    S\S'    SrS\S	'    S
\S'    S\S'    S\S'    S\S'    S\S'    S\S'    S\S'    S\S'    S\S'    S\S'    S\S'    S rS!\S"'    S#SSSSSSSSSSSSSSS S$SSS%.                                       S=S& jjr	S>U 4S' jjr
\\" S(\S)9S?S* j5       5       r\R                  \" S(\S)9S@S+ j5       5       r\SAS, j5       r\SBS- j5       rSBU 4S. jjr\SCU 4S/ jj5       r\S#SSSSSSSSSSSSSSS S$SSS%.                                       SDS0 jj5       rSES1 jrSES2 jrSFS3 jrSGS4 jrSHS5 jrSIS6 jrSJS7 jrSKS8 jrSLS9 jrSMS: jr SNU 4S; jjr!S<r"U =r#$ )OÚImageGenerationég   ah  Image generation capability.

Uses the model's native image generation when available. When the model doesn't
support it, the [direct image generation API](../image-generation.md) can take over. Which
field it goes on follows what you hand over: an `ImageGenerator` carries settings of its own,
so it goes on `local` beside the other implementations you supply; a bare `ImageGenerationModel`
or a `'provider:model'` name goes on `fallback_image_model`.

The `fallback_subagent_model` path is the other way to cover such a model: it runs an additional
agent on an image-capable conversational model, so the image comes from that model's
native `ImageGenerationTool`. Use it when you want those native tool semantics. `local`
also takes a fallback tool you write yourself. The three fields are alternatives:
stating more than one raises `UserError`.

Portable `dimensions` and `aspect_ratio` settings are applied to the direct fallback
using `ImageGenerationSettings`. Other fields configure the native
`ImageGenerationTool`; configure provider-specific direct settings on an explicit
`ImageGenerator` or `ImageGenerationModel`.

When passing a custom `native` instance or factory, its settings are also used for the
`fallback_subagent_model` subagent; capability-level fields override any `native` settings. A static
instance's `aspect_ratio` is also inherited by the direct fallback.
Nzhstr | ImageGenerator | Tool[AgentDepsT] | Callable[..., Any] | AbstractToolset[AgentDepsT] | bool | NoneÚlocalr.   Úfallback_subagent_modelú!ImageGenerationModel | str | NoneÚfallback_image_modelr7   r8   ú/Literal['transparent', 'opaque', 'auto'] | NoneÚ
backgroundúLiteral['high', 'low'] | NoneÚinput_fidelityúLiteral['auto', 'low'] | NoneÚ
moderationr9   r:   ú
int | NoneÚoutput_compressionú%Literal['png', 'webp', 'jpeg'] | NoneÚoutput_formatú/Literal['low', 'medium', 'high', 'auto'] | NoneÚqualityúImageSize | NoneÚsizeúImageDimensions | NoneÚ
dimensionsú!ImageGenerationAspectRatio | NoneÚaspect_ratioÚimage_generationú
str | NoneÚidTF)Únativer_   r`   rb   r8   rd   rf   rh   r:   rj   rl   rn   rp   rr   rt   rw   Údefer_loadingÚdescriptionÚfallback_modelc               óR  • UU l         UU l        UU l        Xl        [	        [        U 5      R                  US LUS LS9  Ub  UOUU l        X@l        XPl	        X`l
        Xpl        X€l        X�l        X l        X°l        XÀl        XÐl        Xàl        Xðl        X l        U R+                  5         g )N)Úfallback_subagent_model_passedÚfallback_model_passed)rw   rz   ry   rx   r+   ÚtyperS   r`   rb   r8   rd   rf   rh   r:   rj   rl   rn   rp   rr   rt   r_   Ú__post_init__)rJ   rx   r_   r`   rb   r8   rd   rf   rh   r:   rj   rl   rn   rp   rr   rt   rw   ry   rz   r{   s                       rN   Ú__init__ÚImageGeneration.__init__#  s®   € ðN ˆŒØ&ˆÔØ*ˆÔØŒÜ'Ü�‹J×ÑØ+BÈ$Ð+NØ"0¸Ð"<ò	
ð
 :HÑ9S¡~ÐYpˆÔ$Ø$8Ô!ØŒØ$ŒØ,ÔØ$ŒØ&ÔØ"4ÔØ*ÔØŒØŒ	Ø$ŒØ(Ôð Œ
Ø×ÑÕrZ   c                ó0  >• SU R                   4SU R                  4SU R                  44 VVs/ s H  u  pUc  M
  UPM     nnn[        U5      S:”  a%  [	        SSR                  S U 5       5       S35      eU R                  S	L a  U(       d  [	        S
5      e[        U R                   [        5      (       a  [	        S5      e[        U R                  [        5      (       a  [	        S5      e[        U R                  [        5      (       a*  SU R                  ;  a  [	        SU R                  < S35      eU R                  (       a¨  U R                  b  U R                  b  [	        [        5      eU R                  S	L ap  U R                  S:X  a  [	        [         5      eU R#                  5       =n(       a:  [$        R&                  " [(        R+                  SR                  U5      S9[,        SS9  / nU R                  S	Ld  U R                   c   U R                  b  U R/                  5       u  peO!U R                  (       d  U R1                  5       n[2        TU ]i  5         U(       a.  [$        R&                  " SSR                  U5       S3[,        SS9  g g s  snnf )Nr_   r`   rb   r*   z1ImageGeneration: cannot specify more than one of ú, c              3  ó.   #   • U  H  nS U S 3v •  M     g7f)Ú`NrQ   )Ú.0Únames     rN   Ú	<genexpr>Ú0ImageGeneration.__post_init__.<locals>.<genexpr>w  s   é € ÐMmÒflÐ^bÐPQÐRVÐQWÐWXÍkÒflùs   ‚u¢    â€” use `local` for an `ImageGenerator` or a custom tool, `fallback_image_model` for a direct image model, or `fallback_subagent_model` for the subagent fallbackFuÞ   ImageGeneration(native=False) requires an explicit fallback â€” pass `local` for an `ImageGenerator` or a custom tool, `fallback_image_model` for a direct image model, or `fallback_subagent_model` for the subagent fallbackz¢ImageGeneration: a bare image model goes to `fallback_image_model`, not `local`, which takes an `ImageGenerator`, a custom `Tool`, `AbstractToolset`, or callable.z•ImageGeneration: an `ImageGenerator` goes to `local`, not `fallback_image_model`, which takes an `ImageGenerationModel` or a `'provider:model'` name.Ú:z'ImageGeneration: `fallback_image_model=z=` is not a direct image model. Name it as `'provider:model'`.r<   r@   é   r>   z2`ImageGeneration` ignored direct-only setting(s): z�. Only a direct generator applies them: use `native=False` with `fallback_image_model='provider:image-model'` or `local=ImageGenerator(...)`.)r_   r`   rb   rG   r   Újoinrx   Ú
isinstancer   r   rF   Ú_has_direct_generatorrr   rt   r   r8   rA   Ú_native_only_settingsrB   rC   Ú_NATIVE_ONLY_SETTINGS_DROPPEDÚformatrD   Ú_native_geometryÚ_direct_only_geometryÚsuperr€   )rJ   rˆ   ÚvalueÚstatedÚnative_onlyÚignoredÚ_Ú	__class__s          €rN   r€   ÚImageGeneration.__post_init__f  s‰  ø€ ð ˜$Ÿ*™*Ð%Ø*¨D×,HÑ,HÐIØ'¨×)BÑ)BÐCñ ô
ò ‘�ð
 ÷ ñ ð 	ñ 
ô ˆv‹;˜‹?ÜØCÀDÇIÁIÑMmÑflÓMmÓDmÐCnð oVð Vóð ð �;‰;˜%Ò®ô ðVóð ô �d—j‘jÔ"6×7Ñ7Üðdóð ô
 �d×/Ñ/´×@Ñ@ÜðVóð ô
 �d×/Ñ/´×5Ñ5¸#ÀT×E^ÑE^Ó:^ô Ø9¸$×:SÑ:SÑ9Vð W>ð >óð ð
 ×%×%ð �‰Ñ*¨t×/@Ñ/@Ñ/LÜÔ @ÓAÐAð �{‰{˜eÒ#Ø—;‘; &Ó(Ü#Ô$<Ó=Ð=Ø"&×"<Ñ"<Ó">Ð>�;Õ>ä—M’MÜ5×<Ñ<ÀdÇiÁiÐP[ÓF\Ð<Ð]Ü#Ø#$òð  ˆØ�;‰;˜eÒ#¨¯
©
Ñ(:¸t×?[Ñ?[Ñ?gØ×.Ñ.Ó0‰JˆAˆwØ×+×+ð
 ×0Ñ0Ó2ˆGÜ‰ÑÔÞä�MŠMØDÀTÇYÁYÈwÓEWÐDXð Y`ð `ô Øóð ùóy
s
   ®	J»JzF`fallback_model` is deprecated; use `fallback_subagent_model` instead.)Úcategoryc                ó   • U R                   $ )zsDeprecated alias for [`fallback_subagent_model`][pydantic_ai.capabilities.ImageGeneration.fallback_subagent_model].©r`   ©rJ   s    rN   r{   ÚImageGeneration.fallback_modelÕ  s   € ð ×+Ñ+Ð+rZ   c                ó   • Xl         g ©NrŸ   )rJ   r–   s     rN   r{   r¡   Ý  s
   € ð
 (-Õ$rZ   c                óØ   • [        U R                  [        5      (       a  U R                  $ [        U R                  [        5      (       a  [        U R                  5      $ U R                  $ )a«  The generator or model to build `generate_image` from, if a direct one is configured.

A `'provider:model'` name is wrapped in a generator here rather than at construction: the
field keeps what the caller declared, since `dataclasses.replace` feeds it back through
`__post_init__`, where a generator on `fallback_image_model` is refused. Cached so that a
capability resolved more than once -- a `DynamicCapability` re-resolves its toolset per
request -- keeps generating through one generator, which is what caches the inferred model
and the provider client behind it. A `cached_property` because that is the shape `combine`
knows to discard and recompute against the merged fields.
)rŽ   r_   r   rb   rF   r    s    rN   Ú_direct_generatorÚ!ImageGeneration._direct_generatorä  sO   € ô �d—j‘j¤.×1Ñ1Ø—:‘:ÐÜ�d×/Ñ/´×5Ñ5Ü! $×";Ñ";Ó<Ð<Ø×(Ñ(Ð(rZ   c                ó   • U R                   SL$ )zóWhether this capability generates through the direct image API.

Derived rather than recorded, so every instance the framework builds from this
configuration -- `dataclasses.replace`, `combine` -- reads the same answer as the
constructed one.
N)r¥   r    s    rN   r�   Ú%ImageGeneration._has_direct_generatorö  s   € ð ×%Ñ%¨TÐ1Ð1rZ   c                óJ   >• [         TU ]  5       =(       d    U R                  S L$ r£   )r•   Ú_has_local_fallbackrb   )rJ   r›   s    €rN   rª   Ú#ImageGeneration._has_local_fallback   s$   ø€ ô
 ‰wÑ*Ó,×U°×0IÑ0IÐQUÐ0UÐUrZ   c                óþ   >• [         TU ]  U5      n[        X 5      (       d   eU Vs/ s H5  n[        U[        5      (       d  M  UR                  c  M)  UR                  PM7     nnU(       a  [        X$S   S9$ U$ s  snf )aq  Merge like `NativeOrLocalTool`, except that `dimensions` is one value, not a collection.

The default merge unions two sequences, and a `(width, height)` pair's entries are not
independent: `(1024, 1024)` beside `(1536, 1024)` unions to `(1024, 1536)`, a flipped
orientation neither instance asked for, and two disjoint pairs union to a three-element
tuple that is no size at all. It takes the later stated value instead, the rule the scalar
fields already get.

Applied after the base merge because `__post_init__` reads only whether `dimensions` is
set, never what it is, and a merge never turns a stated pair into `None`.
éÿÿÿÿ)rr   )r•   ÚcombinerŽ   r]   rr   r   )ÚclsÚcapabilitiesÚmergedÚ
capabilityr—   r›   s        €rN   r®   ÚImageGeneration.combine  s…   ø€ ô ‘‘ Ó.ˆÜ˜&×&Ñ&Ð&Ð&ñ +ó
â*�
Ü˜*¤o×6ó "à;E×;PÑ;Pó "ˆJ×!Ô!Ù*ð 	ð 
ö
 BHŒ˜v¸±*Ñ=ÐSÈVÐSùò
s   §A:ÁA:ÁA:c               óò   • [        U[        5      (       a$  [        U5      S:w  a  [        S5      eUS   US   4nU " S0 SU_SU_SU_SU_S	U_S
U_SU_SU_SU_SU	_SU
_SU_SU_SU_SU_SU_SU_SU_SU_6$ )a­  Construct from the JSON/YAML-serializable subset of the runtime API.

Runtime objects, such as the `ImageGenerationModel` that `fallback_image_model` also takes
and the `ImageGenerator`, `Tool`, toolset and callables `local` takes, can be passed to
`ImageGeneration(...)` directly but cannot be represented in an agent spec. A direct image
model name is serializable and can be passed as `fallback_image_model='provider:model'`.
r=   z?Image generation `dimensions` must contain exactly two integersr   r*   rx   r_   r`   r{   rb   r8   rd   rf   rh   r:   rj   rl   rn   rp   rr   rt   rw   ry   rz   rQ   )rŽ   ÚlistrG   r   )r¯   rx   r_   r`   rb   r8   rd   rf   rh   r:   rj   rl   rn   rp   rr   rt   rw   ry   rz   r{   s                       rN   Ú	from_specÚImageGeneration.from_spec  s  € ôJ �j¤$×'Ñ'Ü�:‹ !Ó#ÜÐ aÓbÐbØ$ Q™-¨°A©Ð7ˆJáò 
Ùð
áð
ñ %<ð
ñ *ð	
ñ
 "6ð
ñ ð
ñ "ð
ñ *ð
ñ "ð
ñ $ð
ñ  2ð
ñ (ð
ñ ð
ñ ð
ñ "ð
ñ  &ð!
ñ" ð#
ñ$ (ð%
ñ& $ð'
ð 	
rZ   c                óª   • / nU R                   b  UR                  S5        U R                  b%  U R                  [        ;  a  UR                  S5        U$ )z8Geometry settings the native tool has no way to express.rr   rt   )rr   Úappendrt   Ú_NATIVE_IMAGE_ASPECT_RATIOS)rJ   Údirect_onlys     rN   r”   Ú%ImageGeneration._direct_only_geometry]  sM   € à!#ˆØ�?‰?Ñ&Ø×Ñ˜|Ô,Ø×ÑÑ(¨T×->Ñ->ÔFaÓ-aØ×Ñ˜~Ô.ØÐrZ   c                óü   • SU R                   4SU R                  4SU R                  4SU R                  4SU R                  4SU R
                  4SU R                  44 VVs/ s H  u  pUc  M
  UPM     snn$ s  snnf )zJSettings only the native tool can express, which a direct generator drops.rd   rf   rh   rj   rl   rn   rp   )rd   rf   rh   rj   rl   rn   rp   )rJ   rˆ   r–   s      rN   r�   Ú%ImageGeneration._native_only_settingsf  s�   € ð ˜tŸ™Ð/Ø! 4×#6Ñ#6Ð7Ø˜tŸ™Ð/Ø% t×'>Ñ'>Ð?Ø  $×"4Ñ"4Ð5Ø˜DŸL™LÐ)Ø˜Ÿ™Ð#ñ ô
ò ‘�ð ÷ ñ ò
ð 	
ùó 
s   Á!	A8Á.A8c                óT  • 0 n/ nU R                   b5  U R                   [        ;   a  U R                   US'   OUR                  S5        U R                  b#  U R                  [        ;   a  U R                  US'   U R
                  (       d  UR                  U R                  5       5        X4$ )u“  The geometry settings the native tool can express, and the ones it can't.

`dimensions` and `aspect_ratio` are only reported as ignored when no direct generator is
configured, since the `generate_image` tool built for one forwards both. `size` has no
direct counterpart, so it is dropped whichever path runs.

That suppression is a construction-time approximation: this runs from `__post_init__`, before
a model exists, while native-vs-local is decided per request in `models.resolve_request_tools`.
Warning here regardless would fire on every configuration whose model has no native image
generation, where the settings *are* applied. The case it misses â€” `native=True` plus a natively
capable model, which drops the direct generator â€” is warned about per request instead, from the
prepare function `get_toolset` installs.

Split out of `_image_gen_kwargs` only to keep that method under the complexity limit.
rp   rt   )rp   Ú_NATIVE_IMAGE_SIZESr¹   rt   rº   r�   Úextendr”   )rJ   Úkwargsr™   s      rN   r“   Ú ImageGeneration._native_geometryx  sŽ   € ð  "$ˆØˆØ�9‰9Ñ Ø�y‰yÔ/Ó/Ø!%§¡��v’à—‘˜vÔ&Ø×ÑÑ(¨T×->Ñ->ÔB]Ó-]Ø%)×%6Ñ%6ˆF�>Ñ"Ø×)×)Ø�N‰N˜4×5Ñ5Ó7Ô8ØˆÐrZ   c                ó  • 0 nU R                   b  U R                   US'   U R                  b  U R                  US'   U R                  b  U R                  US'   U R                  b  U R                  US'   U R                  b  U R                  US'   U R
                  b  U R
                  US'   U R                  5       u  p#UR                  U5        U R                  b  U R                  US'   U R                  b  U R                  US'   U$ )	zDCollect settings supported by the native `ImageGenerationTool` path.rd   rf   rh   rj   rl   rn   r8   Úmodel)
rd   rf   rh   rj   rl   rn   r“   Úupdater8   r:   )rJ   rÂ   Úgeometryrš   s       rN   Ú_image_gen_kwargsÚ!ImageGeneration._image_gen_kwargs•  sù   € à!#ˆØ�?‰?Ñ&Ø#'§?¡?ˆF�<Ñ Ø×ÑÑ*Ø'+×':Ñ':ˆFÐ#Ñ$Ø�?‰?Ñ&Ø#'§?¡?ˆF�<Ñ Ø×"Ñ"Ñ.Ø+/×+BÑ+BˆFÐ'Ñ(Ø×ÑÑ)Ø&*×&8Ñ&8ˆF�?Ñ#Ø�<‰<Ñ#Ø $§¡ˆF�9Ñà×+Ñ+Ó-‰ˆØ�‰�hÔà�;‰;Ñ"Ø#Ÿ{™{ˆF�8ÑØ×ÑÑ'Ø"×.Ñ.ˆF�7‰OØˆrZ   c                ó4   • [        S0 U R                  5       D6$ )NrQ   )r"   rÈ   r    s    rN   Ú_default_nativeÚImageGeneration._default_native®  s   € Ü"Ñ> T×%;Ñ%;Ó%=Ñ>Ð>rZ   c                óL   • [        [        U 5      R                   SU< S35      e)Nz	: `local=z§` is not supported. Pass an `ImageGenerator`, `Tool`, `AbstractToolset`, or callable directly, or name a direct image model as `fallback_image_model='provider:model'`.)r   r   rS   )rJ   rˆ   s     rN   Ú_resolve_local_strategyÚ'ImageGeneration._resolve_local_strategy±  s1   € ô Ü�D‹z×"Ñ"Ð# 9¨T©Hð 57ð 7ó
ð 	
rZ   c           	     ód  • 0 nU R                   b  U R                   US'   U R                  nUcB  U R                   c5  [        U R                  [        5      (       a  U R                  R                  nUb  X2S'   [
        [           " [        UUU R                  U R                  S9R                  SSS9$ )aP  Build the `generate_image` tool from the capability's current settings.

Derived when the toolset is requested rather than stored at construction, so what the tool
carries is always what the capability declares: `dataclasses.replace` and `combine` both
produce an instance whose fields no longer match a tool built from an earlier one.
rr   rt   )r5   r6   r8   r:   Úgenerate_imagez,Generate an image based on the given prompt.)rˆ   rz   )rr   rt   rŽ   rx   r"   r&   r   r2   r8   r:   rO   )rJ   r5   r6   rt   s       rN   Ú_direct_local_toolÚ"ImageGeneration._direct_local_toolº  s§   € ð -/ˆØ�?‰?Ñ&Ø%)§_¡_ˆH�\Ñ"ð ×(Ñ(ˆØÑ D§O¡OÑ$;Ä
È4Ï;É;ÔXk×@lÑ@lØŸ;™;×3Ñ3ˆLØÑ#Ø'3�^Ñ$Ü”CŠyÜ&Ø#Ø!Ø—{‘{Ø ×,Ñ,ñ	÷
 ‰hØ!ØFñ	
ð 		
rZ   c                ó"   • [         R                  $ r£   )r"   Úkindr    s    rN   Ú_native_unique_idÚ!ImageGeneration._native_unique_idÚ  s   € Ü"×'Ñ'Ð'rZ   c                óJ   • U R                  [        U R                  5       5      $ )zVGet the ImageGenerationTool for the fallback, with capability-level overrides applied.)Ú_resolve_native_with_overridesr"   rÈ   r    s    rN   Ú_resolved_nativeÚ ImageGeneration._resolved_nativeÝ  s   € à×2Ñ2Ô3FÈ×H^ÑH^ÓH`ÓaÐarZ   c                óh   • U R                   c  g SSKJn  U" U R                   U R                  5       S9$ )Nr   )Úimage_generation_tool)rÅ   Únative_tool)r`   Ú)pydantic_ai.common_tools.image_generationrÝ   rÚ   )rJ   rÝ   s     rN   Ú_default_localÚImageGeneration._default_localá  s1   € Ø×'Ñ'Ñ/ØÝSá$¨4×+GÑ+GÐUY×UjÑUjÓUlÑmÐmrZ   c                ó¸  >^^^• U nU R                   =nb  [        X R                  U5      S9n[        [        U]  5       n[        U[        5      (       a0  [        U R                  [        5      (       a  U R                  (       d  U$ U R                  5       mU R                  5       mT(       d	  T(       d  U$ UR                  m      SUUU4S jjn[        X4S9$ )N)r_   c                óä  >• U R                   R                  S5      n[        U[        5      (       a¸  [        UR
                  R                  S[        5      ;   nU(       aB  T(       a;  [        R                  " SUR                   SSR                  T5       S3[        SS9  OHU(       dA  T(       a:  [        R                  " [        R                  SR                  T5      S	9[        SS9  T" X5      $ )
NrÅ   Úsupported_native_toolszEThe `ImageGeneration` native tool supersedes the direct generator on z*, so direct-only setting(s) go unapplied: r„   z(. Pass `native=False` to guarantee them.r=   r>   r@   )Ú__dict__ÚgetrŽ   r   r"   Úprofiler   rB   rC   Ú
model_namer�   rD   r‘   r’   )ÚctxÚ	tool_defsrÅ   Únative_supersedesÚadd_unless_nativer»   r˜   s       €€€rN   Ú*_warn_about_settings_the_chosen_path_dropsÚOImageGeneration.get_toolset.<locals>._warn_about_settings_the_chosen_path_drops  sØ   ø€ ð +.¯,©,×*:Ñ*:¸7Ó*CˆEÜ˜%¤×'Ñ'ô %8¸5¿=¹=×;LÑ;LØ,Ô.Dó<ñ %Ð!ö %®Ü—M’MØ_Ð`e×`pÑ`pÐ_qð rCØCGÇ9Á9È[ÓCYÐBZð [AðAô $Ø#$óö +®{Ü—M’MÜ5×<Ñ<ÀdÇiÁiÐP[ÓF\Ð<Ð]Ü#Ø#$òñ
 % SÓ4Ð4rZ   )Úprepare_func)ré   zRunContext[AgentDepsT]rê   zlist[ToolDefinition]rR   z6Awaitable[list[ToolDefinition]] | list[ToolDefinition])r¥   r   rÒ   r•   r]   Úget_toolsetrŽ   r)   rx   r"   r�   r”   r�   rï   r   )	rJ   r²   r5   Útoolsetrí   rì   r»   r˜   r›   s	        @@@€rN   rð   ÚImageGeneration.get_toolsetè  sÐ   û€ Øˆ
Ø×/Ñ/Ð/ˆIÑ<ô
 )¨×5LÑ5LÈYÓ5WÑXˆJÜœ¨Ñ@ÓBˆô ˜7¤O×4Ñ4Ü˜dŸk™kÔ+>×?Ñ?Ø×-×-àˆNà×0Ñ0Ó2ˆØ×0Ñ0Ó2ˆÞ¦;ØˆNà#×0Ñ0Ðð 	5Ø'ð 	5Ø4Hð 	5àC÷ 	5ñ  	5ôD �wÑXÐXrZ   )r8   rt   rd   ry   rz   rr   rb   r`   rw   r:   rf   r_   rh   rx   rj   rl   rn   rp   )(rx   zƒImageGenerationTool | Callable[[RunContext[AgentDepsT]], Awaitable[ImageGenerationTool | None] | ImageGenerationTool | None] | boolr_   zlImageGenerator | Tool[AgentDepsT] | Callable[..., Any] | AbstractToolset[AgentDepsT] | Literal[False] | Noner`   ú�Model | KnownModelName | str | Callable[[RunContext[AgentDepsT]], Awaitable[Model | KnownModelName | str] | Model | KnownModelName | str] | Nonerb   ra   r8   r7   rd   rc   rf   re   rh   rg   r:   r9   rj   ri   rl   rk   rn   rm   rp   ro   rr   rq   rt   rs   rw   rv   ry   Úboolrz   rv   r{   ró   rR   ÚNone)rR   rõ   )rR   r.   )r–   r.   rR   rõ   )rR   z,ImageGenerator | ImageGenerationModel | None)rR   rô   )r°   z(Sequence[AbstractCapability[AgentDepsT]]rR   zAbstractCapability[AgentDepsT])(rx   zImageGenerationTool | boolr_   zLiteral[False] | Noner`   úKnownModelName | str | Nonerb   rv   r8   r7   rd   rc   rf   re   rh   rg   r:   r9   rj   ri   rl   rk   rn   rm   rp   ro   rr   rq   rt   rs   rw   rv   ry   rô   rz   rv   r{   rö   rR   zImageGeneration[AgentDepsT])rR   z	list[str])rR   z tuple[dict[str, Any], list[str]])rR   zdict[str, Any])rR   r"   )rˆ   z
str | boolrR   z.Tool[AgentDepsT] | AbstractToolset[AgentDepsT])r5   r4   rR   z	Tool[Any])rR   rF   )rR   z%ImageGenerationNativeTool[AgentDepsT])rR   z5Tool[AgentDepsT] | AbstractToolset[AgentDepsT] | None)rR   z"AbstractToolset[AgentDepsT] | None)$rS   rT   rU   rV   rW   r_   rX   rb   rw   r�   r€   Úpropertyr   r   r{   Úsetterr	   r¥   r�   rª   Úclassmethodr®   r¶   r”   r�   r“   rÈ   rË   rÎ   rÒ   rÖ   rÚ   rà   rð   rY   Ú__classcell__)r›   s   @rN   r]   r]   g   s	  ø‡ ñð2 	ð 
Ðsó ðð :Ó9ðð ?CÐÐ;ÓBðð& 7Ó6ðð @Ó?ðð 2Ó1ðð .Ó-ðð 1Ó0ðð #Ó"ðð 9Ó8ðð =Ó<ðð Óðð 'Ó&ð	ð 4Ó3ðð (€Bˆ
Ó'ðð ð ð
 ØBFØ=AØFJØ8<Ø48Ø7;Ø)-Ø?CØCGØ!%Ø-1Ø:>Ø+Ø#Ø"&ð ñKAððAððAð"ðAð" @ð#Að$ ;ð%Að& Dð'Að( 6ð)Að* 2ð+Að, 5ð-Að. 'ð/Að0 =ð1Að2 Að3Að4 ð5Að6 +ð7Að8 8ð9Að: ð;Að< ð=Að>  ð?AðBðCAðL 
õMA÷Fjð^ ÙØPÐ[wñó,óó ð,ð ×ÑÙØPÐ[wñó-óó ð-ð ó)ó ð)ð" ó2ó ð2÷Vð öTó ðTð* ð .2Ø'+Ø?CØ+/Ø=AØFJØ8<Ø48Ø7;Ø)-Ø?CØCGØ!%Ø-1Ø:>Ø+Ø#Ø"&ð 7;ñ1=
ð +ð=
ð %ð	=
ð
 "=ð=
ð )ð=
ð ;ð=
ð Dð=
ð 6ð=
ð 2ð=
ð 5ð=
ð 'ð=
ð =ð=
ð Að=
ð ð=
ð  +ð!=
ð" 8ð#=
ð$ ð%=
ð& ð'=
ð(  ð)=
ð0 4ð1=
ð2 
%ô3=
ó ð=
ô~ô
ô$ô:ô2?ô
ô
ô@(ôbôn÷=Yõ =YrZ   r]   )IÚ
__future__r   rB   Úcollections.abcr   r   r   Údataclassesr   r   Ú	functoolsr	   Útypingr
   r   r   r   Útyping_extensionsr   Úpydantic_ai._utilsr   Úpydantic_ai._warningsr   Úpydantic_ai.exceptionsr   r   r   r   Úpydantic_ai.imagesr   r   r   r   r   Úpydantic_ai.images._validationr   Úpydantic_ai.messagesr   Úpydantic_ai.modelsr   r   r   Úpydantic_ai.native_toolsr   r    r!   r"   r#   Úpydantic_ai.toolsr$   r%   r&   r'   Úpydantic_ai.toolsetsr(   Úpydantic_ai.toolsets.preparedr)   Ú_deprecated_fallback_modelr+   Úabstractr,   Únative_or_localr-   rß   r.   r/   Ú	frozensetrÀ   rº   rA   r‘   r2   r]   rQ   rZ   rN   Ú<module>r     sð   ðÝ "ã ß 9Ñ 9ß *Ý %ß 8Ó 8å (å .Ý >ß eÓ e÷õ õ LÝ ,ß CÑ C÷õ ÷ KÓ JÝ 0Ý 9å GÝ (Ý .æßqñ  ¡¨Ó 3Ó4Ð Ù'©Ð1AÓ(BÓCÐ ðMð ð&ð ñ �4Ñ÷%ð %ó ð%ñP �Ñô}
YÐ'¨
Ñ3ó }
Yó ñ}
YrZ   