filename:
chat/__pycache__/tools.cpython-310.pyc
branch:
main
back to repo
o
�حir � @ s� d dl Z d dlZd dlZd dlmZ d dlmZ e j�e j� e
�dd�ZdZe j�
e�r[z#eeddd��Ze�e�Ze�d �ZW d � n1 sIw Y W n eyZ dZY nw e j�e j� e
�dd
�ZdZe j�
e�r�zeeddd��
Ze�e�ZW d � n1 s�w Y W n ey� dZY nw dd� Zd dedefdd�Zdedefdd�Zdededefdd�Zd!dededefdd�Zdedefdd�Zeeeeed�ZdS )"� N)�Any)� safe_path�agentzconfig.json�r�utf-8��encoding� WORKSPACEz
tools.jsonc C s t S )N)�
TOOLS_META� r r �-C:\Users\Ralpo\OneDrive\Desktop\chat\tools.py�get_tools_meta s r
� �path�returnc
K s� z<| rt | �}ntj�t�}g }t�|�D ]\}}}|D ]}tj�tj�||�tj�t��}|�|� qqd�|�p;dW S t yS } zd| � �W Y d} ~ S d} ~ ww )zWList files under `path` inside the workspace. If `path` is empty, list whole workspace.�
z(empty)z[error listing files] N)
r �osr �abspathr �walk�relpath�join�append� Exception)
r �kwargs�base�files�root�_� filenames�f�rel�er r r �
list_files s
���r"