o
    Zh9                     @   sl   d 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 G dd de	ZG d	d
 d
eZdS )z"Tool for the Dataherald Hosted API    )OptionalType)CallbackManagerForToolRun)BaseTool)	BaseModelField)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   `/var/www/html/lang_env/lib/python3.10/site-packages/langchain_community/tools/dataherald/tool.pyr	      s   
 r	   c                   @   s`   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d	ed
ee def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_schemaNr   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.toolsr   Zpydanticr   r   Z(langchain_community.utilities.dataheraldr   r	   r   r   r   r   r   <module>   s    