Enhance Crawl4AI with CLI and documentation updates - Implemented Command-Line Interface (CLI) in `crawl4ai/cli.py` - Added chunking strategies and their documentation in `llm.txt`
2.9 KiB
Hypothetical Questions
-
General Understanding of the New Caching System
- "Why did Crawl4AI move from boolean cache flags to a
CacheModeenum?" - "What are the benefits of using a single
CacheModeenum over multiple booleans?"
- "Why did Crawl4AI move from boolean cache flags to a
-
CacheMode Usage
- "What
CacheModeshould I use if I want normal caching (both read and write)?" - "How do I enable a mode that only reads from cache, or only writes to cache?"
- "What does
CacheMode.BYPASSdo, and how is it different fromCacheMode.DISABLED?"
- "What
-
Migrating from Old to New System
- "How do I translate
bypass_cache=Trueto the newCacheModeapproach?" - "I used to set
disable_cache=True; whatCacheModeshould I use now?" - "If I previously used
no_cache_read=True, how do I achieve the same effect withCacheMode?"
- "How do I translate
-
Implementation Details
- "How do I specify the
CacheModein my crawler runs?" - "Can I pass the
CacheModetoarundirectly, or do I need aCrawlerRunConfigobject?"
- "How do I specify the
-
Suppressing Deprecation Warnings
- "How can I temporarily disable deprecation warnings while I migrate my code?"
-
Edge Cases and Best Practices
- "What if I forget to update my code and still use the old flags?"
- "Is there a
CacheModefor scenarios where I want to only write to cache and never read old data?"
-
Examples and Code Snippets
- "Can I see a side-by-side comparison of old and new caching code for a given URL?"
- "How can I confirm that using
CacheMode.BYPASSskips both reading and writing cache?"
-
Performance and Reliability
- "Will switching to
CacheModeimprove my code’s readability and reduce confusion?" - "Can the new caching system still handle large-scale crawling scenarios efficiently?"
- "Will switching to
Topics Discussed in the File
-
Old vs. New Caching Approach:
Previously, multiple boolean flags (bypass_cache,disable_cache,no_cache_read,no_cache_write) controlled caching. Now, a singleCacheModeenum simplifies configuration. -
CacheMode Enum:
Provides clear modes:ENABLED: Normal caching (read and write)DISABLED: No caching at allREAD_ONLY: Only read from cache, don’t write new dataWRITE_ONLY: Only write to cache, don’t read old dataBYPASS: Skip cache entirely for this operation
-
Migration Patterns:
A simple mapping table helps developers switch old boolean flags to the correspondingCacheModevalue. -
Suppressing Deprecation Warnings:
Temporarily disabling deprecation warnings provides a grace period to update old code. -
Code Examples:
Side-by-side comparisons show how to update code from old flags to the newCacheModeapproach.
In summary, the file guides developers in transitioning from the old caching boolean flags to the new CacheMode enum, explaining the rationale, providing a mapping table, and offering code snippets to facilitate a smooth migration.