
    i                         d dl mZmZmZmZ d dlZd dlmZ d dlm	Z	 erd dl
mZ dee   defdZ G d	 d
e      Z G d d      Zy)    )
NamedTupleOptionalDictTYPE_CHECKINGN)PineconeConfigurationError)OpenApiConfigFactory)Configurationhostreturnc                 ^    | y| j                  d      r| S | j                  d      r| S d| z   S )N zhttps://zhttp://)
startswith)r
   s    h/var/www/catia.catastroantioquia-mas.com/valormas/lib/python3.12/site-packages/pinecone/config/config.pynormalize_hostr      s7    |z"y!    c                       e Zd ZU dZeed<   dZeed<   dZee   ed<   dZ	ee
eef      ed<   dZee   ed<   dZee   ed<   i Zee
eef      ed	<   dZee   ed
<   y)Configr   api_keyr
   N	proxy_urlproxy_headersssl_ca_certs
ssl_verifyadditional_headers
source_tag)__name__
__module____qualname__r   str__annotations__r
   r   r   r   r   r   r   boolr   r    r   r   r   r      s|    GSD#N#Ix}#.2M8DcN+2"&L(3-&!%J%35c3h05 $J$r   r   c                       e Zd ZdZ	 eddddddi fdee   dee   dee   deeeef      dee   dee   d	eeeef      d
e	fd       Z
e	 dde	ded   d
dfd       Zy)ConfigBuilderz

    Configurations are resolved in the following order:

    - configs passed as keyword parameters
    - configs specified in environment variables
    - default values (if applicable)
    Nr   r
   r   r   r   r   r   r   c           
         | xs) |j                  dd       xs t        j                  d      } |xs |j                  dd       }t        |      }|j                  dd       }| st	        d      |st	        d      t        | |||||||      S )Nr   PINECONE_API_KEYr
   r   zYou haven't specified an API key. Please either set the PINECONE_API_KEY environment variable or pass the 'api_key' keyword argument to the Pinecone client constructor.zYou haven't specified a host.)poposgetenvr   r   r   )	r   r
   r   r   r   r   r   kwargsr   s	            r   buildzConfigBuilder.build2   s     YVZZ	48YBIIFX<Y/vzz&$/d#ZZd3
, {  ,-LMM	
 		
r   configopenapi_configOpenApiConfigurationc                    |r-t        j                  || j                  | j                        }n-|+t        j                  | j                  | j                        }| j
                  r| j
                  |_        | j                  r| j                  |_        | j                  r| j                  |_	        | j                  | j                  |_        |S )N)r,   r   r
   )r   r
   )r   copyr   r
   r*   r   proxyr   r   ssl_ca_certr   
verify_ssl)r+   r,   r)   s      r   build_openapi_configz"ConfigBuilder.build_openapi_configT   s     166-v~~FKKN #177U[U`U`aN #)#3#3N +1+?+?N()/)<)<N&((.(9(9N%r   )N)r   r   r   __doc__staticmethodr   r   r   r    r   r*   r3   r!   r   r   r#   r#   !   s     !%"#'26&*%)79
#
sm
 C=
  S#X/	

 sm
 TN
 %T#s(^4
 

 
B KO(01G(H	 r   r#   )typingr   r   r   r   r'   pinecone.exceptionsr   &pinecone.config.openapi_config_factoryr   %pinecone.config.openapi_configurationr	   r-   r   r   r   r#   r!   r   r   <module>r:      sI    < < 	 : G[# 3 %Z %K Kr   