[docs]defcreate_json_agent(llm:BaseLanguageModel,toolkit:JsonToolkit,callback_manager:Optional[BaseCallbackManager]=None,prefix:str=JSON_PREFIX,suffix:str=JSON_SUFFIX,format_instructions:Optional[str]=None,input_variables:Optional[List[str]]=None,verbose:bool=False,agent_executor_kwargs:Optional[Dict[str,Any]]=None,**kwargs:Any,)->AgentExecutor:"""Construct a json agent from an LLM and tools. Args: llm: The language model to use. toolkit: The toolkit to use. callback_manager: The callback manager to use. Default is None. prefix: The prefix to use. Default is JSON_PREFIX. suffix: The suffix to use. Default is JSON_SUFFIX. format_instructions: The format instructions to use. Default is None. input_variables: The input variables to use. Default is None. verbose: Whether to print verbose output. Default is False. agent_executor_kwargs: Optional additional arguments for the agent executor. kwargs: Additional arguments for the agent. Returns: The agent executor. """fromlangchain.agents.agentimportAgentExecutorfromlangchain.agents.mrkl.baseimportZeroShotAgentfromlangchain.chains.llmimportLLMChaintools=toolkit.get_tools()prompt_params=({"format_instructions":format_instructions}ifformat_instructionsisnotNoneelse{})prompt=ZeroShotAgent.create_prompt(tools,prefix=prefix,suffix=suffix,input_variables=input_variables,**prompt_params,)llm_chain=LLMChain(llm=llm,prompt=prompt,callback_manager=callback_manager,)tool_names=[tool.namefortoolintools]agent=ZeroShotAgent(llm_chain=llm_chain,allowed_tools=tool_names,**kwargs)returnAgentExecutor.from_agent_and_tools(agent=agent,tools=tools,callback_manager=callback_manager,verbose=verbose,**(agent_executor_kwargsor{}),)