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:
parent
a9ce5a445b
commit
dd2fa380f2
|
|
@ -162,7 +162,14 @@ Text.
|
||||||
Text.
|
Text.
|
||||||
"""
|
"""
|
||||||
blocks, h1_title = parse_blocks(markdown)
|
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
|
# Erstelle Payloads
|
||||||
payloads = make_chunk_payloads(
|
payloads = make_chunk_payloads(
|
||||||
|
|
@ -208,7 +215,14 @@ type: experience
|
||||||
Text.
|
Text.
|
||||||
"""
|
"""
|
||||||
blocks, _ = parse_blocks(markdown)
|
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(
|
payloads = make_chunk_payloads(
|
||||||
frontmatter={"type": "experience"},
|
frontmatter={"type": "experience"},
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user