o
    xi                     @   sj   d dl mZmZ d dlmZ d dlmZmZ e Ze	dde
de
fddZed	d
efddZdS )    )	APIRouterHTTPException)
LogRequest)save_chat_logget_history_from_dbz-/goal-skill-t/api/history/{mode}/{session_id}mode
session_idc              
      s@   z
t || }d|iW S  ty } ztdt|dd }~ww )Nhistory  status_codedetail)r   	Exceptionr   str)r   r   rowse r   3/home/air/goalskill_t/back/app/routers/GOALSkill.pyget_history	   s   

r   z/goal-skill-t/api/logreqc              
      sL   zt | j| j| j| j ddiW S  ty% } ztdt|dd }~ww )Nstatusokr
   r   )r   r   r   sendermessager   r   r   )r   r   r   r   r   log_message   s   
r   N)fastapir   r   app.schemas.schemasr   
app.modelsr   r   routergetr   r   postr   r   r   r   r   <module>   s    