@langchain/core
Version:
Core LangChain.js abstractions and schemas
1 lines • 1.91 kB
Source Map (JSON)
{"version":3,"file":"json_schema.d.ts","names":["InteropZodType","JsonSchema7Type","JSONSchema","deepCompareStrict","Validator","toJsonSchema","validatesOnlyStrings","JsonSchema7ArrayType","JsonSchema7ObjectType","JsonSchema7StringType","JsonSchema7NumberType","JsonSchema7NullableType"],"sources":["../../src/utils/json_schema.d.ts"],"sourcesContent":["import { InteropZodType } from \"./types/zod.js\";\nimport { type JsonSchema7Type as JSONSchema } from \"./zod-to-json-schema/index.js\";\nexport { deepCompareStrict, Validator } from \"@cfworker/json-schema\";\n/**\n * Converts a Zod schema or JSON schema to a JSON schema.\n * @param schema - The schema to convert.\n * @returns The converted schema.\n */\nexport declare function toJsonSchema(schema: InteropZodType | JSONSchema): JSONSchema;\n/**\n * Validates if a JSON schema validates only strings. May return false negatives in some edge cases\n * (like recursive or unresolvable refs).\n *\n * @param schema - The schema to validate.\n * @returns `true` if the schema validates only strings, `false` otherwise.\n */\nexport declare function validatesOnlyStrings(schema: unknown): boolean;\n// Re-export of the types used throughout langchain for json schema serialization.\n// The plan is to eventually nix zod-to-json-schema altogether in place for\n// zod v4 / a more standardized way of serializing validated inputs, so its re-exported\n// here to remove the dependency on zod-to-json-schema in downstream packages until\n// a determination is made.\nexport { type JsonSchema7Type, type JsonSchema7Type as JSONSchema, type JsonSchema7ArrayType, type JsonSchema7ObjectType, type JsonSchema7StringType, type JsonSchema7NumberType, type JsonSchema7NullableType, } from \"./zod-to-json-schema/index.js\";\n"],"mappings":";;;;;;;;;;;;;;;iBAQwBK,YAAAA,SAAqBL,iBAAiBE,kBAAaA;;AAA3E;;;;;AAAqF;AAQ7DI,iBAAAA,oBAAAA,CAAoB,MAAA,EAAA,OAAA,CAAA,EAAA,OAAA"}