ó
    ±"³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J	r	  S SK
JrJr  S SKJr  S SKJr  \	S   r \ " S	 S
5      5       rg)é    )ÚSequence)ÚKW_ONLYÚ	dataclassÚfield)Údatetime)ÚAnyÚLiteral)Ú
calc_priceÚtypes)Únow_utc)ÚRequestUsage)ÚqueryÚdocumentc                   ó  • \ rS rSr% Sr\\\      \S'    \\S'   \\	   \S'    \
\S'    \	\S'    \	\S'    \" \S	9r\\S
'    \" \S	9r\\S'    Sr\\	\4   S-  \S'    Sr\	S-  \S'    S\\	-  S\\   4S jrS\R0                  4S jrSrg)ÚEmbeddingResulté   a¯  The result of an embedding operation.

This class contains the generated embeddings along with metadata about
the operation, including the original inputs, model information, usage
statistics, and timing.

Example:
```python
from pydantic_ai import Embedder

embedder = Embedder('openai:text-embedding-3-small')


async def main():
    result = await embedder.embed_query('What is AI?')

    # Access embeddings by index
    print(len(result.embeddings[0]))
    #> 1536

    # Access embeddings by original input text
    print(result['What is AI?'] == result.embeddings[0])
    #> True

    # Check usage
    print(f'Tokens used: {result.usage.input_tokens}')
    #> Tokens used: 3
```
Ú
embeddingsÚ_ÚinputsÚ
input_typeÚ
model_nameÚprovider_name)Údefault_factoryÚ	timestampÚusageNÚprovider_detailsÚprovider_response_idÚitemÚreturnc                 ó€   • [        U[        5      (       a  U R                  R                  U5      nU R                  U   $ )a;  Get the embedding for an input by index or by the original input text.

Args:
    item: Either an integer index or the original input string.

Returns:
    The embedding vector for the specified input.

Raises:
    IndexError: If the index is out of range.
    ValueError: If the string is not found in the inputs.
)Ú
isinstanceÚstrr   Úindexr   )Úselfr   s     ÚZ/home/mande/repo/quber/.venv/lib/python3.13/site-packages/pydantic_ai/embeddings/result.pyÚ__getitem__ÚEmbeddingResult.__getitem__U   s4   € ô �dœC× Ñ Ø—;‘;×$Ñ$ TÓ*ˆDà�‰˜tÑ$Ð$ó    c                 óš   • U R                   (       d   S5       e[        U R                  U R                   U R                  U R                  S9$ )a8  Calculate the cost of the embedding request.

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

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)Úprovider_idÚgenai_request_timestamp)r   r
   r   r   r   )r$   s    r%   ÚcostÚEmbeddingResult.costg   sA   € ð ��ÐKÐ KÓKˆÜØ�J‰JØ�O‰OØ×*Ñ*Ø$(§N¡Nñ	
ð 	
r(   © )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   ÚfloatÚ__annotations__r   r"   ÚEmbedInputTyper   Ú_now_utcr   r   r   r   r   Údictr   r   Úintr&   Úgenai_typesÚPriceCalculationr,   Ú__static_attributes__r.   r(   r%   r   r      sÉ   ‡ ñð< ˜ %™Ñ)Ó)ðð
 ƒJà�S‰MÓØ6àÓØCàƒOØ@àÓØ>á°Ñ9€IˆxÓ9Ø.á°Ñ=€Eˆ<Ó=Ø2à.2Ð�d˜3 ˜8‘n tÑ+Ó2Ø6à'+Ð˜# ™*Ó+ØNð%  c¡	ð %¨h°u©oô %ð$
�k×2Ñ2÷ 
r(   r   N)Úcollections.abcr   Údataclassesr   r   r   r   Útypingr   r	   Úgenai_pricesr
   r   r:   Úpydantic_ai._utilsr   r7   Úpydantic_ai.usager   r6   r   r.   r(   r%   Ú<module>rC      sI   ðÝ $ß 1Ñ 1Ý ß ç 9å 2Ý *àÐ,Ñ-€ðð ÷b
ð b
ó ñb
r(   