o
    ưi                     @  sV   d Z ddlmZ ddlZddlmZmZmZ ddlm	Z	 ddl
mZ G dd	 d	ZdS )
z.Factory helpers for Focus export destinations.    )annotationsN)AnyDictOptional   )FocusDestination)FocusS3Destinationc                   @  s2   e Zd ZdZedddddZedddZdS )FocusDestinationFactoryz?Builds destination instances based on provider/config settings.N)configproviderstrprefixr
   Optional[Dict[str, Any]]returnr   c                 C  s>   |   }tj||p
i d}|dkrt||dS td|  d)z?Return a destination implementation for the requested provider.)r   	overridess3)r   r
   
Provider 'z ' not supported for Focus export)lowerr	   _resolve_configr   NotImplementedError)r   r   r
   Zprovider_lowerZnormalized_config r   f/home/app/Keep/.python/lib/python3.10/site-packages/litellm/integrations/focus/destinations/factory.pycreate   s   
zFocusDestinationFactory.creater   Dict[str, Any]c                 C  s   | dkrO| dptd| dptd| dptd| dp(td	| d
p1td| dp:tdd}| dsFtddd | D S td|  d)Nr   bucket_nameZFOCUS_S3_BUCKET_NAMEregion_nameZFOCUS_S3_REGION_NAMEendpoint_urlZFOCUS_S3_ENDPOINT_URLaws_access_key_idZFOCUS_S3_ACCESS_KEYaws_secret_access_keyZFOCUS_S3_SECRET_KEYaws_session_tokenZFOCUS_S3_SESSION_TOKEN)r   r   r   r   r   r   z4FOCUS_S3_BUCKET_NAME must be provided for S3 exportsc                 S  s   i | ]\}}|d ur||qS )Nr   ).0kvr   r   r   
<dictcomp>8   s    z;FocusDestinationFactory._resolve_config.<locals>.<dictcomp>r   z.' not supported for Focus export configuration)getosgetenv
ValueErroritemsr   )r   r   resolvedr   r   r   r   !   s(   







z'FocusDestinationFactory._resolve_config)r   r   r   r   r
   r   r   r   )r   r   r   r   r   r   )__name__
__module____qualname____doc__staticmethodr   r   r   r   r   r   r	      s    r	   )r-   
__future__r   r%   typingr   r   r   baser   Zs3_destinationr   r	   r   r   r   r   <module>   s    