Refactor strategy_by_heading function calls in test_wp26_comprehensive.py

- Updated the function signature for `strategy_by_heading` to accept a configuration dictionary and note ID, enhancing flexibility in chunking strategies.
- Introduced a configuration object to specify parameters such as max tokens and smart edge allocation, improving code clarity and maintainability.
This commit is contained in:
Lars 2026-01-26 10:36:58 +01:00
parent a9ce5a445b
commit dd2fa380f2

View File

@ -162,7 +162,14 @@ Text.
Text.
"""
blocks, h1_title = parse_blocks(markdown)
chunks = strategy_by_heading(blocks, note_type="experience", max_tokens=500)
# Korrekte Signatur: strategy_by_heading(blocks, config, note_id, context_prefix)
config = {
"max": 500,
"target": 400,
"enable_smart_edge_allocation": True
}
chunks = strategy_by_heading(blocks, config, note_id="test-note")
# Erstelle Payloads
payloads = make_chunk_payloads(
@ -208,7 +215,14 @@ type: experience
Text.
"""
blocks, _ = parse_blocks(markdown)
chunks = strategy_by_heading(blocks, note_type="experience", max_tokens=500)
# Korrekte Signatur: strategy_by_heading(blocks, config, note_id, context_prefix)
config = {
"max": 500,
"target": 400,
"enable_smart_edge_allocation": True
}
chunks = strategy_by_heading(blocks, config, note_id="test-note")
payloads = make_chunk_payloads(
frontmatter={"type": "experience"},