
    dh                        S r SSKJr  SSKJrJrJrJrJr  SSK	J
r
  SSKJr  SSKJrJr  SSKJr  \(       a  SSKJr  S	\\S	S	S
S	SSSS	4                             SS jjrg	)zOpenAPI spec agent.    )annotations)TYPE_CHECKINGAnyDictListOptional)BaseCallbackManager)BaseLanguageModel)OPENAPI_PREFIXOPENAPI_SUFFIX)OpenAPIToolkitAgentExecutorN   forceFc                4   SSK Jn  SSKJn  SSKJn  UR                  5       nUb  SU0O0 nUR                  " U4UUUS.UD6nU" U UUS9nU Vs/ sH  nUR                  PM     nnU" S
UUS.UD6nUR                  " S
UUUU
UUUU	S	.U=(       d    0 D6$ s  snf )aa  Construct an OpenAPI agent from an LLM and tools.

*Security Note*: When creating an OpenAPI agent, check the permissions
    and capabilities of the underlying toolkit.

    For example, if the default implementation of OpenAPIToolkit
    uses the RequestsToolkit which contains tools to make arbitrary
    network requests against any URL (e.g., GET, POST, PATCH, PUT, DELETE),

    Control access to who can submit issue requests using this toolkit and
    what network access it has.

    See https://python.langchain.com/docs/security for more information.

Args:
    llm: The language model to use.
    toolkit: The OpenAPI toolkit.
    callback_manager: Optional. The callback manager. Default is None.
    prefix: Optional. The prefix for the prompt. Default is OPENAPI_PREFIX.
    suffix: Optional. The suffix for the prompt. Default is OPENAPI_SUFFIX.
    format_instructions: Optional. The format instructions for the prompt.
        Default is None.
    input_variables: Optional. The input variables for the prompt. Default is None.
    max_iterations: Optional. The maximum number of iterations. Default is 15.
    max_execution_time: Optional. The maximum execution time. Default is None.
    early_stopping_method: Optional. The early stopping method. Default is "force".
    verbose: Optional. Whether to print verbose output. Default is False.
    return_intermediate_steps: Optional. Whether to return intermediate steps.
        Default is False.
    agent_executor_kwargs: Optional. Additional keyword arguments
        for the agent executor.
    kwargs: Additional arguments.

Returns:
    The agent executor.
r   r   )ZeroShotAgent)LLMChainformat_instructions)prefixsuffixinput_variables)llmpromptcallback_manager)	llm_chainallowed_tools)agenttoolsr   verbosereturn_intermediate_stepsmax_iterationsmax_execution_timeearly_stopping_method )
langchain.agents.agentr   langchain.agents.mrkl.baser   langchain.chains.llmr   	get_toolscreate_promptnamefrom_agent_and_tools)r   toolkitr   r   r   r   r   r"   r#   r$   r    r!   agent_executor_kwargskwargsr   r   r   r   prompt_paramsr   r   tool
tool_namesr   s                           g/var/www/html/shao/venv/lib/python3.13/site-packages/langchain_community/agent_toolkits/openapi/base.pycreate_openapi_agentr4      s    h 58-E * 
 34 
 (('	
 F )I
 )..$))J.RIZR6RE-- 
)";%-3
 !&B
 
 /s   B)r   r
   r-   r   r   zOptional[BaseCallbackManager]r   strr   r5   r   zOptional[str]r   zOptional[List[str]]r"   zOptional[int]r#   zOptional[float]r$   r5   r    boolr!   r6   r.   zOptional[Dict[str, Any]]r/   r   returnr   )__doc__
__future__r   typingr   r   r   r   r   langchain_core.callbacksr	   langchain_core.language_modelsr
   1langchain_community.agent_toolkits.openapi.promptr   r   2langchain_community.agent_toolkits.openapi.toolkitr   r&   r   r4   r%       r3   <module>r@      s     " ; ; 8 < N4 7;  )-+/$&*.!(&+6:V	VV 4V 	V
 V 'V )V "V (V V V  $V 4V V Vr?   