文件体积控制策略
通过多维度参数精细控制输出:
- 基础限制::
- set up
maxFileSize
(单位MB)限制单个文件大小 - utilization
maxTokens
基于GPT token数自动分割文件
- set up
- Content Filtering::
- configure
selector
精确提取目标区域(如.main-content
) - pass (a bill or inspection etc)
filterOutCssSelectors
排除页眉/页脚等无关元素 - start using
simplifyHtml
移除冗余HTML标签
- configure
- Advanced Techniques::
- utilization
resourceExclusions: ['*.jpg', '*.mp4']
排除媒体资源 - increase
postProcessing
钩子函数进行文本压缩 - 对大型站点启用
splitByDomain
按子域名分组
- utilization
- Follow-up treatment:可结合jq等工具手动分割JSON文件
This answer comes from the articleGPT-Crawler: Automatically Crawling Website Content to Generate Knowledge Base DocumentsThe