U
    h'                     @   sl   d Z ddlmZmZ ddlmZ ddlmZmZ ddl	m
Z
 ddlmZ G dd deZG d	d
 d
e
ZdS )z"Tool for the Dataherald Hosted API    )OptionalType)CallbackManagerForToolRun)	BaseModelField)BaseTool)DataheraldAPIWrapperc                   @   s    e Zd ZU eddZeed< dS )DataheraldTextToSQLInputz7Natural language query to be translated to a SQL query.)descriptionpromptN)__name__
__module____qualname__r   r   str__annotations__ r   r   M/tmp/pip-unpacked-wheel-9gdii04g/langchain_community/tools/dataherald/tool.pyr	      s   
r	   c                   @   sZ   e Zd ZU dZdZeed< dZeed< eed< e	Z
ee ed< deee ed	d
dZdS )DataheraldTextToSQLz+Tool that queries using the Dataherald SDK.Z
dataheraldnamezcA wrapper around Dataherald. Text to SQL. Input should be a prompt and an existing db_connection_idr
   api_wrapperargs_schemaN)r   run_managerreturnc                 C   s   | j |S )zUse the Dataherald tool.)r   run)selfr   r   r   r   r   _run   s    zDataheraldTextToSQL._run)N)r   r   r   __doc__r   r   r   r
   r   r	   r   r   r   r   r   r   r   r   r   r   r      s   

 r   N)r   typingr   r   Zlangchain_core.callbacksr   Zlangchain_core.pydantic_v1r   r   Zlangchain_core.toolsr   Z(langchain_community.utilities.dataheraldr   r	   r   r   r   r   r   <module>   s   