a
    bg                     @   sz   d dl Z d dlmZmZ d dlmZ d dlmZ d dlm	Z	m
Z
 d dlmZmZmZ G dd de	ZG d	d
 d
eeZdS )    N)OptionalType)CallbackManagerForToolRun)BaseTool)	BaseModelField)INVALID_PATH_TEMPLATEBaseFileToolMixinFileValidationErrorc                   @   s:   e Zd ZU dZedddZeed< edddZeed< dS )	FileCopyInputzInput for CopyFileTool..zPath of the file to copy)descriptionsource_pathzPath to save the copied filedestination_pathN)	__name__
__module____qualname____doc__r   r   str__annotations__r    r   r   |/var/www/html/cobodadashboardai.evdpl.com/venv/lib/python3.9/site-packages/langchain_community/tools/file_management/copy.pyr      s   
r   c                   @   sT   e Zd ZU dZdZeed< eZe	e
 ed< dZeed< deeee edd	d
ZdS )CopyFileToolzTool that copies a file.	copy_filenameargs_schemaz/Create a copy of a file in a specified locationr   N)r   r   run_managerreturnc              
   C   s   z|  |}W n  ty.   tjd|d Y S 0 z|  |}W n  ty^   tjd|d Y S 0 z$tj||dd d| d| dW S  ty } zd	t| W  Y d }~S d }~0 0 d S )
Nr   )Zarg_namevaluer   F)follow_symlinkszFile copied successfully from z to .zError: )Zget_relative_pathr
   r   formatshutilcopy2	Exceptionr   )selfr   r   r   Zsource_path_Zdestination_path_er   r   r   _run   s"    zCopyFileTool._run)N)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r&   r   r   r   r   r      s   
 r   )r!   typingr   r   Zlangchain_core.callbacksr   Zlangchain_core.toolsr   Zpydanticr   r   Z/langchain_community.tools.file_management.utilsr   r	   r
   r   r   r   r   r   r   <module>   s   