
    ih                     R    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y	)
    )AnyDictschemadefinitionsreturnc                 t   t        | t              r$t        |       D ]  \  }}t        ||      | |<    | S t        | t              rsd| v rH| j                  d      j                  d      d   }|j                  |i       }| j                  |       | S | j                         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           e/var/www/html/dev/engine/venv/lib/python3.12/site-packages/langchain/chains/openai_functions/utils.pyr   r      s     &$ ( 	FGAt24EF1I	F M 
FD	!Vjj(..s3B7G//'2.CMM# M %lln M
U8LsMM    c                     | d   j                         D ci c]  \  }}|d|i| }}}d|| j                  dg       dS c c}}w )N
propertiestitleobjectrequired)typer   r!   )r   r   )r   kvpropss       r   _convert_schemar&      sZ    .4\.B.H.H.JKdaQ!!q!!KEKJJz2.  Ls   A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_call )r'   s    r   get_llm_kwargsr-      s     #vx?O6PQQr   N)typingr   r   strr   r   r&   r-   r,   r   r   <module>r0      sS    s c3h C $D T 	RT 	Rd 	Rr   