1. Paginate through all current level blocks before recursing into children (before this PR we would go back and forth between paginate and recurse) 2. For top-level blocks only, split blocks into 5 lists, and concurrently get their content --------- From my local timing benchmarks, this speeds up the tool call by ~60% (23 seconds to 9.1 seconds) for larger Notion pages Without optimization: Avg 22995 Attempt 1: 27503.49497795105 Attempt 2: 20863.977909088135 Attempt 3: 20888.309955596924 Attempt 4: 18574.61714744568 Attempt 5: 27147.75586128235 With optimization: Avg 9148.6 Attempt 1: 9941.372871398926 Attempt 2: 10097.685098648071 Attempt 3: 7855.895042419434 Attempt 4: 9078.719854354858 Attempt 5: 8772.69196510315 |
||
|---|---|---|
| .. | ||
| tools | ||
| __init__.py | ||
| block_to_markdown_converter.py | ||
| constants.py | ||
| enums.py | ||
| markdown_to_block_converter.py | ||
| types.py | ||
| utils.py | ||