Dify
什么是 Dify?
可以把 Dify 想象成 AI 应用开发领域的瑞士军刀。它是开源的、用途广泛的,能够出色地满足你的各种 AI 需求。以下是它的与众不同之处:
1️⃣ 快速应用开发:无需深入复杂的代码。借助拖放功能,构建 AI 应用变得轻而易举。
2️⃣ 灵活的工作流管理:自由组合各种节点、传递变量并集成 API,创建符合你独特需求的工作流。
3️⃣ 无缝第三方集成:无论是外部 API 还是数据类型转换,Dify 都能优雅地一一处理。
它就像一个强力工具箱,让你的 AI 创意变为现实——无需披风加身。
什么是 Google Search?
Google Search 是由 Scrapeless 团队 推出的 Google SERP 数据抓取 API。它能够提取 Google 页面的结构化搜索结果,覆盖 20 多种 Google 场景。以下是最受欢迎的 8 种:

你可以在 Scrapeless 控制台中了解更多
加入我们的开发者计划,每月可获得 50K 次免费调用!
它的主要优势包括:
- 超快响应:平均响应时间为 1~2 秒,满足实时调用需求
- 极低价格:仅需 $0.1/1K 次请求,大幅降低数据获取成本
- 全区域支持:可在任何国家或城市获取本地搜索结果
- 多语言支持:兼容 Python、Node.js、Golang 等主流语言
- 面向 LLM 的优化输出:通过 RAG 和 MCP 为 AI 模型提供实时、准确、客观的上下文信息,并可自定义返回字段和格式
将 Scrapeless 集成到 Dify 的好处
将 Scrapeless 集成到 Dify 平台具有以下明显的好处:
💨 简化开发流程:借助 Dify 的低代码特性,你无需从零编写复杂代码即可快速开发应用。
⏰ 实时数据支持:使用 Google Search 提供的实时搜索数据,为后续内容创作提供可靠依据。
💰 降低维护成本:无需自行开发或维护搜索引擎爬虫工具,大幅节省开发及后期维护成本。
💡 灵活扩展:整个流程可根据实际需求进行调整和扩展,方便未来集成更多 SEO 或内容优化功能。
快速开始
如何集成 Dify.ai 和 Google Search?
通过将 Dify 与 Google Search 集成,我们可以尝试构建一套智能 SEO 标题生成工具,它能够实时抓取 Google 搜索结果,并利用大语言模型(LLM)进行语义理解和内容创作,从而生成更具吸引力和准确性的标题。
继续阅读并跟随我的步骤来完成它!

1. 通过 “Create from Blank” 创建应用。

选择工作流并输入名称和描述。

2. 添加输入节点和字段。

3. 选择 Google Search 节点以帮助访问 Google。

设置搜索输入。

4. 适配数据类型
由于 Google Search 的输出格式为 JSON,我们需要添加一个 Code 节点来适配类型:

填入以下代码,将 JSON 结构转换为字符串类型,作为下一个节点的参数输入:
function main({result}) {
return {
result: JSON.stringify(result)
}
}
5. 汇总结果并生成博客标题。
添加一个 LLM 节点:

选择 gpt-3.5-turbo 模型(你可以随意更换为其他 LLM 模型),并填入以下提示词。提示词将使用 Google Search 的搜索结果来生成更友好的博客标题:
SYSTEM:
You are an SEO expert and subject-matter expert. Your task is to generate an SEO article title for the keywords provided by the user based on the context of the Google Search.
USER:
For context about what my article should be about, these are the top ranking results for /keyword: /result
What are the principles that made these rank?
ASSISTANT:
To craft an SEO-friendly article title for the keywords "/keyword" that aligns with the principles observed in the top-ranking results you've shared, it's important to understand what made those titles effective. Here are the principles that likely contributed to their high rankings:
1. **Keywords Placement and Clarity**: Each title directly addresses the query by including the exact keywords or a very close variant. This clarity ensures search engines can easily understand the relevance of the content.
2. **Brevity and Directness**: The titles are concise, making them easy to read and understand quickly. They avoid unnecessary words and get straight to the point.
3. **Inclusion of Definitions or Explanations**: The titles suggest that the article will define or explain the concept, which is precisely what someone searching for "/keyword" would be looking for.
4. **Variety in Presentation**: Despite covering similar content, each title approaches the subject from a slightly different angle. This variety can capture interest from a broader audience.
USER:
Given these principles, please help me generate a title that will rank for the keywords "/keyword" by modeling after the syntax of the top ranking titles. Don't copy but give me something better, and avoid language such as "Master", "Comprehensive" or "Discover" or "Unveil". Do not use gerunds, and write in active, present voice only. Return the title only. Do not include any special symbols such as quotation mark and colons.
6. 添加输出结果节点。


恭喜!核心流程现已完成,接下来让我们测试一下!
试运行
输入关键词 “AI content generation” 并点击 “Start Run”。

我们可以看到,一个在 Google 上排名靠前的博客标题已成功生成。

发布与使用
如果上述步骤已完成,你就可以放心地进行发布了。

发布完成后,我们就可以使用该应用了:


至此,你已经学会了如何使用 Google Search 和 Dify 构建一个 SEO 友好的博客标题生成器!