Format: application/x-python-code
⬇ Download File (1.3 KB)
   1  o
   2  
   3  ��hw�@sDddlmZmZmZddlmZddlmZGdd�d�Ze�ZdS)�)�Callable�Dict�Any�)�available_functions)�tool_definitionsc@sDeZdZdd�Zdd�Zdededdfd	d
   4  �Zdedefdd�ZdS)
   5  �ToolRegistrycCsi|_|��dS)N)�tools�_register_core_tools)�self�r�@C:\Users\shubh\Videos\agent\agent\modules\tools\tool_registry.py�__init__szToolRegistry.__init__cCs,tD]}t�|d�}|�|d|�qdS)N�name)rr�get�register)rZtool�funcrrr
   6  r
   7  
   8  s�z!ToolRegistry._register_core_toolsr�method�returnNcCs(||jvr
   9  td|�d���||j|<dS)N�Tool z already registered)r	�
  10  ValueError)rrrrrr
  11  rs
  12  zToolRegistry.registercCs$||jvr
  13  td|�d���|j|S)Nrz not found in registry)r	�KeyError)rrrrr
  14  �
  15  get_methods
  16  
  17  zToolRegistry.get_method)	�__name__�
  18  __module__�__qualname__rr
  19  �strrrrrrrr
  20  rs
  21  rN)	�typingrrr�
  22  tool_executorrrr�
  23  tool_registryrrrr
  24  �<module>s
  25  
  26