Background requirements
用户常需要从网页提取特定信息(如商品价格、技术参数),而标准markdown转换可能无法满足个性化需求。
procedure
- 编写精准提示词:在配置文件的
prompt
字段中明确指令,例如:- 提取价格:
prompt=提取所有价格信息,按¥符号识别并列表
- 筛选日期:
prompt=仅输出包含YYYY-MM-DD格式日期的段落
- 提取价格:
- 创建专用视图: in
~/.spegel.toml
中添加新视图区块,例如:[[views]]
id = "prices"
name = "Price Extractor"
prompt = "List all product prices in bullet points" - Model Selection Optimization:对复杂任务(如多语言混合内容),建议切换至GPT-4等更高性能模型。
Debugging Tips
若输出不准确,可尝试:逐步增加提示词细节;添加示例到提示词中;通过spegel --debug
查看中间处理结果。
This answer comes from the articleSpegel: using AI to transform web pages into an end-to-end browsing experienceThe