o
    .if3                     @   sd   d Z ddlmZ ddlmZmZ ddlmZ g dZdee de	fdd	Z
dee de	fd
dZdS )zDifferent methods for rendering Tools to be passed to LLMs.

Depending on the LLM you are using and the prompting strategy you are using,
you may want Tools to be rendered in a different way.
This module contains various ways to render tools.
    )List)format_tool_to_openai_functionformat_tool_to_openai_tool)BaseTool)render_text_description render_text_description_and_argsr   r   toolsreturnc                 C   s   d dd | D S )zRender the tool name and description in plain text.

    Output will be in the format of:

    .. code-block:: markdown

        search: This tool is used for search
        calculator: This tool is used for math
    
c                 S   s   g | ]}|j  d |j qS ): )namedescription).0tool r   O/var/www/html/corbot_env/lib/python3.10/site-packages/langchain/tools/render.py
<listcomp>"   s    z+render_text_description.<locals>.<listcomp>)join)r   r   r   r   r      s   
r   c                 C   s@   g }| D ]}t |j}||j d|j d|  qd|S )a/  Render the tool name, description, and args in plain text.

    Output will be in the format of:

    .. code-block:: markdown

        search: This tool is used for search, args: {"query": {"type": "string"}}
        calculator: This tool is used for math, args: {"expression": {"type": "string"}}
    r   z, args: r
   )strargsappendr   r   r   )r   tool_stringsr   args_schemar   r   r   r   %   s
   
 
r   N)__doc__typingr   +langchain_community.tools.convert_to_openair   r   langchain_core.toolsr   __all__r   r   r   r   r   r   r   <module>   s    