您可以直接向实例上传文件或连接外部数据源。
| 数据源 (Data Source) | 描述 (Description) |
|---|---|
| 内置存储 (Built-in storage) | 直接向实例上传文件。默认在每个实例上可用。 |
| 网站 (Website) | 连接您拥有的域名以对网站页面建立索引。 |
| R2 存储桶 (R2 Bucket) | 连接 Cloudflare R2 存储桶以对存储的文档建立索引。 |
AI Search 可以接收各种类型的文件。支持以下纯文本文件和富文本格式文件。
| 格式 (Format) | 文件扩展名 (File extensions) | MIME 类型 (Mime Type) |
|---|---|---|
| Text | .txt, .rst |
text/plain |
| Log | .log, .log.gz |
text/plain |
| Config | .ini, .conf, .env, .properties, .gitignore, .editorconfig, .toml |
text/plain, text/toml |
| Markdown | .markdown, .md, .mdx, .mdoc |
text/markdown |
| LaTeX | .tex, .latex |
application/x-tex, application/x-latex |
| Script | .sh, .bat, .ps1 |
application/x-sh, application/x-msdos-batch, text/x-powershell |
| SGML | .sgml |
text/sgml |
| JSON | .json |
application/json |
| SQL | .sql |
application/sql |
| YAML | .yaml, .yml |
application/x-yaml |
| CSS | .css |
text/css |
| JavaScript | .js |
application/javascript |
| PHP | .php |
application/x-httpd-php |
| Python | .py |
text/x-python |
| Ruby | .rb |
text/x-ruby |
| Java | .java |
text/x-java-source |
| C | .c |
text/x-c |
| C++ | .cpp, .cxx |
text/x-c++ |
| C Header | .h, .hpp |
text/x-c-header |
| Go | .go |
text/x-go |
| Rust | .rs |
text/rust |
| Swift | .swift |
text/swift |
| Dart | .dart |
text/dart |
| EMACS Lisp | .el |
application/x-elisp, text/x-elisp, text/x-emacs-lisp |
AI Search 使用 Markdown 转换 将富文本格式文件转换为 Markdown。下表列出了将被转换为 Markdown 的受支持格式:
格式 | 文件扩展名 | Mime 类型 | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
PDF 文档 |
|
| ||||||||||||
图像 1 |
|
| ||||||||||||
HTML 文档 |
|
| ||||||||||||
XML 文档 |
|
| ||||||||||||
Microsoft Office 文档 |
|
| ||||||||||||
Open Document Format |
|
| ||||||||||||
CSV |
|
| ||||||||||||
Apple 文档 |
|
|
1 图像转换使用两个 Workers AI 模型进行对象检测 和摘要。更多详情请参阅 Workers AI 定价。
AI Search 的文件大小限制为最高 4 MB。
超过此限制的文件将不会被建立索引,并将显示在错误日志中。