Home / Function/ _get_openai_tool_output_parser() — langchain Function Reference

_get_openai_tool_output_parser() — langchain Function Reference

Architecture documentation for the _get_openai_tool_output_parser() function in base.py from the langchain codebase.

Entity Profile

Dependency Diagram

graph TD
  da705fa3_279a_2153_6004_974d984cb208["_get_openai_tool_output_parser()"]
  22e1446e_2db6_2965_eef8_bf9239c6dbfc["base.py"]
  da705fa3_279a_2153_6004_974d984cb208 -->|defined in| 22e1446e_2db6_2965_eef8_bf9239c6dbfc
  74a2fd31_540f_8c92_debc_5e39815247bf["_create_openai_tools_runnable()"]
  74a2fd31_540f_8c92_debc_5e39815247bf -->|calls| da705fa3_279a_2153_6004_974d984cb208
  style da705fa3_279a_2153_6004_974d984cb208 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/langchain/langchain_classic/chains/structured_output/base.py lines 475–490

def _get_openai_tool_output_parser(
    tool: dict[str, Any] | type[BaseModel] | Callable,
    *,
    first_tool_only: bool = False,
) -> BaseOutputParser | BaseGenerationOutputParser:
    if isinstance(tool, type) and is_basemodel_subclass(tool):
        output_parser: BaseOutputParser | BaseGenerationOutputParser = (
            PydanticToolsParser(tools=[tool], first_tool_only=first_tool_only)
        )
    else:
        key_name = convert_to_openai_tool(tool)["function"]["name"]
        output_parser = JsonOutputKeyToolsParser(
            first_tool_only=first_tool_only,
            key_name=key_name,
        )
    return output_parser

Subdomains

Frequently Asked Questions

What does _get_openai_tool_output_parser() do?
_get_openai_tool_output_parser() is a function in the langchain codebase, defined in libs/langchain/langchain_classic/chains/structured_output/base.py.
Where is _get_openai_tool_output_parser() defined?
_get_openai_tool_output_parser() is defined in libs/langchain/langchain_classic/chains/structured_output/base.py at line 475.
What calls _get_openai_tool_output_parser()?
_get_openai_tool_output_parser() is called by 1 function(s): _create_openai_tools_runnable.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free