ó
    ±"³j  ã                   ó´   • S SK Jr  S SK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  S SKJr  S SKJr  S S	KJr  \ " S
 S5      5       r\ " S S5      5       rg)é    )ÚSequence)ÚKW_ONLYÚ	dataclassÚfield)Údatetime)ÚAny)Útypes)Úcalculate_price_for_usage)Únow_utc)ÚBinaryImage)ÚRequestUsagec                   óz   • \ rS rSr% Sr\\S'    \\S'   Sr\	S-  \S'    Sr
\	S-  \S'    Sr\\	\4   S-  \S'   S	rg)
ÚGeneratedImageé   zBOne generated image with normalized content and provider metadata.ÚcontentÚ_NÚrevised_promptÚoutput_formatÚprovider_details© )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Ú__annotations__r   r   Ústrr   r   Údictr   Ú__static_attributes__r   ó    ÚV/home/mande/repo/quber/.venv/lib/python3.13/site-packages/pydantic_ai/images/result.pyr   r      sP   ‡ áLàÓØ;àƒJà!%€N�C˜$‘JÓ%Ø<à $€M�3˜‘:Ó$ØVà.2Ð�d˜3 ˜8‘n tÑ+Ó2Ú=r    r   c                   ó  • \ rS rSr% Sr\\   \S'    \\S'   \	\S'    \	\S'    \	\S'    \
" \S9r\\S	'    \
" \S9r\\S
'    Sr\\	\4   S-  \S'    Sr\	S-  \S'    Sr\	S-  \S'    \S\4S j5       rS\R2                  4S jrSrg)ÚImageGenerationResulté!   z,The result of an image generation operation.Úimagesr   ÚpromptÚ
model_nameÚprovider_name)Údefault_factoryÚ	timestampÚusageNr   Úprovider_response_idÚprovider_urlÚreturnc                 ó4   • U R                   S   R                  $ )a?  The first generated image. Use `images` when the request asked for more than one.

A result always holds at least one image: the
[`ImageGenerationModel.generate`][pydantic_ai.images.ImageGenerationModel.generate] contract
requires an implementation with nothing to return to raise instead of returning an empty result.
r   )r%   r   ©Úselfs    r!   ÚimageÚImageGenerationResult.imageB   s   € ð �{‰{˜1‰~×%Ñ%Ð%r    c                 ó°   • U R                   (       d   S5       e[        U R                  U R                   U R                  U R                  U R
                  S9$ )a-  Calculate the cost of the image generation request.

Uses [`genai-prices`](https://github.com/pydantic/genai-prices) for pricing data.

Models priced per token are covered, such as the GPT Image and Gemini image families. The
Grok Imagine family raises `LookupError`: it has no entry in the pricing data, and there is
no unit that counts generated images to price it with.

Returns:
    A price calculation object with `total_price`, `input_price`, and other cost details.

Raises:
    LookupError: If pricing data is not available for this model/provider.
z)Model name is required to calculate price)r'   Úprovider_api_urlr(   Úgenai_request_timestamp)r'   r
   r+   r-   r(   r*   r0   s    r!   ÚcostÚImageGenerationResult.costL   sJ   € ð ��ÐKÐ KÓKˆÜ(Ø�J‰JØ—‘Ø!×.Ñ.Ø×,Ñ,Ø$(§N¡Nñ
ð 	
r    r   )r   r   r   r   r   r   r   r   r   r   r   Ú_now_utcr*   r   r   r+   r   r   r   r,   r-   Úpropertyr   r2   Úgenai_typesÚPriceCalculationr7   r   r   r    r!   r#   r#   !   s¾   ‡ á6à�^Ñ$Ó$ØàƒJàƒKØ/àƒOØ:àÓØ#á°Ñ9€IˆxÓ9Ø5á°Ñ=€Eˆ<Ó=Ø,à.2Ð�d˜3 ˜8‘n tÑ+Ó2Ø6à'+Ð˜# ™*Ó+ØNà#€L�#˜‘*Ó#Ø)àð&�{ó &ó ð&ð
�k×2Ñ2÷ 
r    r#   N)Úcollections.abcr   Údataclassesr   r   r   r   Útypingr   Úgenai_pricesr	   r;   Úpydantic_ai._genai_pricesr
   Úpydantic_ai._utilsr   r9   Úpydantic_ai.messagesr   Úpydantic_ai.usager   r   r#   r   r    r!   Ú<module>rE      sX   ðÝ $ß 1Ñ 1Ý Ý å -å ?Ý 2Ý ,Ý *ð ÷>ð >ó ð>ð$ ÷@
ð @
ó ñ@
r    