
    Ng                     Z    d dl mZmZ dedeeef         defdZdedefdZdedefdZd	S )
    )AnyDictschemadefinitionsreturnc                    t          | t                    r)t          |           D ]\  }}t          ||          | |<   nt          | t                    rd| v rZ|                     d                              d          d         }|                    |i           }|                     |           n-| 	                                D ]\  }}t          ||          | |<   | S )zW
    Resolve the $ref keys in a JSON schema object using the provided definitions.
    z$ref/)

isinstancelist	enumerate_resolve_schema_referencesdictpopsplitgetupdateitems)r   r   iitemref_keyrefkeyvalues           c/var/www/html/ai-engine/env/lib/python3.11/site-packages/langchain/chains/openai_functions/utils.pyr   r      s     &$ 
M (( 	F 	FGAt24EEF1II	F	FD	!	! MVjj((..s33B7G//'2..CMM#$llnn M M
U8LLsM    c                 ~    d | d                                          D             }d||                     dg           dS )Nc                 "    i | ]\  }}|d |i|S )title ).0kvs      r   
<dictcomp>z#_convert_schema.<locals>.<dictcomp>   s(    KKKdaQ!!q!KKKr   
propertiesobjectrequired)typer%   r'   )r   r   )r   propss     r   _convert_schemar*      sL    KKf\.B.H.H.J.JKKKEJJz2..  r   functionc                     | gd| d         idS )zReturn the kwargs for the LLMChain constructor.

    Args:
        function: The function to use.

    Returns:
        The kwargs for the LLMChain constructor.
    name)	functionsfunction_callr    )r+   s    r   get_llm_kwargsr0      s     #vx?O6PQQQr   N)typingr   r   strr   r   r*   r0   r    r   r   <module>r3      s           s c3h C    $D T    	RT 	Rd 	R 	R 	R 	R 	R 	Rr   