(UPDATE: I originally only pasted two of the three warnings.)
The example on this page still works, but it gives three deprecation warnings:
Output:
/tavily_demo.py:10: LangChainDeprecationWarning: The class `ChatOpenAI` was deprecated in LangChain 0.0.10 and will be removed in 1.0. An updated version of the class exists in the :class:`~langchain-openai package and should be used instead. To use it run `pip install -U :class:`~langchain-openai` and import as `from :class:`~langchain_openai import ChatOpenAI``.
llm = ChatOpenAI(model_name="gpt-4", temperature=0.7)
tavily_demo.py:15: LangChainDeprecationWarning: The function `initialize_agent` was deprecated in LangChain 0.1.0 and will be removed in 1.0. Use :meth:`~Use new agent constructor methods like create_react_agent, create_json_agent, create_structured_chat_agent, etc.` instead.
tavily_demo.py:32: LangChainDeprecationWarning: The method `Chain.run` was deprecated in langchain 0.1.0 and will be removed in 1.0. Use :meth:`~invoke` instead.
agent_chain.run(
The first and third are trivial to fix. The second one not so much, as I’m not sure how to do something equivalent with the suggested new functions; haven’t got it working it. I’ll follow up if I do.