Skip to main content

概述

Sourcey 已经生成了这个检索器需要的文件。 使用 SourceyRetriever 从已发布的 Sourcey 文档站点进行检索。它读取 search-index.json,在存在时使用 llms-full.txt,并返回包含规范页面 URL 的 Document 对象到 metadata.source。

集成细节

设置

安装

不需要 API 密钥。

实例化

siteUrl 应指向已发布 Sourcey 文档构建的根目录。

使用

在链中使用

安装一个对话模型包。此示例使用 OpenAI:

Sourcey 站点要求

为了干净的检索,已发布的 Sourcey 站点应该:
  • 发布 search-index.json
  • 发布 llms-full.txt
  • 在 sourcey.config.ts 中设置 siteUrl,以便返回的引用是规范的
如果 llms-full.txt 不可用,SourceyRetriever 会回退到从匹配的 HTML 页面提取文本。

更多


官方原文:src/oss/javascript/integrations/retrievers/sourcey.mdx · 非官方翻译,译文由 AI 生成,以英文原文为准。
Last modified on November 3, 2026