o
    `h                     @   sB   d dl mZ d dlmZ d dlZd dlmZ dZG dd dZdS )    )LLM)settingsN)Pathz(user_journey_service/config/prompts.yamlc                   @   s$   e Zd Zdd Zdd Zdd ZdS )MicrolearningTopicValidatorc              	   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/topic_validator.py__init__   s   z$MicrolearningTopicValidator.__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(MicrolearningTopicValidator.load_promptsc                 C   sV   | j d }td|j  |j|jd}td|  d|dg}| j|}| S )Ntopic_validatorzthe topic is : )topiczthe prompt is : user)rolecontent)r   printr$   formatr   callstrip)r   
input_dataprompt_templatepromptmessagesresponser   r   r   validate_topic,   s   
z*MicrolearningTopicValidator.validate_topicN)__name__
__module____qualname__r   r   r1   r   r   r   r   r      s    r   )	crewair    user_journey_service.core.configr   r    pathlibr   r   r   r   r   r   r   <module>   s    