分析和集成

以 Markdown 格式查看

llms.txtllms-full.txt 会自动为您的站点生成,但读者和 AI 工具如何发现它们取决于您。在 Fern Dashboard 中跟踪使用情况,并在您的文档中直接展示端点。

跟踪 LLM 流量

Fern Dashboard 提供 llms.txt 使用分析,包括:

  • 按 LLM 提供商(Claude、ChatGPT、Cursor 等)分类的流量
  • Markdown 和 llms.txt 文件的机器人与人工访问者的页面级明细

向读者展示端点

要让人类读者能够发现端点,请添加按钮或导航链接:

为您的 SDK 文档添加一个按钮,链接到您 API Reference 的 llms-full.txt。使用 lang 将代码示例过滤为一种语言,使用 excludeSpec=true 排除原始 OpenAPI 规范。

Markdown
1<Button href="/api-reference/llms-full.txt?lang=python&excludeSpec=true" target="_blank">
2 为 LLM 打开 Python API Reference
3</Button>

这为用户提供了一个干净的、特定语言的输出,他们可以在编写代码时将其提供给 AI 工具。

在导航栏中添加一个下拉菜单,链接到 llms-full.txt 的不同过滤版本,让用户轻松访问其偏好语言的 LLM 优化文档。

docs.yml
1navbar-links:
2 - type: dropdown
3 text: LLMs
4 icon: fa-solid fa-robot
5 links:
6 - text: 完整文档
7 href: /llms-full.txt
8 - text: Python SDK
9 href: /api-reference/llms-full.txt?lang=python&excludeSpec=true
10 - text: TypeScript SDK
11 href: /api-reference/llms-full.txt?lang=typescript&excludeSpec=true
12 - text: Go SDK
13 href: /api-reference/llms-full.txt?lang=go&excludeSpec=true