o
    i                     @  s   d dl mZ d dlZd dlZd dlmZ d dlmZ d dl	m
Z
 d dlmZ d dlmZ d dlmZ ed	G d
d deej ZdS )    )annotationsN)
deprecated)ModelProfile)	UserError)cached_async_http_clientgoogle_model_profile)ProviderzS`GoogleGLAProvider` is deprecated, use `GoogleProvider` with `GoogleModel` instead.c                   @  sN   e Zd ZdZedd ZedddZedd	d
ZdddZddddZ	dS )GoogleGLAProviderz/Provider for Google Generative Language AI API.c                 C     dS )N
google-gla selfr   r   f/var/www/html/karishye-ai-python/venv/lib/python3.10/site-packages/pydantic_ai/providers/google_gla.pyname      zGoogleGLAProvider.namereturnstrc                 C  r   )Nz8https://generativelanguage.googleapis.com/v1beta/models/r   r   r   r   r   base_url   r   zGoogleGLAProvider.base_urlhttpx.AsyncClientc                 C  s   | j S N)_clientr   r   r   r   client   s   zGoogleGLAProvider.client
model_nameModelProfile | Nonec                 C  s   t |S r   r   )r   r   r   r   r   model_profile   s   zGoogleGLAProvider.model_profileNapi_key
str | Nonehttp_clienthttpx.AsyncClient | NoneNonec                 C  sD   |pt d}|std|ptdd| _| j| j_|| jjd< dS )a5  Create a new Google GLA provider.

        Args:
            api_key: The API key to use for authentication, if not provided, the `GEMINI_API_KEY` environment variable
                will be used if available.
            http_client: An existing `httpx.AsyncClient` to use for making HTTP requests.
        GEMINI_API_KEYz|Set the `GEMINI_API_KEY` environment variable or pass it via `GoogleGLAProvider(api_key=...)`to use the Google GLA provider.r   )providerzX-Goog-Api-KeyN)osgetenvr   r   r   r   headers)r   r   r   r   r   r   __init__"   s   
zGoogleGLAProvider.__init__)r   r   )r   r   )r   r   r   r   )NN)r   r   r   r    r   r!   )
__name__
__module____qualname____doc__propertyr   r   r   r   r'   r   r   r   r   r
      s    

r
   )
__future__r   _annotationsr$   httpxtyping_extensionsr   pydantic_air   pydantic_ai.exceptionsr   pydantic_ai.modelsr   pydantic_ai.profiles.googler   pydantic_ai.providersr	   AsyncClientr
   r   r   r   r   <module>   s    