import os os.environ['TOKENIZERS_PARALLELISM'] = 'true' os.environ['MISTRAL_API_KEY'] = "i5jSJkCFNGKfgIztloxTMjfckiFbYBj4" from langchain import hub from langchain.agents import AgentExecutor, create_json_chat_agent from langchain_mistralai.chat_models import ChatMistralAI prompt = hub.pull("hwchase17/react-chat-json") from langchain_community.tools import DuckDuckGoSearchRun tools = [DuckDuckGoSearchRun()] llm = ChatMistralAI(model='mistral-large-latest') agent = create_json_chat_agent( llm=llm, tools=tools, prompt=prompt, ) agent_executor = AgentExecutor( agent=agent, tools=tools, verbose=True, handle_parsing_errors=True ) agent_executor.invoke({"input":"How many proteins should I eat per day? Search mainly on wikipedia"})