diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..57d5abcd --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,63 @@ +# Nothing ran these checks automatically before, so a defect they were +# written to catch could still be merged. They are cheap and need no +# dependencies beyond the standard library. +name: lint + +on: + pull_request: + push: + branches: [master] + +permissions: + contents: read + +jobs: + tools: + name: tools + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + + - name: Unit tests + run: python -m unittest discover -s tools -p 'test_*.py' -v + + - name: Every eol.rst matches versions.json + run: python tools/update_eol.py --check + + headings: + name: section titles + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' + + # reStructuredText requires the overline and underline of a section + # title to be the same length. Where they differ docutils refuses to + # build the section and the next one silently becomes the page title, + # without failing the build. Scoped to the versions versions.json + # calls current, so it follows a release instead of needing an edit, + # and so the archived versions -- which still carry mismatches and are + # consolidated by canonical anyway -- do not block unrelated work. + - name: Section title rules in the current documentation versions + run: | + set -eu + versions=$(python -c \ + "import json; d = json.load(open('versions.json')); \ + print(d['release'], d['development'])") + dirs="" + for v in $versions; do + for d in */"$v"; do + [ -d "$d" ] && dirs="$dirs $d" + done + done + if [ -z "$dirs" ]; then + echo "versions.json names no directory that exists" >&2 + exit 1 + fi + echo "linting:$dirs" + python tools/check_headings.py $dirs diff --git a/zh-cn/15.8/config/llm-gemini.rst b/zh-cn/15.8/config/llm-gemini.rst index 396b1ee4..8f4f879e 100644 --- a/zh-cn/15.8/config/llm-gemini.rst +++ b/zh-cn/15.8/config/llm-gemini.rst @@ -5,7 +5,7 @@ Google Gemini配置(AI 搜索 / RAG) 概述 ==== -本页说明如何配置 ``fess-llm-gemini`` 插件,以便 |Fess| 使用 Google Gemini 实现其**AI搜索模式(RAG:Retrieval-Augmented Generation)** —— 基于引用来源,直接从您的企业搜索索引回答自然语言问题。|Fess| 会调用 Google AI API(Generative Language API),使用 Gemini 模型对已爬取的文档执行 RAG。 +本页说明如何配置 ``fess-llm-gemini`` 插件,以便 |Fess| 使用 Google Gemini 实现其\ **AI搜索模式(RAG:Retrieval-Augmented Generation)** —— 基于引用来源,直接从您的企业搜索索引回答自然语言问题。|Fess| 会调用 Google AI API(Generative Language API),使用 Gemini 模型对已爬取的文档执行 RAG。 Google Gemini是Google公司提供的最先进的大型语言模型(LLM)。 |Fess| 可以使用Google AI API(Generative Language API)通过Gemini模型实现AI搜索模式功能。 diff --git a/zh-cn/15.8/config/llm-ollama.rst b/zh-cn/15.8/config/llm-ollama.rst index 902d7da2..c63d64a6 100644 --- a/zh-cn/15.8/config/llm-ollama.rst +++ b/zh-cn/15.8/config/llm-ollama.rst @@ -5,7 +5,7 @@ Ollama配置(本地 LLM / RAG) 概述 ==== -本页说明如何配置 ``fess-llm-ollama`` 插件,以便 |Fess| 使用本地部署的 Ollama 模型实现其**AI搜索模式(RAG:Retrieval-Augmented Generation)** —— 基于引用来源,直接从您的企业搜索索引回答自然语言问题,且无需将数据发送至外部 API。|Fess| 会调用本地 Ollama API,对已爬取的文档执行 RAG。 +本页说明如何配置 ``fess-llm-ollama`` 插件,以便 |Fess| 使用本地部署的 Ollama 模型实现其\ **AI搜索模式(RAG:Retrieval-Augmented Generation)** —— 基于引用来源,直接从您的企业搜索索引回答自然语言问题,且无需将数据发送至外部 API。|Fess| 会调用本地 Ollama API,对已爬取的文档执行 RAG。 Ollama是用于在本地环境运行大型语言模型(LLM)的开源平台。 |Fess| 的Ollama集成功能以插件 ``fess-llm-ollama`` 的形式提供,适合在私有环境中使用。 diff --git a/zh-cn/15.8/config/llm-openai.rst b/zh-cn/15.8/config/llm-openai.rst index f2760374..4d8498fa 100644 --- a/zh-cn/15.8/config/llm-openai.rst +++ b/zh-cn/15.8/config/llm-openai.rst @@ -5,7 +5,7 @@ OpenAI配置(AI 搜索 / RAG) 概述 ==== -本页说明如何配置 ``fess-llm-openai`` 插件,以便 |Fess| 使用 OpenAI 实现其**AI搜索模式(RAG:Retrieval-Augmented Generation)** —— 基于引用来源,直接从您的企业搜索索引回答自然语言问题。|Fess| 会调用 OpenAI API,使用 GPT 模型对已爬取的文档执行 RAG。 +本页说明如何配置 ``fess-llm-openai`` 插件,以便 |Fess| 使用 OpenAI 实现其\ **AI搜索模式(RAG:Retrieval-Augmented Generation)** —— 基于引用来源,直接从您的企业搜索索引回答自然语言问题。|Fess| 会调用 OpenAI API,使用 GPT 模型对已爬取的文档执行 RAG。 OpenAI是提供GPT-4等高性能大型语言模型(LLM)的云服务。 |Fess| 可以使用OpenAI API实现AI搜索模式功能。