recipes / v1.schema.json
bhavnicksm's picture
Refactor RecursiveRules configuration in JSON schema to use an object structure with levels array for RecursiveChunker settings.
f3843fe
Raw
History Blame Contribute Delete
2.24 kB
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Chonkie Recipe",
"type": "object",
"required": ["name", "schema", "description", "language", "recipe"],
"properties": {
"name": {
"type": "string",
"description": "Recipe name"
},
"schema": {
"type": "string",
"description": "Schema version for the recipe"
},
"description": {
"type": "string",
"description": "Recipe description"
},
"language": {
"type": "string",
"description": "Target language (optional)"
},
"metadata": {
"type": "object",
"description": "Additional metadata"
},
"recipe": {
"type": "object",
"description": "Recipe-specific configurations",
"properties": {
"delimiters": {
"description": "Common delimiters used by SentenceChunker and SemanticChunker",
"oneOf": [
{"type": "string"},
{"type": "array", "items": {"type": "string"}}
]
},
"include_delim": {
"type": "string",
"enum": ["prev", "next", null],
"description": "How to include delimiters"
},
"recursive_rules": {
"type": "object",
"description": "RecursiveRules configurations for RecursiveChunker",
"properties": {
"levels": {
"type": "array",
"items": {
"type": "object",
"properties": {
"delimiters": {
"oneOf": [
{ "type": "string" },
{ "type": "array", "items": { "type": "string" } },
{ "type": "null" }
]
},
"whitespace": {
"type": "boolean"
},
"include_delim": {
"type": "string",
"enum": ["prev", "next", null]
}
}
}
}
}
}
}
}
}
}