@langchain/core 1.1.32 → 1.1.33-dev-1773698445534
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/dist/_virtual/_rolldown/runtime.cjs +12 -22
- package/dist/_virtual/_rolldown/runtime.js +6 -11
- package/dist/agents.cjs +8 -10
- package/dist/agents.js +1 -2
- package/dist/caches/index.cjs +11 -12
- package/dist/caches/index.cjs.map +1 -1
- package/dist/caches/index.js +1 -2
- package/dist/caches/index.js.map +1 -1
- package/dist/callbacks/base.cjs +10 -11
- package/dist/callbacks/base.cjs.map +1 -1
- package/dist/callbacks/base.js +1 -2
- package/dist/callbacks/base.js.map +1 -1
- package/dist/callbacks/dispatch/index.cjs +7 -8
- package/dist/callbacks/dispatch/index.cjs.map +1 -1
- package/dist/callbacks/dispatch/index.d.ts +0 -2
- package/dist/callbacks/dispatch/index.d.ts.map +1 -1
- package/dist/callbacks/dispatch/index.js +1 -2
- package/dist/callbacks/dispatch/index.js.map +1 -1
- package/dist/callbacks/dispatch/web.cjs +3 -4
- package/dist/callbacks/dispatch/web.cjs.map +1 -1
- package/dist/callbacks/dispatch/web.d.ts +0 -2
- package/dist/callbacks/dispatch/web.d.ts.map +1 -1
- package/dist/callbacks/dispatch/web.js +1 -2
- package/dist/callbacks/dispatch/web.js.map +1 -1
- package/dist/callbacks/manager.cjs +18 -19
- package/dist/callbacks/manager.cjs.map +1 -1
- package/dist/callbacks/manager.js +1 -2
- package/dist/callbacks/manager.js.map +1 -1
- package/dist/callbacks/promises.cjs +9 -10
- package/dist/callbacks/promises.js +1 -2
- package/dist/chat_history.cjs +12 -13
- package/dist/chat_history.cjs.map +1 -1
- package/dist/chat_history.d.ts +0 -2
- package/dist/chat_history.d.ts.map +1 -1
- package/dist/chat_history.js +1 -2
- package/dist/chat_history.js.map +1 -1
- package/dist/context.cjs +6 -7
- package/dist/context.cjs.map +1 -1
- package/dist/context.js +1 -2
- package/dist/context.js.map +1 -1
- package/dist/document_loaders/base.cjs +8 -10
- package/dist/document_loaders/base.cjs.map +1 -1
- package/dist/document_loaders/base.js +1 -2
- package/dist/document_loaders/base.js.map +1 -1
- package/dist/document_loaders/langsmith.cjs +9 -10
- package/dist/document_loaders/langsmith.cjs.map +1 -1
- package/dist/document_loaders/langsmith.js +1 -2
- package/dist/document_loaders/langsmith.js.map +1 -1
- package/dist/documents/document.cjs +1 -2
- package/dist/documents/document.cjs.map +1 -1
- package/dist/documents/document.js +1 -1
- package/dist/documents/document.js.map +1 -1
- package/dist/documents/index.cjs +10 -11
- package/dist/documents/index.js +1 -2
- package/dist/documents/transformers.cjs +2 -3
- package/dist/documents/transformers.cjs.map +1 -1
- package/dist/documents/transformers.js +1 -2
- package/dist/documents/transformers.js.map +1 -1
- package/dist/embeddings.cjs +9 -10
- package/dist/embeddings.cjs.map +1 -1
- package/dist/embeddings.js +1 -2
- package/dist/embeddings.js.map +1 -1
- package/dist/errors/index.cjs +9 -10
- package/dist/errors/index.cjs.map +1 -1
- package/dist/errors/index.js +1 -2
- package/dist/errors/index.js.map +1 -1
- package/dist/example_selectors/base.cjs +2 -3
- package/dist/example_selectors/base.cjs.map +1 -1
- package/dist/example_selectors/base.js +1 -2
- package/dist/example_selectors/base.js.map +1 -1
- package/dist/example_selectors/conditional.cjs +1 -2
- package/dist/example_selectors/conditional.cjs.map +1 -1
- package/dist/example_selectors/conditional.js +1 -1
- package/dist/example_selectors/index.cjs +12 -13
- package/dist/example_selectors/index.js +1 -2
- package/dist/example_selectors/length_based.cjs +2 -3
- package/dist/example_selectors/length_based.cjs.map +1 -1
- package/dist/example_selectors/length_based.js +1 -2
- package/dist/example_selectors/length_based.js.map +1 -1
- package/dist/example_selectors/semantic_similarity.cjs +3 -4
- package/dist/example_selectors/semantic_similarity.cjs.map +1 -1
- package/dist/example_selectors/semantic_similarity.js +1 -2
- package/dist/example_selectors/semantic_similarity.js.map +1 -1
- package/dist/index.cjs +8 -10
- package/dist/index.js +1 -2
- package/dist/indexing/base.cjs +6 -7
- package/dist/indexing/base.cjs.map +1 -1
- package/dist/indexing/base.js +1 -2
- package/dist/indexing/base.js.map +1 -1
- package/dist/indexing/index.cjs +10 -11
- package/dist/indexing/index.js +1 -2
- package/dist/indexing/record_manager.cjs +2 -3
- package/dist/indexing/record_manager.cjs.map +1 -1
- package/dist/indexing/record_manager.js +1 -2
- package/dist/indexing/record_manager.js.map +1 -1
- package/dist/language_models/base.cjs +15 -16
- package/dist/language_models/base.cjs.map +1 -1
- package/dist/language_models/base.d.ts +0 -2
- package/dist/language_models/base.d.ts.map +1 -1
- package/dist/language_models/base.js +2 -3
- package/dist/language_models/base.js.map +1 -1
- package/dist/language_models/chat_models.cjs +26 -27
- package/dist/language_models/chat_models.cjs.map +1 -1
- package/dist/language_models/chat_models.d.ts +0 -3
- package/dist/language_models/chat_models.d.ts.map +1 -1
- package/dist/language_models/chat_models.js +1 -2
- package/dist/language_models/chat_models.js.map +1 -1
- package/dist/language_models/llms.cjs +13 -14
- package/dist/language_models/llms.cjs.map +1 -1
- package/dist/language_models/llms.d.ts +0 -1
- package/dist/language_models/llms.d.ts.map +1 -1
- package/dist/language_models/llms.js +1 -2
- package/dist/language_models/llms.js.map +1 -1
- package/dist/language_models/profile.cjs +8 -10
- package/dist/language_models/profile.js +1 -2
- package/dist/language_models/structured_output.cjs +19 -20
- package/dist/language_models/structured_output.cjs.map +1 -1
- package/dist/language_models/structured_output.d.ts +0 -5
- package/dist/language_models/structured_output.d.ts.map +1 -1
- package/dist/language_models/structured_output.js +1 -2
- package/dist/language_models/structured_output.js.map +1 -1
- package/dist/language_models/utils.cjs +1 -2
- package/dist/language_models/utils.cjs.map +1 -1
- package/dist/language_models/utils.js +1 -1
- package/dist/load/import_constants.cjs +1 -2
- package/dist/load/import_constants.cjs.map +1 -1
- package/dist/load/import_constants.js +1 -1
- package/dist/load/import_map.cjs +69 -70
- package/dist/load/import_map.js +1 -2
- package/dist/load/index.cjs +8 -9
- package/dist/load/index.cjs.map +1 -1
- package/dist/load/index.js +1 -2
- package/dist/load/index.js.map +1 -1
- package/dist/load/map_keys.cjs +2 -3
- package/dist/load/map_keys.cjs.map +1 -1
- package/dist/load/map_keys.js +1 -2
- package/dist/load/map_keys.js.map +1 -1
- package/dist/load/serializable.cjs +10 -11
- package/dist/load/serializable.cjs.map +1 -1
- package/dist/load/serializable.js +1 -2
- package/dist/load/serializable.js.map +1 -1
- package/dist/load/validation.cjs +3 -4
- package/dist/load/validation.cjs.map +1 -1
- package/dist/load/validation.js +3 -3
- package/dist/load/validation.js.map +1 -1
- package/dist/memory.cjs +8 -10
- package/dist/memory.cjs.map +1 -1
- package/dist/memory.js +1 -2
- package/dist/memory.js.map +1 -1
- package/dist/messages/ai.cjs +6 -7
- package/dist/messages/ai.cjs.map +1 -1
- package/dist/messages/ai.js +1 -2
- package/dist/messages/ai.js.map +1 -1
- package/dist/messages/base.cjs +8 -9
- package/dist/messages/base.cjs.map +1 -1
- package/dist/messages/base.js +1 -2
- package/dist/messages/base.js.map +1 -1
- package/dist/messages/block_translators/anthropic.cjs +2 -3
- package/dist/messages/block_translators/anthropic.cjs.map +1 -1
- package/dist/messages/block_translators/anthropic.js +1 -2
- package/dist/messages/block_translators/anthropic.js.map +1 -1
- package/dist/messages/block_translators/bedrock_converse.cjs +2 -3
- package/dist/messages/block_translators/bedrock_converse.cjs.map +1 -1
- package/dist/messages/block_translators/bedrock_converse.js +1 -2
- package/dist/messages/block_translators/bedrock_converse.js.map +1 -1
- package/dist/messages/block_translators/data.cjs +3 -4
- package/dist/messages/block_translators/data.cjs.map +1 -1
- package/dist/messages/block_translators/data.js +1 -2
- package/dist/messages/block_translators/data.js.map +1 -1
- package/dist/messages/block_translators/deepseek.cjs +2 -3
- package/dist/messages/block_translators/deepseek.cjs.map +1 -1
- package/dist/messages/block_translators/deepseek.js +1 -2
- package/dist/messages/block_translators/deepseek.js.map +1 -1
- package/dist/messages/block_translators/google.cjs +2 -3
- package/dist/messages/block_translators/google.cjs.map +1 -1
- package/dist/messages/block_translators/google.js +1 -2
- package/dist/messages/block_translators/google.js.map +1 -1
- package/dist/messages/block_translators/google_genai.cjs +2 -3
- package/dist/messages/block_translators/google_genai.cjs.map +1 -1
- package/dist/messages/block_translators/google_genai.js +1 -2
- package/dist/messages/block_translators/google_genai.js.map +1 -1
- package/dist/messages/block_translators/google_vertexai.cjs +2 -3
- package/dist/messages/block_translators/google_vertexai.cjs.map +1 -1
- package/dist/messages/block_translators/google_vertexai.js +1 -2
- package/dist/messages/block_translators/google_vertexai.js.map +1 -1
- package/dist/messages/block_translators/groq.cjs +2 -3
- package/dist/messages/block_translators/groq.cjs.map +1 -1
- package/dist/messages/block_translators/groq.js +1 -2
- package/dist/messages/block_translators/groq.js.map +1 -1
- package/dist/messages/block_translators/index.cjs +11 -12
- package/dist/messages/block_translators/index.cjs.map +1 -1
- package/dist/messages/block_translators/index.js +1 -2
- package/dist/messages/block_translators/index.js.map +1 -1
- package/dist/messages/block_translators/ollama.cjs +2 -3
- package/dist/messages/block_translators/ollama.cjs.map +1 -1
- package/dist/messages/block_translators/ollama.js +1 -2
- package/dist/messages/block_translators/ollama.js.map +1 -1
- package/dist/messages/block_translators/openai.cjs +29 -4
- package/dist/messages/block_translators/openai.cjs.map +1 -1
- package/dist/messages/block_translators/openai.js +27 -2
- package/dist/messages/block_translators/openai.js.map +1 -1
- package/dist/messages/block_translators/utils.cjs +1 -2
- package/dist/messages/block_translators/utils.cjs.map +1 -1
- package/dist/messages/block_translators/utils.js +1 -1
- package/dist/messages/block_translators/xai.cjs +2 -3
- package/dist/messages/block_translators/xai.cjs.map +1 -1
- package/dist/messages/block_translators/xai.js +1 -2
- package/dist/messages/block_translators/xai.js.map +1 -1
- package/dist/messages/chat.cjs +2 -3
- package/dist/messages/chat.cjs.map +1 -1
- package/dist/messages/chat.js +1 -2
- package/dist/messages/chat.js.map +1 -1
- package/dist/messages/content/data.cjs +1 -2
- package/dist/messages/content/data.cjs.map +1 -1
- package/dist/messages/content/data.js +1 -1
- package/dist/messages/content/index.cjs +3 -4
- package/dist/messages/content/index.cjs.map +1 -1
- package/dist/messages/content/index.js +1 -2
- package/dist/messages/content/index.js.map +1 -1
- package/dist/messages/content/multimodal.cjs +1 -2
- package/dist/messages/content/multimodal.cjs.map +1 -1
- package/dist/messages/content/multimodal.js +1 -1
- package/dist/messages/content/tools.cjs +1 -2
- package/dist/messages/content/tools.cjs.map +1 -1
- package/dist/messages/content/tools.js +1 -1
- package/dist/messages/format.cjs +1 -2
- package/dist/messages/format.cjs.map +1 -1
- package/dist/messages/format.js +1 -1
- package/dist/messages/function.cjs +2 -3
- package/dist/messages/function.cjs.map +1 -1
- package/dist/messages/function.js +1 -2
- package/dist/messages/function.js.map +1 -1
- package/dist/messages/human.cjs +2 -3
- package/dist/messages/human.cjs.map +1 -1
- package/dist/messages/human.js +1 -2
- package/dist/messages/human.js.map +1 -1
- package/dist/messages/index.cjs +22 -23
- package/dist/messages/index.js +1 -2
- package/dist/messages/message.cjs +1 -2
- package/dist/messages/message.cjs.map +1 -1
- package/dist/messages/message.js +1 -1
- package/dist/messages/metadata.cjs +2 -3
- package/dist/messages/metadata.cjs.map +1 -1
- package/dist/messages/metadata.js +1 -2
- package/dist/messages/metadata.js.map +1 -1
- package/dist/messages/modifier.cjs +2 -3
- package/dist/messages/modifier.cjs.map +1 -1
- package/dist/messages/modifier.js +1 -2
- package/dist/messages/modifier.js.map +1 -1
- package/dist/messages/system.cjs +2 -3
- package/dist/messages/system.cjs.map +1 -1
- package/dist/messages/system.js +1 -2
- package/dist/messages/system.js.map +1 -1
- package/dist/messages/tool.cjs +9 -10
- package/dist/messages/tool.cjs.map +1 -1
- package/dist/messages/tool.js +1 -2
- package/dist/messages/tool.js.map +1 -1
- package/dist/messages/transformers.cjs +11 -12
- package/dist/messages/transformers.cjs.map +1 -1
- package/dist/messages/transformers.js +1 -2
- package/dist/messages/transformers.js.map +1 -1
- package/dist/messages/utils.cjs +12 -13
- package/dist/messages/utils.cjs.map +1 -1
- package/dist/messages/utils.js +1 -2
- package/dist/messages/utils.js.map +1 -1
- package/dist/output_parsers/base.cjs +4 -5
- package/dist/output_parsers/base.cjs.map +1 -1
- package/dist/output_parsers/base.d.ts +0 -4
- package/dist/output_parsers/base.d.ts.map +1 -1
- package/dist/output_parsers/base.js +1 -2
- package/dist/output_parsers/base.js.map +1 -1
- package/dist/output_parsers/bytes.cjs +2 -3
- package/dist/output_parsers/bytes.cjs.map +1 -1
- package/dist/output_parsers/bytes.js +1 -2
- package/dist/output_parsers/bytes.js.map +1 -1
- package/dist/output_parsers/index.cjs +18 -19
- package/dist/output_parsers/index.js +1 -2
- package/dist/output_parsers/json.cjs +5 -6
- package/dist/output_parsers/json.cjs.map +1 -1
- package/dist/output_parsers/json.d.ts +0 -1
- package/dist/output_parsers/json.d.ts.map +1 -1
- package/dist/output_parsers/json.js +2 -3
- package/dist/output_parsers/json.js.map +1 -1
- package/dist/output_parsers/list.cjs +3 -4
- package/dist/output_parsers/list.cjs.map +1 -1
- package/dist/output_parsers/list.d.ts +0 -1
- package/dist/output_parsers/list.d.ts.map +1 -1
- package/dist/output_parsers/list.js +1 -2
- package/dist/output_parsers/list.js.map +1 -1
- package/dist/output_parsers/openai_functions/index.cjs +9 -10
- package/dist/output_parsers/openai_functions/index.js +1 -2
- package/dist/output_parsers/openai_functions/json_output_functions_parsers.cjs +7 -8
- package/dist/output_parsers/openai_functions/json_output_functions_parsers.cjs.map +1 -1
- package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.ts +0 -1
- package/dist/output_parsers/openai_functions/json_output_functions_parsers.d.ts.map +1 -1
- package/dist/output_parsers/openai_functions/json_output_functions_parsers.js +1 -2
- package/dist/output_parsers/openai_functions/json_output_functions_parsers.js.map +1 -1
- package/dist/output_parsers/openai_tools/index.cjs +9 -10
- package/dist/output_parsers/openai_tools/index.js +1 -2
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.cjs +7 -8
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.cjs.map +1 -1
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.js +1 -2
- package/dist/output_parsers/openai_tools/json_output_tools_parsers.js.map +1 -1
- package/dist/output_parsers/standard_schema.cjs +4 -5
- package/dist/output_parsers/standard_schema.cjs.map +1 -1
- package/dist/output_parsers/standard_schema.js +1 -2
- package/dist/output_parsers/standard_schema.js.map +1 -1
- package/dist/output_parsers/string.cjs +2 -3
- package/dist/output_parsers/string.cjs.map +1 -1
- package/dist/output_parsers/string.d.ts +0 -1
- package/dist/output_parsers/string.d.ts.map +1 -1
- package/dist/output_parsers/string.js +1 -2
- package/dist/output_parsers/string.js.map +1 -1
- package/dist/output_parsers/structured.cjs +5 -6
- package/dist/output_parsers/structured.cjs.map +1 -1
- package/dist/output_parsers/structured.js +1 -2
- package/dist/output_parsers/structured.js.map +1 -1
- package/dist/output_parsers/transform.cjs +6 -7
- package/dist/output_parsers/transform.cjs.map +1 -1
- package/dist/output_parsers/transform.js +1 -2
- package/dist/output_parsers/transform.js.map +1 -1
- package/dist/output_parsers/xml.cjs +5 -6
- package/dist/output_parsers/xml.cjs.map +1 -1
- package/dist/output_parsers/xml.js +1 -2
- package/dist/output_parsers/xml.js.map +1 -1
- package/dist/outputs.cjs +8 -10
- package/dist/outputs.cjs.map +1 -1
- package/dist/outputs.js +1 -2
- package/dist/outputs.js.map +1 -1
- package/dist/prompt_values.cjs +11 -12
- package/dist/prompt_values.cjs.map +1 -1
- package/dist/prompt_values.js +1 -2
- package/dist/prompt_values.js.map +1 -1
- package/dist/prompts/base.cjs +2 -3
- package/dist/prompts/base.cjs.map +1 -1
- package/dist/prompts/base.d.ts +0 -2
- package/dist/prompts/base.d.ts.map +1 -1
- package/dist/prompts/base.js +1 -2
- package/dist/prompts/base.js.map +1 -1
- package/dist/prompts/chat.cjs +17 -18
- package/dist/prompts/chat.cjs.map +1 -1
- package/dist/prompts/chat.d.ts +0 -1
- package/dist/prompts/chat.d.ts.map +1 -1
- package/dist/prompts/chat.js +1 -2
- package/dist/prompts/chat.js.map +1 -1
- package/dist/prompts/dict.cjs +3 -4
- package/dist/prompts/dict.cjs.map +1 -1
- package/dist/prompts/dict.js +1 -2
- package/dist/prompts/dict.js.map +1 -1
- package/dist/prompts/few_shot.cjs +5 -6
- package/dist/prompts/few_shot.cjs.map +1 -1
- package/dist/prompts/few_shot.d.ts +0 -1
- package/dist/prompts/few_shot.d.ts.map +1 -1
- package/dist/prompts/few_shot.js +1 -2
- package/dist/prompts/few_shot.js.map +1 -1
- package/dist/prompts/image.cjs +4 -5
- package/dist/prompts/image.cjs.map +1 -1
- package/dist/prompts/image.d.ts +0 -1
- package/dist/prompts/image.d.ts.map +1 -1
- package/dist/prompts/image.js +1 -2
- package/dist/prompts/image.js.map +1 -1
- package/dist/prompts/index.cjs +18 -19
- package/dist/prompts/index.js +1 -2
- package/dist/prompts/pipeline.cjs +3 -4
- package/dist/prompts/pipeline.cjs.map +1 -1
- package/dist/prompts/pipeline.js +1 -2
- package/dist/prompts/pipeline.js.map +1 -1
- package/dist/prompts/prompt.cjs +3 -4
- package/dist/prompts/prompt.cjs.map +1 -1
- package/dist/prompts/prompt.d.ts +0 -1
- package/dist/prompts/prompt.d.ts.map +1 -1
- package/dist/prompts/prompt.js +1 -2
- package/dist/prompts/prompt.js.map +1 -1
- package/dist/prompts/serde.d.ts +0 -1
- package/dist/prompts/serde.d.ts.map +1 -1
- package/dist/prompts/string.cjs +3 -4
- package/dist/prompts/string.cjs.map +1 -1
- package/dist/prompts/string.js +1 -2
- package/dist/prompts/string.js.map +1 -1
- package/dist/prompts/structured.cjs +3 -4
- package/dist/prompts/structured.cjs.map +1 -1
- package/dist/prompts/structured.d.ts +0 -1
- package/dist/prompts/structured.d.ts.map +1 -1
- package/dist/prompts/structured.js +1 -2
- package/dist/prompts/structured.js.map +1 -1
- package/dist/prompts/template.cjs +3 -4
- package/dist/prompts/template.cjs.map +1 -1
- package/dist/prompts/template.d.ts +0 -2
- package/dist/prompts/template.d.ts.map +1 -1
- package/dist/prompts/template.js +1 -2
- package/dist/prompts/template.js.map +1 -1
- package/dist/retrievers/document_compressors/index.cjs +8 -10
- package/dist/retrievers/document_compressors/index.cjs.map +1 -1
- package/dist/retrievers/document_compressors/index.js +1 -2
- package/dist/retrievers/document_compressors/index.js.map +1 -1
- package/dist/retrievers/index.cjs +11 -12
- package/dist/retrievers/index.cjs.map +1 -1
- package/dist/retrievers/index.d.ts +0 -1
- package/dist/retrievers/index.d.ts.map +1 -1
- package/dist/retrievers/index.js +1 -2
- package/dist/retrievers/index.js.map +1 -1
- package/dist/runnables/base.cjs +32 -36
- package/dist/runnables/base.cjs.map +1 -1
- package/dist/runnables/base.d.cts.map +1 -1
- package/dist/runnables/base.d.ts.map +1 -1
- package/dist/runnables/base.js +15 -19
- package/dist/runnables/base.js.map +1 -1
- package/dist/runnables/branch.cjs +4 -5
- package/dist/runnables/branch.cjs.map +1 -1
- package/dist/runnables/branch.d.ts +0 -1
- package/dist/runnables/branch.d.ts.map +1 -1
- package/dist/runnables/branch.js +1 -2
- package/dist/runnables/branch.js.map +1 -1
- package/dist/runnables/config.cjs +4 -7
- package/dist/runnables/config.cjs.map +1 -1
- package/dist/runnables/config.js +2 -4
- package/dist/runnables/config.js.map +1 -1
- package/dist/runnables/graph.cjs +11 -12
- package/dist/runnables/graph.cjs.map +1 -1
- package/dist/runnables/graph.js +1 -2
- package/dist/runnables/graph.js.map +1 -1
- package/dist/runnables/graph_mermaid.cjs +2 -3
- package/dist/runnables/graph_mermaid.cjs.map +1 -1
- package/dist/runnables/graph_mermaid.js +1 -2
- package/dist/runnables/graph_mermaid.js.map +1 -1
- package/dist/runnables/history.cjs +7 -8
- package/dist/runnables/history.cjs.map +1 -1
- package/dist/runnables/history.d.ts +0 -2
- package/dist/runnables/history.d.ts.map +1 -1
- package/dist/runnables/history.js +1 -2
- package/dist/runnables/history.js.map +1 -1
- package/dist/runnables/index.cjs +15 -16
- package/dist/runnables/index.js +1 -2
- package/dist/runnables/iter.cjs +4 -5
- package/dist/runnables/iter.cjs.map +1 -1
- package/dist/runnables/iter.js +1 -2
- package/dist/runnables/iter.js.map +1 -1
- package/dist/runnables/passthrough.cjs +4 -5
- package/dist/runnables/passthrough.cjs.map +1 -1
- package/dist/runnables/passthrough.d.ts +0 -1
- package/dist/runnables/passthrough.d.ts.map +1 -1
- package/dist/runnables/passthrough.js +1 -2
- package/dist/runnables/passthrough.js.map +1 -1
- package/dist/runnables/router.cjs +3 -4
- package/dist/runnables/router.cjs.map +1 -1
- package/dist/runnables/router.d.ts +0 -1
- package/dist/runnables/router.d.ts.map +1 -1
- package/dist/runnables/router.js +1 -2
- package/dist/runnables/router.js.map +1 -1
- package/dist/runnables/utils.cjs +1 -2
- package/dist/runnables/utils.cjs.map +1 -1
- package/dist/runnables/utils.js +1 -1
- package/dist/runnables/utils.js.map +1 -1
- package/dist/runnables/wrappers.cjs +2 -3
- package/dist/runnables/wrappers.cjs.map +1 -1
- package/dist/runnables/wrappers.js +1 -2
- package/dist/runnables/wrappers.js.map +1 -1
- package/dist/singletons/async_local_storage/context.cjs +3 -4
- package/dist/singletons/async_local_storage/context.cjs.map +1 -1
- package/dist/singletons/async_local_storage/context.js +1 -2
- package/dist/singletons/async_local_storage/context.js.map +1 -1
- package/dist/singletons/async_local_storage/globals.cjs +1 -2
- package/dist/singletons/async_local_storage/globals.cjs.map +1 -1
- package/dist/singletons/async_local_storage/globals.js +1 -1
- package/dist/singletons/async_local_storage/globals.js.map +1 -1
- package/dist/singletons/async_local_storage/index.cjs +4 -5
- package/dist/singletons/async_local_storage/index.cjs.map +1 -1
- package/dist/singletons/async_local_storage/index.js +1 -2
- package/dist/singletons/async_local_storage/index.js.map +1 -1
- package/dist/singletons/callbacks.cjs +4 -5
- package/dist/singletons/callbacks.cjs.map +1 -1
- package/dist/singletons/callbacks.js +1 -2
- package/dist/singletons/callbacks.js.map +1 -1
- package/dist/singletons/index.cjs +10 -11
- package/dist/singletons/index.js +1 -2
- package/dist/singletons/tracer.cjs +3 -4
- package/dist/singletons/tracer.cjs.map +1 -1
- package/dist/singletons/tracer.js +1 -2
- package/dist/singletons/tracer.js.map +1 -1
- package/dist/stores.cjs +9 -10
- package/dist/stores.cjs.map +1 -1
- package/dist/stores.js +1 -2
- package/dist/stores.js.map +1 -1
- package/dist/structured_query/base.cjs +3 -4
- package/dist/structured_query/base.cjs.map +1 -1
- package/dist/structured_query/base.js +1 -2
- package/dist/structured_query/base.js.map +1 -1
- package/dist/structured_query/functional.cjs +4 -5
- package/dist/structured_query/functional.cjs.map +1 -1
- package/dist/structured_query/functional.js +1 -2
- package/dist/structured_query/functional.js.map +1 -1
- package/dist/structured_query/index.cjs +12 -13
- package/dist/structured_query/index.js +1 -2
- package/dist/structured_query/ir.cjs +1 -2
- package/dist/structured_query/ir.cjs.map +1 -1
- package/dist/structured_query/ir.js +1 -1
- package/dist/structured_query/ir.js.map +1 -1
- package/dist/structured_query/utils.cjs +1 -2
- package/dist/structured_query/utils.cjs.map +1 -1
- package/dist/structured_query/utils.js +1 -1
- package/dist/testing/fake_model_builder.cjs +6 -7
- package/dist/testing/fake_model_builder.cjs.map +1 -1
- package/dist/testing/fake_model_builder.d.ts +0 -1
- package/dist/testing/fake_model_builder.d.ts.map +1 -1
- package/dist/testing/fake_model_builder.js +1 -2
- package/dist/testing/fake_model_builder.js.map +1 -1
- package/dist/testing/index.cjs +10 -11
- package/dist/testing/index.js +1 -2
- package/dist/testing/matchers.cjs +7 -8
- package/dist/testing/matchers.cjs.map +1 -1
- package/dist/testing/matchers.js +1 -2
- package/dist/testing/matchers.js.map +1 -1
- package/dist/tools/index.cjs +20 -21
- package/dist/tools/index.cjs.map +1 -1
- package/dist/tools/index.d.cts +1 -1
- package/dist/tools/index.d.cts.map +1 -1
- package/dist/tools/index.d.ts +1 -3
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +1 -2
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/types.cjs +3 -4
- package/dist/tools/types.cjs.map +1 -1
- package/dist/tools/types.d.ts +0 -2
- package/dist/tools/types.d.ts.map +1 -1
- package/dist/tools/types.js +1 -2
- package/dist/tools/types.js.map +1 -1
- package/dist/tools/utils.cjs +1 -2
- package/dist/tools/utils.cjs.map +1 -1
- package/dist/tools/utils.js +1 -1
- package/dist/tracers/base.cjs +10 -11
- package/dist/tracers/base.cjs.map +1 -1
- package/dist/tracers/base.js +1 -2
- package/dist/tracers/base.js.map +1 -1
- package/dist/tracers/console.cjs +9 -10
- package/dist/tracers/console.cjs.map +1 -1
- package/dist/tracers/console.js +1 -2
- package/dist/tracers/console.js.map +1 -1
- package/dist/tracers/event_stream.cjs +5 -6
- package/dist/tracers/event_stream.cjs.map +1 -1
- package/dist/tracers/event_stream.d.ts +0 -2
- package/dist/tracers/event_stream.d.ts.map +1 -1
- package/dist/tracers/event_stream.js +1 -2
- package/dist/tracers/event_stream.js.map +1 -1
- package/dist/tracers/log_stream.cjs +13 -14
- package/dist/tracers/log_stream.cjs.map +1 -1
- package/dist/tracers/log_stream.js +1 -2
- package/dist/tracers/log_stream.js.map +1 -1
- package/dist/tracers/root_listener.cjs +2 -3
- package/dist/tracers/root_listener.cjs.map +1 -1
- package/dist/tracers/root_listener.js +1 -2
- package/dist/tracers/root_listener.js.map +1 -1
- package/dist/tracers/run_collector.cjs +9 -10
- package/dist/tracers/run_collector.cjs.map +1 -1
- package/dist/tracers/run_collector.js +1 -2
- package/dist/tracers/run_collector.js.map +1 -1
- package/dist/tracers/tracer_langchain.cjs +12 -13
- package/dist/tracers/tracer_langchain.cjs.map +1 -1
- package/dist/tracers/tracer_langchain.js +1 -2
- package/dist/tracers/tracer_langchain.js.map +1 -1
- package/dist/types/stream.cjs +8 -10
- package/dist/types/stream.js +1 -2
- package/dist/utils/async_caller.cjs +10 -11
- package/dist/utils/async_caller.cjs.map +1 -1
- package/dist/utils/async_caller.js +1 -2
- package/dist/utils/async_caller.js.map +1 -1
- package/dist/utils/callbacks.cjs +2 -3
- package/dist/utils/callbacks.cjs.map +1 -1
- package/dist/utils/callbacks.js +1 -2
- package/dist/utils/callbacks.js.map +1 -1
- package/dist/utils/chunk_array.cjs +8 -10
- package/dist/utils/chunk_array.cjs.map +1 -1
- package/dist/utils/chunk_array.js +1 -2
- package/dist/utils/chunk_array.js.map +1 -1
- package/dist/utils/context.cjs +8 -10
- package/dist/utils/context.cjs.map +1 -1
- package/dist/utils/context.js +1 -2
- package/dist/utils/context.js.map +1 -1
- package/dist/utils/env.cjs +8 -10
- package/dist/utils/env.cjs.map +1 -1
- package/dist/utils/env.js +1 -2
- package/dist/utils/env.js.map +1 -1
- package/dist/utils/event_source_parse.cjs +9 -10
- package/dist/utils/event_source_parse.cjs.map +1 -1
- package/dist/utils/event_source_parse.js +1 -2
- package/dist/utils/event_source_parse.js.map +1 -1
- package/dist/utils/fast-json-patch/index.cjs +5 -16
- package/dist/utils/fast-json-patch/index.cjs.map +1 -1
- package/dist/utils/fast-json-patch/index.js +6 -17
- package/dist/utils/fast-json-patch/index.js.map +1 -1
- package/dist/utils/fast-json-patch/src/core.cjs +8 -9
- package/dist/utils/fast-json-patch/src/core.cjs.map +1 -1
- package/dist/utils/fast-json-patch/src/core.js +1 -2
- package/dist/utils/fast-json-patch/src/core.js.map +1 -1
- package/dist/utils/fast-json-patch/src/duplex.cjs +3 -4
- package/dist/utils/fast-json-patch/src/duplex.cjs.map +1 -1
- package/dist/utils/fast-json-patch/src/duplex.js +1 -2
- package/dist/utils/fast-json-patch/src/duplex.js.map +1 -1
- package/dist/utils/fast-json-patch/src/helpers.cjs +1 -2
- package/dist/utils/fast-json-patch/src/helpers.cjs.map +1 -1
- package/dist/utils/fast-json-patch/src/helpers.js +1 -1
- package/dist/utils/fast-json-patch/src/helpers.js.map +1 -1
- package/dist/utils/format.cjs +8 -10
- package/dist/utils/format.js +1 -2
- package/dist/utils/function_calling.cjs +10 -11
- package/dist/utils/function_calling.cjs.map +1 -1
- package/dist/utils/function_calling.js +1 -2
- package/dist/utils/function_calling.js.map +1 -1
- package/dist/utils/hash.cjs +9 -10
- package/dist/utils/hash.js +1 -2
- package/dist/utils/is-network-error/index.cjs +1 -2
- package/dist/utils/is-network-error/index.cjs.map +1 -1
- package/dist/utils/is-network-error/index.js +1 -1
- package/dist/utils/is-network-error/index.js.map +1 -1
- package/dist/utils/js-sha256/hash.cjs +1 -3
- package/dist/utils/js-sha256/hash.cjs.map +1 -1
- package/dist/utils/js-sha256/hash.js +1 -1
- package/dist/utils/js-sha256/hash.js.map +1 -1
- package/dist/utils/json.cjs +1 -2
- package/dist/utils/json.cjs.map +1 -1
- package/dist/utils/json.js +1 -1
- package/dist/utils/json_patch.cjs +11 -12
- package/dist/utils/json_patch.js +1 -2
- package/dist/utils/json_schema.cjs +22 -23
- package/dist/utils/json_schema.cjs.map +1 -1
- package/dist/utils/json_schema.d.ts +0 -1
- package/dist/utils/json_schema.d.ts.map +1 -1
- package/dist/utils/json_schema.js +1 -2
- package/dist/utils/json_schema.js.map +1 -1
- package/dist/utils/math.cjs +11 -12
- package/dist/utils/math.cjs.map +1 -1
- package/dist/utils/math.js +1 -2
- package/dist/utils/math.js.map +1 -1
- package/dist/utils/ml-distance/distances.cjs +1 -2
- package/dist/utils/ml-distance/distances.cjs.map +1 -1
- package/dist/utils/ml-distance/distances.js +1 -1
- package/dist/utils/ml-distance/similarities.cjs +1 -2
- package/dist/utils/ml-distance/similarities.cjs.map +1 -1
- package/dist/utils/ml-distance/similarities.js +1 -1
- package/dist/utils/ml-distance-euclidean/euclidean.cjs +1 -2
- package/dist/utils/ml-distance-euclidean/euclidean.cjs.map +1 -1
- package/dist/utils/ml-distance-euclidean/euclidean.js +1 -1
- package/dist/utils/namespace.cjs +1 -2
- package/dist/utils/namespace.cjs.map +1 -1
- package/dist/utils/namespace.js +1 -1
- package/dist/utils/p-retry/index.cjs +2 -3
- package/dist/utils/p-retry/index.cjs.map +1 -1
- package/dist/utils/p-retry/index.js +1 -2
- package/dist/utils/p-retry/index.js.map +1 -1
- package/dist/utils/sax-js/sax.cjs +1 -2
- package/dist/utils/sax-js/sax.cjs.map +1 -1
- package/dist/utils/sax-js/sax.js +1 -1
- package/dist/utils/signal.cjs +1 -2
- package/dist/utils/signal.cjs.map +1 -1
- package/dist/utils/signal.js +1 -1
- package/dist/utils/signal.js.map +1 -1
- package/dist/utils/ssrf.cjs +8 -10
- package/dist/utils/ssrf.cjs.map +1 -1
- package/dist/utils/ssrf.js +1 -2
- package/dist/utils/ssrf.js.map +1 -1
- package/dist/utils/standard_schema.cjs +8 -10
- package/dist/utils/standard_schema.cjs.map +1 -1
- package/dist/utils/standard_schema.js +1 -2
- package/dist/utils/standard_schema.js.map +1 -1
- package/dist/utils/stream.cjs +13 -14
- package/dist/utils/stream.cjs.map +1 -1
- package/dist/utils/stream.d.cts.map +1 -1
- package/dist/utils/stream.d.ts.map +1 -1
- package/dist/utils/stream.js +2 -3
- package/dist/utils/stream.js.map +1 -1
- package/dist/utils/testing/chat_models.cjs +7 -8
- package/dist/utils/testing/chat_models.cjs.map +1 -1
- package/dist/utils/testing/chat_models.d.ts +0 -1
- package/dist/utils/testing/chat_models.d.ts.map +1 -1
- package/dist/utils/testing/chat_models.js +1 -2
- package/dist/utils/testing/chat_models.js.map +1 -1
- package/dist/utils/testing/embeddings.cjs +2 -3
- package/dist/utils/testing/embeddings.cjs.map +1 -1
- package/dist/utils/testing/embeddings.js +1 -2
- package/dist/utils/testing/embeddings.js.map +1 -1
- package/dist/utils/testing/index.cjs +18 -19
- package/dist/utils/testing/index.js +1 -2
- package/dist/utils/testing/llms.cjs +2 -3
- package/dist/utils/testing/llms.cjs.map +1 -1
- package/dist/utils/testing/llms.js +1 -2
- package/dist/utils/testing/llms.js.map +1 -1
- package/dist/utils/testing/message_history.cjs +6 -7
- package/dist/utils/testing/message_history.cjs.map +1 -1
- package/dist/utils/testing/message_history.d.ts +0 -1
- package/dist/utils/testing/message_history.d.ts.map +1 -1
- package/dist/utils/testing/message_history.js +1 -2
- package/dist/utils/testing/message_history.js.map +1 -1
- package/dist/utils/testing/output_parsers.cjs +2 -3
- package/dist/utils/testing/output_parsers.cjs.map +1 -1
- package/dist/utils/testing/output_parsers.js +1 -2
- package/dist/utils/testing/output_parsers.js.map +1 -1
- package/dist/utils/testing/retrievers.cjs +3 -4
- package/dist/utils/testing/retrievers.cjs.map +1 -1
- package/dist/utils/testing/retrievers.js +1 -2
- package/dist/utils/testing/retrievers.js.map +1 -1
- package/dist/utils/testing/runnables.cjs +2 -3
- package/dist/utils/testing/runnables.cjs.map +1 -1
- package/dist/utils/testing/runnables.js +1 -2
- package/dist/utils/testing/runnables.js.map +1 -1
- package/dist/utils/testing/tools.cjs +2 -3
- package/dist/utils/testing/tools.cjs.map +1 -1
- package/dist/utils/testing/tools.js +1 -2
- package/dist/utils/testing/tools.js.map +1 -1
- package/dist/utils/testing/tracers.cjs +2 -3
- package/dist/utils/testing/tracers.cjs.map +1 -1
- package/dist/utils/testing/tracers.js +1 -2
- package/dist/utils/testing/tracers.js.map +1 -1
- package/dist/utils/testing/vectorstores.cjs +4 -5
- package/dist/utils/testing/vectorstores.cjs.map +1 -1
- package/dist/utils/testing/vectorstores.js +1 -2
- package/dist/utils/testing/vectorstores.js.map +1 -1
- package/dist/utils/tiktoken.cjs +9 -10
- package/dist/utils/tiktoken.cjs.map +1 -1
- package/dist/utils/tiktoken.js +1 -2
- package/dist/utils/tiktoken.js.map +1 -1
- package/dist/utils/types/index.cjs +9 -10
- package/dist/utils/types/index.js +1 -2
- package/dist/utils/types/zod.cjs +2 -3
- package/dist/utils/types/zod.cjs.map +1 -1
- package/dist/utils/types/zod.js +1 -2
- package/dist/utils/types/zod.js.map +1 -1
- package/dist/utils/zod-to-json-schema/Options.cjs +1 -2
- package/dist/utils/zod-to-json-schema/Options.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/Options.d.ts +1 -3
- package/dist/utils/zod-to-json-schema/Options.js +1 -1
- package/dist/utils/zod-to-json-schema/Options.js.map +1 -1
- package/dist/utils/zod-to-json-schema/Refs.cjs +2 -3
- package/dist/utils/zod-to-json-schema/Refs.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/Refs.d.ts +1 -3
- package/dist/utils/zod-to-json-schema/Refs.js +1 -2
- package/dist/utils/zod-to-json-schema/Refs.js.map +1 -1
- package/dist/utils/zod-to-json-schema/errorMessages.cjs +1 -2
- package/dist/utils/zod-to-json-schema/errorMessages.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/errorMessages.d.ts +0 -2
- package/dist/utils/zod-to-json-schema/errorMessages.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/errorMessages.js +1 -1
- package/dist/utils/zod-to-json-schema/getRelativePath.cjs +1 -2
- package/dist/utils/zod-to-json-schema/getRelativePath.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/getRelativePath.js +1 -1
- package/dist/utils/zod-to-json-schema/index.cjs +37 -37
- package/dist/utils/zod-to-json-schema/index.d.ts +1 -14
- package/dist/utils/zod-to-json-schema/index.js +38 -39
- package/dist/utils/zod-to-json-schema/parseDef.cjs +5 -6
- package/dist/utils/zod-to-json-schema/parseDef.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parseDef.d.ts +1 -3
- package/dist/utils/zod-to-json-schema/parseDef.js +1 -2
- package/dist/utils/zod-to-json-schema/parseDef.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/any.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/any.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/any.d.ts +0 -2
- package/dist/utils/zod-to-json-schema/parsers/any.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/any.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/any.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/array.cjs +4 -5
- package/dist/utils/zod-to-json-schema/parsers/array.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/array.d.ts +0 -3
- package/dist/utils/zod-to-json-schema/parsers/array.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/array.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/array.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/bigint.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/bigint.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/bigint.d.ts +0 -3
- package/dist/utils/zod-to-json-schema/parsers/bigint.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/bigint.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/bigint.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/boolean.cjs +1 -2
- package/dist/utils/zod-to-json-schema/parsers/boolean.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/boolean.js +1 -1
- package/dist/utils/zod-to-json-schema/parsers/branded.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/branded.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/branded.d.ts +1 -3
- package/dist/utils/zod-to-json-schema/parsers/branded.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/branded.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/catch.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/catch.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/catch.d.ts +1 -3
- package/dist/utils/zod-to-json-schema/parsers/catch.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/catch.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/date.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/date.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/date.d.ts +0 -4
- package/dist/utils/zod-to-json-schema/parsers/date.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/date.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/date.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/default.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/default.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/default.d.ts +1 -3
- package/dist/utils/zod-to-json-schema/parsers/default.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/default.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/effects.cjs +3 -4
- package/dist/utils/zod-to-json-schema/parsers/effects.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/effects.d.ts +1 -3
- package/dist/utils/zod-to-json-schema/parsers/effects.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/effects.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/enum.cjs +1 -2
- package/dist/utils/zod-to-json-schema/parsers/enum.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/enum.d.ts +0 -2
- package/dist/utils/zod-to-json-schema/parsers/enum.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/enum.js +1 -1
- package/dist/utils/zod-to-json-schema/parsers/intersection.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/intersection.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/intersection.d.ts +0 -3
- package/dist/utils/zod-to-json-schema/parsers/intersection.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/intersection.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/intersection.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/literal.cjs +1 -2
- package/dist/utils/zod-to-json-schema/parsers/literal.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/literal.d.ts +0 -3
- package/dist/utils/zod-to-json-schema/parsers/literal.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/literal.js +1 -1
- package/dist/utils/zod-to-json-schema/parsers/map.cjs +4 -5
- package/dist/utils/zod-to-json-schema/parsers/map.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/map.d.ts +0 -4
- package/dist/utils/zod-to-json-schema/parsers/map.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/map.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/map.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/nativeEnum.cjs +1 -2
- package/dist/utils/zod-to-json-schema/parsers/nativeEnum.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/nativeEnum.d.ts +0 -2
- package/dist/utils/zod-to-json-schema/parsers/nativeEnum.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/nativeEnum.js +1 -1
- package/dist/utils/zod-to-json-schema/parsers/never.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/never.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/never.d.ts +0 -2
- package/dist/utils/zod-to-json-schema/parsers/never.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/never.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/never.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/null.cjs +1 -2
- package/dist/utils/zod-to-json-schema/parsers/null.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/null.d.ts +0 -2
- package/dist/utils/zod-to-json-schema/parsers/null.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/null.js +1 -1
- package/dist/utils/zod-to-json-schema/parsers/nullable.cjs +3 -4
- package/dist/utils/zod-to-json-schema/parsers/nullable.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/nullable.d.ts +0 -3
- package/dist/utils/zod-to-json-schema/parsers/nullable.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/nullable.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/nullable.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/number.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/number.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/number.d.ts +0 -3
- package/dist/utils/zod-to-json-schema/parsers/number.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/number.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/number.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/object.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/object.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/object.d.ts +0 -3
- package/dist/utils/zod-to-json-schema/parsers/object.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/object.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/object.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/optional.cjs +3 -4
- package/dist/utils/zod-to-json-schema/parsers/optional.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/optional.d.ts +1 -3
- package/dist/utils/zod-to-json-schema/parsers/optional.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/optional.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/pipeline.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/pipeline.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/pipeline.d.ts +1 -4
- package/dist/utils/zod-to-json-schema/parsers/pipeline.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/pipeline.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/promise.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/promise.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/promise.d.ts +1 -3
- package/dist/utils/zod-to-json-schema/parsers/promise.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/promise.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/readonly.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/readonly.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/readonly.d.ts +1 -3
- package/dist/utils/zod-to-json-schema/parsers/readonly.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/readonly.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/record.cjs +6 -7
- package/dist/utils/zod-to-json-schema/parsers/record.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/record.d.ts +0 -3
- package/dist/utils/zod-to-json-schema/parsers/record.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/record.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/record.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/set.cjs +3 -4
- package/dist/utils/zod-to-json-schema/parsers/set.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/set.d.ts +0 -3
- package/dist/utils/zod-to-json-schema/parsers/set.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/set.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/set.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/string.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/string.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/string.d.ts +0 -3
- package/dist/utils/zod-to-json-schema/parsers/string.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/string.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/string.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/tuple.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/tuple.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/tuple.d.ts +0 -3
- package/dist/utils/zod-to-json-schema/parsers/tuple.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/tuple.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/tuple.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/undefined.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/undefined.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/undefined.d.ts +0 -2
- package/dist/utils/zod-to-json-schema/parsers/undefined.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/undefined.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/undefined.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/union.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/union.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/union.d.ts +0 -3
- package/dist/utils/zod-to-json-schema/parsers/union.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/union.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/union.js.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/unknown.cjs +2 -3
- package/dist/utils/zod-to-json-schema/parsers/unknown.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/unknown.d.ts +0 -2
- package/dist/utils/zod-to-json-schema/parsers/unknown.d.ts.map +1 -1
- package/dist/utils/zod-to-json-schema/parsers/unknown.js +1 -2
- package/dist/utils/zod-to-json-schema/parsers/unknown.js.map +1 -1
- package/dist/utils/zod-to-json-schema/selectParser.cjs +32 -33
- package/dist/utils/zod-to-json-schema/selectParser.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/selectParser.d.ts +0 -2
- package/dist/utils/zod-to-json-schema/selectParser.js +1 -2
- package/dist/utils/zod-to-json-schema/selectParser.js.map +1 -1
- package/dist/utils/zod-to-json-schema/zodToJsonSchema.cjs +4 -5
- package/dist/utils/zod-to-json-schema/zodToJsonSchema.cjs.map +1 -1
- package/dist/utils/zod-to-json-schema/zodToJsonSchema.d.ts +1 -3
- package/dist/utils/zod-to-json-schema/zodToJsonSchema.js +1 -2
- package/dist/utils/zod-to-json-schema/zodToJsonSchema.js.map +1 -1
- package/dist/vectorstores.cjs +10 -11
- package/dist/vectorstores.cjs.map +1 -1
- package/dist/vectorstores.js +1 -2
- package/dist/vectorstores.js.map +1 -1
- package/package.json +1 -1
- package/agents.cjs +0 -1
- package/agents.d.cts +0 -1
- package/agents.d.ts +0 -1
- package/agents.js +0 -1
- package/caches.cjs +0 -1
- package/caches.d.cts +0 -1
- package/caches.d.ts +0 -1
- package/caches.js +0 -1
- package/callbacks/base.cjs +0 -1
- package/callbacks/base.d.cts +0 -1
- package/callbacks/base.d.ts +0 -1
- package/callbacks/base.js +0 -1
- package/callbacks/dispatch/web.cjs +0 -1
- package/callbacks/dispatch/web.d.cts +0 -1
- package/callbacks/dispatch/web.d.ts +0 -1
- package/callbacks/dispatch/web.js +0 -1
- package/callbacks/dispatch.cjs +0 -1
- package/callbacks/dispatch.d.cts +0 -1
- package/callbacks/dispatch.d.ts +0 -1
- package/callbacks/dispatch.js +0 -1
- package/callbacks/manager.cjs +0 -1
- package/callbacks/manager.d.cts +0 -1
- package/callbacks/manager.d.ts +0 -1
- package/callbacks/manager.js +0 -1
- package/callbacks/promises.cjs +0 -1
- package/callbacks/promises.d.cts +0 -1
- package/callbacks/promises.d.ts +0 -1
- package/callbacks/promises.js +0 -1
- package/chat_history.cjs +0 -1
- package/chat_history.d.cts +0 -1
- package/chat_history.d.ts +0 -1
- package/chat_history.js +0 -1
- package/context.cjs +0 -1
- package/context.d.cts +0 -1
- package/context.d.ts +0 -1
- package/context.js +0 -1
- package/document_loaders/base.cjs +0 -1
- package/document_loaders/base.d.cts +0 -1
- package/document_loaders/base.d.ts +0 -1
- package/document_loaders/base.js +0 -1
- package/document_loaders/langsmith.cjs +0 -1
- package/document_loaders/langsmith.d.cts +0 -1
- package/document_loaders/langsmith.d.ts +0 -1
- package/document_loaders/langsmith.js +0 -1
- package/documents.cjs +0 -1
- package/documents.d.cts +0 -1
- package/documents.d.ts +0 -1
- package/documents.js +0 -1
- package/embeddings.cjs +0 -1
- package/embeddings.d.cts +0 -1
- package/embeddings.d.ts +0 -1
- package/embeddings.js +0 -1
- package/errors.cjs +0 -1
- package/errors.d.cts +0 -1
- package/errors.d.ts +0 -1
- package/errors.js +0 -1
- package/example_selectors.cjs +0 -1
- package/example_selectors.d.cts +0 -1
- package/example_selectors.d.ts +0 -1
- package/example_selectors.js +0 -1
- package/indexing.cjs +0 -1
- package/indexing.d.cts +0 -1
- package/indexing.d.ts +0 -1
- package/indexing.js +0 -1
- package/language_models/base.cjs +0 -1
- package/language_models/base.d.cts +0 -1
- package/language_models/base.d.ts +0 -1
- package/language_models/base.js +0 -1
- package/language_models/chat_models.cjs +0 -1
- package/language_models/chat_models.d.cts +0 -1
- package/language_models/chat_models.d.ts +0 -1
- package/language_models/chat_models.js +0 -1
- package/language_models/llms.cjs +0 -1
- package/language_models/llms.d.cts +0 -1
- package/language_models/llms.d.ts +0 -1
- package/language_models/llms.js +0 -1
- package/language_models/profile.cjs +0 -1
- package/language_models/profile.d.cts +0 -1
- package/language_models/profile.d.ts +0 -1
- package/language_models/profile.js +0 -1
- package/language_models/structured_output.cjs +0 -1
- package/language_models/structured_output.d.cts +0 -1
- package/language_models/structured_output.d.ts +0 -1
- package/language_models/structured_output.js +0 -1
- package/load/serializable.cjs +0 -1
- package/load/serializable.d.cts +0 -1
- package/load/serializable.d.ts +0 -1
- package/load/serializable.js +0 -1
- package/load.cjs +0 -1
- package/load.d.cts +0 -1
- package/load.d.ts +0 -1
- package/load.js +0 -1
- package/memory.cjs +0 -1
- package/memory.d.cts +0 -1
- package/memory.d.ts +0 -1
- package/memory.js +0 -1
- package/messages/tool.cjs +0 -1
- package/messages/tool.d.cts +0 -1
- package/messages/tool.d.ts +0 -1
- package/messages/tool.js +0 -1
- package/messages.cjs +0 -1
- package/messages.d.cts +0 -1
- package/messages.d.ts +0 -1
- package/messages.js +0 -1
- package/output_parsers/openai_functions.cjs +0 -1
- package/output_parsers/openai_functions.d.cts +0 -1
- package/output_parsers/openai_functions.d.ts +0 -1
- package/output_parsers/openai_functions.js +0 -1
- package/output_parsers/openai_tools.cjs +0 -1
- package/output_parsers/openai_tools.d.cts +0 -1
- package/output_parsers/openai_tools.d.ts +0 -1
- package/output_parsers/openai_tools.js +0 -1
- package/output_parsers.cjs +0 -1
- package/output_parsers.d.cts +0 -1
- package/output_parsers.d.ts +0 -1
- package/output_parsers.js +0 -1
- package/outputs.cjs +0 -1
- package/outputs.d.cts +0 -1
- package/outputs.d.ts +0 -1
- package/outputs.js +0 -1
- package/prompt_values.cjs +0 -1
- package/prompt_values.d.cts +0 -1
- package/prompt_values.d.ts +0 -1
- package/prompt_values.js +0 -1
- package/prompts.cjs +0 -1
- package/prompts.d.cts +0 -1
- package/prompts.d.ts +0 -1
- package/prompts.js +0 -1
- package/retrievers/document_compressors.cjs +0 -1
- package/retrievers/document_compressors.d.cts +0 -1
- package/retrievers/document_compressors.d.ts +0 -1
- package/retrievers/document_compressors.js +0 -1
- package/retrievers.cjs +0 -1
- package/retrievers.d.cts +0 -1
- package/retrievers.d.ts +0 -1
- package/retrievers.js +0 -1
- package/runnables/graph.cjs +0 -1
- package/runnables/graph.d.cts +0 -1
- package/runnables/graph.d.ts +0 -1
- package/runnables/graph.js +0 -1
- package/runnables.cjs +0 -1
- package/runnables.d.cts +0 -1
- package/runnables.d.ts +0 -1
- package/runnables.js +0 -1
- package/singletons.cjs +0 -1
- package/singletons.d.cts +0 -1
- package/singletons.d.ts +0 -1
- package/singletons.js +0 -1
- package/stores.cjs +0 -1
- package/stores.d.cts +0 -1
- package/stores.d.ts +0 -1
- package/stores.js +0 -1
- package/structured_query.cjs +0 -1
- package/structured_query.d.cts +0 -1
- package/structured_query.d.ts +0 -1
- package/structured_query.js +0 -1
- package/tools.cjs +0 -1
- package/tools.d.cts +0 -1
- package/tools.d.ts +0 -1
- package/tools.js +0 -1
- package/tracers/base.cjs +0 -1
- package/tracers/base.d.cts +0 -1
- package/tracers/base.d.ts +0 -1
- package/tracers/base.js +0 -1
- package/tracers/console.cjs +0 -1
- package/tracers/console.d.cts +0 -1
- package/tracers/console.d.ts +0 -1
- package/tracers/console.js +0 -1
- package/tracers/log_stream.cjs +0 -1
- package/tracers/log_stream.d.cts +0 -1
- package/tracers/log_stream.d.ts +0 -1
- package/tracers/log_stream.js +0 -1
- package/tracers/run_collector.cjs +0 -1
- package/tracers/run_collector.d.cts +0 -1
- package/tracers/run_collector.d.ts +0 -1
- package/tracers/run_collector.js +0 -1
- package/tracers/tracer_langchain.cjs +0 -1
- package/tracers/tracer_langchain.d.cts +0 -1
- package/tracers/tracer_langchain.d.ts +0 -1
- package/tracers/tracer_langchain.js +0 -1
- package/types/stream.cjs +0 -1
- package/types/stream.d.cts +0 -1
- package/types/stream.d.ts +0 -1
- package/types/stream.js +0 -1
- package/utils/async_caller.cjs +0 -1
- package/utils/async_caller.d.cts +0 -1
- package/utils/async_caller.d.ts +0 -1
- package/utils/async_caller.js +0 -1
- package/utils/chunk_array.cjs +0 -1
- package/utils/chunk_array.d.cts +0 -1
- package/utils/chunk_array.d.ts +0 -1
- package/utils/chunk_array.js +0 -1
- package/utils/context.cjs +0 -1
- package/utils/context.d.cts +0 -1
- package/utils/context.d.ts +0 -1
- package/utils/context.js +0 -1
- package/utils/env.cjs +0 -1
- package/utils/env.d.cts +0 -1
- package/utils/env.d.ts +0 -1
- package/utils/env.js +0 -1
- package/utils/event_source_parse.cjs +0 -1
- package/utils/event_source_parse.d.cts +0 -1
- package/utils/event_source_parse.d.ts +0 -1
- package/utils/event_source_parse.js +0 -1
- package/utils/format.cjs +0 -1
- package/utils/format.d.cts +0 -1
- package/utils/format.d.ts +0 -1
- package/utils/format.js +0 -1
- package/utils/function_calling.cjs +0 -1
- package/utils/function_calling.d.cts +0 -1
- package/utils/function_calling.d.ts +0 -1
- package/utils/function_calling.js +0 -1
- package/utils/hash.cjs +0 -1
- package/utils/hash.d.cts +0 -1
- package/utils/hash.d.ts +0 -1
- package/utils/hash.js +0 -1
- package/utils/json_patch.cjs +0 -1
- package/utils/json_patch.d.cts +0 -1
- package/utils/json_patch.d.ts +0 -1
- package/utils/json_patch.js +0 -1
- package/utils/json_schema.cjs +0 -1
- package/utils/json_schema.d.cts +0 -1
- package/utils/json_schema.d.ts +0 -1
- package/utils/json_schema.js +0 -1
- package/utils/math.cjs +0 -1
- package/utils/math.d.cts +0 -1
- package/utils/math.d.ts +0 -1
- package/utils/math.js +0 -1
- package/utils/ssrf.cjs +0 -1
- package/utils/ssrf.d.cts +0 -1
- package/utils/ssrf.d.ts +0 -1
- package/utils/ssrf.js +0 -1
- package/utils/standard_schema.cjs +0 -1
- package/utils/standard_schema.d.cts +0 -1
- package/utils/standard_schema.d.ts +0 -1
- package/utils/standard_schema.js +0 -1
- package/utils/stream.cjs +0 -1
- package/utils/stream.d.cts +0 -1
- package/utils/stream.d.ts +0 -1
- package/utils/stream.js +0 -1
- package/utils/testing.cjs +0 -1
- package/utils/testing.d.cts +0 -1
- package/utils/testing.d.ts +0 -1
- package/utils/testing.js +0 -1
- package/utils/tiktoken.cjs +0 -1
- package/utils/tiktoken.d.cts +0 -1
- package/utils/tiktoken.d.ts +0 -1
- package/utils/tiktoken.js +0 -1
- package/utils/types.cjs +0 -1
- package/utils/types.d.cts +0 -1
- package/utils/types.d.ts +0 -1
- package/utils/types.js +0 -1
- package/vectorstores.cjs +0 -1
- package/vectorstores.d.cts +0 -1
- package/vectorstores.d.ts +0 -1
- package/vectorstores.js +0 -1
|
@@ -3,12 +3,8 @@ import { BaseMessage } from "../messages/base.js";
|
|
|
3
3
|
import { ChatGeneration, Generation } from "../outputs.js";
|
|
4
4
|
import { Callbacks } from "../callbacks/manager.js";
|
|
5
5
|
import { RunnableConfig } from "../runnables/types.js";
|
|
6
|
-
import "../runnables/config.js";
|
|
7
6
|
import { Runnable } from "../runnables/base.js";
|
|
8
7
|
import { BasePromptValueInterface } from "../prompt_values.js";
|
|
9
|
-
import "../messages/index.js";
|
|
10
|
-
import "../runnables/index.js";
|
|
11
|
-
|
|
12
8
|
//#region src/output_parsers/base.d.ts
|
|
13
9
|
/**
|
|
14
10
|
* Options for formatting instructions.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","names":[],"sources":["../../src/output_parsers/base.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"base.d.ts","names":[],"sources":["../../src/output_parsers/base.ts"],"mappings":";;;;;;;;;;;UAWiB,yBAAA;;AAAjB;;;;uBAOsB,mBAAA,sBAAyC,QAAA,UACpD,WAAA,EACT,CAAA;EAFoB;;;;;;;;EAAA,SAYX,WAAA,CACP,WAAA,EAAa,UAAA,KAAe,cAAA,IAC5B,SAAA,GAAY,SAAA,GACX,OAAA,CAAQ,CAAA;EAAR;;;;;;;;EAUH,qBAAA,CACE,WAAA,EAAa,UAAA,KAAe,cAAA,IAC5B,OAAA,EAAS,wBAAA,EACT,SAAA,GAAY,SAAA,GACX,OAAA,CAAQ,CAAA;EAAA,UAID,oBAAA,CAAqB,OAAA,EAAS,WAAA;EAAA,UAM9B,2BAAA,CAA4B,OAAA,EAAS,YAAA;EAiBpC;;;;;;;;;;EAHL,MAAA,CACJ,KAAA,WAAgB,WAAA,EAChB,OAAA,GAAU,cAAA,GACT,OAAA,CAAQ,CAAA;AAAA;;;;uBA8BS,gBAAA,sBAEZ,mBAAA,CAAoB,CAAA;EAC5B,WAAA,CACE,WAAA,EAAa,UAAA,KAAe,cAAA,IAC5B,SAAA,GAAY,SAAA,GACX,OAAA,CAAQ,CAAA;EAnEX;;;;;;EAAA,SA6ES,KAAA,CAAM,IAAA,UAAc,SAAA,GAAY,SAAA,GAAY,OAAA,CAAQ,CAAA;EAEvD,eAAA,CACJ,IAAA,UACA,OAAA,EAAS,wBAAA,EACT,SAAA,GAAY,SAAA,GACX,OAAA,CAAQ,CAAA;EA/ER;;;;;;;;;;;EAAA,SA8FM,qBAAA,CAAsB,OAAA,GAAU,yBAAA;EApEvC;;;EAyEF,KAAA,CAAA;AAAA;AA1CF;;;;;;;;;;;;;;;;;;AAAA,cAiEa,qBAAA,SAA8B,KAAA;EACzC,SAAA;EAEA,WAAA;EAEA,SAAA;EAEA,WAAA,CACE,OAAA,UACA,SAAA,WACA,WAAA,WACA,SAAA;AAAA"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { addLangChainErrorFields } from "../errors/index.js";
|
|
2
2
|
import { Runnable } from "../runnables/base.js";
|
|
3
3
|
import "../runnables/index.js";
|
|
4
|
-
|
|
5
4
|
//#region src/output_parsers/base.ts
|
|
6
5
|
/**
|
|
7
6
|
* Abstract base class for parsing the output of a Large Language Model
|
|
@@ -100,7 +99,7 @@ var OutputParserException = class extends Error {
|
|
|
100
99
|
addLangChainErrorFields(this, "OUTPUT_PARSING_FAILURE");
|
|
101
100
|
}
|
|
102
101
|
};
|
|
103
|
-
|
|
104
102
|
//#endregion
|
|
105
103
|
export { BaseLLMOutputParser, BaseOutputParser, OutputParserException };
|
|
104
|
+
|
|
106
105
|
//# sourceMappingURL=base.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","names":[],"sources":["../../src/output_parsers/base.ts"],"sourcesContent":["import { Runnable } from \"../runnables/index.js\";\nimport type { RunnableConfig } from \"../runnables/config.js\";\nimport type { BasePromptValueInterface } from \"../prompt_values.js\";\nimport type { BaseMessage, ContentBlock } from \"../messages/index.js\";\nimport type { Callbacks } from \"../callbacks/manager.js\";\nimport type { Generation, ChatGeneration } from \"../outputs.js\";\nimport { addLangChainErrorFields } from \"../errors/index.js\";\n\n/**\n * Options for formatting instructions.\n */\nexport interface FormatInstructionsOptions {}\n\n/**\n * Abstract base class for parsing the output of a Large Language Model\n * (LLM) call. It provides methods for parsing the result of an LLM call\n * and invoking the parser with a given input.\n */\nexport abstract class BaseLLMOutputParser<T = unknown> extends Runnable<\n string | BaseMessage,\n T\n> {\n /**\n * Parses the result of an LLM call. This method is meant to be\n * implemented by subclasses to define how the output from the LLM should\n * be parsed.\n * @param generations The generations from an LLM call.\n * @param callbacks Optional callbacks.\n * @returns A promise of the parsed output.\n */\n abstract parseResult(\n generations: Generation[] | ChatGeneration[],\n callbacks?: Callbacks\n ): Promise<T>;\n\n /**\n * Parses the result of an LLM call with a given prompt. By default, it\n * simply calls `parseResult`.\n * @param generations The generations from an LLM call.\n * @param _prompt The prompt used in the LLM call.\n * @param callbacks Optional callbacks.\n * @returns A promise of the parsed output.\n */\n parseResultWithPrompt(\n generations: Generation[] | ChatGeneration[],\n _prompt: BasePromptValueInterface,\n callbacks?: Callbacks\n ): Promise<T> {\n return this.parseResult(generations, callbacks);\n }\n\n protected _baseMessageToString(message: BaseMessage): string {\n return typeof message.content === \"string\"\n ? message.content\n : this._baseMessageContentToString(message.content);\n }\n\n protected _baseMessageContentToString(content: ContentBlock[]): string {\n return JSON.stringify(content);\n }\n\n /**\n * Calls the parser with a given input and optional configuration options.\n * If the input is a string, it creates a generation with the input as\n * text and calls `parseResult`. If the input is a `BaseMessage`, it\n * creates a generation with the input as a message and the content of the\n * input as text, and then calls `parseResult`.\n * @param input The input to the parser, which can be a string or a `BaseMessage`.\n * @param options Optional configuration options.\n * @returns A promise of the parsed output.\n */\n async invoke(\n input: string | BaseMessage,\n options?: RunnableConfig\n ): Promise<T> {\n if (typeof input === \"string\") {\n return this._callWithConfig(\n async (input: string, options): Promise<T> =>\n this.parseResult([{ text: input }], options?.callbacks),\n input,\n { ...options, runType: \"parser\" }\n );\n } else {\n return this._callWithConfig(\n async (input: BaseMessage, options): Promise<T> =>\n this.parseResult(\n [\n {\n message: input,\n text: this._baseMessageToString(input),\n },\n ],\n options?.callbacks\n ),\n input,\n { ...options, runType: \"parser\" }\n );\n }\n }\n}\n\n/**\n * Class to parse the output of an LLM call.\n */\nexport abstract class BaseOutputParser<\n T = unknown,\n> extends BaseLLMOutputParser<T> {\n parseResult(\n generations: Generation[] | ChatGeneration[],\n callbacks?: Callbacks\n ): Promise<T> {\n return this.parse(generations[0].text, callbacks);\n }\n\n /**\n * Parse the output of an LLM call.\n *\n * @param text - LLM output to parse.\n * @returns Parsed output.\n */\n abstract parse(text: string, callbacks?: Callbacks): Promise<T>;\n\n async parseWithPrompt(\n text: string,\n _prompt: BasePromptValueInterface,\n callbacks?: Callbacks\n ): Promise<T> {\n return this.parse(text, callbacks);\n }\n\n /**\n * Return a string describing the format of the output.\n * @returns Format instructions.\n * @param options - Options for formatting instructions.\n * @example\n * ```json\n * {\n * \"foo\": \"bar\"\n * }\n * ```\n */\n abstract getFormatInstructions(options?: FormatInstructionsOptions): string;\n\n /**\n * Return the string type key uniquely identifying this class of parser\n */\n _type(): string {\n throw new Error(\"_type not implemented\");\n }\n}\n\n/**\n * Exception that output parsers should raise to signify a parsing error.\n *\n * This exists to differentiate parsing errors from other code or execution errors\n * that also may arise inside the output parser. OutputParserExceptions will be\n * available to catch and handle in ways to fix the parsing error, while other\n * errors will be raised.\n *\n * @param message - The error that's being re-raised or an error message.\n * @param llmOutput - String model output which is error-ing.\n * @param observation - String explanation of error which can be passed to a\n * model to try and remediate the issue.\n * @param sendToLLM - Whether to send the observation and llm_output back to an Agent\n * after an OutputParserException has been raised. This gives the underlying\n * model driving the agent the context that the previous output was improperly\n * structured, in the hopes that it will update the output to the correct\n * format.\n */\nexport class OutputParserException extends Error {\n llmOutput?: string;\n\n observation?: string;\n\n sendToLLM: boolean;\n\n constructor(\n message: string,\n llmOutput?: string,\n observation?: string,\n sendToLLM = false\n ) {\n super(message);\n this.llmOutput = llmOutput;\n this.observation = observation;\n this.sendToLLM = sendToLLM;\n\n if (sendToLLM) {\n if (observation === undefined || llmOutput === undefined) {\n throw new Error(\n \"Arguments 'observation' & 'llmOutput' are required if 'sendToLlm' is true\"\n );\n }\n }\n\n addLangChainErrorFields(this, \"OUTPUT_PARSING_FAILURE\");\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"base.js","names":[],"sources":["../../src/output_parsers/base.ts"],"sourcesContent":["import { Runnable } from \"../runnables/index.js\";\nimport type { RunnableConfig } from \"../runnables/config.js\";\nimport type { BasePromptValueInterface } from \"../prompt_values.js\";\nimport type { BaseMessage, ContentBlock } from \"../messages/index.js\";\nimport type { Callbacks } from \"../callbacks/manager.js\";\nimport type { Generation, ChatGeneration } from \"../outputs.js\";\nimport { addLangChainErrorFields } from \"../errors/index.js\";\n\n/**\n * Options for formatting instructions.\n */\nexport interface FormatInstructionsOptions {}\n\n/**\n * Abstract base class for parsing the output of a Large Language Model\n * (LLM) call. It provides methods for parsing the result of an LLM call\n * and invoking the parser with a given input.\n */\nexport abstract class BaseLLMOutputParser<T = unknown> extends Runnable<\n string | BaseMessage,\n T\n> {\n /**\n * Parses the result of an LLM call. This method is meant to be\n * implemented by subclasses to define how the output from the LLM should\n * be parsed.\n * @param generations The generations from an LLM call.\n * @param callbacks Optional callbacks.\n * @returns A promise of the parsed output.\n */\n abstract parseResult(\n generations: Generation[] | ChatGeneration[],\n callbacks?: Callbacks\n ): Promise<T>;\n\n /**\n * Parses the result of an LLM call with a given prompt. By default, it\n * simply calls `parseResult`.\n * @param generations The generations from an LLM call.\n * @param _prompt The prompt used in the LLM call.\n * @param callbacks Optional callbacks.\n * @returns A promise of the parsed output.\n */\n parseResultWithPrompt(\n generations: Generation[] | ChatGeneration[],\n _prompt: BasePromptValueInterface,\n callbacks?: Callbacks\n ): Promise<T> {\n return this.parseResult(generations, callbacks);\n }\n\n protected _baseMessageToString(message: BaseMessage): string {\n return typeof message.content === \"string\"\n ? message.content\n : this._baseMessageContentToString(message.content);\n }\n\n protected _baseMessageContentToString(content: ContentBlock[]): string {\n return JSON.stringify(content);\n }\n\n /**\n * Calls the parser with a given input and optional configuration options.\n * If the input is a string, it creates a generation with the input as\n * text and calls `parseResult`. If the input is a `BaseMessage`, it\n * creates a generation with the input as a message and the content of the\n * input as text, and then calls `parseResult`.\n * @param input The input to the parser, which can be a string or a `BaseMessage`.\n * @param options Optional configuration options.\n * @returns A promise of the parsed output.\n */\n async invoke(\n input: string | BaseMessage,\n options?: RunnableConfig\n ): Promise<T> {\n if (typeof input === \"string\") {\n return this._callWithConfig(\n async (input: string, options): Promise<T> =>\n this.parseResult([{ text: input }], options?.callbacks),\n input,\n { ...options, runType: \"parser\" }\n );\n } else {\n return this._callWithConfig(\n async (input: BaseMessage, options): Promise<T> =>\n this.parseResult(\n [\n {\n message: input,\n text: this._baseMessageToString(input),\n },\n ],\n options?.callbacks\n ),\n input,\n { ...options, runType: \"parser\" }\n );\n }\n }\n}\n\n/**\n * Class to parse the output of an LLM call.\n */\nexport abstract class BaseOutputParser<\n T = unknown,\n> extends BaseLLMOutputParser<T> {\n parseResult(\n generations: Generation[] | ChatGeneration[],\n callbacks?: Callbacks\n ): Promise<T> {\n return this.parse(generations[0].text, callbacks);\n }\n\n /**\n * Parse the output of an LLM call.\n *\n * @param text - LLM output to parse.\n * @returns Parsed output.\n */\n abstract parse(text: string, callbacks?: Callbacks): Promise<T>;\n\n async parseWithPrompt(\n text: string,\n _prompt: BasePromptValueInterface,\n callbacks?: Callbacks\n ): Promise<T> {\n return this.parse(text, callbacks);\n }\n\n /**\n * Return a string describing the format of the output.\n * @returns Format instructions.\n * @param options - Options for formatting instructions.\n * @example\n * ```json\n * {\n * \"foo\": \"bar\"\n * }\n * ```\n */\n abstract getFormatInstructions(options?: FormatInstructionsOptions): string;\n\n /**\n * Return the string type key uniquely identifying this class of parser\n */\n _type(): string {\n throw new Error(\"_type not implemented\");\n }\n}\n\n/**\n * Exception that output parsers should raise to signify a parsing error.\n *\n * This exists to differentiate parsing errors from other code or execution errors\n * that also may arise inside the output parser. OutputParserExceptions will be\n * available to catch and handle in ways to fix the parsing error, while other\n * errors will be raised.\n *\n * @param message - The error that's being re-raised or an error message.\n * @param llmOutput - String model output which is error-ing.\n * @param observation - String explanation of error which can be passed to a\n * model to try and remediate the issue.\n * @param sendToLLM - Whether to send the observation and llm_output back to an Agent\n * after an OutputParserException has been raised. This gives the underlying\n * model driving the agent the context that the previous output was improperly\n * structured, in the hopes that it will update the output to the correct\n * format.\n */\nexport class OutputParserException extends Error {\n llmOutput?: string;\n\n observation?: string;\n\n sendToLLM: boolean;\n\n constructor(\n message: string,\n llmOutput?: string,\n observation?: string,\n sendToLLM = false\n ) {\n super(message);\n this.llmOutput = llmOutput;\n this.observation = observation;\n this.sendToLLM = sendToLLM;\n\n if (sendToLLM) {\n if (observation === undefined || llmOutput === undefined) {\n throw new Error(\n \"Arguments 'observation' & 'llmOutput' are required if 'sendToLlm' is true\"\n );\n }\n }\n\n addLangChainErrorFields(this, \"OUTPUT_PARSING_FAILURE\");\n }\n}\n"],"mappings":";;;;;;;;;AAkBA,IAAsB,sBAAtB,cAA+D,SAG7D;;;;;;;;;CAsBA,sBACE,aACA,SACA,WACY;AACZ,SAAO,KAAK,YAAY,aAAa,UAAU;;CAGjD,qBAA+B,SAA8B;AAC3D,SAAO,OAAO,QAAQ,YAAY,WAC9B,QAAQ,UACR,KAAK,4BAA4B,QAAQ,QAAQ;;CAGvD,4BAAsC,SAAiC;AACrE,SAAO,KAAK,UAAU,QAAQ;;;;;;;;;;;;CAahC,MAAM,OACJ,OACA,SACY;AACZ,MAAI,OAAO,UAAU,SACnB,QAAO,KAAK,gBACV,OAAO,OAAe,YACpB,KAAK,YAAY,CAAC,EAAE,MAAM,OAAO,CAAC,EAAE,SAAS,UAAU,EACzD,OACA;GAAE,GAAG;GAAS,SAAS;GAAU,CAClC;MAED,QAAO,KAAK,gBACV,OAAO,OAAoB,YACzB,KAAK,YACH,CACE;GACE,SAAS;GACT,MAAM,KAAK,qBAAqB,MAAM;GACvC,CACF,EACD,SAAS,UACV,EACH,OACA;GAAE,GAAG;GAAS,SAAS;GAAU,CAClC;;;;;;AAQP,IAAsB,mBAAtB,cAEU,oBAAuB;CAC/B,YACE,aACA,WACY;AACZ,SAAO,KAAK,MAAM,YAAY,GAAG,MAAM,UAAU;;CAWnD,MAAM,gBACJ,MACA,SACA,WACY;AACZ,SAAO,KAAK,MAAM,MAAM,UAAU;;;;;CAmBpC,QAAgB;AACd,QAAM,IAAI,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;AAsB5C,IAAa,wBAAb,cAA2C,MAAM;CAC/C;CAEA;CAEA;CAEA,YACE,SACA,WACA,aACA,YAAY,OACZ;AACA,QAAM,QAAQ;AACd,OAAK,YAAY;AACjB,OAAK,cAAc;AACnB,OAAK,YAAY;AAEjB,MAAI;OACE,gBAAgB,KAAA,KAAa,cAAc,KAAA,EAC7C,OAAM,IAAI,MACR,4EACD;;AAIL,0BAAwB,MAAM,yBAAyB"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
const require_transform = require(
|
|
2
|
-
|
|
1
|
+
const require_transform = require("./transform.cjs");
|
|
3
2
|
//#region src/output_parsers/bytes.ts
|
|
4
3
|
/**
|
|
5
4
|
* OutputParser that parses LLMResult into the top likely string and
|
|
@@ -23,7 +22,7 @@ var BytesOutputParser = class extends require_transform.BaseTransformOutputParse
|
|
|
23
22
|
return "";
|
|
24
23
|
}
|
|
25
24
|
};
|
|
26
|
-
|
|
27
25
|
//#endregion
|
|
28
26
|
exports.BytesOutputParser = BytesOutputParser;
|
|
27
|
+
|
|
29
28
|
//# sourceMappingURL=bytes.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bytes.cjs","names":["BaseTransformOutputParser"],"sources":["../../src/output_parsers/bytes.ts"],"sourcesContent":["import { BaseTransformOutputParser } from \"./transform.js\";\n\n/**\n * OutputParser that parses LLMResult into the top likely string and\n * encodes it into bytes.\n */\nexport class BytesOutputParser extends BaseTransformOutputParser<Uint8Array> {\n static lc_name() {\n return \"BytesOutputParser\";\n }\n\n lc_namespace = [\"langchain_core\", \"output_parsers\", \"bytes\"];\n\n lc_serializable = true;\n\n protected textEncoder: InstanceType<typeof TextEncoder> = new TextEncoder();\n\n parse(text: string): Promise<Uint8Array> {\n return Promise.resolve(this.textEncoder.encode(text));\n }\n\n getFormatInstructions(): string {\n return \"\";\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"bytes.cjs","names":["BaseTransformOutputParser"],"sources":["../../src/output_parsers/bytes.ts"],"sourcesContent":["import { BaseTransformOutputParser } from \"./transform.js\";\n\n/**\n * OutputParser that parses LLMResult into the top likely string and\n * encodes it into bytes.\n */\nexport class BytesOutputParser extends BaseTransformOutputParser<Uint8Array> {\n static lc_name() {\n return \"BytesOutputParser\";\n }\n\n lc_namespace = [\"langchain_core\", \"output_parsers\", \"bytes\"];\n\n lc_serializable = true;\n\n protected textEncoder: InstanceType<typeof TextEncoder> = new TextEncoder();\n\n parse(text: string): Promise<Uint8Array> {\n return Promise.resolve(this.textEncoder.encode(text));\n }\n\n getFormatInstructions(): string {\n return \"\";\n }\n}\n"],"mappings":";;;;;;AAMA,IAAa,oBAAb,cAAuCA,kBAAAA,0BAAsC;CAC3E,OAAO,UAAU;AACf,SAAO;;CAGT,eAAe;EAAC;EAAkB;EAAkB;EAAQ;CAE5D,kBAAkB;CAElB,cAA0D,IAAI,aAAa;CAE3E,MAAM,MAAmC;AACvC,SAAO,QAAQ,QAAQ,KAAK,YAAY,OAAO,KAAK,CAAC;;CAGvD,wBAAgC;AAC9B,SAAO"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { BaseTransformOutputParser } from "./transform.js";
|
|
2
|
-
|
|
3
2
|
//#region src/output_parsers/bytes.ts
|
|
4
3
|
/**
|
|
5
4
|
* OutputParser that parses LLMResult into the top likely string and
|
|
@@ -23,7 +22,7 @@ var BytesOutputParser = class extends BaseTransformOutputParser {
|
|
|
23
22
|
return "";
|
|
24
23
|
}
|
|
25
24
|
};
|
|
26
|
-
|
|
27
25
|
//#endregion
|
|
28
26
|
export { BytesOutputParser };
|
|
27
|
+
|
|
29
28
|
//# sourceMappingURL=bytes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bytes.js","names":[],"sources":["../../src/output_parsers/bytes.ts"],"sourcesContent":["import { BaseTransformOutputParser } from \"./transform.js\";\n\n/**\n * OutputParser that parses LLMResult into the top likely string and\n * encodes it into bytes.\n */\nexport class BytesOutputParser extends BaseTransformOutputParser<Uint8Array> {\n static lc_name() {\n return \"BytesOutputParser\";\n }\n\n lc_namespace = [\"langchain_core\", \"output_parsers\", \"bytes\"];\n\n lc_serializable = true;\n\n protected textEncoder: InstanceType<typeof TextEncoder> = new TextEncoder();\n\n parse(text: string): Promise<Uint8Array> {\n return Promise.resolve(this.textEncoder.encode(text));\n }\n\n getFormatInstructions(): string {\n return \"\";\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"bytes.js","names":[],"sources":["../../src/output_parsers/bytes.ts"],"sourcesContent":["import { BaseTransformOutputParser } from \"./transform.js\";\n\n/**\n * OutputParser that parses LLMResult into the top likely string and\n * encodes it into bytes.\n */\nexport class BytesOutputParser extends BaseTransformOutputParser<Uint8Array> {\n static lc_name() {\n return \"BytesOutputParser\";\n }\n\n lc_namespace = [\"langchain_core\", \"output_parsers\", \"bytes\"];\n\n lc_serializable = true;\n\n protected textEncoder: InstanceType<typeof TextEncoder> = new TextEncoder();\n\n parse(text: string): Promise<Uint8Array> {\n return Promise.resolve(this.textEncoder.encode(text));\n }\n\n getFormatInstructions(): string {\n return \"\";\n }\n}\n"],"mappings":";;;;;;AAMA,IAAa,oBAAb,cAAuC,0BAAsC;CAC3E,OAAO,UAAU;AACf,SAAO;;CAGT,eAAe;EAAC;EAAkB;EAAkB;EAAQ;CAE5D,kBAAkB;CAElB,cAA0D,IAAI,aAAa;CAE3E,MAAM,MAAmC;AACvC,SAAO,QAAQ,QAAQ,KAAK,YAAY,OAAO,KAAK,CAAC;;CAGvD,wBAAgC;AAC9B,SAAO"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value:
|
|
2
|
-
const require_runtime = require(
|
|
3
|
-
const require_json = require(
|
|
4
|
-
const require_base = require(
|
|
5
|
-
const require_transform = require(
|
|
6
|
-
const require_bytes = require(
|
|
7
|
-
const require_list = require(
|
|
8
|
-
const require_string = require(
|
|
9
|
-
const require_json$1 = require(
|
|
10
|
-
const require_standard_schema = require(
|
|
11
|
-
const require_structured = require(
|
|
12
|
-
const require_xml = require(
|
|
13
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_runtime = require("../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_json = require("../utils/json.cjs");
|
|
4
|
+
const require_base = require("./base.cjs");
|
|
5
|
+
const require_transform = require("./transform.cjs");
|
|
6
|
+
const require_bytes = require("./bytes.cjs");
|
|
7
|
+
const require_list = require("./list.cjs");
|
|
8
|
+
const require_string = require("./string.cjs");
|
|
9
|
+
const require_json$1 = require("./json.cjs");
|
|
10
|
+
const require_standard_schema = require("./standard_schema.cjs");
|
|
11
|
+
const require_structured = require("./structured.cjs");
|
|
12
|
+
const require_xml = require("./xml.cjs");
|
|
14
13
|
//#region src/output_parsers/index.ts
|
|
15
14
|
var output_parsers_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
16
15
|
AsymmetricStructuredOutputParser: () => require_structured.AsymmetricStructuredOutputParser,
|
|
@@ -36,7 +35,6 @@ var output_parsers_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
|
36
35
|
parsePartialJson: () => require_json.parsePartialJson,
|
|
37
36
|
parseXMLMarkdown: () => require_xml.parseXMLMarkdown
|
|
38
37
|
});
|
|
39
|
-
|
|
40
38
|
//#endregion
|
|
41
39
|
exports.AsymmetricStructuredOutputParser = require_structured.AsymmetricStructuredOutputParser;
|
|
42
40
|
exports.BaseCumulativeTransformOutputParser = require_transform.BaseCumulativeTransformOutputParser;
|
|
@@ -57,13 +55,14 @@ exports.StringOutputParser = require_string.StringOutputParser;
|
|
|
57
55
|
exports.StructuredOutputParser = require_structured.StructuredOutputParser;
|
|
58
56
|
exports.XMLOutputParser = require_xml.XMLOutputParser;
|
|
59
57
|
exports.XML_FORMAT_INSTRUCTIONS = require_xml.XML_FORMAT_INSTRUCTIONS;
|
|
60
|
-
Object.defineProperty(exports,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
58
|
+
Object.defineProperty(exports, "output_parsers_exports", {
|
|
59
|
+
enumerable: true,
|
|
60
|
+
get: function() {
|
|
61
|
+
return output_parsers_exports;
|
|
62
|
+
}
|
|
65
63
|
});
|
|
66
64
|
exports.parseJsonMarkdown = require_json.parseJsonMarkdown;
|
|
67
65
|
exports.parsePartialJson = require_json.parsePartialJson;
|
|
68
66
|
exports.parseXMLMarkdown = require_xml.parseXMLMarkdown;
|
|
67
|
+
|
|
69
68
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -9,7 +9,6 @@ import { JsonOutputParser } from "./json.js";
|
|
|
9
9
|
import { StandardSchemaOutputParser } from "./standard_schema.js";
|
|
10
10
|
import { AsymmetricStructuredOutputParser, JsonMarkdownStructuredOutputParser, StructuredOutputParser } from "./structured.js";
|
|
11
11
|
import { XMLOutputParser, XML_FORMAT_INSTRUCTIONS, parseXMLMarkdown } from "./xml.js";
|
|
12
|
-
|
|
13
12
|
//#region src/output_parsers/index.ts
|
|
14
13
|
var output_parsers_exports = /* @__PURE__ */ __exportAll({
|
|
15
14
|
AsymmetricStructuredOutputParser: () => AsymmetricStructuredOutputParser,
|
|
@@ -35,7 +34,7 @@ var output_parsers_exports = /* @__PURE__ */ __exportAll({
|
|
|
35
34
|
parsePartialJson: () => parsePartialJson,
|
|
36
35
|
parseXMLMarkdown: () => parseXMLMarkdown
|
|
37
36
|
});
|
|
38
|
-
|
|
39
37
|
//#endregion
|
|
40
38
|
export { AsymmetricStructuredOutputParser, BaseCumulativeTransformOutputParser, BaseLLMOutputParser, BaseOutputParser, BaseTransformOutputParser, BytesOutputParser, CommaSeparatedListOutputParser, CustomListOutputParser, JsonMarkdownStructuredOutputParser, JsonOutputParser, ListOutputParser, MarkdownListOutputParser, NumberedListOutputParser, OutputParserException, StandardSchemaOutputParser, StringOutputParser, StructuredOutputParser, XMLOutputParser, XML_FORMAT_INSTRUCTIONS, output_parsers_exports, parseJsonMarkdown, parsePartialJson, parseXMLMarkdown };
|
|
39
|
+
|
|
41
40
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
const require_json = require(
|
|
2
|
-
const require_duplex = require(
|
|
3
|
-
const require_transform = require(
|
|
4
|
-
require(
|
|
5
|
-
|
|
1
|
+
const require_json = require("../utils/json.cjs");
|
|
2
|
+
const require_duplex = require("../utils/fast-json-patch/src/duplex.cjs");
|
|
3
|
+
const require_transform = require("./transform.cjs");
|
|
4
|
+
require("../utils/json_patch.cjs");
|
|
6
5
|
//#region src/output_parsers/json.ts
|
|
7
6
|
/**
|
|
8
7
|
* Class for parsing the output of an LLM into a JSON object.
|
|
@@ -47,7 +46,7 @@ var JsonOutputParser = class extends require_transform.BaseCumulativeTransformOu
|
|
|
47
46
|
return message.text;
|
|
48
47
|
}
|
|
49
48
|
};
|
|
50
|
-
|
|
51
49
|
//#endregion
|
|
52
50
|
exports.JsonOutputParser = JsonOutputParser;
|
|
51
|
+
|
|
53
52
|
//# sourceMappingURL=json.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json.cjs","names":["BaseCumulativeTransformOutputParser","compare","parseJsonMarkdown"],"sources":["../../src/output_parsers/json.ts"],"sourcesContent":["import { BaseCumulativeTransformOutputParser } from \"./transform.js\";\nimport { Operation, compare } from \"../utils/json_patch.js\";\nimport { ChatGeneration, Generation } from \"../outputs.js\";\nimport { parseJsonMarkdown, parsePartialJson } from \"../utils/json.js\";\nimport type { BaseMessage } from \"../messages/index.js\";\n\n/**\n * Class for parsing the output of an LLM into a JSON object.\n */\nexport class JsonOutputParser<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n T extends Record<string, any> = Record<string, any>,\n> extends BaseCumulativeTransformOutputParser<T> {\n static lc_name() {\n return \"JsonOutputParser\";\n }\n\n lc_namespace = [\"langchain_core\", \"output_parsers\"];\n\n lc_serializable = true;\n\n /** @internal */\n override _concatOutputChunks<T>(first: T, second: T): T {\n if (this.diff) {\n return super._concatOutputChunks(first, second);\n }\n return second;\n }\n\n protected _diff(\n prev: unknown | undefined,\n next: unknown\n ): Operation[] | undefined {\n if (!next) {\n return undefined;\n }\n if (!prev) {\n return [{ op: \"replace\", path: \"\", value: next }];\n }\n return compare(prev, next);\n }\n\n // This should actually return Partial<T>, but there's no way\n // to specify emitted chunks as instances separate from the main output type.\n async parsePartialResult(\n generations: ChatGeneration[] | Generation[]\n ): Promise<T | undefined> {\n return parseJsonMarkdown(generations[0].text) as T | undefined;\n }\n\n async parse(text: string): Promise<T> {\n return parseJsonMarkdown(text, JSON.parse) as T;\n }\n\n getFormatInstructions(): string {\n return \"\";\n }\n\n /**\n * Extracts text content from a message for JSON parsing.\n * Uses the message's `.text` accessor which properly handles both\n * string content and ContentBlock[] arrays (extracting text from text blocks).\n * @param message The message to extract text from\n * @returns The text content of the message\n */\n protected _baseMessageToString(message: BaseMessage): string {\n return message.text;\n }\n}\n\nexport { parsePartialJson, parseJsonMarkdown };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"json.cjs","names":["BaseCumulativeTransformOutputParser","compare","parseJsonMarkdown"],"sources":["../../src/output_parsers/json.ts"],"sourcesContent":["import { BaseCumulativeTransformOutputParser } from \"./transform.js\";\nimport { Operation, compare } from \"../utils/json_patch.js\";\nimport { ChatGeneration, Generation } from \"../outputs.js\";\nimport { parseJsonMarkdown, parsePartialJson } from \"../utils/json.js\";\nimport type { BaseMessage } from \"../messages/index.js\";\n\n/**\n * Class for parsing the output of an LLM into a JSON object.\n */\nexport class JsonOutputParser<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n T extends Record<string, any> = Record<string, any>,\n> extends BaseCumulativeTransformOutputParser<T> {\n static lc_name() {\n return \"JsonOutputParser\";\n }\n\n lc_namespace = [\"langchain_core\", \"output_parsers\"];\n\n lc_serializable = true;\n\n /** @internal */\n override _concatOutputChunks<T>(first: T, second: T): T {\n if (this.diff) {\n return super._concatOutputChunks(first, second);\n }\n return second;\n }\n\n protected _diff(\n prev: unknown | undefined,\n next: unknown\n ): Operation[] | undefined {\n if (!next) {\n return undefined;\n }\n if (!prev) {\n return [{ op: \"replace\", path: \"\", value: next }];\n }\n return compare(prev, next);\n }\n\n // This should actually return Partial<T>, but there's no way\n // to specify emitted chunks as instances separate from the main output type.\n async parsePartialResult(\n generations: ChatGeneration[] | Generation[]\n ): Promise<T | undefined> {\n return parseJsonMarkdown(generations[0].text) as T | undefined;\n }\n\n async parse(text: string): Promise<T> {\n return parseJsonMarkdown(text, JSON.parse) as T;\n }\n\n getFormatInstructions(): string {\n return \"\";\n }\n\n /**\n * Extracts text content from a message for JSON parsing.\n * Uses the message's `.text` accessor which properly handles both\n * string content and ContentBlock[] arrays (extracting text from text blocks).\n * @param message The message to extract text from\n * @returns The text content of the message\n */\n protected _baseMessageToString(message: BaseMessage): string {\n return message.text;\n }\n}\n\nexport { parsePartialJson, parseJsonMarkdown };\n"],"mappings":";;;;;;;;AASA,IAAa,mBAAb,cAGUA,kBAAAA,oCAAuC;CAC/C,OAAO,UAAU;AACf,SAAO;;CAGT,eAAe,CAAC,kBAAkB,iBAAiB;CAEnD,kBAAkB;;CAGlB,oBAAgC,OAAU,QAAc;AACtD,MAAI,KAAK,KACP,QAAO,MAAM,oBAAoB,OAAO,OAAO;AAEjD,SAAO;;CAGT,MACE,MACA,MACyB;AACzB,MAAI,CAAC,KACH;AAEF,MAAI,CAAC,KACH,QAAO,CAAC;GAAE,IAAI;GAAW,MAAM;GAAI,OAAO;GAAM,CAAC;AAEnD,SAAOC,eAAAA,QAAQ,MAAM,KAAK;;CAK5B,MAAM,mBACJ,aACwB;AACxB,SAAOC,aAAAA,kBAAkB,YAAY,GAAG,KAAK;;CAG/C,MAAM,MAAM,MAA0B;AACpC,SAAOA,aAAAA,kBAAkB,MAAM,KAAK,MAAM;;CAG5C,wBAAgC;AAC9B,SAAO;;;;;;;;;CAUT,qBAA+B,SAA8B;AAC3D,SAAO,QAAQ"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BaseMessage } from "../messages/base.js";
|
|
2
2
|
import { ChatGeneration, Generation } from "../outputs.js";
|
|
3
3
|
import { Operation } from "../utils/fast-json-patch/src/core.js";
|
|
4
|
-
import "../messages/index.js";
|
|
5
4
|
import { BaseCumulativeTransformOutputParser } from "./transform.js";
|
|
6
5
|
import { parseJsonMarkdown, parsePartialJson } from "../utils/json.js";
|
|
7
6
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json.d.ts","names":[],"sources":["../../src/output_parsers/json.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"json.d.ts","names":[],"sources":["../../src/output_parsers/json.ts"],"mappings":";;;;;;;;;;cASa,gBAAA,WAED,MAAA,gBAAsB,MAAA,uBACxB,mCAAA,CAAoC,CAAA;EAAA,OACrC,OAAA,CAAA;EAIP,YAAA;EAEA,eAAA;EARgC;EAWvB,mBAAA,GAAA,CAAuB,KAAA,EAAO,CAAA,EAAG,MAAA,EAAQ,CAAA,GAAI,CAAA;EAAA,UAO5C,KAAA,CACR,IAAA,uBACA,IAAA,YACC,SAAA;EAYG,kBAAA,CACJ,WAAA,EAAa,cAAA,KAAmB,UAAA,KAC/B,OAAA,CAAQ,CAAA;EAIL,KAAA,CAAM,IAAA,WAAe,OAAA,CAAQ,CAAA;EAInC,qBAAA,CAAA;EATe;;;;;;;EAAA,UAoBL,oBAAA,CAAqB,OAAA,EAAS,WAAA;AAAA"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { parseJsonMarkdown
|
|
1
|
+
import { parseJsonMarkdown } from "../utils/json.js";
|
|
2
2
|
import { compare } from "../utils/fast-json-patch/src/duplex.js";
|
|
3
3
|
import { BaseCumulativeTransformOutputParser } from "./transform.js";
|
|
4
4
|
import "../utils/json_patch.js";
|
|
5
|
-
|
|
6
5
|
//#region src/output_parsers/json.ts
|
|
7
6
|
/**
|
|
8
7
|
* Class for parsing the output of an LLM into a JSON object.
|
|
@@ -47,7 +46,7 @@ var JsonOutputParser = class extends BaseCumulativeTransformOutputParser {
|
|
|
47
46
|
return message.text;
|
|
48
47
|
}
|
|
49
48
|
};
|
|
50
|
-
|
|
51
49
|
//#endregion
|
|
52
50
|
export { JsonOutputParser };
|
|
51
|
+
|
|
53
52
|
//# sourceMappingURL=json.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json.js","names":[],"sources":["../../src/output_parsers/json.ts"],"sourcesContent":["import { BaseCumulativeTransformOutputParser } from \"./transform.js\";\nimport { Operation, compare } from \"../utils/json_patch.js\";\nimport { ChatGeneration, Generation } from \"../outputs.js\";\nimport { parseJsonMarkdown, parsePartialJson } from \"../utils/json.js\";\nimport type { BaseMessage } from \"../messages/index.js\";\n\n/**\n * Class for parsing the output of an LLM into a JSON object.\n */\nexport class JsonOutputParser<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n T extends Record<string, any> = Record<string, any>,\n> extends BaseCumulativeTransformOutputParser<T> {\n static lc_name() {\n return \"JsonOutputParser\";\n }\n\n lc_namespace = [\"langchain_core\", \"output_parsers\"];\n\n lc_serializable = true;\n\n /** @internal */\n override _concatOutputChunks<T>(first: T, second: T): T {\n if (this.diff) {\n return super._concatOutputChunks(first, second);\n }\n return second;\n }\n\n protected _diff(\n prev: unknown | undefined,\n next: unknown\n ): Operation[] | undefined {\n if (!next) {\n return undefined;\n }\n if (!prev) {\n return [{ op: \"replace\", path: \"\", value: next }];\n }\n return compare(prev, next);\n }\n\n // This should actually return Partial<T>, but there's no way\n // to specify emitted chunks as instances separate from the main output type.\n async parsePartialResult(\n generations: ChatGeneration[] | Generation[]\n ): Promise<T | undefined> {\n return parseJsonMarkdown(generations[0].text) as T | undefined;\n }\n\n async parse(text: string): Promise<T> {\n return parseJsonMarkdown(text, JSON.parse) as T;\n }\n\n getFormatInstructions(): string {\n return \"\";\n }\n\n /**\n * Extracts text content from a message for JSON parsing.\n * Uses the message's `.text` accessor which properly handles both\n * string content and ContentBlock[] arrays (extracting text from text blocks).\n * @param message The message to extract text from\n * @returns The text content of the message\n */\n protected _baseMessageToString(message: BaseMessage): string {\n return message.text;\n }\n}\n\nexport { parsePartialJson, parseJsonMarkdown };\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"json.js","names":[],"sources":["../../src/output_parsers/json.ts"],"sourcesContent":["import { BaseCumulativeTransformOutputParser } from \"./transform.js\";\nimport { Operation, compare } from \"../utils/json_patch.js\";\nimport { ChatGeneration, Generation } from \"../outputs.js\";\nimport { parseJsonMarkdown, parsePartialJson } from \"../utils/json.js\";\nimport type { BaseMessage } from \"../messages/index.js\";\n\n/**\n * Class for parsing the output of an LLM into a JSON object.\n */\nexport class JsonOutputParser<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n T extends Record<string, any> = Record<string, any>,\n> extends BaseCumulativeTransformOutputParser<T> {\n static lc_name() {\n return \"JsonOutputParser\";\n }\n\n lc_namespace = [\"langchain_core\", \"output_parsers\"];\n\n lc_serializable = true;\n\n /** @internal */\n override _concatOutputChunks<T>(first: T, second: T): T {\n if (this.diff) {\n return super._concatOutputChunks(first, second);\n }\n return second;\n }\n\n protected _diff(\n prev: unknown | undefined,\n next: unknown\n ): Operation[] | undefined {\n if (!next) {\n return undefined;\n }\n if (!prev) {\n return [{ op: \"replace\", path: \"\", value: next }];\n }\n return compare(prev, next);\n }\n\n // This should actually return Partial<T>, but there's no way\n // to specify emitted chunks as instances separate from the main output type.\n async parsePartialResult(\n generations: ChatGeneration[] | Generation[]\n ): Promise<T | undefined> {\n return parseJsonMarkdown(generations[0].text) as T | undefined;\n }\n\n async parse(text: string): Promise<T> {\n return parseJsonMarkdown(text, JSON.parse) as T;\n }\n\n getFormatInstructions(): string {\n return \"\";\n }\n\n /**\n * Extracts text content from a message for JSON parsing.\n * Uses the message's `.text` accessor which properly handles both\n * string content and ContentBlock[] arrays (extracting text from text blocks).\n * @param message The message to extract text from\n * @returns The text content of the message\n */\n protected _baseMessageToString(message: BaseMessage): string {\n return message.text;\n }\n}\n\nexport { parsePartialJson, parseJsonMarkdown };\n"],"mappings":";;;;;;;;AASA,IAAa,mBAAb,cAGU,oCAAuC;CAC/C,OAAO,UAAU;AACf,SAAO;;CAGT,eAAe,CAAC,kBAAkB,iBAAiB;CAEnD,kBAAkB;;CAGlB,oBAAgC,OAAU,QAAc;AACtD,MAAI,KAAK,KACP,QAAO,MAAM,oBAAoB,OAAO,OAAO;AAEjD,SAAO;;CAGT,MACE,MACA,MACyB;AACzB,MAAI,CAAC,KACH;AAEF,MAAI,CAAC,KACH,QAAO,CAAC;GAAE,IAAI;GAAW,MAAM;GAAI,OAAO;GAAM,CAAC;AAEnD,SAAO,QAAQ,MAAM,KAAK;;CAK5B,MAAM,mBACJ,aACwB;AACxB,SAAO,kBAAkB,YAAY,GAAG,KAAK;;CAG/C,MAAM,MAAM,MAA0B;AACpC,SAAO,kBAAkB,MAAM,KAAK,MAAM;;CAG5C,wBAAgC;AAC9B,SAAO;;;;;;;;;CAUT,qBAA+B,SAA8B;AAC3D,SAAO,QAAQ"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
const require_base = require(
|
|
2
|
-
const require_transform = require(
|
|
3
|
-
|
|
1
|
+
const require_base = require("./base.cjs");
|
|
2
|
+
const require_transform = require("./transform.cjs");
|
|
4
3
|
//#region src/output_parsers/list.ts
|
|
5
4
|
/**
|
|
6
5
|
* Class to parse the output of an LLM call to a list.
|
|
@@ -150,11 +149,11 @@ var MarkdownListOutputParser = class extends ListOutputParser {
|
|
|
150
149
|
return [...text.matchAll(this.re) ?? []].map((m) => m[1]);
|
|
151
150
|
}
|
|
152
151
|
};
|
|
153
|
-
|
|
154
152
|
//#endregion
|
|
155
153
|
exports.CommaSeparatedListOutputParser = CommaSeparatedListOutputParser;
|
|
156
154
|
exports.CustomListOutputParser = CustomListOutputParser;
|
|
157
155
|
exports.ListOutputParser = ListOutputParser;
|
|
158
156
|
exports.MarkdownListOutputParser = MarkdownListOutputParser;
|
|
159
157
|
exports.NumberedListOutputParser = NumberedListOutputParser;
|
|
158
|
+
|
|
160
159
|
//# sourceMappingURL=list.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.cjs","names":["BaseTransformOutputParser","OutputParserException"],"sources":["../../src/output_parsers/list.ts"],"sourcesContent":["import { BaseMessage } from \"../messages/index.js\";\nimport { OutputParserException } from \"./base.js\";\nimport { BaseTransformOutputParser } from \"./transform.js\";\n\n/**\n * Class to parse the output of an LLM call to a list.\n * @augments BaseOutputParser\n */\nexport abstract class ListOutputParser extends BaseTransformOutputParser<\n string[]\n> {\n re?: RegExp;\n\n async *_transform(\n inputGenerator: AsyncGenerator<string | BaseMessage>\n ): AsyncGenerator<string[]> {\n let buffer = \"\";\n for await (const input of inputGenerator) {\n if (typeof input === \"string\") {\n // add current chunk to buffer\n buffer += input;\n } else {\n // extract message content and add to buffer\n buffer += input.content;\n }\n // get parts in buffer\n if (!this.re) {\n const parts = await this.parse(buffer);\n if (parts.length > 1) {\n // if there are multiple parts, yield all but the last one\n for (const part of parts.slice(0, -1)) {\n yield [part];\n }\n // keep the last part in the buffer\n buffer = parts[parts.length - 1];\n }\n } else {\n // if there is a regex, get all matches\n const matches = [...buffer.matchAll(this.re)];\n if (matches.length > 1) {\n let doneIdx = 0;\n // if there are multiple matches, yield all but the last one\n for (const match of matches.slice(0, -1)) {\n yield [match[1]];\n doneIdx += (match.index ?? 0) + match[0].length;\n }\n // keep the last match in the buffer\n buffer = buffer.slice(doneIdx);\n }\n }\n }\n\n // yield the last part\n for (const part of await this.parse(buffer)) {\n yield [part];\n }\n }\n}\n\n/**\n * Class to parse the output of an LLM call as a comma-separated list.\n * @augments ListOutputParser\n */\nexport class CommaSeparatedListOutputParser extends ListOutputParser {\n static lc_name() {\n return \"CommaSeparatedListOutputParser\";\n }\n\n lc_namespace = [\"langchain_core\", \"output_parsers\", \"list\"];\n\n lc_serializable = true;\n\n /**\n * Parses the given text into an array of strings, using a comma as the\n * separator. If the parsing fails, throws an OutputParserException.\n * @param text The text to parse.\n * @returns An array of strings obtained by splitting the input text at each comma.\n */\n async parse(text: string): Promise<string[]> {\n try {\n return text\n .trim()\n .split(\",\")\n .map((s) => s.trim());\n } catch {\n throw new OutputParserException(`Could not parse output: ${text}`, text);\n }\n }\n\n /**\n * Provides instructions on the expected format of the response for the\n * CommaSeparatedListOutputParser.\n * @returns A string containing instructions on the expected format of the response.\n */\n getFormatInstructions(): string {\n return `Your response should be a list of comma separated values, eg: \\`foo, bar, baz\\``;\n }\n}\n\n/**\n * Class to parse the output of an LLM call to a list with a specific length and separator.\n * @augments ListOutputParser\n */\nexport class CustomListOutputParser extends ListOutputParser {\n lc_namespace = [\"langchain_core\", \"output_parsers\", \"list\"];\n\n private length: number | undefined;\n\n private separator: string;\n\n constructor({ length, separator }: { length?: number; separator?: string }) {\n super(...arguments);\n this.length = length;\n this.separator = separator || \",\";\n }\n\n /**\n * Parses the given text into an array of strings, using the specified\n * separator. If the parsing fails or the number of items in the list\n * doesn't match the expected length, throws an OutputParserException.\n * @param text The text to parse.\n * @returns An array of strings obtained by splitting the input text at each occurrence of the specified separator.\n */\n async parse(text: string): Promise<string[]> {\n try {\n const items = text\n .trim()\n .split(this.separator)\n .map((s) => s.trim());\n if (this.length !== undefined && items.length !== this.length) {\n throw new OutputParserException(\n `Incorrect number of items. Expected ${this.length}, got ${items.length}.`\n );\n }\n return items;\n } catch (e) {\n if (Object.getPrototypeOf(e) === OutputParserException.prototype) {\n throw e;\n }\n throw new OutputParserException(`Could not parse output: ${text}`);\n }\n }\n\n /**\n * Provides instructions on the expected format of the response for the\n * CustomListOutputParser, including the number of items and the\n * separator.\n * @returns A string containing instructions on the expected format of the response.\n */\n getFormatInstructions(): string {\n return `Your response should be a list of ${\n this.length === undefined ? \"\" : `${this.length} `\n }items separated by \"${this.separator}\" (eg: \\`foo${this.separator} bar${\n this.separator\n } baz\\`)`;\n }\n}\n\nexport class NumberedListOutputParser extends ListOutputParser {\n static lc_name() {\n return \"NumberedListOutputParser\";\n }\n\n lc_namespace = [\"langchain_core\", \"output_parsers\", \"list\"];\n\n lc_serializable = true;\n\n getFormatInstructions(): string {\n return `Your response should be a numbered list with each item on a new line. For example: \\n\\n1. foo\\n\\n2. bar\\n\\n3. baz`;\n }\n\n re = /\\d+\\.\\s([^\\n]+)/g;\n\n async parse(text: string): Promise<string[]> {\n return [...(text.matchAll(this.re) ?? [])].map((m) => m[1]);\n }\n}\n\nexport class MarkdownListOutputParser extends ListOutputParser {\n static lc_name() {\n return \"NumberedListOutputParser\";\n }\n\n lc_namespace = [\"langchain_core\", \"output_parsers\", \"list\"];\n\n lc_serializable = true;\n\n getFormatInstructions(): string {\n return `Your response should be a numbered list with each item on a new line. For example: \\n\\n1. foo\\n\\n2. bar\\n\\n3. baz`;\n }\n\n re = /^\\s*[-*]\\s([^\\n]+)$/gm;\n\n async parse(text: string): Promise<string[]> {\n return [...(text.matchAll(this.re) ?? [])].map((m) => m[1]);\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"list.cjs","names":["BaseTransformOutputParser","OutputParserException"],"sources":["../../src/output_parsers/list.ts"],"sourcesContent":["import { BaseMessage } from \"../messages/index.js\";\nimport { OutputParserException } from \"./base.js\";\nimport { BaseTransformOutputParser } from \"./transform.js\";\n\n/**\n * Class to parse the output of an LLM call to a list.\n * @augments BaseOutputParser\n */\nexport abstract class ListOutputParser extends BaseTransformOutputParser<\n string[]\n> {\n re?: RegExp;\n\n async *_transform(\n inputGenerator: AsyncGenerator<string | BaseMessage>\n ): AsyncGenerator<string[]> {\n let buffer = \"\";\n for await (const input of inputGenerator) {\n if (typeof input === \"string\") {\n // add current chunk to buffer\n buffer += input;\n } else {\n // extract message content and add to buffer\n buffer += input.content;\n }\n // get parts in buffer\n if (!this.re) {\n const parts = await this.parse(buffer);\n if (parts.length > 1) {\n // if there are multiple parts, yield all but the last one\n for (const part of parts.slice(0, -1)) {\n yield [part];\n }\n // keep the last part in the buffer\n buffer = parts[parts.length - 1];\n }\n } else {\n // if there is a regex, get all matches\n const matches = [...buffer.matchAll(this.re)];\n if (matches.length > 1) {\n let doneIdx = 0;\n // if there are multiple matches, yield all but the last one\n for (const match of matches.slice(0, -1)) {\n yield [match[1]];\n doneIdx += (match.index ?? 0) + match[0].length;\n }\n // keep the last match in the buffer\n buffer = buffer.slice(doneIdx);\n }\n }\n }\n\n // yield the last part\n for (const part of await this.parse(buffer)) {\n yield [part];\n }\n }\n}\n\n/**\n * Class to parse the output of an LLM call as a comma-separated list.\n * @augments ListOutputParser\n */\nexport class CommaSeparatedListOutputParser extends ListOutputParser {\n static lc_name() {\n return \"CommaSeparatedListOutputParser\";\n }\n\n lc_namespace = [\"langchain_core\", \"output_parsers\", \"list\"];\n\n lc_serializable = true;\n\n /**\n * Parses the given text into an array of strings, using a comma as the\n * separator. If the parsing fails, throws an OutputParserException.\n * @param text The text to parse.\n * @returns An array of strings obtained by splitting the input text at each comma.\n */\n async parse(text: string): Promise<string[]> {\n try {\n return text\n .trim()\n .split(\",\")\n .map((s) => s.trim());\n } catch {\n throw new OutputParserException(`Could not parse output: ${text}`, text);\n }\n }\n\n /**\n * Provides instructions on the expected format of the response for the\n * CommaSeparatedListOutputParser.\n * @returns A string containing instructions on the expected format of the response.\n */\n getFormatInstructions(): string {\n return `Your response should be a list of comma separated values, eg: \\`foo, bar, baz\\``;\n }\n}\n\n/**\n * Class to parse the output of an LLM call to a list with a specific length and separator.\n * @augments ListOutputParser\n */\nexport class CustomListOutputParser extends ListOutputParser {\n lc_namespace = [\"langchain_core\", \"output_parsers\", \"list\"];\n\n private length: number | undefined;\n\n private separator: string;\n\n constructor({ length, separator }: { length?: number; separator?: string }) {\n super(...arguments);\n this.length = length;\n this.separator = separator || \",\";\n }\n\n /**\n * Parses the given text into an array of strings, using the specified\n * separator. If the parsing fails or the number of items in the list\n * doesn't match the expected length, throws an OutputParserException.\n * @param text The text to parse.\n * @returns An array of strings obtained by splitting the input text at each occurrence of the specified separator.\n */\n async parse(text: string): Promise<string[]> {\n try {\n const items = text\n .trim()\n .split(this.separator)\n .map((s) => s.trim());\n if (this.length !== undefined && items.length !== this.length) {\n throw new OutputParserException(\n `Incorrect number of items. Expected ${this.length}, got ${items.length}.`\n );\n }\n return items;\n } catch (e) {\n if (Object.getPrototypeOf(e) === OutputParserException.prototype) {\n throw e;\n }\n throw new OutputParserException(`Could not parse output: ${text}`);\n }\n }\n\n /**\n * Provides instructions on the expected format of the response for the\n * CustomListOutputParser, including the number of items and the\n * separator.\n * @returns A string containing instructions on the expected format of the response.\n */\n getFormatInstructions(): string {\n return `Your response should be a list of ${\n this.length === undefined ? \"\" : `${this.length} `\n }items separated by \"${this.separator}\" (eg: \\`foo${this.separator} bar${\n this.separator\n } baz\\`)`;\n }\n}\n\nexport class NumberedListOutputParser extends ListOutputParser {\n static lc_name() {\n return \"NumberedListOutputParser\";\n }\n\n lc_namespace = [\"langchain_core\", \"output_parsers\", \"list\"];\n\n lc_serializable = true;\n\n getFormatInstructions(): string {\n return `Your response should be a numbered list with each item on a new line. For example: \\n\\n1. foo\\n\\n2. bar\\n\\n3. baz`;\n }\n\n re = /\\d+\\.\\s([^\\n]+)/g;\n\n async parse(text: string): Promise<string[]> {\n return [...(text.matchAll(this.re) ?? [])].map((m) => m[1]);\n }\n}\n\nexport class MarkdownListOutputParser extends ListOutputParser {\n static lc_name() {\n return \"NumberedListOutputParser\";\n }\n\n lc_namespace = [\"langchain_core\", \"output_parsers\", \"list\"];\n\n lc_serializable = true;\n\n getFormatInstructions(): string {\n return `Your response should be a numbered list with each item on a new line. For example: \\n\\n1. foo\\n\\n2. bar\\n\\n3. baz`;\n }\n\n re = /^\\s*[-*]\\s([^\\n]+)$/gm;\n\n async parse(text: string): Promise<string[]> {\n return [...(text.matchAll(this.re) ?? [])].map((m) => m[1]);\n }\n}\n"],"mappings":";;;;;;;AAQA,IAAsB,mBAAtB,cAA+CA,kBAAAA,0BAE7C;CACA;CAEA,OAAO,WACL,gBAC0B;EAC1B,IAAI,SAAS;AACb,aAAW,MAAM,SAAS,gBAAgB;AACxC,OAAI,OAAO,UAAU,SAEnB,WAAU;OAGV,WAAU,MAAM;AAGlB,OAAI,CAAC,KAAK,IAAI;IACZ,MAAM,QAAQ,MAAM,KAAK,MAAM,OAAO;AACtC,QAAI,MAAM,SAAS,GAAG;AAEpB,UAAK,MAAM,QAAQ,MAAM,MAAM,GAAG,GAAG,CACnC,OAAM,CAAC,KAAK;AAGd,cAAS,MAAM,MAAM,SAAS;;UAE3B;IAEL,MAAM,UAAU,CAAC,GAAG,OAAO,SAAS,KAAK,GAAG,CAAC;AAC7C,QAAI,QAAQ,SAAS,GAAG;KACtB,IAAI,UAAU;AAEd,UAAK,MAAM,SAAS,QAAQ,MAAM,GAAG,GAAG,EAAE;AACxC,YAAM,CAAC,MAAM,GAAG;AAChB,kBAAY,MAAM,SAAS,KAAK,MAAM,GAAG;;AAG3C,cAAS,OAAO,MAAM,QAAQ;;;;AAMpC,OAAK,MAAM,QAAQ,MAAM,KAAK,MAAM,OAAO,CACzC,OAAM,CAAC,KAAK;;;;;;;AASlB,IAAa,iCAAb,cAAoD,iBAAiB;CACnE,OAAO,UAAU;AACf,SAAO;;CAGT,eAAe;EAAC;EAAkB;EAAkB;EAAO;CAE3D,kBAAkB;;;;;;;CAQlB,MAAM,MAAM,MAAiC;AAC3C,MAAI;AACF,UAAO,KACJ,MAAM,CACN,MAAM,IAAI,CACV,KAAK,MAAM,EAAE,MAAM,CAAC;UACjB;AACN,SAAM,IAAIC,aAAAA,sBAAsB,2BAA2B,QAAQ,KAAK;;;;;;;;CAS5E,wBAAgC;AAC9B,SAAO;;;;;;;AAQX,IAAa,yBAAb,cAA4C,iBAAiB;CAC3D,eAAe;EAAC;EAAkB;EAAkB;EAAO;CAE3D;CAEA;CAEA,YAAY,EAAE,QAAQ,aAAsD;AAC1E,QAAM,GAAG,UAAU;AACnB,OAAK,SAAS;AACd,OAAK,YAAY,aAAa;;;;;;;;;CAUhC,MAAM,MAAM,MAAiC;AAC3C,MAAI;GACF,MAAM,QAAQ,KACX,MAAM,CACN,MAAM,KAAK,UAAU,CACrB,KAAK,MAAM,EAAE,MAAM,CAAC;AACvB,OAAI,KAAK,WAAW,KAAA,KAAa,MAAM,WAAW,KAAK,OACrD,OAAM,IAAIA,aAAAA,sBACR,uCAAuC,KAAK,OAAO,QAAQ,MAAM,OAAO,GACzE;AAEH,UAAO;WACA,GAAG;AACV,OAAI,OAAO,eAAe,EAAE,KAAKA,aAAAA,sBAAsB,UACrD,OAAM;AAER,SAAM,IAAIA,aAAAA,sBAAsB,2BAA2B,OAAO;;;;;;;;;CAUtE,wBAAgC;AAC9B,SAAO,qCACL,KAAK,WAAW,KAAA,IAAY,KAAK,GAAG,KAAK,OAAO,GACjD,sBAAsB,KAAK,UAAU,cAAc,KAAK,UAAU,MACjE,KAAK,UACN;;;AAIL,IAAa,2BAAb,cAA8C,iBAAiB;CAC7D,OAAO,UAAU;AACf,SAAO;;CAGT,eAAe;EAAC;EAAkB;EAAkB;EAAO;CAE3D,kBAAkB;CAElB,wBAAgC;AAC9B,SAAO;;CAGT,KAAK;CAEL,MAAM,MAAM,MAAiC;AAC3C,SAAO,CAAC,GAAI,KAAK,SAAS,KAAK,GAAG,IAAI,EAAE,CAAE,CAAC,KAAK,MAAM,EAAE,GAAG;;;AAI/D,IAAa,2BAAb,cAA8C,iBAAiB;CAC7D,OAAO,UAAU;AACf,SAAO;;CAGT,eAAe;EAAC;EAAkB;EAAkB;EAAO;CAE3D,kBAAkB;CAElB,wBAAgC;AAC9B,SAAO;;CAGT,KAAK;CAEL,MAAM,MAAM,MAAiC;AAC3C,SAAO,CAAC,GAAI,KAAK,SAAS,KAAK,GAAG,IAAI,EAAE,CAAE,CAAC,KAAK,MAAM,EAAE,GAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","names":[],"sources":["../../src/output_parsers/list.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"list.d.ts","names":[],"sources":["../../src/output_parsers/list.ts"],"mappings":";;;;;;;AAQA;uBAAsB,gBAAA,SAAyB,yBAAA;EAG7C,EAAA,GAAK,MAAA;EAEE,UAAA,CACL,cAAA,EAAgB,cAAA,UAAwB,WAAA,IACvC,cAAA;AAAA;;;;;cAgDQ,8BAAA,SAAuC,gBAAA;EAAA,OAC3C,OAAA,CAAA;EAIP,YAAA;EAEA,eAAA;EAzDO;;;;;;EAiED,KAAA,CAAM,IAAA,WAAe,OAAA;EAfhB;;;;;EA+BX,qBAAA,CAAA;AAAA;;;;;cASW,sBAAA,SAA+B,gBAAA;EAC1C,YAAA;EAAA,QAEQ,MAAA;EAAA,QAEA,SAAA;EAER,WAAA,CAAA;IAAc,MAAA;IAAQ;EAAA;IAAe,MAAA;IAAiB,SAAA;EAAA;EAa3B;;;;;;;EAArB,KAAA,CAAM,IAAA,WAAe,OAAA;EAb3B;;;;;;EAuCA,qBAAA,CAAA;AAAA;AAAA,cASW,wBAAA,SAAiC,gBAAA;EAAA,OACrC,OAAA,CAAA;EAIP,YAAA;EAEA,eAAA;EAEA,qBAAA,CAAA;EAIA,EAAA,EAAE,MAAA;EAEI,KAAA,CAAM,IAAA,WAAe,OAAA;AAAA;AAAA,cAKhB,wBAAA,SAAiC,gBAAA;EAAA,OACrC,OAAA,CAAA;EAIP,YAAA;EAEA,eAAA;EAEA,qBAAA,CAAA;EAIA,EAAA,EAAE,MAAA;EAEI,KAAA,CAAM,IAAA,WAAe,OAAA;AAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { OutputParserException } from "./base.js";
|
|
2
2
|
import { BaseTransformOutputParser } from "./transform.js";
|
|
3
|
-
|
|
4
3
|
//#region src/output_parsers/list.ts
|
|
5
4
|
/**
|
|
6
5
|
* Class to parse the output of an LLM call to a list.
|
|
@@ -150,7 +149,7 @@ var MarkdownListOutputParser = class extends ListOutputParser {
|
|
|
150
149
|
return [...text.matchAll(this.re) ?? []].map((m) => m[1]);
|
|
151
150
|
}
|
|
152
151
|
};
|
|
153
|
-
|
|
154
152
|
//#endregion
|
|
155
153
|
export { CommaSeparatedListOutputParser, CustomListOutputParser, ListOutputParser, MarkdownListOutputParser, NumberedListOutputParser };
|
|
154
|
+
|
|
156
155
|
//# sourceMappingURL=list.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","names":[],"sources":["../../src/output_parsers/list.ts"],"sourcesContent":["import { BaseMessage } from \"../messages/index.js\";\nimport { OutputParserException } from \"./base.js\";\nimport { BaseTransformOutputParser } from \"./transform.js\";\n\n/**\n * Class to parse the output of an LLM call to a list.\n * @augments BaseOutputParser\n */\nexport abstract class ListOutputParser extends BaseTransformOutputParser<\n string[]\n> {\n re?: RegExp;\n\n async *_transform(\n inputGenerator: AsyncGenerator<string | BaseMessage>\n ): AsyncGenerator<string[]> {\n let buffer = \"\";\n for await (const input of inputGenerator) {\n if (typeof input === \"string\") {\n // add current chunk to buffer\n buffer += input;\n } else {\n // extract message content and add to buffer\n buffer += input.content;\n }\n // get parts in buffer\n if (!this.re) {\n const parts = await this.parse(buffer);\n if (parts.length > 1) {\n // if there are multiple parts, yield all but the last one\n for (const part of parts.slice(0, -1)) {\n yield [part];\n }\n // keep the last part in the buffer\n buffer = parts[parts.length - 1];\n }\n } else {\n // if there is a regex, get all matches\n const matches = [...buffer.matchAll(this.re)];\n if (matches.length > 1) {\n let doneIdx = 0;\n // if there are multiple matches, yield all but the last one\n for (const match of matches.slice(0, -1)) {\n yield [match[1]];\n doneIdx += (match.index ?? 0) + match[0].length;\n }\n // keep the last match in the buffer\n buffer = buffer.slice(doneIdx);\n }\n }\n }\n\n // yield the last part\n for (const part of await this.parse(buffer)) {\n yield [part];\n }\n }\n}\n\n/**\n * Class to parse the output of an LLM call as a comma-separated list.\n * @augments ListOutputParser\n */\nexport class CommaSeparatedListOutputParser extends ListOutputParser {\n static lc_name() {\n return \"CommaSeparatedListOutputParser\";\n }\n\n lc_namespace = [\"langchain_core\", \"output_parsers\", \"list\"];\n\n lc_serializable = true;\n\n /**\n * Parses the given text into an array of strings, using a comma as the\n * separator. If the parsing fails, throws an OutputParserException.\n * @param text The text to parse.\n * @returns An array of strings obtained by splitting the input text at each comma.\n */\n async parse(text: string): Promise<string[]> {\n try {\n return text\n .trim()\n .split(\",\")\n .map((s) => s.trim());\n } catch {\n throw new OutputParserException(`Could not parse output: ${text}`, text);\n }\n }\n\n /**\n * Provides instructions on the expected format of the response for the\n * CommaSeparatedListOutputParser.\n * @returns A string containing instructions on the expected format of the response.\n */\n getFormatInstructions(): string {\n return `Your response should be a list of comma separated values, eg: \\`foo, bar, baz\\``;\n }\n}\n\n/**\n * Class to parse the output of an LLM call to a list with a specific length and separator.\n * @augments ListOutputParser\n */\nexport class CustomListOutputParser extends ListOutputParser {\n lc_namespace = [\"langchain_core\", \"output_parsers\", \"list\"];\n\n private length: number | undefined;\n\n private separator: string;\n\n constructor({ length, separator }: { length?: number; separator?: string }) {\n super(...arguments);\n this.length = length;\n this.separator = separator || \",\";\n }\n\n /**\n * Parses the given text into an array of strings, using the specified\n * separator. If the parsing fails or the number of items in the list\n * doesn't match the expected length, throws an OutputParserException.\n * @param text The text to parse.\n * @returns An array of strings obtained by splitting the input text at each occurrence of the specified separator.\n */\n async parse(text: string): Promise<string[]> {\n try {\n const items = text\n .trim()\n .split(this.separator)\n .map((s) => s.trim());\n if (this.length !== undefined && items.length !== this.length) {\n throw new OutputParserException(\n `Incorrect number of items. Expected ${this.length}, got ${items.length}.`\n );\n }\n return items;\n } catch (e) {\n if (Object.getPrototypeOf(e) === OutputParserException.prototype) {\n throw e;\n }\n throw new OutputParserException(`Could not parse output: ${text}`);\n }\n }\n\n /**\n * Provides instructions on the expected format of the response for the\n * CustomListOutputParser, including the number of items and the\n * separator.\n * @returns A string containing instructions on the expected format of the response.\n */\n getFormatInstructions(): string {\n return `Your response should be a list of ${\n this.length === undefined ? \"\" : `${this.length} `\n }items separated by \"${this.separator}\" (eg: \\`foo${this.separator} bar${\n this.separator\n } baz\\`)`;\n }\n}\n\nexport class NumberedListOutputParser extends ListOutputParser {\n static lc_name() {\n return \"NumberedListOutputParser\";\n }\n\n lc_namespace = [\"langchain_core\", \"output_parsers\", \"list\"];\n\n lc_serializable = true;\n\n getFormatInstructions(): string {\n return `Your response should be a numbered list with each item on a new line. For example: \\n\\n1. foo\\n\\n2. bar\\n\\n3. baz`;\n }\n\n re = /\\d+\\.\\s([^\\n]+)/g;\n\n async parse(text: string): Promise<string[]> {\n return [...(text.matchAll(this.re) ?? [])].map((m) => m[1]);\n }\n}\n\nexport class MarkdownListOutputParser extends ListOutputParser {\n static lc_name() {\n return \"NumberedListOutputParser\";\n }\n\n lc_namespace = [\"langchain_core\", \"output_parsers\", \"list\"];\n\n lc_serializable = true;\n\n getFormatInstructions(): string {\n return `Your response should be a numbered list with each item on a new line. For example: \\n\\n1. foo\\n\\n2. bar\\n\\n3. baz`;\n }\n\n re = /^\\s*[-*]\\s([^\\n]+)$/gm;\n\n async parse(text: string): Promise<string[]> {\n return [...(text.matchAll(this.re) ?? [])].map((m) => m[1]);\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"list.js","names":[],"sources":["../../src/output_parsers/list.ts"],"sourcesContent":["import { BaseMessage } from \"../messages/index.js\";\nimport { OutputParserException } from \"./base.js\";\nimport { BaseTransformOutputParser } from \"./transform.js\";\n\n/**\n * Class to parse the output of an LLM call to a list.\n * @augments BaseOutputParser\n */\nexport abstract class ListOutputParser extends BaseTransformOutputParser<\n string[]\n> {\n re?: RegExp;\n\n async *_transform(\n inputGenerator: AsyncGenerator<string | BaseMessage>\n ): AsyncGenerator<string[]> {\n let buffer = \"\";\n for await (const input of inputGenerator) {\n if (typeof input === \"string\") {\n // add current chunk to buffer\n buffer += input;\n } else {\n // extract message content and add to buffer\n buffer += input.content;\n }\n // get parts in buffer\n if (!this.re) {\n const parts = await this.parse(buffer);\n if (parts.length > 1) {\n // if there are multiple parts, yield all but the last one\n for (const part of parts.slice(0, -1)) {\n yield [part];\n }\n // keep the last part in the buffer\n buffer = parts[parts.length - 1];\n }\n } else {\n // if there is a regex, get all matches\n const matches = [...buffer.matchAll(this.re)];\n if (matches.length > 1) {\n let doneIdx = 0;\n // if there are multiple matches, yield all but the last one\n for (const match of matches.slice(0, -1)) {\n yield [match[1]];\n doneIdx += (match.index ?? 0) + match[0].length;\n }\n // keep the last match in the buffer\n buffer = buffer.slice(doneIdx);\n }\n }\n }\n\n // yield the last part\n for (const part of await this.parse(buffer)) {\n yield [part];\n }\n }\n}\n\n/**\n * Class to parse the output of an LLM call as a comma-separated list.\n * @augments ListOutputParser\n */\nexport class CommaSeparatedListOutputParser extends ListOutputParser {\n static lc_name() {\n return \"CommaSeparatedListOutputParser\";\n }\n\n lc_namespace = [\"langchain_core\", \"output_parsers\", \"list\"];\n\n lc_serializable = true;\n\n /**\n * Parses the given text into an array of strings, using a comma as the\n * separator. If the parsing fails, throws an OutputParserException.\n * @param text The text to parse.\n * @returns An array of strings obtained by splitting the input text at each comma.\n */\n async parse(text: string): Promise<string[]> {\n try {\n return text\n .trim()\n .split(\",\")\n .map((s) => s.trim());\n } catch {\n throw new OutputParserException(`Could not parse output: ${text}`, text);\n }\n }\n\n /**\n * Provides instructions on the expected format of the response for the\n * CommaSeparatedListOutputParser.\n * @returns A string containing instructions on the expected format of the response.\n */\n getFormatInstructions(): string {\n return `Your response should be a list of comma separated values, eg: \\`foo, bar, baz\\``;\n }\n}\n\n/**\n * Class to parse the output of an LLM call to a list with a specific length and separator.\n * @augments ListOutputParser\n */\nexport class CustomListOutputParser extends ListOutputParser {\n lc_namespace = [\"langchain_core\", \"output_parsers\", \"list\"];\n\n private length: number | undefined;\n\n private separator: string;\n\n constructor({ length, separator }: { length?: number; separator?: string }) {\n super(...arguments);\n this.length = length;\n this.separator = separator || \",\";\n }\n\n /**\n * Parses the given text into an array of strings, using the specified\n * separator. If the parsing fails or the number of items in the list\n * doesn't match the expected length, throws an OutputParserException.\n * @param text The text to parse.\n * @returns An array of strings obtained by splitting the input text at each occurrence of the specified separator.\n */\n async parse(text: string): Promise<string[]> {\n try {\n const items = text\n .trim()\n .split(this.separator)\n .map((s) => s.trim());\n if (this.length !== undefined && items.length !== this.length) {\n throw new OutputParserException(\n `Incorrect number of items. Expected ${this.length}, got ${items.length}.`\n );\n }\n return items;\n } catch (e) {\n if (Object.getPrototypeOf(e) === OutputParserException.prototype) {\n throw e;\n }\n throw new OutputParserException(`Could not parse output: ${text}`);\n }\n }\n\n /**\n * Provides instructions on the expected format of the response for the\n * CustomListOutputParser, including the number of items and the\n * separator.\n * @returns A string containing instructions on the expected format of the response.\n */\n getFormatInstructions(): string {\n return `Your response should be a list of ${\n this.length === undefined ? \"\" : `${this.length} `\n }items separated by \"${this.separator}\" (eg: \\`foo${this.separator} bar${\n this.separator\n } baz\\`)`;\n }\n}\n\nexport class NumberedListOutputParser extends ListOutputParser {\n static lc_name() {\n return \"NumberedListOutputParser\";\n }\n\n lc_namespace = [\"langchain_core\", \"output_parsers\", \"list\"];\n\n lc_serializable = true;\n\n getFormatInstructions(): string {\n return `Your response should be a numbered list with each item on a new line. For example: \\n\\n1. foo\\n\\n2. bar\\n\\n3. baz`;\n }\n\n re = /\\d+\\.\\s([^\\n]+)/g;\n\n async parse(text: string): Promise<string[]> {\n return [...(text.matchAll(this.re) ?? [])].map((m) => m[1]);\n }\n}\n\nexport class MarkdownListOutputParser extends ListOutputParser {\n static lc_name() {\n return \"NumberedListOutputParser\";\n }\n\n lc_namespace = [\"langchain_core\", \"output_parsers\", \"list\"];\n\n lc_serializable = true;\n\n getFormatInstructions(): string {\n return `Your response should be a numbered list with each item on a new line. For example: \\n\\n1. foo\\n\\n2. bar\\n\\n3. baz`;\n }\n\n re = /^\\s*[-*]\\s([^\\n]+)$/gm;\n\n async parse(text: string): Promise<string[]> {\n return [...(text.matchAll(this.re) ?? [])].map((m) => m[1]);\n }\n}\n"],"mappings":";;;;;;;AAQA,IAAsB,mBAAtB,cAA+C,0BAE7C;CACA;CAEA,OAAO,WACL,gBAC0B;EAC1B,IAAI,SAAS;AACb,aAAW,MAAM,SAAS,gBAAgB;AACxC,OAAI,OAAO,UAAU,SAEnB,WAAU;OAGV,WAAU,MAAM;AAGlB,OAAI,CAAC,KAAK,IAAI;IACZ,MAAM,QAAQ,MAAM,KAAK,MAAM,OAAO;AACtC,QAAI,MAAM,SAAS,GAAG;AAEpB,UAAK,MAAM,QAAQ,MAAM,MAAM,GAAG,GAAG,CACnC,OAAM,CAAC,KAAK;AAGd,cAAS,MAAM,MAAM,SAAS;;UAE3B;IAEL,MAAM,UAAU,CAAC,GAAG,OAAO,SAAS,KAAK,GAAG,CAAC;AAC7C,QAAI,QAAQ,SAAS,GAAG;KACtB,IAAI,UAAU;AAEd,UAAK,MAAM,SAAS,QAAQ,MAAM,GAAG,GAAG,EAAE;AACxC,YAAM,CAAC,MAAM,GAAG;AAChB,kBAAY,MAAM,SAAS,KAAK,MAAM,GAAG;;AAG3C,cAAS,OAAO,MAAM,QAAQ;;;;AAMpC,OAAK,MAAM,QAAQ,MAAM,KAAK,MAAM,OAAO,CACzC,OAAM,CAAC,KAAK;;;;;;;AASlB,IAAa,iCAAb,cAAoD,iBAAiB;CACnE,OAAO,UAAU;AACf,SAAO;;CAGT,eAAe;EAAC;EAAkB;EAAkB;EAAO;CAE3D,kBAAkB;;;;;;;CAQlB,MAAM,MAAM,MAAiC;AAC3C,MAAI;AACF,UAAO,KACJ,MAAM,CACN,MAAM,IAAI,CACV,KAAK,MAAM,EAAE,MAAM,CAAC;UACjB;AACN,SAAM,IAAI,sBAAsB,2BAA2B,QAAQ,KAAK;;;;;;;;CAS5E,wBAAgC;AAC9B,SAAO;;;;;;;AAQX,IAAa,yBAAb,cAA4C,iBAAiB;CAC3D,eAAe;EAAC;EAAkB;EAAkB;EAAO;CAE3D;CAEA;CAEA,YAAY,EAAE,QAAQ,aAAsD;AAC1E,QAAM,GAAG,UAAU;AACnB,OAAK,SAAS;AACd,OAAK,YAAY,aAAa;;;;;;;;;CAUhC,MAAM,MAAM,MAAiC;AAC3C,MAAI;GACF,MAAM,QAAQ,KACX,MAAM,CACN,MAAM,KAAK,UAAU,CACrB,KAAK,MAAM,EAAE,MAAM,CAAC;AACvB,OAAI,KAAK,WAAW,KAAA,KAAa,MAAM,WAAW,KAAK,OACrD,OAAM,IAAI,sBACR,uCAAuC,KAAK,OAAO,QAAQ,MAAM,OAAO,GACzE;AAEH,UAAO;WACA,GAAG;AACV,OAAI,OAAO,eAAe,EAAE,KAAK,sBAAsB,UACrD,OAAM;AAER,SAAM,IAAI,sBAAsB,2BAA2B,OAAO;;;;;;;;;CAUtE,wBAAgC;AAC9B,SAAO,qCACL,KAAK,WAAW,KAAA,IAAY,KAAK,GAAG,KAAK,OAAO,GACjD,sBAAsB,KAAK,UAAU,cAAc,KAAK,UAAU,MACjE,KAAK,UACN;;;AAIL,IAAa,2BAAb,cAA8C,iBAAiB;CAC7D,OAAO,UAAU;AACf,SAAO;;CAGT,eAAe;EAAC;EAAkB;EAAkB;EAAO;CAE3D,kBAAkB;CAElB,wBAAgC;AAC9B,SAAO;;CAGT,KAAK;CAEL,MAAM,MAAM,MAAiC;AAC3C,SAAO,CAAC,GAAI,KAAK,SAAS,KAAK,GAAG,IAAI,EAAE,CAAE,CAAC,KAAK,MAAM,EAAE,GAAG;;;AAI/D,IAAa,2BAAb,cAA8C,iBAAiB;CAC7D,OAAO,UAAU;AACf,SAAO;;CAGT,eAAe;EAAC;EAAkB;EAAkB;EAAO;CAE3D,kBAAkB;CAElB,wBAAgC;AAC9B,SAAO;;CAGT,KAAK;CAEL,MAAM,MAAM,MAAiC;AAC3C,SAAO,CAAC,GAAI,KAAK,SAAS,KAAK,GAAG,IAAI,EAAE,CAAE,CAAC,KAAK,MAAM,EAAE,GAAG"}
|
|
@@ -1,22 +1,21 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value:
|
|
2
|
-
const require_runtime = require(
|
|
3
|
-
const require_json_output_functions_parsers = require(
|
|
4
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_runtime = require("../../_virtual/_rolldown/runtime.cjs");
|
|
3
|
+
const require_json_output_functions_parsers = require("./json_output_functions_parsers.cjs");
|
|
5
4
|
//#region src/output_parsers/openai_functions/index.ts
|
|
6
5
|
var openai_functions_exports = /* @__PURE__ */ require_runtime.__exportAll({
|
|
7
6
|
JsonKeyOutputFunctionsParser: () => require_json_output_functions_parsers.JsonKeyOutputFunctionsParser,
|
|
8
7
|
JsonOutputFunctionsParser: () => require_json_output_functions_parsers.JsonOutputFunctionsParser,
|
|
9
8
|
OutputFunctionsParser: () => require_json_output_functions_parsers.OutputFunctionsParser
|
|
10
9
|
});
|
|
11
|
-
|
|
12
10
|
//#endregion
|
|
13
11
|
exports.JsonKeyOutputFunctionsParser = require_json_output_functions_parsers.JsonKeyOutputFunctionsParser;
|
|
14
12
|
exports.JsonOutputFunctionsParser = require_json_output_functions_parsers.JsonOutputFunctionsParser;
|
|
15
13
|
exports.OutputFunctionsParser = require_json_output_functions_parsers.OutputFunctionsParser;
|
|
16
|
-
Object.defineProperty(exports,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
Object.defineProperty(exports, "openai_functions_exports", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function() {
|
|
17
|
+
return openai_functions_exports;
|
|
18
|
+
}
|
|
21
19
|
});
|
|
20
|
+
|
|
22
21
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { __exportAll } from "../../_virtual/_rolldown/runtime.js";
|
|
2
2
|
import { JsonKeyOutputFunctionsParser, JsonOutputFunctionsParser, OutputFunctionsParser } from "./json_output_functions_parsers.js";
|
|
3
|
-
|
|
4
3
|
//#region src/output_parsers/openai_functions/index.ts
|
|
5
4
|
var openai_functions_exports = /* @__PURE__ */ __exportAll({
|
|
6
5
|
JsonKeyOutputFunctionsParser: () => JsonKeyOutputFunctionsParser,
|
|
7
6
|
JsonOutputFunctionsParser: () => JsonOutputFunctionsParser,
|
|
8
7
|
OutputFunctionsParser: () => OutputFunctionsParser
|
|
9
8
|
});
|
|
10
|
-
|
|
11
9
|
//#endregion
|
|
12
10
|
export { JsonKeyOutputFunctionsParser, JsonOutputFunctionsParser, OutputFunctionsParser, openai_functions_exports };
|
|
11
|
+
|
|
13
12
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
const require_json = require(
|
|
2
|
-
const require_duplex = require(
|
|
3
|
-
const require_base = require(
|
|
4
|
-
const require_transform = require(
|
|
5
|
-
require(
|
|
6
|
-
require(
|
|
7
|
-
|
|
1
|
+
const require_json = require("../../utils/json.cjs");
|
|
2
|
+
const require_duplex = require("../../utils/fast-json-patch/src/duplex.cjs");
|
|
3
|
+
const require_base = require("../base.cjs");
|
|
4
|
+
const require_transform = require("../transform.cjs");
|
|
5
|
+
require("../../utils/json_patch.cjs");
|
|
6
|
+
require("../json.cjs");
|
|
8
7
|
//#region src/output_parsers/openai_functions/json_output_functions_parsers.ts
|
|
9
8
|
/**
|
|
10
9
|
* Class for parsing the output of an LLM. Can be configured to return
|
|
@@ -133,9 +132,9 @@ var JsonKeyOutputFunctionsParser = class extends require_base.BaseLLMOutputParse
|
|
|
133
132
|
return (await this.outputParser.parseResult(generations))[this.attrName];
|
|
134
133
|
}
|
|
135
134
|
};
|
|
136
|
-
|
|
137
135
|
//#endregion
|
|
138
136
|
exports.JsonKeyOutputFunctionsParser = JsonKeyOutputFunctionsParser;
|
|
139
137
|
exports.JsonOutputFunctionsParser = JsonOutputFunctionsParser;
|
|
140
138
|
exports.OutputFunctionsParser = OutputFunctionsParser;
|
|
139
|
+
|
|
141
140
|
//# sourceMappingURL=json_output_functions_parsers.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json_output_functions_parsers.cjs","names":["BaseLLMOutputParser","BaseCumulativeTransformOutputParser","compare","parsePartialJson"],"sources":["../../../src/output_parsers/openai_functions/json_output_functions_parsers.ts"],"sourcesContent":["import { Optional } from \"../../types/type-utils.js\";\nimport { Generation, ChatGeneration } from \"../../outputs.js\";\nimport { BaseLLMOutputParser } from \"../base.js\";\nimport { parsePartialJson } from \"../json.js\";\nimport {\n BaseCumulativeTransformOutputParser,\n BaseCumulativeTransformOutputParserInput,\n} from \"../transform.js\";\nimport { JsonSchema7ObjectType } from \"../../utils/json_schema.js\";\nimport {\n compare,\n type Operation as JSONPatchOperation,\n} from \"../../utils/json_patch.js\";\n\n/**\n * Represents optional parameters for a function in a JSON Schema.\n */\nexport type FunctionParameters = Optional<\n JsonSchema7ObjectType,\n \"additionalProperties\"\n>;\n\n/**\n * Class for parsing the output of an LLM. Can be configured to return\n * only the arguments of the function call in the output.\n */\nexport class OutputFunctionsParser extends BaseLLMOutputParser<string> {\n static lc_name() {\n return \"OutputFunctionsParser\";\n }\n\n lc_namespace = [\"langchain\", \"output_parsers\", \"openai_functions\"];\n\n lc_serializable = true;\n\n argsOnly = true;\n\n constructor(config?: { argsOnly?: boolean }) {\n super();\n this.argsOnly = config?.argsOnly ?? this.argsOnly;\n }\n\n /**\n * Parses the output and returns a string representation of the function\n * call or its arguments.\n * @param generations The output of the LLM to parse.\n * @returns A string representation of the function call or its arguments.\n */\n async parseResult(\n generations: Generation[] | ChatGeneration[]\n ): Promise<string> {\n if (\"message\" in generations[0]) {\n const gen = generations[0] as ChatGeneration;\n const functionCall = gen.message.additional_kwargs.function_call;\n if (!functionCall) {\n throw new Error(\n `No function_call in message ${JSON.stringify(generations)}`\n );\n }\n if (!functionCall.arguments) {\n throw new Error(\n `No arguments in function_call ${JSON.stringify(generations)}`\n );\n }\n if (this.argsOnly) {\n return functionCall.arguments;\n }\n return JSON.stringify(functionCall);\n } else {\n throw new Error(\n `No message in generations ${JSON.stringify(generations)}`\n );\n }\n }\n}\n\n/**\n * Class for parsing the output of an LLM into a JSON object. Uses an\n * instance of `OutputFunctionsParser` to parse the output.\n */\nexport class JsonOutputFunctionsParser<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Output extends Record<string, any> = Record<string, any>,\n> extends BaseCumulativeTransformOutputParser<Output> {\n static lc_name() {\n return \"JsonOutputFunctionsParser\";\n }\n\n lc_namespace = [\"langchain\", \"output_parsers\", \"openai_functions\"];\n\n lc_serializable = true;\n\n outputParser: OutputFunctionsParser;\n\n argsOnly = true;\n\n constructor(\n config?: { argsOnly?: boolean } & BaseCumulativeTransformOutputParserInput\n ) {\n super(config);\n this.argsOnly = config?.argsOnly ?? this.argsOnly;\n this.outputParser = new OutputFunctionsParser(config);\n }\n\n protected _diff(\n prev: unknown | undefined,\n next: unknown\n ): JSONPatchOperation[] | undefined {\n if (!next) {\n return undefined;\n }\n const ops = compare(prev ?? {}, next);\n return ops;\n }\n\n async parsePartialResult(\n generations: ChatGeneration[]\n ): Promise<Output | undefined> {\n const generation = generations[0];\n if (!generation.message) {\n return undefined;\n }\n const { message } = generation;\n const functionCall = message.additional_kwargs.function_call;\n if (!functionCall) {\n return undefined;\n }\n if (this.argsOnly) {\n return parsePartialJson(functionCall.arguments);\n }\n\n return {\n ...functionCall,\n arguments: parsePartialJson(functionCall.arguments),\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } as Record<string, any> as Output;\n }\n\n /**\n * Parses the output and returns a JSON object. If `argsOnly` is true,\n * only the arguments of the function call are returned.\n * @param generations The output of the LLM to parse.\n * @returns A JSON object representation of the function call or its arguments.\n */\n async parseResult(\n generations: Generation[] | ChatGeneration[]\n ): Promise<Output> {\n const result = await this.outputParser.parseResult(generations);\n if (!result) {\n throw new Error(\n `No result from \"OutputFunctionsParser\" ${JSON.stringify(generations)}`\n );\n }\n return this.parse(result);\n }\n\n async parse(text: string): Promise<Output> {\n const parsedResult = JSON.parse(text);\n if (this.argsOnly) {\n return parsedResult;\n }\n parsedResult.arguments = JSON.parse(parsedResult.arguments);\n return parsedResult;\n }\n\n getFormatInstructions(): string {\n return \"\";\n }\n}\n\n/**\n * Class for parsing the output of an LLM into a JSON object and returning\n * a specific attribute. Uses an instance of `JsonOutputFunctionsParser`\n * to parse the output.\n */\nexport class JsonKeyOutputFunctionsParser<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n T extends Record<string, any> = Record<string, any>,\n> extends BaseLLMOutputParser<T> {\n static lc_name() {\n return \"JsonKeyOutputFunctionsParser\";\n }\n\n lc_namespace = [\"langchain\", \"output_parsers\", \"openai_functions\"];\n\n lc_serializable = true;\n\n outputParser = new JsonOutputFunctionsParser();\n\n attrName: string;\n\n get lc_aliases() {\n return {\n attrName: \"key_name\",\n };\n }\n\n constructor(fields: { attrName: string }) {\n super(fields);\n this.attrName = fields.attrName;\n }\n\n /**\n * Parses the output and returns a specific attribute of the parsed JSON\n * object.\n * @param generations The output of the LLM to parse.\n * @returns The value of a specific attribute of the parsed JSON object.\n */\n async parseResult(generations: Generation[] | ChatGeneration[]): Promise<T> {\n const result = await this.outputParser.parseResult(generations);\n return result[this.attrName as keyof typeof result] as T;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"json_output_functions_parsers.cjs","names":["BaseLLMOutputParser","BaseCumulativeTransformOutputParser","compare","parsePartialJson"],"sources":["../../../src/output_parsers/openai_functions/json_output_functions_parsers.ts"],"sourcesContent":["import { Optional } from \"../../types/type-utils.js\";\nimport { Generation, ChatGeneration } from \"../../outputs.js\";\nimport { BaseLLMOutputParser } from \"../base.js\";\nimport { parsePartialJson } from \"../json.js\";\nimport {\n BaseCumulativeTransformOutputParser,\n BaseCumulativeTransformOutputParserInput,\n} from \"../transform.js\";\nimport { JsonSchema7ObjectType } from \"../../utils/json_schema.js\";\nimport {\n compare,\n type Operation as JSONPatchOperation,\n} from \"../../utils/json_patch.js\";\n\n/**\n * Represents optional parameters for a function in a JSON Schema.\n */\nexport type FunctionParameters = Optional<\n JsonSchema7ObjectType,\n \"additionalProperties\"\n>;\n\n/**\n * Class for parsing the output of an LLM. Can be configured to return\n * only the arguments of the function call in the output.\n */\nexport class OutputFunctionsParser extends BaseLLMOutputParser<string> {\n static lc_name() {\n return \"OutputFunctionsParser\";\n }\n\n lc_namespace = [\"langchain\", \"output_parsers\", \"openai_functions\"];\n\n lc_serializable = true;\n\n argsOnly = true;\n\n constructor(config?: { argsOnly?: boolean }) {\n super();\n this.argsOnly = config?.argsOnly ?? this.argsOnly;\n }\n\n /**\n * Parses the output and returns a string representation of the function\n * call or its arguments.\n * @param generations The output of the LLM to parse.\n * @returns A string representation of the function call or its arguments.\n */\n async parseResult(\n generations: Generation[] | ChatGeneration[]\n ): Promise<string> {\n if (\"message\" in generations[0]) {\n const gen = generations[0] as ChatGeneration;\n const functionCall = gen.message.additional_kwargs.function_call;\n if (!functionCall) {\n throw new Error(\n `No function_call in message ${JSON.stringify(generations)}`\n );\n }\n if (!functionCall.arguments) {\n throw new Error(\n `No arguments in function_call ${JSON.stringify(generations)}`\n );\n }\n if (this.argsOnly) {\n return functionCall.arguments;\n }\n return JSON.stringify(functionCall);\n } else {\n throw new Error(\n `No message in generations ${JSON.stringify(generations)}`\n );\n }\n }\n}\n\n/**\n * Class for parsing the output of an LLM into a JSON object. Uses an\n * instance of `OutputFunctionsParser` to parse the output.\n */\nexport class JsonOutputFunctionsParser<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Output extends Record<string, any> = Record<string, any>,\n> extends BaseCumulativeTransformOutputParser<Output> {\n static lc_name() {\n return \"JsonOutputFunctionsParser\";\n }\n\n lc_namespace = [\"langchain\", \"output_parsers\", \"openai_functions\"];\n\n lc_serializable = true;\n\n outputParser: OutputFunctionsParser;\n\n argsOnly = true;\n\n constructor(\n config?: { argsOnly?: boolean } & BaseCumulativeTransformOutputParserInput\n ) {\n super(config);\n this.argsOnly = config?.argsOnly ?? this.argsOnly;\n this.outputParser = new OutputFunctionsParser(config);\n }\n\n protected _diff(\n prev: unknown | undefined,\n next: unknown\n ): JSONPatchOperation[] | undefined {\n if (!next) {\n return undefined;\n }\n const ops = compare(prev ?? {}, next);\n return ops;\n }\n\n async parsePartialResult(\n generations: ChatGeneration[]\n ): Promise<Output | undefined> {\n const generation = generations[0];\n if (!generation.message) {\n return undefined;\n }\n const { message } = generation;\n const functionCall = message.additional_kwargs.function_call;\n if (!functionCall) {\n return undefined;\n }\n if (this.argsOnly) {\n return parsePartialJson(functionCall.arguments);\n }\n\n return {\n ...functionCall,\n arguments: parsePartialJson(functionCall.arguments),\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } as Record<string, any> as Output;\n }\n\n /**\n * Parses the output and returns a JSON object. If `argsOnly` is true,\n * only the arguments of the function call are returned.\n * @param generations The output of the LLM to parse.\n * @returns A JSON object representation of the function call or its arguments.\n */\n async parseResult(\n generations: Generation[] | ChatGeneration[]\n ): Promise<Output> {\n const result = await this.outputParser.parseResult(generations);\n if (!result) {\n throw new Error(\n `No result from \"OutputFunctionsParser\" ${JSON.stringify(generations)}`\n );\n }\n return this.parse(result);\n }\n\n async parse(text: string): Promise<Output> {\n const parsedResult = JSON.parse(text);\n if (this.argsOnly) {\n return parsedResult;\n }\n parsedResult.arguments = JSON.parse(parsedResult.arguments);\n return parsedResult;\n }\n\n getFormatInstructions(): string {\n return \"\";\n }\n}\n\n/**\n * Class for parsing the output of an LLM into a JSON object and returning\n * a specific attribute. Uses an instance of `JsonOutputFunctionsParser`\n * to parse the output.\n */\nexport class JsonKeyOutputFunctionsParser<\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n T extends Record<string, any> = Record<string, any>,\n> extends BaseLLMOutputParser<T> {\n static lc_name() {\n return \"JsonKeyOutputFunctionsParser\";\n }\n\n lc_namespace = [\"langchain\", \"output_parsers\", \"openai_functions\"];\n\n lc_serializable = true;\n\n outputParser = new JsonOutputFunctionsParser();\n\n attrName: string;\n\n get lc_aliases() {\n return {\n attrName: \"key_name\",\n };\n }\n\n constructor(fields: { attrName: string }) {\n super(fields);\n this.attrName = fields.attrName;\n }\n\n /**\n * Parses the output and returns a specific attribute of the parsed JSON\n * object.\n * @param generations The output of the LLM to parse.\n * @returns The value of a specific attribute of the parsed JSON object.\n */\n async parseResult(generations: Generation[] | ChatGeneration[]): Promise<T> {\n const result = await this.outputParser.parseResult(generations);\n return result[this.attrName as keyof typeof result] as T;\n }\n}\n"],"mappings":";;;;;;;;;;;AA0BA,IAAa,wBAAb,cAA2CA,aAAAA,oBAA4B;CACrE,OAAO,UAAU;AACf,SAAO;;CAGT,eAAe;EAAC;EAAa;EAAkB;EAAmB;CAElE,kBAAkB;CAElB,WAAW;CAEX,YAAY,QAAiC;AAC3C,SAAO;AACP,OAAK,WAAW,QAAQ,YAAY,KAAK;;;;;;;;CAS3C,MAAM,YACJ,aACiB;AACjB,MAAI,aAAa,YAAY,IAAI;GAE/B,MAAM,eADM,YAAY,GACC,QAAQ,kBAAkB;AACnD,OAAI,CAAC,aACH,OAAM,IAAI,MACR,+BAA+B,KAAK,UAAU,YAAY,GAC3D;AAEH,OAAI,CAAC,aAAa,UAChB,OAAM,IAAI,MACR,iCAAiC,KAAK,UAAU,YAAY,GAC7D;AAEH,OAAI,KAAK,SACP,QAAO,aAAa;AAEtB,UAAO,KAAK,UAAU,aAAa;QAEnC,OAAM,IAAI,MACR,6BAA6B,KAAK,UAAU,YAAY,GACzD;;;;;;;AASP,IAAa,4BAAb,cAGUC,kBAAAA,oCAA4C;CACpD,OAAO,UAAU;AACf,SAAO;;CAGT,eAAe;EAAC;EAAa;EAAkB;EAAmB;CAElE,kBAAkB;CAElB;CAEA,WAAW;CAEX,YACE,QACA;AACA,QAAM,OAAO;AACb,OAAK,WAAW,QAAQ,YAAY,KAAK;AACzC,OAAK,eAAe,IAAI,sBAAsB,OAAO;;CAGvD,MACE,MACA,MACkC;AAClC,MAAI,CAAC,KACH;AAGF,SADYC,eAAAA,QAAQ,QAAQ,EAAE,EAAE,KAAK;;CAIvC,MAAM,mBACJ,aAC6B;EAC7B,MAAM,aAAa,YAAY;AAC/B,MAAI,CAAC,WAAW,QACd;EAEF,MAAM,EAAE,YAAY;EACpB,MAAM,eAAe,QAAQ,kBAAkB;AAC/C,MAAI,CAAC,aACH;AAEF,MAAI,KAAK,SACP,QAAOC,aAAAA,iBAAiB,aAAa,UAAU;AAGjD,SAAO;GACL,GAAG;GACH,WAAWA,aAAAA,iBAAiB,aAAa,UAAU;GAEpD;;;;;;;;CASH,MAAM,YACJ,aACiB;EACjB,MAAM,SAAS,MAAM,KAAK,aAAa,YAAY,YAAY;AAC/D,MAAI,CAAC,OACH,OAAM,IAAI,MACR,0CAA0C,KAAK,UAAU,YAAY,GACtE;AAEH,SAAO,KAAK,MAAM,OAAO;;CAG3B,MAAM,MAAM,MAA+B;EACzC,MAAM,eAAe,KAAK,MAAM,KAAK;AACrC,MAAI,KAAK,SACP,QAAO;AAET,eAAa,YAAY,KAAK,MAAM,aAAa,UAAU;AAC3D,SAAO;;CAGT,wBAAgC;AAC9B,SAAO;;;;;;;;AASX,IAAa,+BAAb,cAGUH,aAAAA,oBAAuB;CAC/B,OAAO,UAAU;AACf,SAAO;;CAGT,eAAe;EAAC;EAAa;EAAkB;EAAmB;CAElE,kBAAkB;CAElB,eAAe,IAAI,2BAA2B;CAE9C;CAEA,IAAI,aAAa;AACf,SAAO,EACL,UAAU,YACX;;CAGH,YAAY,QAA8B;AACxC,QAAM,OAAO;AACb,OAAK,WAAW,OAAO;;;;;;;;CASzB,MAAM,YAAY,aAA0D;AAE1E,UADe,MAAM,KAAK,aAAa,YAAY,YAAY,EACjD,KAAK"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ChatGeneration, Generation } from "../../outputs.js";
|
|
2
2
|
import { Operation } from "../../utils/fast-json-patch/src/core.js";
|
|
3
3
|
import { JsonSchema7ObjectType } from "../../utils/zod-to-json-schema/parsers/object.js";
|
|
4
|
-
import "../../utils/json_schema.js";
|
|
5
4
|
import { BaseLLMOutputParser } from "../base.js";
|
|
6
5
|
import { BaseCumulativeTransformOutputParser, BaseCumulativeTransformOutputParserInput } from "../transform.js";
|
|
7
6
|
import { Optional } from "../../types/type-utils.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json_output_functions_parsers.d.ts","names":[],"sources":["../../../src/output_parsers/openai_functions/json_output_functions_parsers.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"json_output_functions_parsers.d.ts","names":[],"sources":["../../../src/output_parsers/openai_functions/json_output_functions_parsers.ts"],"mappings":";;;;;;;;;;;KAiBY,kBAAA,GAAqB,QAAA,CAC/B,qBAAA;;;;;cAQW,qBAAA,SAA8B,mBAAA;EAAA,OAClC,OAAA,CAAA;EAIP,YAAA;EAEA,eAAA;EAEA,QAAA;EAEA,WAAA,CAAY,MAAA;IAAW,QAAA;EAAA;EAXqC;;;;;;EAsBtD,WAAA,CACJ,WAAA,EAAa,UAAA,KAAe,cAAA,KAC3B,OAAA;AAAA;;;;;cA8BQ,yBAAA,gBAEI,MAAA,gBAAsB,MAAA,uBAC7B,mCAAA,CAAoC,MAAA;EAAA,OACrC,OAAA,CAAA;EAIP,YAAA;EAEA,eAAA;EAEA,YAAA,EAAc,qBAAA;EAEd,QAAA;EAEA,WAAA,CACE,MAAA;IAAW,QAAA;EAAA,IAAuB,wCAAA;EAAA,UAO1B,KAAA,CACR,IAAA,uBACA,IAAA,YACC,SAAA;EAQG,kBAAA,CACJ,WAAA,EAAa,cAAA,KACZ,OAAA,CAAQ,MAAA;EApByB;;;;;;EA+C9B,WAAA,CACJ,WAAA,EAAa,UAAA,KAAe,cAAA,KAC3B,OAAA,CAAQ,MAAA;EAUL,KAAA,CAAM,IAAA,WAAe,OAAA,CAAQ,MAAA;EASnC,qBAAA,CAAA;AAAA;;;;;;cAUW,4BAAA,WAED,MAAA,gBAAsB,MAAA,uBACxB,mBAAA,CAAoB,CAAA;EAAA,OACrB,OAAA,CAAA;EAIP,YAAA;EAEA,eAAA;EAEA,YAAA,EAAY,yBAAA,CAAA,MAAA;EAEZ,QAAA;EAAA,IAEI,UAAA,CAAA;;;EAMJ,WAAA,CAAY,MAAA;IAAU,QAAA;EAAA;EApGc;;;;;;EA+G9B,WAAA,CAAY,WAAA,EAAa,UAAA,KAAe,cAAA,KAAmB,OAAA,CAAQ,CAAA;AAAA"}
|
|
@@ -4,7 +4,6 @@ import { BaseLLMOutputParser } from "../base.js";
|
|
|
4
4
|
import { BaseCumulativeTransformOutputParser } from "../transform.js";
|
|
5
5
|
import "../../utils/json_patch.js";
|
|
6
6
|
import "../json.js";
|
|
7
|
-
|
|
8
7
|
//#region src/output_parsers/openai_functions/json_output_functions_parsers.ts
|
|
9
8
|
/**
|
|
10
9
|
* Class for parsing the output of an LLM. Can be configured to return
|
|
@@ -133,7 +132,7 @@ var JsonKeyOutputFunctionsParser = class extends BaseLLMOutputParser {
|
|
|
133
132
|
return (await this.outputParser.parseResult(generations))[this.attrName];
|
|
134
133
|
}
|
|
135
134
|
};
|
|
136
|
-
|
|
137
135
|
//#endregion
|
|
138
136
|
export { JsonKeyOutputFunctionsParser, JsonOutputFunctionsParser, OutputFunctionsParser };
|
|
137
|
+
|
|
139
138
|
//# sourceMappingURL=json_output_functions_parsers.js.map
|