langgraph
langgraph copied to clipboard
DOC: Update Deprecated Functions in Documentation and Examples
This pull request resolves #160
Includes updates for the deprecated format_tool_to_openai_function
and langchain.output_parsers.openai_tools
across all documentation and example scripts, aligning with the planned updates for LangChain v0.2.0.
Changes:
-
Replaced
langchain.tools.render.format_tool_to_openai_function()
withlangchain_core.utils.function_calling.convert_to_openai_tool()
in all notebooks and examples. -
Replaced
langchain.output_parsers.openai_tools
withlangchain_core.output_parsers.openai_tools
in all notebooks and examples.
With the recent standardisation of tool_calls
attribute on AIMessage, should we update the examples to use that instead?
Example Changes:
-
m.additional_kwargs['tool_calls'][0]['function']['arguments']
would be changed to -
m.tool_calls[0]["args"]
Do we want to move away from from langchain_core.utils.function_calling import convert_to_openai_function
and just demonstrate the use of llm.bind_tools
or llm.with_structured_output
moving forward?