diff --git a/README.md b/README.md index 6e0033d..693bcea 100644 --- a/README.md +++ b/README.md @@ -184,17 +184,17 @@ List the available directions or filter them by keyword: .venv/bin/python src/idea_forge/b_library.py agent ``` -The four registered directions are used by default. To choose your own combination, add the following to `config/providers.local.json`: +The registered directions are used by default. To choose your own combination, add the following to `config/providers.local.json`: ```json { "idea_forge": { - "b_directions": ["Agent_运行时与沙箱", "视觉推理"] + "b_directions": ["agent_memory", "llm_reasoning"] } } ``` -Each direction name corresponds to a Markdown filename under `knowledge_base/`. Adding directions increases generation and review calls; start with a small set when validating a new setup. +The example uses knowledge files included in this repository. Each direction name is a Markdown filename under `knowledge_base/` without the `.md` suffix. To use a custom direction, create its knowledge file before adding its name to the configuration. Adding directions increases generation and review calls; start with a small set when validating a new setup. ### 4.4 Optional: Draft a Knowledge Direction with GPT Researcher diff --git a/README_CN.md b/README_CN.md index 0b0fbed..834db94 100644 --- a/README_CN.md +++ b/README_CN.md @@ -190,17 +190,17 @@ set +a .venv/bin/python src/idea_forge/b_library.py agent ``` -默认使用已注册的四个方向。要指定自己的组合,在 `config/providers.local.json` 中加入: +默认使用已注册的方向。要指定自己的组合,在 `config/providers.local.json` 中加入: ```json { "idea_forge": { - "b_directions": ["Agent_运行时与沙箱", "视觉推理"] + "b_directions": ["agent_memory", "llm_reasoning"] } } ``` -方向名对应 `knowledge_base/` 下的 Markdown 文件名。每增加一个方向,构思和评审调用量都会增加;第一次运行建议先选少量方向验证流程。 +示例使用仓库自带的知识文件。方向名对应 `knowledge_base/` 下不带 `.md` 后缀的 Markdown 文件名。使用自定义方向前,先创建对应的知识文件,再把名称加入配置。每增加一个方向,构思和评审调用量都会增加;第一次运行建议先选少量方向验证流程。 ### 4.4 可选:用 GPT Researcher 起草知识方向 diff --git a/tests/test_b_direction_selection.py b/tests/test_b_direction_selection.py index 461bc09..b0cf73b 100644 --- a/tests/test_b_direction_selection.py +++ b/tests/test_b_direction_selection.py @@ -14,6 +14,7 @@ import builtins import json +import re import sys import types @@ -244,3 +245,17 @@ def test_the_pending_rerun_uses_the_configured_directions(forge, monkeypatch, tm assert seen["b_ids"] == ["llm_reasoning"] assert json.loads(pending.read_text())["seeds"] == [], "the queue is drained after a run" assert published == [True] + + +@pytest.mark.parametrize("document", ["README.md", "README_CN.md"]) +def test_readme_direction_example_uses_bundled_knowledge(forge, document): + text = (REPO / document).read_text(encoding="utf-8") + examples = [json.loads(block) for block in re.findall(r"```json\n(.*?)```", text, re.S) + if '"b_directions"' in block] + assert examples, f"{document} must include a direction configuration example" + for config in examples: + forge.llm.load_config = lambda: config + selected, _ = forge.bl.select_b_directions() + assert selected + for direction in selected: + assert forge.bl.knowledge_path(direction["id"]) is not None