Function that creates an extraction chain from a Zod schema. It
converts the Zod schema to a JSON schema using zod-to-json-schema
before creating the extraction chain.
Parameters
schema: ZodObject<any, any, any, any, {}>
The Zod schema which extracted data should match
llm: BaseChatModel<BaseFunctionCallOptions>
Must be a ChatOpenAI or AnthropicFunctions model that supports function calling.
Function that creates an extraction chain from a Zod schema. It converts the Zod schema to a JSON schema using zod-to-json-schema before creating the extraction chain.