
    j                         U d dl mZmZ erddlmZmZ d dlmZmZ d dl	m
Z
 d dlmZ ddlmZ dZee   ed	<   dZed
   ed<   deddfdZ	 	 	 	 	 	 ddZej(                  j*                  eiZg dZy)    )TYPE_CHECKINGOptional   )PromptManagerPromptTemplate)PromptLiteLLMParams
PromptSpec)CustomPromptManagement)SupportedPromptIntegrations)DotpromptManagerNglobal_prompt_directoryr   global_prompt_manager	directoryreturnc                     ddl }| |_        y)z
    Set the global prompt directory for dotprompt files.

    Args:
        directory: Path to directory containing .prompt files
    r   N)litellmr   )r   r   s     /Users/manta/Documents/Projects/TheRoad-I1/backend/.venv/lib/python3.12/site-packages/litellm/integrations/dotprompt/__init__.pyset_global_prompt_directoryr      s     &/G#    c                     t        | dd      }t        | dd      }t        | dd      }|rt        d      t        | dd      }	 t        ||||      }|S # t        $ r}|d}~ww xY w)z2
    Initialize a prompt from a .prompt file.
    prompt_directoryNprompt_data	prompt_idzgCannot set prompt_directory when working with prompt_initializer. Needs to be a specific dotprompt fileprompt_file)r   r   r   r   )getattr
ValueErrorr   	Exception)litellm_paramsprompt_specr   r   r   r   dot_prompt_manageres           r   prompt_initializerr"      s     ~/A4H.->KT:Iu
 	
 .->K--##	
 "! s   A 	A$AA$)r   r   r   r   r   r   )r   r   r   r	   r   r
   )typingr   r   prompt_managerr   r   "litellm.types.prompts.init_promptsr   r	   -litellm.integrations.custom_prompt_managementr
   r   dotprompt_managerr   r   str__annotations__r   r   r"   
DOT_PROMPTvalueprompt_initializer_registry__all__ r   r   <module>r/      s    * *=RT J / *. # -37 x0 7	03 	04 	0)8D>  **002D 
r   