o
    phf                     @   sN   d dl mZ d dlmZ d dlZd dlmZ dZd dlm	Z	 G dd dZ
dS )	    )LLM)settingsN)Pathz(user_journey_service/config/prompts.yaml)DurationEstimatorToolc                   @   s$   e Zd Zdd Zdd Zdd ZdS )MicrolearningDurationEstimatorc              	   C   s@   t tj dtj tjtjtjtjtjtj	d| _
|  | _d S )N/)modeltemperatureapi_keyapi_baseapi_versionseedtimeout)r   r   PROVIDERLLM1TEMPERATUREOPENAI_KEY1	ENDPOINT1API_VERSION1SEEDTIMEOUTllmload_promptsprompts)self r   /home/azureuser/microlearn/backend/user_journey_with_openai/agentic_workflow/src/user_journey_service/processors/duration_estimator.py__init__!   s   	z'MicrolearningDurationEstimator.__init__c                 C   s<   t ttd}t|W  d    S 1 sw   Y  d S )Nr)openr   prompts_pathyaml	safe_load)r   fr   r   r   r   -   s   $z+MicrolearningDurationEstimator.load_promptsc                 C   sH   | j d }|j|j|j|j|j|jd}d|dg}| j|}|	 S )Nduration_estimator)	Job_Title
ExperienceSkillstopicLeveluser)rolecontent)
r   formatr%   r&   r'   r(   r)   r   callstrip)r   
input_dataprompt_templatepromptmessagesresponser   r   r   estimate_duration1   s   
z0MicrolearningDurationEstimator.estimate_durationN)__name__
__module____qualname__r   r   r5   r   r   r   r   r       s    r   )crewair    user_journey_service.core.configr   r!   pathlibr   r    9user_journey_service.tools.custom_duration_estimator_toolr   r   r   r   r   r   <module>   s    