Overview
YAML loader processes YAML files using jq-style queries to split documents and extract content. Supports multiple document files, metadata flattening, and flexible content synthesis modes. Loader Class:YAMLLoader
Config Class: YAMLLoaderConfig
Install
Install the YAML loader optional dependency group:
Examples
Parameters
| Parameter | Type | Description | Default | Source |
|---|---|---|---|---|
encoding | str | None | File encoding (auto-detected if None) | None | Base |
error_handling | "ignore" | "warn" | "raise" | How to handle loading errors | ”warn” | Base |
include_metadata | bool | Whether to include file metadata | True | Base |
custom_metadata | dict | Additional metadata to include | Base | |
max_file_size | int | None | Maximum file size in bytes | None | Base |
skip_empty_content | bool | Skip documents with empty content | True | Base |
split_by_jq_query | str | jq query to select document objects | ”.” | Specific |
handle_multiple_docs | bool | Process multiple documents separated by ’---‘ | True | Specific |
content_synthesis_mode | "canonical_yaml" | "json" | "smart_text" | Content format | ”canonical_yaml” | Specific |
yaml_indent | int | Indentation level for YAML output | 2 | Specific |
json_indent | int | None | Indentation level for JSON output | 2 | Specific |
flatten_metadata | bool | Flatten nested structure into metadata | True | Specific |
metadata_jq_queries | dict[str, str] | None | Map metadata keys to jq queries | None | Specific |

