Ë
    tPêjŽ  ã                   óþ   — U d dl mZmZmZ erd dlmZ d dlmZmZ ddl	m
Z
 d dlmZ d dlmZmZmZ ddl	mZm
Z
 dZeedz     ed	<   d
eddfd„Zdd„Zdededefd„Zej&                  j(                  eiZeed<   g d¢Zy)é    )ÚTYPE_CHECKINGÚAnyÚFinal)ÚCustomPromptManagement)ÚPromptLiteLLMParamsÚ
PromptSpecé   )ÚGitLabPromptManager)r   r   ÚSupportedPromptIntegrations)ÚGitLabPromptCacher
   NÚglobal_gitlab_configÚconfigÚreturnc                 ó   — ddl }| |_        y)af  
    Set the global gitlab configuration for prompt management.

    Args:
        config: Dictionary containing gitlab configuration
                - workspace: gitlab workspace name
                - repository: Repository name
                - access_token: gitlab access token
                - branch: Branch to fetch prompts from (default: main)
    r   N)Úlitellmr   )r   r   s     úi/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/litellm/integrations/gitlab/__init__.pyÚset_global_gitlab_configr      s   € ó à#)€GÕ ó    Úlitellm_paramsc                 ó–   — t        | dd«      }t        | dd«      }|st        d«      ‚	 t        ||¬«      }|S # t        $ r}|‚d}~ww xY w)z7
    Initialize a prompt from a Gitlab repository.
    Úgitlab_configNÚ	prompt_idú7gitlab_config is required for gitlab prompt integration)r   r   )ÚgetattrÚ
ValueErrorr
   Ú	Exception)r   Úprompt_specr   r   Úgitlab_prompt_managerÚes         r   Úprompt_initializerr    "   sb   € ô # >°?ÀDÓI€MÜ˜~¨{¸DÓA€IáÜÐRÓSÐSðÜ':Ø'Øô(
Ðð
 %Ð$øÜò Øˆûðús   ©8 ¸	AÁAÁAÚpromptc                 óˆ   — t        | dd«      xs i }t        | dd«      }|st        d«      ‚t        ||j                  |¬«      S )a8  
    Build a GitLab-backed prompt manager for this prompt.
    Expected fields on litellm_params:
      - prompt_integration="gitlab"  (handled by the caller)
      - gitlab_config: Dict[str, Any] (project/access_token/branch/prompts_path/etc.)
      - git_ref (optional): per-prompt tag/branch/SHA override
    r   NÚgit_refr   )r   r   Úref)r   r   r
   r   )r   r!   r   r#   s       r   Ú_gitlab_prompt_initializerr%   7   sT   € ô ,3°>À?ÐTXÓ+YÒ+_Ð]_€MÜ!(¨¸ÀDÓ!I€GáÜÐRÓSÐSô Ø#Ø×"Ñ"Øôð r   Úprompt_initializer_registry)r   r
   r   r   )r   r   r   r   r   r   )Útypingr   r   r   Ú-litellm.integrations.custom_prompt_managementr   Ú"litellm.types.prompts.init_promptsr   r   r   r
   r   r   r   ÚdictÚ__annotations__r   r    r%   ÚGITLABÚvaluer&   Ú__all__© r   r   ú<module>r0      sš   ðß ,Ò ,áÝTßRå:å Pß kÑ kç Ið ,0Ð �e˜D 4™KÑ(Ó /ð* Tð *¨dó *ó ð*Ø'ðàðð óð:  ×&Ñ&×,Ñ,Ð.Hð&Ð ˜Uó ò
�r   