Model wrapper that returns outputs formatted to match the given schema.
withStructuredOutput<
RunOutput extends Record<string, any> = Record<string, any>
>(
schema: Record<string, any> | ZodType<RunOutput, ZodTypeDef, RunOutput>,
config: StructuredOutputMethodOptions<false>
): Runnable<BaseLanguageModelInput, RunOutput>| Name | Type | Description |
|---|---|---|
schema* | Record<string, any> | ZodType<RunOutput, ZodTypeDef, RunOutput> | |
config | StructuredOutputMethodOptions<false> |