langgraph icon indicating copy to clipboard operation
langgraph copied to clipboard

DOC: Update Deprecated Functions in Documentation and Examples

Open siddicky opened this issue 10 months ago • 1 comments

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:

  1. Replaced langchain.tools.render.format_tool_to_openai_function() with langchain_core.utils.function_calling.convert_to_openai_tool() in all notebooks and examples.

  2. Replaced langchain.output_parsers.openai_tools with langchain_core.output_parsers.openai_tools in all notebooks and examples.

siddicky avatar Apr 12 '24 03:04 siddicky

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?

siddicky avatar Apr 14 '24 09:04 siddicky