@langchain/core 1.1.29 → 1.1.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/dist/language_models/base.cjs +1 -1
- package/dist/language_models/base.cjs.map +1 -1
- package/dist/language_models/base.d.cts +6 -0
- package/dist/language_models/base.d.cts.map +1 -1
- package/dist/language_models/base.d.ts +6 -0
- package/dist/language_models/base.d.ts.map +1 -1
- package/dist/language_models/base.js +1 -1
- package/dist/language_models/base.js.map +1 -1
- package/dist/language_models/chat_models.cjs +8 -23
- package/dist/language_models/chat_models.cjs.map +1 -1
- package/dist/language_models/chat_models.d.cts +6 -0
- package/dist/language_models/chat_models.d.cts.map +1 -1
- package/dist/language_models/chat_models.d.ts +6 -0
- package/dist/language_models/chat_models.d.ts.map +1 -1
- package/dist/language_models/chat_models.js +9 -24
- package/dist/language_models/chat_models.js.map +1 -1
- package/dist/language_models/structured_output.cjs +88 -0
- package/dist/language_models/structured_output.cjs.map +1 -0
- package/dist/language_models/structured_output.d.cts +46 -0
- package/dist/language_models/structured_output.d.cts.map +1 -0
- package/dist/language_models/structured_output.d.ts +50 -0
- package/dist/language_models/structured_output.d.ts.map +1 -0
- package/dist/language_models/structured_output.js +79 -0
- package/dist/language_models/structured_output.js.map +1 -0
- package/dist/load/import_map.cjs +10 -4
- package/dist/load/import_map.cjs.map +1 -1
- package/dist/load/import_map.js +12 -6
- package/dist/load/import_map.js.map +1 -1
- package/dist/messages/base.cjs.map +1 -1
- package/dist/messages/base.d.cts +2 -2
- package/dist/messages/base.d.cts.map +1 -1
- package/dist/messages/base.d.ts +2 -2
- package/dist/messages/base.d.ts.map +1 -1
- package/dist/messages/base.js.map +1 -1
- package/dist/output_parsers/index.cjs +4 -1
- package/dist/output_parsers/index.cjs.map +1 -1
- package/dist/output_parsers/index.d.cts +2 -1
- package/dist/output_parsers/index.d.ts +2 -1
- package/dist/output_parsers/index.js +4 -2
- package/dist/output_parsers/index.js.map +1 -1
- package/dist/output_parsers/openai_tools/index.d.cts +2 -2
- package/dist/output_parsers/openai_tools/index.d.ts +2 -2
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.cjs +8 -1
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.cjs.map +1 -1
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.d.cts +6 -1
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.d.cts.map +1 -1
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.d.ts +6 -1
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.d.ts.map +1 -1
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.js +8 -1
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.js.map +1 -1
- package/dist/output_parsers/standard_schema.cjs +40 -0
- package/dist/output_parsers/standard_schema.cjs.map +1 -0
- package/dist/output_parsers/standard_schema.d.cts +16 -0
- package/dist/output_parsers/standard_schema.d.cts.map +1 -0
- package/dist/output_parsers/standard_schema.d.ts +16 -0
- package/dist/output_parsers/standard_schema.d.ts.map +1 -0
- package/dist/output_parsers/standard_schema.js +40 -0
- package/dist/output_parsers/standard_schema.js.map +1 -0
- package/dist/runnables/base.cjs +1 -1
- package/dist/runnables/base.cjs.map +1 -1
- package/dist/runnables/base.js +2 -2
- package/dist/runnables/base.js.map +1 -1
- package/dist/testing/fake_model_builder.cjs +174 -0
- package/dist/testing/fake_model_builder.cjs.map +1 -0
- package/dist/testing/fake_model_builder.d.cts +87 -0
- package/dist/testing/fake_model_builder.d.cts.map +1 -0
- package/dist/testing/fake_model_builder.d.ts +88 -0
- package/dist/testing/fake_model_builder.d.ts.map +1 -0
- package/dist/testing/fake_model_builder.js +174 -0
- package/dist/testing/fake_model_builder.js.map +1 -0
- package/dist/testing/index.cjs +41 -0
- package/dist/testing/index.cjs.map +1 -0
- package/dist/testing/index.d.cts +3 -0
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.js +23 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/matchers.cjs +213 -0
- package/dist/testing/matchers.cjs.map +1 -0
- package/dist/testing/matchers.d.cts +94 -0
- package/dist/testing/matchers.d.cts.map +1 -0
- package/dist/testing/matchers.d.ts +94 -0
- package/dist/testing/matchers.d.ts.map +1 -0
- package/dist/testing/matchers.js +203 -0
- package/dist/testing/matchers.js.map +1 -0
- package/dist/utils/json_schema.cjs +3 -1
- package/dist/utils/json_schema.cjs.map +1 -1
- package/dist/utils/json_schema.d.cts +3 -2
- package/dist/utils/json_schema.d.cts.map +1 -1
- package/dist/utils/json_schema.d.ts +3 -2
- package/dist/utils/json_schema.d.ts.map +1 -1
- package/dist/utils/json_schema.js +3 -1
- package/dist/utils/json_schema.js.map +1 -1
- package/dist/utils/standard_schema.cjs +43 -0
- package/dist/utils/standard_schema.cjs.map +1 -0
- package/dist/utils/standard_schema.d.cts +27 -0
- package/dist/utils/standard_schema.d.cts.map +1 -0
- package/dist/utils/standard_schema.d.ts +27 -0
- package/dist/utils/standard_schema.d.ts.map +1 -0
- package/dist/utils/standard_schema.js +34 -0
- package/dist/utils/standard_schema.js.map +1 -0
- package/dist/utils/types/zod.cjs +1 -1
- package/dist/utils/types/zod.cjs.map +1 -1
- package/dist/utils/types/zod.d.cts +3 -2
- package/dist/utils/types/zod.d.cts.map +1 -1
- package/dist/utils/types/zod.d.ts +3 -2
- package/dist/utils/types/zod.d.ts.map +1 -1
- package/dist/utils/types/zod.js +1 -1
- package/dist/utils/types/zod.js.map +1 -1
- package/errors.cjs +1 -0
- package/errors.d.cts +1 -0
- package/errors.d.ts +1 -0
- package/errors.js +1 -0
- package/language_models/structured_output.cjs +1 -0
- package/language_models/structured_output.d.cts +1 -0
- package/language_models/structured_output.d.ts +1 -0
- package/language_models/structured_output.js +1 -0
- package/package.json +42 -3
- package/utils/standard_schema.cjs +1 -0
- package/utils/standard_schema.d.cts +1 -0
- package/utils/standard_schema.d.ts +1 -0
- package/utils/standard_schema.js +1 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
const require_zod = require('../utils/types/zod.cjs');
|
|
4
|
+
const require_utils_standard_schema = require('../utils/standard_schema.cjs');
|
|
5
|
+
const require_base = require('../runnables/base.cjs');
|
|
6
|
+
const require_passthrough = require('../runnables/passthrough.cjs');
|
|
7
|
+
require('../runnables/index.cjs');
|
|
8
|
+
const require_json = require('../output_parsers/json.cjs');
|
|
9
|
+
const require_standard_schema = require('../output_parsers/standard_schema.cjs');
|
|
10
|
+
const require_structured = require('../output_parsers/structured.cjs');
|
|
11
|
+
require('../output_parsers/index.cjs');
|
|
12
|
+
const require_json_output_tools_parsers = require('../output_parsers/openai_tools/json_output_tools_parsers.cjs');
|
|
13
|
+
require('../utils/types/index.cjs');
|
|
14
|
+
|
|
15
|
+
//#region src/language_models/structured_output.ts
|
|
16
|
+
var structured_output_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
17
|
+
assembleStructuredOutputPipeline: () => assembleStructuredOutputPipeline,
|
|
18
|
+
createContentParser: () => createContentParser,
|
|
19
|
+
createFunctionCallingParser: () => createFunctionCallingParser
|
|
20
|
+
});
|
|
21
|
+
/**
|
|
22
|
+
* Creates the appropriate content-based output parser for a schema. Use this for
|
|
23
|
+
* jsonMode/jsonSchema methods where the LLM returns JSON text.
|
|
24
|
+
*
|
|
25
|
+
* - Zod schema -> StructuredOutputParser (Zod validation)
|
|
26
|
+
* - Standard schema -> StandardSchemaOutputParser (standard schema validation)
|
|
27
|
+
* - Plain JSON schema -> JsonOutputParser (no validation)
|
|
28
|
+
*/
|
|
29
|
+
function createContentParser(schema) {
|
|
30
|
+
if (require_zod.isInteropZodSchema(schema)) return require_structured.StructuredOutputParser.fromZodSchema(schema);
|
|
31
|
+
if (require_utils_standard_schema.isSerializableSchema(schema)) return require_standard_schema.StandardSchemaOutputParser.fromSerializableSchema(schema);
|
|
32
|
+
return new require_json.JsonOutputParser();
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Creates the appropriate tool-calling output parser for a schema. Use this for
|
|
36
|
+
* function calling / tool use methods where the LLM returns structured tool calls.
|
|
37
|
+
*
|
|
38
|
+
* - Zod schema -> parser with Zod validation
|
|
39
|
+
* - Standard schema -> parser with standard schema validation
|
|
40
|
+
* - Plain JSON schema -> parser with no validation
|
|
41
|
+
*/
|
|
42
|
+
function createFunctionCallingParser(schema, keyName, ParserClass) {
|
|
43
|
+
const Ctor = ParserClass ?? require_json_output_tools_parsers.JsonOutputKeyToolsParser;
|
|
44
|
+
if (require_zod.isInteropZodSchema(schema)) return new Ctor({
|
|
45
|
+
returnSingle: true,
|
|
46
|
+
keyName,
|
|
47
|
+
zodSchema: schema
|
|
48
|
+
});
|
|
49
|
+
if (require_utils_standard_schema.isSerializableSchema(schema)) return new Ctor({
|
|
50
|
+
returnSingle: true,
|
|
51
|
+
keyName,
|
|
52
|
+
serializableSchema: schema
|
|
53
|
+
});
|
|
54
|
+
return new Ctor({
|
|
55
|
+
returnSingle: true,
|
|
56
|
+
keyName
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Pipes an LLM through an output parser, optionally wrapping the result
|
|
61
|
+
* to include the raw LLM response alongside the parsed output.
|
|
62
|
+
*
|
|
63
|
+
* When `includeRaw` is true, returns `{ raw: BaseMessage, parsed: RunOutput }`.
|
|
64
|
+
* If parsing fails, `parsed` falls back to null.
|
|
65
|
+
*/
|
|
66
|
+
function assembleStructuredOutputPipeline(llm, outputParser, includeRaw, runName) {
|
|
67
|
+
if (!includeRaw) {
|
|
68
|
+
const result = llm.pipe(outputParser);
|
|
69
|
+
return runName ? result.withConfig({ runName }) : result;
|
|
70
|
+
}
|
|
71
|
+
const parserAssign = require_passthrough.RunnablePassthrough.assign({ parsed: (input, config) => outputParser.invoke(input.raw, config) });
|
|
72
|
+
const parserNone = require_passthrough.RunnablePassthrough.assign({ parsed: () => null });
|
|
73
|
+
const parsedWithFallback = parserAssign.withFallbacks({ fallbacks: [parserNone] });
|
|
74
|
+
const result = require_base.RunnableSequence.from([{ raw: llm }, parsedWithFallback]);
|
|
75
|
+
return runName ? result.withConfig({ runName }) : result;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
//#endregion
|
|
79
|
+
exports.assembleStructuredOutputPipeline = assembleStructuredOutputPipeline;
|
|
80
|
+
exports.createContentParser = createContentParser;
|
|
81
|
+
exports.createFunctionCallingParser = createFunctionCallingParser;
|
|
82
|
+
Object.defineProperty(exports, 'structured_output_exports', {
|
|
83
|
+
enumerable: true,
|
|
84
|
+
get: function () {
|
|
85
|
+
return structured_output_exports;
|
|
86
|
+
}
|
|
87
|
+
});
|
|
88
|
+
//# sourceMappingURL=structured_output.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structured_output.cjs","names":["isInteropZodSchema","StructuredOutputParser","isSerializableSchema","StandardSchemaOutputParser","JsonOutputParser","JsonOutputKeyToolsParser","RunnablePassthrough","RunnableSequence"],"sources":["../../src/language_models/structured_output.ts"],"sourcesContent":["import { BaseMessage } from \"../messages/index.js\";\nimport {\n BaseLLMOutputParser,\n BaseOutputParser,\n JsonOutputParser,\n StructuredOutputParser,\n} from \"../output_parsers/index.js\";\nimport { JsonOutputKeyToolsParser } from \"../output_parsers/openai_tools/json_output_tools_parsers.js\";\nimport { StandardSchemaOutputParser } from \"../output_parsers/standard_schema.js\";\nimport {\n Runnable,\n RunnablePassthrough,\n RunnableSequence,\n} from \"../runnables/index.js\";\nimport {\n isSerializableSchema,\n SerializableSchema,\n} from \"../utils/standard_schema.js\";\nimport { InteropZodType, isInteropZodSchema } from \"../utils/types/index.js\";\nimport { BaseLanguageModelInput } from \"./base.js\";\n\n/**\n * Creates the appropriate content-based output parser for a schema. Use this for\n * jsonMode/jsonSchema methods where the LLM returns JSON text.\n *\n * - Zod schema -> StructuredOutputParser (Zod validation)\n * - Standard schema -> StandardSchemaOutputParser (standard schema validation)\n * - Plain JSON schema -> JsonOutputParser (no validation)\n */\nexport function createContentParser<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>,\n>(\n schema:\n | InteropZodType<RunOutput>\n | SerializableSchema<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>\n): BaseOutputParser<RunOutput> {\n if (isInteropZodSchema(schema)) {\n return StructuredOutputParser.fromZodSchema(schema);\n }\n if (isSerializableSchema(schema)) {\n return StandardSchemaOutputParser.fromSerializableSchema(schema);\n }\n return new JsonOutputParser<RunOutput>();\n}\n\ntype FunctionCallingParserConstructor<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n T extends Record<string, any> = Record<string, any>,\n> = new (params: {\n keyName: string;\n returnSingle?: boolean;\n zodSchema?: InteropZodType<T>;\n serializableSchema?: SerializableSchema<T>;\n}) => BaseLLMOutputParser<T>;\n\n/**\n * Creates the appropriate tool-calling output parser for a schema. Use this for\n * function calling / tool use methods where the LLM returns structured tool calls.\n *\n * - Zod schema -> parser with Zod validation\n * - Standard schema -> parser with standard schema validation\n * - Plain JSON schema -> parser with no validation\n */\nexport function createFunctionCallingParser<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>,\n>(\n schema:\n | InteropZodType<RunOutput>\n | SerializableSchema<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>,\n keyName: string,\n ParserClass?: FunctionCallingParserConstructor<RunOutput>\n): BaseLLMOutputParser<RunOutput> {\n const Ctor = ParserClass ?? JsonOutputKeyToolsParser;\n if (isInteropZodSchema(schema)) {\n return new Ctor({ returnSingle: true, keyName, zodSchema: schema });\n }\n if (isSerializableSchema(schema)) {\n return new Ctor({\n returnSingle: true,\n keyName,\n serializableSchema: schema,\n });\n }\n return new Ctor({ returnSingle: true, keyName });\n}\n\n/**\n * Pipes an LLM through an output parser, optionally wrapping the result\n * to include the raw LLM response alongside the parsed output.\n *\n * When `includeRaw` is true, returns `{ raw: BaseMessage, parsed: RunOutput }`.\n * If parsing fails, `parsed` falls back to null.\n */\nexport function assembleStructuredOutputPipeline<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>,\n>(\n llm: Runnable<BaseLanguageModelInput>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n outputParser: Runnable<any, RunOutput>,\n includeRaw?: boolean,\n runName?: string\n):\n | Runnable<BaseLanguageModelInput, RunOutput>\n | Runnable<BaseLanguageModelInput, { raw: BaseMessage; parsed: RunOutput }> {\n if (!includeRaw) {\n const result = llm.pipe(outputParser);\n return runName ? result.withConfig({ runName }) : result;\n }\n\n const parserAssign = RunnablePassthrough.assign({\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parsed: (input: any, config) => outputParser.invoke(input.raw, config),\n });\n const parserNone = RunnablePassthrough.assign({\n parsed: () => null,\n });\n const parsedWithFallback = parserAssign.withFallbacks({\n fallbacks: [parserNone],\n });\n const result = RunnableSequence.from<\n BaseLanguageModelInput,\n { raw: BaseMessage; parsed: RunOutput }\n >([{ raw: llm }, parsedWithFallback]);\n return runName ? result.withConfig({ runName }) : result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,SAAgB,oBAId,QAK6B;AAC7B,KAAIA,+BAAmB,OAAO,CAC5B,QAAOC,0CAAuB,cAAc,OAAO;AAErD,KAAIC,mDAAqB,OAAO,CAC9B,QAAOC,mDAA2B,uBAAuB,OAAO;AAElE,QAAO,IAAIC,+BAA6B;;;;;;;;;;AAqB1C,SAAgB,4BAId,QAKA,SACA,aACgC;CAChC,MAAM,OAAO,eAAeC;AAC5B,KAAIL,+BAAmB,OAAO,CAC5B,QAAO,IAAI,KAAK;EAAE,cAAc;EAAM;EAAS,WAAW;EAAQ,CAAC;AAErE,KAAIE,mDAAqB,OAAO,CAC9B,QAAO,IAAI,KAAK;EACd,cAAc;EACd;EACA,oBAAoB;EACrB,CAAC;AAEJ,QAAO,IAAI,KAAK;EAAE,cAAc;EAAM;EAAS,CAAC;;;;;;;;;AAUlD,SAAgB,iCAId,KAEA,cACA,YACA,SAG4E;AAC5E,KAAI,CAAC,YAAY;EACf,MAAM,SAAS,IAAI,KAAK,aAAa;AACrC,SAAO,UAAU,OAAO,WAAW,EAAE,SAAS,CAAC,GAAG;;CAGpD,MAAM,eAAeI,wCAAoB,OAAO,EAE9C,SAAS,OAAY,WAAW,aAAa,OAAO,MAAM,KAAK,OAAO,EACvE,CAAC;CACF,MAAM,aAAaA,wCAAoB,OAAO,EAC5C,cAAc,MACf,CAAC;CACF,MAAM,qBAAqB,aAAa,cAAc,EACpD,WAAW,CAAC,WAAW,EACxB,CAAC;CACF,MAAM,SAASC,8BAAiB,KAG9B,CAAC,EAAE,KAAK,KAAK,EAAE,mBAAmB,CAAC;AACrC,QAAO,UAAU,OAAO,WAAW,EAAE,SAAS,CAAC,GAAG"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { BaseMessage } from "../messages/base.cjs";
|
|
2
|
+
import { SerializableSchema } from "../utils/standard_schema.cjs";
|
|
3
|
+
import { InteropZodType } from "../utils/types/zod.cjs";
|
|
4
|
+
import { Runnable } from "../runnables/base.cjs";
|
|
5
|
+
import { BaseLanguageModelInput } from "./base.cjs";
|
|
6
|
+
import { BaseLLMOutputParser, BaseOutputParser } from "../output_parsers/base.cjs";
|
|
7
|
+
|
|
8
|
+
//#region src/language_models/structured_output.d.ts
|
|
9
|
+
/**
|
|
10
|
+
* Creates the appropriate content-based output parser for a schema. Use this for
|
|
11
|
+
* jsonMode/jsonSchema methods where the LLM returns JSON text.
|
|
12
|
+
*
|
|
13
|
+
* - Zod schema -> StructuredOutputParser (Zod validation)
|
|
14
|
+
* - Standard schema -> StandardSchemaOutputParser (standard schema validation)
|
|
15
|
+
* - Plain JSON schema -> JsonOutputParser (no validation)
|
|
16
|
+
*/
|
|
17
|
+
declare function createContentParser<RunOutput extends Record<string, any> = Record<string, any>>(schema: InteropZodType<RunOutput> | SerializableSchema<RunOutput> | Record<string, any>): BaseOutputParser<RunOutput>;
|
|
18
|
+
type FunctionCallingParserConstructor<T extends Record<string, any> = Record<string, any>> = new (params: {
|
|
19
|
+
keyName: string;
|
|
20
|
+
returnSingle?: boolean;
|
|
21
|
+
zodSchema?: InteropZodType<T>;
|
|
22
|
+
serializableSchema?: SerializableSchema<T>;
|
|
23
|
+
}) => BaseLLMOutputParser<T>;
|
|
24
|
+
/**
|
|
25
|
+
* Creates the appropriate tool-calling output parser for a schema. Use this for
|
|
26
|
+
* function calling / tool use methods where the LLM returns structured tool calls.
|
|
27
|
+
*
|
|
28
|
+
* - Zod schema -> parser with Zod validation
|
|
29
|
+
* - Standard schema -> parser with standard schema validation
|
|
30
|
+
* - Plain JSON schema -> parser with no validation
|
|
31
|
+
*/
|
|
32
|
+
declare function createFunctionCallingParser<RunOutput extends Record<string, any> = Record<string, any>>(schema: InteropZodType<RunOutput> | SerializableSchema<RunOutput> | Record<string, any>, keyName: string, ParserClass?: FunctionCallingParserConstructor<RunOutput>): BaseLLMOutputParser<RunOutput>;
|
|
33
|
+
/**
|
|
34
|
+
* Pipes an LLM through an output parser, optionally wrapping the result
|
|
35
|
+
* to include the raw LLM response alongside the parsed output.
|
|
36
|
+
*
|
|
37
|
+
* When `includeRaw` is true, returns `{ raw: BaseMessage, parsed: RunOutput }`.
|
|
38
|
+
* If parsing fails, `parsed` falls back to null.
|
|
39
|
+
*/
|
|
40
|
+
declare function assembleStructuredOutputPipeline<RunOutput extends Record<string, any> = Record<string, any>>(llm: Runnable<BaseLanguageModelInput>, outputParser: Runnable<any, RunOutput>, includeRaw?: boolean, runName?: string): Runnable<BaseLanguageModelInput, RunOutput> | Runnable<BaseLanguageModelInput, {
|
|
41
|
+
raw: BaseMessage;
|
|
42
|
+
parsed: RunOutput;
|
|
43
|
+
}>;
|
|
44
|
+
//#endregion
|
|
45
|
+
export { assembleStructuredOutputPipeline, createContentParser, createFunctionCallingParser };
|
|
46
|
+
//# sourceMappingURL=structured_output.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structured_output.d.cts","names":[],"sources":["../../src/language_models/structured_output.ts"],"mappings":";;;;;;;;;;AA6BA;;;;;;iBAAgB,mBAAA,mBAEI,MAAA,gBAAsB,MAAA,cAAA,CAExC,MAAA,EACI,cAAA,CAAe,SAAA,IACf,kBAAA,CAAmB,SAAA,IAEnB,MAAA,gBACH,gBAAA,CAAiB,SAAA;AAAA,KAUf,gCAAA,WAEO,MAAA,gBAAsB,MAAA,sBACzB,MAAA;EACP,OAAA;EACA,YAAA;EACA,SAAA,GAAY,cAAA,CAAe,CAAA;EAC3B,kBAAA,GAAqB,kBAAA,CAAmB,CAAA;AAAA,MACpC,mBAAA,CAAoB,CAAA;;;;;;;;;iBAUV,2BAAA,mBAEI,MAAA,gBAAsB,MAAA,cAAA,CAExC,MAAA,EACI,cAAA,CAAe,SAAA,IACf,kBAAA,CAAmB,SAAA,IAEnB,MAAA,eACJ,OAAA,UACA,WAAA,GAAc,gCAAA,CAAiC,SAAA,IAC9C,mBAAA,CAAoB,SAAA;;;;;;AA/BtB;;iBAqDe,gCAAA,mBAEI,MAAA,gBAAsB,MAAA,cAAA,CAExC,GAAA,EAAK,QAAA,CAAS,sBAAA,GAEd,YAAA,EAAc,QAAA,MAAc,SAAA,GAC5B,UAAA,YACA,OAAA,YAEE,QAAA,CAAS,sBAAA,EAAwB,SAAA,IACjC,QAAA,CAAS,sBAAA;EAA0B,GAAA,EAAK,WAAA;EAAa,MAAA,EAAQ,SAAA;AAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { BaseMessage } from "../messages/base.js";
|
|
2
|
+
import { SerializableSchema } from "../utils/standard_schema.js";
|
|
3
|
+
import { InteropZodType } from "../utils/types/zod.js";
|
|
4
|
+
import "../utils/types/index.js";
|
|
5
|
+
import { Runnable } from "../runnables/base.js";
|
|
6
|
+
import { BaseLanguageModelInput } from "./base.js";
|
|
7
|
+
import "../messages/index.js";
|
|
8
|
+
import "../runnables/index.js";
|
|
9
|
+
import { BaseLLMOutputParser, BaseOutputParser } from "../output_parsers/base.js";
|
|
10
|
+
import "../output_parsers/index.js";
|
|
11
|
+
|
|
12
|
+
//#region src/language_models/structured_output.d.ts
|
|
13
|
+
/**
|
|
14
|
+
* Creates the appropriate content-based output parser for a schema. Use this for
|
|
15
|
+
* jsonMode/jsonSchema methods where the LLM returns JSON text.
|
|
16
|
+
*
|
|
17
|
+
* - Zod schema -> StructuredOutputParser (Zod validation)
|
|
18
|
+
* - Standard schema -> StandardSchemaOutputParser (standard schema validation)
|
|
19
|
+
* - Plain JSON schema -> JsonOutputParser (no validation)
|
|
20
|
+
*/
|
|
21
|
+
declare function createContentParser<RunOutput extends Record<string, any> = Record<string, any>>(schema: InteropZodType<RunOutput> | SerializableSchema<RunOutput> | Record<string, any>): BaseOutputParser<RunOutput>;
|
|
22
|
+
type FunctionCallingParserConstructor<T extends Record<string, any> = Record<string, any>> = new (params: {
|
|
23
|
+
keyName: string;
|
|
24
|
+
returnSingle?: boolean;
|
|
25
|
+
zodSchema?: InteropZodType<T>;
|
|
26
|
+
serializableSchema?: SerializableSchema<T>;
|
|
27
|
+
}) => BaseLLMOutputParser<T>;
|
|
28
|
+
/**
|
|
29
|
+
* Creates the appropriate tool-calling output parser for a schema. Use this for
|
|
30
|
+
* function calling / tool use methods where the LLM returns structured tool calls.
|
|
31
|
+
*
|
|
32
|
+
* - Zod schema -> parser with Zod validation
|
|
33
|
+
* - Standard schema -> parser with standard schema validation
|
|
34
|
+
* - Plain JSON schema -> parser with no validation
|
|
35
|
+
*/
|
|
36
|
+
declare function createFunctionCallingParser<RunOutput extends Record<string, any> = Record<string, any>>(schema: InteropZodType<RunOutput> | SerializableSchema<RunOutput> | Record<string, any>, keyName: string, ParserClass?: FunctionCallingParserConstructor<RunOutput>): BaseLLMOutputParser<RunOutput>;
|
|
37
|
+
/**
|
|
38
|
+
* Pipes an LLM through an output parser, optionally wrapping the result
|
|
39
|
+
* to include the raw LLM response alongside the parsed output.
|
|
40
|
+
*
|
|
41
|
+
* When `includeRaw` is true, returns `{ raw: BaseMessage, parsed: RunOutput }`.
|
|
42
|
+
* If parsing fails, `parsed` falls back to null.
|
|
43
|
+
*/
|
|
44
|
+
declare function assembleStructuredOutputPipeline<RunOutput extends Record<string, any> = Record<string, any>>(llm: Runnable<BaseLanguageModelInput>, outputParser: Runnable<any, RunOutput>, includeRaw?: boolean, runName?: string): Runnable<BaseLanguageModelInput, RunOutput> | Runnable<BaseLanguageModelInput, {
|
|
45
|
+
raw: BaseMessage;
|
|
46
|
+
parsed: RunOutput;
|
|
47
|
+
}>;
|
|
48
|
+
//#endregion
|
|
49
|
+
export { assembleStructuredOutputPipeline, createContentParser, createFunctionCallingParser };
|
|
50
|
+
//# sourceMappingURL=structured_output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structured_output.d.ts","names":[],"sources":["../../src/language_models/structured_output.ts"],"mappings":";;;;;;;;;;;;;;;;;;AA6BA;;iBAAgB,mBAAA,mBAEI,MAAA,gBAAsB,MAAA,cAAA,CAExC,MAAA,EACI,cAAA,CAAe,SAAA,IACf,kBAAA,CAAmB,SAAA,IAEnB,MAAA,gBACH,gBAAA,CAAiB,SAAA;AAAA,KAUf,gCAAA,WAEO,MAAA,gBAAsB,MAAA,sBACzB,MAAA;EACP,OAAA;EACA,YAAA;EACA,SAAA,GAAY,cAAA,CAAe,CAAA;EAC3B,kBAAA,GAAqB,kBAAA,CAAmB,CAAA;AAAA,MACpC,mBAAA,CAAoB,CAAA;;;;;;;;;iBAUV,2BAAA,mBAEI,MAAA,gBAAsB,MAAA,cAAA,CAExC,MAAA,EACI,cAAA,CAAe,SAAA,IACf,kBAAA,CAAmB,SAAA,IAEnB,MAAA,eACJ,OAAA,UACA,WAAA,GAAc,gCAAA,CAAiC,SAAA,IAC9C,mBAAA,CAAoB,SAAA;;;;;;;;iBAsBP,gCAAA,mBAEI,MAAA,gBAAsB,MAAA,cAAA,CAExC,GAAA,EAAK,QAAA,CAAS,sBAAA,GAEd,YAAA,EAAc,QAAA,MAAc,SAAA,GAC5B,UAAA,YACA,OAAA,YAEE,QAAA,CAAS,sBAAA,EAAwB,SAAA,IACjC,QAAA,CAAS,sBAAA;EAA0B,GAAA,EAAK,WAAA;EAAa,MAAA,EAAQ,SAAA;AAAA"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { __exportAll } from "../_virtual/_rolldown/runtime.js";
|
|
2
|
+
import { isInteropZodSchema } from "../utils/types/zod.js";
|
|
3
|
+
import { isSerializableSchema } from "../utils/standard_schema.js";
|
|
4
|
+
import { RunnableSequence } from "../runnables/base.js";
|
|
5
|
+
import { RunnablePassthrough } from "../runnables/passthrough.js";
|
|
6
|
+
import "../runnables/index.js";
|
|
7
|
+
import { JsonOutputParser } from "../output_parsers/json.js";
|
|
8
|
+
import { StandardSchemaOutputParser } from "../output_parsers/standard_schema.js";
|
|
9
|
+
import { StructuredOutputParser } from "../output_parsers/structured.js";
|
|
10
|
+
import "../output_parsers/index.js";
|
|
11
|
+
import { JsonOutputKeyToolsParser } from "../output_parsers/openai_tools/json_output_tools_parsers.js";
|
|
12
|
+
import "../utils/types/index.js";
|
|
13
|
+
|
|
14
|
+
//#region src/language_models/structured_output.ts
|
|
15
|
+
var structured_output_exports = /* @__PURE__ */ __exportAll({
|
|
16
|
+
assembleStructuredOutputPipeline: () => assembleStructuredOutputPipeline,
|
|
17
|
+
createContentParser: () => createContentParser,
|
|
18
|
+
createFunctionCallingParser: () => createFunctionCallingParser
|
|
19
|
+
});
|
|
20
|
+
/**
|
|
21
|
+
* Creates the appropriate content-based output parser for a schema. Use this for
|
|
22
|
+
* jsonMode/jsonSchema methods where the LLM returns JSON text.
|
|
23
|
+
*
|
|
24
|
+
* - Zod schema -> StructuredOutputParser (Zod validation)
|
|
25
|
+
* - Standard schema -> StandardSchemaOutputParser (standard schema validation)
|
|
26
|
+
* - Plain JSON schema -> JsonOutputParser (no validation)
|
|
27
|
+
*/
|
|
28
|
+
function createContentParser(schema) {
|
|
29
|
+
if (isInteropZodSchema(schema)) return StructuredOutputParser.fromZodSchema(schema);
|
|
30
|
+
if (isSerializableSchema(schema)) return StandardSchemaOutputParser.fromSerializableSchema(schema);
|
|
31
|
+
return new JsonOutputParser();
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Creates the appropriate tool-calling output parser for a schema. Use this for
|
|
35
|
+
* function calling / tool use methods where the LLM returns structured tool calls.
|
|
36
|
+
*
|
|
37
|
+
* - Zod schema -> parser with Zod validation
|
|
38
|
+
* - Standard schema -> parser with standard schema validation
|
|
39
|
+
* - Plain JSON schema -> parser with no validation
|
|
40
|
+
*/
|
|
41
|
+
function createFunctionCallingParser(schema, keyName, ParserClass) {
|
|
42
|
+
const Ctor = ParserClass ?? JsonOutputKeyToolsParser;
|
|
43
|
+
if (isInteropZodSchema(schema)) return new Ctor({
|
|
44
|
+
returnSingle: true,
|
|
45
|
+
keyName,
|
|
46
|
+
zodSchema: schema
|
|
47
|
+
});
|
|
48
|
+
if (isSerializableSchema(schema)) return new Ctor({
|
|
49
|
+
returnSingle: true,
|
|
50
|
+
keyName,
|
|
51
|
+
serializableSchema: schema
|
|
52
|
+
});
|
|
53
|
+
return new Ctor({
|
|
54
|
+
returnSingle: true,
|
|
55
|
+
keyName
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Pipes an LLM through an output parser, optionally wrapping the result
|
|
60
|
+
* to include the raw LLM response alongside the parsed output.
|
|
61
|
+
*
|
|
62
|
+
* When `includeRaw` is true, returns `{ raw: BaseMessage, parsed: RunOutput }`.
|
|
63
|
+
* If parsing fails, `parsed` falls back to null.
|
|
64
|
+
*/
|
|
65
|
+
function assembleStructuredOutputPipeline(llm, outputParser, includeRaw, runName) {
|
|
66
|
+
if (!includeRaw) {
|
|
67
|
+
const result = llm.pipe(outputParser);
|
|
68
|
+
return runName ? result.withConfig({ runName }) : result;
|
|
69
|
+
}
|
|
70
|
+
const parserAssign = RunnablePassthrough.assign({ parsed: (input, config) => outputParser.invoke(input.raw, config) });
|
|
71
|
+
const parserNone = RunnablePassthrough.assign({ parsed: () => null });
|
|
72
|
+
const parsedWithFallback = parserAssign.withFallbacks({ fallbacks: [parserNone] });
|
|
73
|
+
const result = RunnableSequence.from([{ raw: llm }, parsedWithFallback]);
|
|
74
|
+
return runName ? result.withConfig({ runName }) : result;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
//#endregion
|
|
78
|
+
export { assembleStructuredOutputPipeline, createContentParser, createFunctionCallingParser, structured_output_exports };
|
|
79
|
+
//# sourceMappingURL=structured_output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structured_output.js","names":[],"sources":["../../src/language_models/structured_output.ts"],"sourcesContent":["import { BaseMessage } from \"../messages/index.js\";\nimport {\n BaseLLMOutputParser,\n BaseOutputParser,\n JsonOutputParser,\n StructuredOutputParser,\n} from \"../output_parsers/index.js\";\nimport { JsonOutputKeyToolsParser } from \"../output_parsers/openai_tools/json_output_tools_parsers.js\";\nimport { StandardSchemaOutputParser } from \"../output_parsers/standard_schema.js\";\nimport {\n Runnable,\n RunnablePassthrough,\n RunnableSequence,\n} from \"../runnables/index.js\";\nimport {\n isSerializableSchema,\n SerializableSchema,\n} from \"../utils/standard_schema.js\";\nimport { InteropZodType, isInteropZodSchema } from \"../utils/types/index.js\";\nimport { BaseLanguageModelInput } from \"./base.js\";\n\n/**\n * Creates the appropriate content-based output parser for a schema. Use this for\n * jsonMode/jsonSchema methods where the LLM returns JSON text.\n *\n * - Zod schema -> StructuredOutputParser (Zod validation)\n * - Standard schema -> StandardSchemaOutputParser (standard schema validation)\n * - Plain JSON schema -> JsonOutputParser (no validation)\n */\nexport function createContentParser<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>,\n>(\n schema:\n | InteropZodType<RunOutput>\n | SerializableSchema<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>\n): BaseOutputParser<RunOutput> {\n if (isInteropZodSchema(schema)) {\n return StructuredOutputParser.fromZodSchema(schema);\n }\n if (isSerializableSchema(schema)) {\n return StandardSchemaOutputParser.fromSerializableSchema(schema);\n }\n return new JsonOutputParser<RunOutput>();\n}\n\ntype FunctionCallingParserConstructor<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n T extends Record<string, any> = Record<string, any>,\n> = new (params: {\n keyName: string;\n returnSingle?: boolean;\n zodSchema?: InteropZodType<T>;\n serializableSchema?: SerializableSchema<T>;\n}) => BaseLLMOutputParser<T>;\n\n/**\n * Creates the appropriate tool-calling output parser for a schema. Use this for\n * function calling / tool use methods where the LLM returns structured tool calls.\n *\n * - Zod schema -> parser with Zod validation\n * - Standard schema -> parser with standard schema validation\n * - Plain JSON schema -> parser with no validation\n */\nexport function createFunctionCallingParser<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>,\n>(\n schema:\n | InteropZodType<RunOutput>\n | SerializableSchema<RunOutput>\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n | Record<string, any>,\n keyName: string,\n ParserClass?: FunctionCallingParserConstructor<RunOutput>\n): BaseLLMOutputParser<RunOutput> {\n const Ctor = ParserClass ?? JsonOutputKeyToolsParser;\n if (isInteropZodSchema(schema)) {\n return new Ctor({ returnSingle: true, keyName, zodSchema: schema });\n }\n if (isSerializableSchema(schema)) {\n return new Ctor({\n returnSingle: true,\n keyName,\n serializableSchema: schema,\n });\n }\n return new Ctor({ returnSingle: true, keyName });\n}\n\n/**\n * Pipes an LLM through an output parser, optionally wrapping the result\n * to include the raw LLM response alongside the parsed output.\n *\n * When `includeRaw` is true, returns `{ raw: BaseMessage, parsed: RunOutput }`.\n * If parsing fails, `parsed` falls back to null.\n */\nexport function assembleStructuredOutputPipeline<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n RunOutput extends Record<string, any> = Record<string, any>,\n>(\n llm: Runnable<BaseLanguageModelInput>,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n outputParser: Runnable<any, RunOutput>,\n includeRaw?: boolean,\n runName?: string\n):\n | Runnable<BaseLanguageModelInput, RunOutput>\n | Runnable<BaseLanguageModelInput, { raw: BaseMessage; parsed: RunOutput }> {\n if (!includeRaw) {\n const result = llm.pipe(outputParser);\n return runName ? result.withConfig({ runName }) : result;\n }\n\n const parserAssign = RunnablePassthrough.assign({\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n parsed: (input: any, config) => outputParser.invoke(input.raw, config),\n });\n const parserNone = RunnablePassthrough.assign({\n parsed: () => null,\n });\n const parsedWithFallback = parserAssign.withFallbacks({\n fallbacks: [parserNone],\n });\n const result = RunnableSequence.from<\n BaseLanguageModelInput,\n { raw: BaseMessage; parsed: RunOutput }\n >([{ raw: llm }, parsedWithFallback]);\n return runName ? result.withConfig({ runName }) : result;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,SAAgB,oBAId,QAK6B;AAC7B,KAAI,mBAAmB,OAAO,CAC5B,QAAO,uBAAuB,cAAc,OAAO;AAErD,KAAI,qBAAqB,OAAO,CAC9B,QAAO,2BAA2B,uBAAuB,OAAO;AAElE,QAAO,IAAI,kBAA6B;;;;;;;;;;AAqB1C,SAAgB,4BAId,QAKA,SACA,aACgC;CAChC,MAAM,OAAO,eAAe;AAC5B,KAAI,mBAAmB,OAAO,CAC5B,QAAO,IAAI,KAAK;EAAE,cAAc;EAAM;EAAS,WAAW;EAAQ,CAAC;AAErE,KAAI,qBAAqB,OAAO,CAC9B,QAAO,IAAI,KAAK;EACd,cAAc;EACd;EACA,oBAAoB;EACrB,CAAC;AAEJ,QAAO,IAAI,KAAK;EAAE,cAAc;EAAM;EAAS,CAAC;;;;;;;;;AAUlD,SAAgB,iCAId,KAEA,cACA,YACA,SAG4E;AAC5E,KAAI,CAAC,YAAY;EACf,MAAM,SAAS,IAAI,KAAK,aAAa;AACrC,SAAO,UAAU,OAAO,WAAW,EAAE,SAAS,CAAC,GAAG;;CAGpD,MAAM,eAAe,oBAAoB,OAAO,EAE9C,SAAS,OAAY,WAAW,aAAa,OAAO,MAAM,KAAK,OAAO,EACvE,CAAC;CACF,MAAM,aAAa,oBAAoB,OAAO,EAC5C,cAAc,MACf,CAAC;CACF,MAAM,qBAAqB,aAAa,cAAc,EACpD,WAAW,CAAC,WAAW,EACxB,CAAC;CACF,MAAM,SAAS,iBAAiB,KAG9B,CAAC,EAAE,KAAK,KAAK,EAAE,mBAAmB,CAAC;AACrC,QAAO,UAAU,OAAO,WAAW,EAAE,SAAS,CAAC,GAAG"}
|
package/dist/load/import_map.cjs
CHANGED
|
@@ -18,6 +18,7 @@ const require_utils_stream = require('../utils/stream.cjs');
|
|
|
18
18
|
const require_tracers_log_stream = require('../tracers/log_stream.cjs');
|
|
19
19
|
const require_outputs = require('../outputs.cjs');
|
|
20
20
|
const require_utils_async_caller = require('../utils/async_caller.cjs');
|
|
21
|
+
const require_utils_standard_schema = require('../utils/standard_schema.cjs');
|
|
21
22
|
const require_utils_json_schema = require('../utils/json_schema.cjs');
|
|
22
23
|
const require_runnables_graph = require('../runnables/graph.cjs');
|
|
23
24
|
const require_messages_index = require('../messages/index.cjs');
|
|
@@ -31,13 +32,15 @@ const require_indexing_index = require('../indexing/index.cjs');
|
|
|
31
32
|
const require_prompt_values = require('../prompt_values.cjs');
|
|
32
33
|
const require_utils_tiktoken = require('../utils/tiktoken.cjs');
|
|
33
34
|
const require_language_models_base = require('../language_models/base.cjs');
|
|
35
|
+
const require_runnables_index = require('../runnables/index.cjs');
|
|
36
|
+
const require_utils_json_patch = require('../utils/json_patch.cjs');
|
|
37
|
+
const require_output_parsers_index = require('../output_parsers/index.cjs');
|
|
38
|
+
const require_utils_types_index = require('../utils/types/index.cjs');
|
|
39
|
+
const require_language_models_structured_output = require('../language_models/structured_output.cjs');
|
|
34
40
|
const require_language_models_chat_models = require('../language_models/chat_models.cjs');
|
|
35
41
|
const require_language_models_llms = require('../language_models/llms.cjs');
|
|
36
42
|
const require_language_models_profile = require('../language_models/profile.cjs');
|
|
37
43
|
const require_memory = require('../memory.cjs');
|
|
38
|
-
const require_runnables_index = require('../runnables/index.cjs');
|
|
39
|
-
const require_utils_json_patch = require('../utils/json_patch.cjs');
|
|
40
|
-
const require_output_parsers_index = require('../output_parsers/index.cjs');
|
|
41
44
|
const require_output_parsers_openai_functions_index = require('../output_parsers/openai_functions/index.cjs');
|
|
42
45
|
const require_output_parsers_openai_tools_index = require('../output_parsers/openai_tools/index.cjs');
|
|
43
46
|
const require_prompts_index = require('../prompts/index.cjs');
|
|
@@ -45,6 +48,7 @@ const require_retrievers_document_compressors_index = require('../retrievers/doc
|
|
|
45
48
|
const require_retrievers_index = require('../retrievers/index.cjs');
|
|
46
49
|
const require_stores = require('../stores.cjs');
|
|
47
50
|
const require_structured_query_index = require('../structured_query/index.cjs');
|
|
51
|
+
const require_testing_index = require('../testing/index.cjs');
|
|
48
52
|
const require_tools_index = require('../tools/index.cjs');
|
|
49
53
|
const require_tracers_run_collector = require('../tracers/run_collector.cjs');
|
|
50
54
|
const require_types_stream = require('../types/stream.cjs');
|
|
@@ -57,7 +61,6 @@ const require_utils_math = require('../utils/math.cjs');
|
|
|
57
61
|
const require_utils_ssrf = require('../utils/ssrf.cjs');
|
|
58
62
|
const require_vectorstores = require('../vectorstores.cjs');
|
|
59
63
|
const require_utils_testing_index = require('../utils/testing/index.cjs');
|
|
60
|
-
const require_utils_types_index = require('../utils/types/index.cjs');
|
|
61
64
|
|
|
62
65
|
//#region src/load/import_map.ts
|
|
63
66
|
var import_map_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
@@ -79,6 +82,7 @@ var import_map_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
|
79
82
|
language_models__chat_models: () => require_language_models_chat_models.chat_models_exports,
|
|
80
83
|
language_models__llms: () => require_language_models_llms.llms_exports,
|
|
81
84
|
language_models__profile: () => require_language_models_profile.profile_exports,
|
|
85
|
+
language_models__structured_output: () => require_language_models_structured_output.structured_output_exports,
|
|
82
86
|
load__serializable: () => require_load_serializable.serializable_exports,
|
|
83
87
|
memory: () => require_memory.memory_exports,
|
|
84
88
|
messages: () => require_messages_index.messages_exports,
|
|
@@ -96,6 +100,7 @@ var import_map_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
|
96
100
|
singletons: () => require_singletons_index.singletons_exports,
|
|
97
101
|
stores: () => require_stores.stores_exports,
|
|
98
102
|
structured_query: () => require_structured_query_index.structured_query_exports,
|
|
103
|
+
testing: () => require_testing_index.testing_exports,
|
|
99
104
|
tools: () => require_tools_index.tools_exports,
|
|
100
105
|
tracers__base: () => require_tracers_base.base_exports,
|
|
101
106
|
tracers__console: () => require_tracers_console.console_exports,
|
|
@@ -115,6 +120,7 @@ var import_map_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
|
115
120
|
utils__json_schema: () => require_utils_json_schema.json_schema_exports,
|
|
116
121
|
utils__math: () => require_utils_math.math_exports,
|
|
117
122
|
utils__ssrf: () => require_utils_ssrf.ssrf_exports,
|
|
123
|
+
utils__standard_schema: () => require_utils_standard_schema.standard_schema_exports,
|
|
118
124
|
utils__stream: () => require_utils_stream.stream_exports,
|
|
119
125
|
utils__testing: () => require_utils_testing_index.testing_exports,
|
|
120
126
|
utils__tiktoken: () => require_utils_tiktoken.tiktoken_exports,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import_map.cjs","names":[],"sources":["../../src/load/import_map.ts"],"sourcesContent":["/** Auto-generated by import-map plugin. Do not edit manually */\n\nexport * as agents from \"../agents.js\";\nexport * as caches from \"../caches/index.js\";\nexport * as callbacks__base from \"../callbacks/base.js\";\nexport * as callbacks__manager from \"../callbacks/manager.js\";\nexport * as callbacks__promises from \"../callbacks/promises.js\";\nexport * as chat_history from \"../chat_history.js\";\nexport * as document_loaders__base from \"../document_loaders/base.js\";\nexport * as document_loaders__langsmith from \"../document_loaders/langsmith.js\";\nexport * as documents from \"../documents/index.js\";\nexport * as embeddings from \"../embeddings.js\";\nexport * as errors from \"../errors/index.js\";\nexport * as example_selectors from \"../example_selectors/index.js\";\nexport * as index from \"../index.js\";\nexport * as indexing from \"../indexing/index.js\";\nexport * as language_models__base from \"../language_models/base.js\";\nexport * as language_models__chat_models from \"../language_models/chat_models.js\";\nexport * as language_models__llms from \"../language_models/llms.js\";\nexport * as language_models__profile from \"../language_models/profile.js\";\nexport * as load__serializable from \"../load/serializable.js\";\nexport * as memory from \"../memory.js\";\nexport * as messages from \"../messages/index.js\";\nexport * as messages__tool from \"../messages/tool.js\";\nexport * as output_parsers from \"../output_parsers/index.js\";\nexport * as output_parsers__openai_functions from \"../output_parsers/openai_functions/index.js\";\nexport * as output_parsers__openai_tools from \"../output_parsers/openai_tools/index.js\";\nexport * as outputs from \"../outputs.js\";\nexport * as prompt_values from \"../prompt_values.js\";\nexport * as prompts from \"../prompts/index.js\";\nexport * as retrievers__document_compressors from \"../retrievers/document_compressors/index.js\";\nexport * as retrievers from \"../retrievers/index.js\";\nexport * as runnables__graph from \"../runnables/graph.js\";\nexport * as runnables from \"../runnables/index.js\";\nexport * as singletons from \"../singletons/index.js\";\nexport * as stores from \"../stores.js\";\nexport * as structured_query from \"../structured_query/index.js\";\nexport * as tools from \"../tools/index.js\";\nexport * as tracers__base from \"../tracers/base.js\";\nexport * as tracers__console from \"../tracers/console.js\";\nexport * as tracers__log_stream from \"../tracers/log_stream.js\";\nexport * as tracers__run_collector from \"../tracers/run_collector.js\";\nexport * as tracers__tracer_langchain from \"../tracers/tracer_langchain.js\";\nexport * as types__stream from \"../types/stream.js\";\nexport * as utils__async_caller from \"../utils/async_caller.js\";\nexport * as utils__chunk_array from \"../utils/chunk_array.js\";\nexport * as utils__context from \"../utils/context.js\";\nexport * as utils__env from \"../utils/env.js\";\nexport * as utils__event_source_parse from \"../utils/event_source_parse.js\";\nexport * as utils__format from \"../utils/format.js\";\nexport * as utils__function_calling from \"../utils/function_calling.js\";\nexport * as utils__hash from \"../utils/hash.js\";\nexport * as utils__json_patch from \"../utils/json_patch.js\";\nexport * as utils__json_schema from \"../utils/json_schema.js\";\nexport * as utils__math from \"../utils/math.js\";\nexport * as utils__ssrf from \"../utils/ssrf.js\";\nexport * as utils__stream from \"../utils/stream.js\";\nexport * as utils__testing from \"../utils/testing/index.js\";\nexport * as utils__tiktoken from \"../utils/tiktoken.js\";\nexport * as utils__types from \"../utils/types/index.js\";\nexport * as vectorstores from \"../vectorstores.js\";\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"import_map.cjs","names":[],"sources":["../../src/load/import_map.ts"],"sourcesContent":["/** Auto-generated by import-map plugin. Do not edit manually */\n\nexport * as agents from \"../agents.js\";\nexport * as caches from \"../caches/index.js\";\nexport * as callbacks__base from \"../callbacks/base.js\";\nexport * as callbacks__manager from \"../callbacks/manager.js\";\nexport * as callbacks__promises from \"../callbacks/promises.js\";\nexport * as chat_history from \"../chat_history.js\";\nexport * as document_loaders__base from \"../document_loaders/base.js\";\nexport * as document_loaders__langsmith from \"../document_loaders/langsmith.js\";\nexport * as documents from \"../documents/index.js\";\nexport * as embeddings from \"../embeddings.js\";\nexport * as errors from \"../errors/index.js\";\nexport * as example_selectors from \"../example_selectors/index.js\";\nexport * as index from \"../index.js\";\nexport * as indexing from \"../indexing/index.js\";\nexport * as language_models__base from \"../language_models/base.js\";\nexport * as language_models__chat_models from \"../language_models/chat_models.js\";\nexport * as language_models__llms from \"../language_models/llms.js\";\nexport * as language_models__profile from \"../language_models/profile.js\";\nexport * as language_models__structured_output from \"../language_models/structured_output.js\";\nexport * as load__serializable from \"../load/serializable.js\";\nexport * as memory from \"../memory.js\";\nexport * as messages from \"../messages/index.js\";\nexport * as messages__tool from \"../messages/tool.js\";\nexport * as output_parsers from \"../output_parsers/index.js\";\nexport * as output_parsers__openai_functions from \"../output_parsers/openai_functions/index.js\";\nexport * as output_parsers__openai_tools from \"../output_parsers/openai_tools/index.js\";\nexport * as outputs from \"../outputs.js\";\nexport * as prompt_values from \"../prompt_values.js\";\nexport * as prompts from \"../prompts/index.js\";\nexport * as retrievers__document_compressors from \"../retrievers/document_compressors/index.js\";\nexport * as retrievers from \"../retrievers/index.js\";\nexport * as runnables__graph from \"../runnables/graph.js\";\nexport * as runnables from \"../runnables/index.js\";\nexport * as singletons from \"../singletons/index.js\";\nexport * as stores from \"../stores.js\";\nexport * as structured_query from \"../structured_query/index.js\";\nexport * as testing from \"../testing/index.js\";\nexport * as tools from \"../tools/index.js\";\nexport * as tracers__base from \"../tracers/base.js\";\nexport * as tracers__console from \"../tracers/console.js\";\nexport * as tracers__log_stream from \"../tracers/log_stream.js\";\nexport * as tracers__run_collector from \"../tracers/run_collector.js\";\nexport * as tracers__tracer_langchain from \"../tracers/tracer_langchain.js\";\nexport * as types__stream from \"../types/stream.js\";\nexport * as utils__async_caller from \"../utils/async_caller.js\";\nexport * as utils__chunk_array from \"../utils/chunk_array.js\";\nexport * as utils__context from \"../utils/context.js\";\nexport * as utils__env from \"../utils/env.js\";\nexport * as utils__event_source_parse from \"../utils/event_source_parse.js\";\nexport * as utils__format from \"../utils/format.js\";\nexport * as utils__function_calling from \"../utils/function_calling.js\";\nexport * as utils__hash from \"../utils/hash.js\";\nexport * as utils__json_patch from \"../utils/json_patch.js\";\nexport * as utils__json_schema from \"../utils/json_schema.js\";\nexport * as utils__math from \"../utils/math.js\";\nexport * as utils__ssrf from \"../utils/ssrf.js\";\nexport * as utils__standard_schema from \"../utils/standard_schema.js\";\nexport * as utils__stream from \"../utils/stream.js\";\nexport * as utils__testing from \"../utils/testing/index.js\";\nexport * as utils__tiktoken from \"../utils/tiktoken.js\";\nexport * as utils__types from \"../utils/types/index.js\";\nexport * as vectorstores from \"../vectorstores.js\";\n"],"mappings":""}
|
package/dist/load/import_map.js
CHANGED
|
@@ -18,6 +18,7 @@ import { stream_exports } from "../utils/stream.js";
|
|
|
18
18
|
import { log_stream_exports } from "../tracers/log_stream.js";
|
|
19
19
|
import { outputs_exports } from "../outputs.js";
|
|
20
20
|
import { async_caller_exports } from "../utils/async_caller.js";
|
|
21
|
+
import { standard_schema_exports } from "../utils/standard_schema.js";
|
|
21
22
|
import { json_schema_exports } from "../utils/json_schema.js";
|
|
22
23
|
import { graph_exports } from "../runnables/graph.js";
|
|
23
24
|
import { messages_exports } from "../messages/index.js";
|
|
@@ -31,13 +32,15 @@ import { indexing_exports } from "../indexing/index.js";
|
|
|
31
32
|
import { prompt_values_exports } from "../prompt_values.js";
|
|
32
33
|
import { tiktoken_exports } from "../utils/tiktoken.js";
|
|
33
34
|
import { base_exports as base_exports$3 } from "../language_models/base.js";
|
|
35
|
+
import { runnables_exports } from "../runnables/index.js";
|
|
36
|
+
import { json_patch_exports } from "../utils/json_patch.js";
|
|
37
|
+
import { output_parsers_exports } from "../output_parsers/index.js";
|
|
38
|
+
import { types_exports } from "../utils/types/index.js";
|
|
39
|
+
import { structured_output_exports } from "../language_models/structured_output.js";
|
|
34
40
|
import { chat_models_exports } from "../language_models/chat_models.js";
|
|
35
41
|
import { llms_exports } from "../language_models/llms.js";
|
|
36
42
|
import { profile_exports } from "../language_models/profile.js";
|
|
37
43
|
import { memory_exports } from "../memory.js";
|
|
38
|
-
import { runnables_exports } from "../runnables/index.js";
|
|
39
|
-
import { json_patch_exports } from "../utils/json_patch.js";
|
|
40
|
-
import { output_parsers_exports } from "../output_parsers/index.js";
|
|
41
44
|
import { openai_functions_exports } from "../output_parsers/openai_functions/index.js";
|
|
42
45
|
import { openai_tools_exports } from "../output_parsers/openai_tools/index.js";
|
|
43
46
|
import { prompts_exports } from "../prompts/index.js";
|
|
@@ -45,6 +48,7 @@ import { document_compressors_exports } from "../retrievers/document_compressors
|
|
|
45
48
|
import { retrievers_exports } from "../retrievers/index.js";
|
|
46
49
|
import { stores_exports } from "../stores.js";
|
|
47
50
|
import { structured_query_exports } from "../structured_query/index.js";
|
|
51
|
+
import { testing_exports } from "../testing/index.js";
|
|
48
52
|
import { tools_exports } from "../tools/index.js";
|
|
49
53
|
import { run_collector_exports } from "../tracers/run_collector.js";
|
|
50
54
|
import { stream_exports as stream_exports$1 } from "../types/stream.js";
|
|
@@ -56,8 +60,7 @@ import { function_calling_exports } from "../utils/function_calling.js";
|
|
|
56
60
|
import { math_exports } from "../utils/math.js";
|
|
57
61
|
import { ssrf_exports } from "../utils/ssrf.js";
|
|
58
62
|
import { vectorstores_exports } from "../vectorstores.js";
|
|
59
|
-
import { testing_exports } from "../utils/testing/index.js";
|
|
60
|
-
import { types_exports } from "../utils/types/index.js";
|
|
63
|
+
import { testing_exports as testing_exports$1 } from "../utils/testing/index.js";
|
|
61
64
|
|
|
62
65
|
//#region src/load/import_map.ts
|
|
63
66
|
var import_map_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -79,6 +82,7 @@ var import_map_exports = /* @__PURE__ */ __exportAll({
|
|
|
79
82
|
language_models__chat_models: () => chat_models_exports,
|
|
80
83
|
language_models__llms: () => llms_exports,
|
|
81
84
|
language_models__profile: () => profile_exports,
|
|
85
|
+
language_models__structured_output: () => structured_output_exports,
|
|
82
86
|
load__serializable: () => serializable_exports,
|
|
83
87
|
memory: () => memory_exports,
|
|
84
88
|
messages: () => messages_exports,
|
|
@@ -96,6 +100,7 @@ var import_map_exports = /* @__PURE__ */ __exportAll({
|
|
|
96
100
|
singletons: () => singletons_exports,
|
|
97
101
|
stores: () => stores_exports,
|
|
98
102
|
structured_query: () => structured_query_exports,
|
|
103
|
+
testing: () => testing_exports,
|
|
99
104
|
tools: () => tools_exports,
|
|
100
105
|
tracers__base: () => base_exports$1,
|
|
101
106
|
tracers__console: () => console_exports,
|
|
@@ -115,8 +120,9 @@ var import_map_exports = /* @__PURE__ */ __exportAll({
|
|
|
115
120
|
utils__json_schema: () => json_schema_exports,
|
|
116
121
|
utils__math: () => math_exports,
|
|
117
122
|
utils__ssrf: () => ssrf_exports,
|
|
123
|
+
utils__standard_schema: () => standard_schema_exports,
|
|
118
124
|
utils__stream: () => stream_exports,
|
|
119
|
-
utils__testing: () => testing_exports,
|
|
125
|
+
utils__testing: () => testing_exports$1,
|
|
120
126
|
utils__tiktoken: () => tiktoken_exports,
|
|
121
127
|
utils__types: () => types_exports,
|
|
122
128
|
vectorstores: () => vectorstores_exports
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import_map.js","names":[],"sources":["../../src/load/import_map.ts"],"sourcesContent":["/** Auto-generated by import-map plugin. Do not edit manually */\n\nexport * as agents from \"../agents.js\";\nexport * as caches from \"../caches/index.js\";\nexport * as callbacks__base from \"../callbacks/base.js\";\nexport * as callbacks__manager from \"../callbacks/manager.js\";\nexport * as callbacks__promises from \"../callbacks/promises.js\";\nexport * as chat_history from \"../chat_history.js\";\nexport * as document_loaders__base from \"../document_loaders/base.js\";\nexport * as document_loaders__langsmith from \"../document_loaders/langsmith.js\";\nexport * as documents from \"../documents/index.js\";\nexport * as embeddings from \"../embeddings.js\";\nexport * as errors from \"../errors/index.js\";\nexport * as example_selectors from \"../example_selectors/index.js\";\nexport * as index from \"../index.js\";\nexport * as indexing from \"../indexing/index.js\";\nexport * as language_models__base from \"../language_models/base.js\";\nexport * as language_models__chat_models from \"../language_models/chat_models.js\";\nexport * as language_models__llms from \"../language_models/llms.js\";\nexport * as language_models__profile from \"../language_models/profile.js\";\nexport * as load__serializable from \"../load/serializable.js\";\nexport * as memory from \"../memory.js\";\nexport * as messages from \"../messages/index.js\";\nexport * as messages__tool from \"../messages/tool.js\";\nexport * as output_parsers from \"../output_parsers/index.js\";\nexport * as output_parsers__openai_functions from \"../output_parsers/openai_functions/index.js\";\nexport * as output_parsers__openai_tools from \"../output_parsers/openai_tools/index.js\";\nexport * as outputs from \"../outputs.js\";\nexport * as prompt_values from \"../prompt_values.js\";\nexport * as prompts from \"../prompts/index.js\";\nexport * as retrievers__document_compressors from \"../retrievers/document_compressors/index.js\";\nexport * as retrievers from \"../retrievers/index.js\";\nexport * as runnables__graph from \"../runnables/graph.js\";\nexport * as runnables from \"../runnables/index.js\";\nexport * as singletons from \"../singletons/index.js\";\nexport * as stores from \"../stores.js\";\nexport * as structured_query from \"../structured_query/index.js\";\nexport * as tools from \"../tools/index.js\";\nexport * as tracers__base from \"../tracers/base.js\";\nexport * as tracers__console from \"../tracers/console.js\";\nexport * as tracers__log_stream from \"../tracers/log_stream.js\";\nexport * as tracers__run_collector from \"../tracers/run_collector.js\";\nexport * as tracers__tracer_langchain from \"../tracers/tracer_langchain.js\";\nexport * as types__stream from \"../types/stream.js\";\nexport * as utils__async_caller from \"../utils/async_caller.js\";\nexport * as utils__chunk_array from \"../utils/chunk_array.js\";\nexport * as utils__context from \"../utils/context.js\";\nexport * as utils__env from \"../utils/env.js\";\nexport * as utils__event_source_parse from \"../utils/event_source_parse.js\";\nexport * as utils__format from \"../utils/format.js\";\nexport * as utils__function_calling from \"../utils/function_calling.js\";\nexport * as utils__hash from \"../utils/hash.js\";\nexport * as utils__json_patch from \"../utils/json_patch.js\";\nexport * as utils__json_schema from \"../utils/json_schema.js\";\nexport * as utils__math from \"../utils/math.js\";\nexport * as utils__ssrf from \"../utils/ssrf.js\";\nexport * as utils__stream from \"../utils/stream.js\";\nexport * as utils__testing from \"../utils/testing/index.js\";\nexport * as utils__tiktoken from \"../utils/tiktoken.js\";\nexport * as utils__types from \"../utils/types/index.js\";\nexport * as vectorstores from \"../vectorstores.js\";\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"import_map.js","names":[],"sources":["../../src/load/import_map.ts"],"sourcesContent":["/** Auto-generated by import-map plugin. Do not edit manually */\n\nexport * as agents from \"../agents.js\";\nexport * as caches from \"../caches/index.js\";\nexport * as callbacks__base from \"../callbacks/base.js\";\nexport * as callbacks__manager from \"../callbacks/manager.js\";\nexport * as callbacks__promises from \"../callbacks/promises.js\";\nexport * as chat_history from \"../chat_history.js\";\nexport * as document_loaders__base from \"../document_loaders/base.js\";\nexport * as document_loaders__langsmith from \"../document_loaders/langsmith.js\";\nexport * as documents from \"../documents/index.js\";\nexport * as embeddings from \"../embeddings.js\";\nexport * as errors from \"../errors/index.js\";\nexport * as example_selectors from \"../example_selectors/index.js\";\nexport * as index from \"../index.js\";\nexport * as indexing from \"../indexing/index.js\";\nexport * as language_models__base from \"../language_models/base.js\";\nexport * as language_models__chat_models from \"../language_models/chat_models.js\";\nexport * as language_models__llms from \"../language_models/llms.js\";\nexport * as language_models__profile from \"../language_models/profile.js\";\nexport * as language_models__structured_output from \"../language_models/structured_output.js\";\nexport * as load__serializable from \"../load/serializable.js\";\nexport * as memory from \"../memory.js\";\nexport * as messages from \"../messages/index.js\";\nexport * as messages__tool from \"../messages/tool.js\";\nexport * as output_parsers from \"../output_parsers/index.js\";\nexport * as output_parsers__openai_functions from \"../output_parsers/openai_functions/index.js\";\nexport * as output_parsers__openai_tools from \"../output_parsers/openai_tools/index.js\";\nexport * as outputs from \"../outputs.js\";\nexport * as prompt_values from \"../prompt_values.js\";\nexport * as prompts from \"../prompts/index.js\";\nexport * as retrievers__document_compressors from \"../retrievers/document_compressors/index.js\";\nexport * as retrievers from \"../retrievers/index.js\";\nexport * as runnables__graph from \"../runnables/graph.js\";\nexport * as runnables from \"../runnables/index.js\";\nexport * as singletons from \"../singletons/index.js\";\nexport * as stores from \"../stores.js\";\nexport * as structured_query from \"../structured_query/index.js\";\nexport * as testing from \"../testing/index.js\";\nexport * as tools from \"../tools/index.js\";\nexport * as tracers__base from \"../tracers/base.js\";\nexport * as tracers__console from \"../tracers/console.js\";\nexport * as tracers__log_stream from \"../tracers/log_stream.js\";\nexport * as tracers__run_collector from \"../tracers/run_collector.js\";\nexport * as tracers__tracer_langchain from \"../tracers/tracer_langchain.js\";\nexport * as types__stream from \"../types/stream.js\";\nexport * as utils__async_caller from \"../utils/async_caller.js\";\nexport * as utils__chunk_array from \"../utils/chunk_array.js\";\nexport * as utils__context from \"../utils/context.js\";\nexport * as utils__env from \"../utils/env.js\";\nexport * as utils__event_source_parse from \"../utils/event_source_parse.js\";\nexport * as utils__format from \"../utils/format.js\";\nexport * as utils__function_calling from \"../utils/function_calling.js\";\nexport * as utils__hash from \"../utils/hash.js\";\nexport * as utils__json_patch from \"../utils/json_patch.js\";\nexport * as utils__json_schema from \"../utils/json_schema.js\";\nexport * as utils__math from \"../utils/math.js\";\nexport * as utils__ssrf from \"../utils/ssrf.js\";\nexport * as utils__standard_schema from \"../utils/standard_schema.js\";\nexport * as utils__stream from \"../utils/stream.js\";\nexport * as utils__testing from \"../utils/testing/index.js\";\nexport * as utils__tiktoken from \"../utils/tiktoken.js\";\nexport * as utils__types from \"../utils/types/index.js\";\nexport * as vectorstores from \"../vectorstores.js\";\n"],"mappings":""}
|