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 )ContentReviewerc              	   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/content_reviewer.py__init__   s   	zContentReviewer.__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ContentReviewer.load_promptsc           
      C   sB   t d | jd }|j|||||d}d|dg}| j|}	|	S )NzInside reviewer function....content_reviewer)main_heading
stage_datacontenttopic_sections
word_countuser)roler&   )printr   formatr   call)
r   r'   r$   r%   r&   r(   prompt_templatepromptmessagesresponser   r   r   review_and_enrich_content-   s   
%z)ContentReviewer.review_and_enrich_contentN)__name__
__module____qualname__r   r   r2   r   r   r   r   r      s    r   )	crewair    user_journey_service.core.configr   r    pathlibr   r   r   r   r   r   r   <module>   s    