chain = OpenAIFunctionsChain(
        llm=llm, prompt=prompt, functions=functions, kwargs=EXTRACTION_KWARGS
    )
    pydantic_parsing_chain = TransformChain(
        transform=partial(_parse_entities_pydantic, pydantic_schema=PydanticSchema),
        input_variables=["input"],
        output_variables=["output"],
    )
    return SimpleSequentialChain(chains=[chain, pydantic_parsing_chain])
_TAGGING_TEMPLATE = """Extract the desired information from the following passage.
Passage:
{input}
"""
[docs]def create_tagging_chain(schema: dict, llm: BaseLanguageModel) -> Chain:
    functions = _get_tagging_functions(schema)
    prompt = ChatPromptTemplate.from_template(_TAGGING_TEMPLATE)
    chain = OpenAIFunctionsChain(
        llm=llm, prompt=prompt, functions=functions, kwargs=EXTRACTION_KWARGS
    )
    parsing_chain = TransformChain(
        transform=_parse_tag, input_variables=["input"], output_variables=["output"]
    )
    return SimpleSequentialChain(chains=[chain, parsing_chain])
[docs]def create_tagging_chain_pydantic(
    pydantic_schema: Any, llm: BaseLanguageModel
) -> Chain:
    openai_schema = pydantic_schema.schema()
    functions = _get_tagging_functions(openai_schema)
    prompt = ChatPromptTemplate.from_template(_TAGGING_TEMPLATE)
    chain = OpenAIFunctionsChain(
        llm=llm, prompt=prompt, functions=functions, kwargs=EXTRACTION_KWARGS
    )
    pydantic_parsing_chain = TransformChain(
rtdocs_stable/api.python.langchain.com/en/stable/_modules/langchain/chains/openai_functions.html