MCPcopy Create free account
hub / github.com/VectifyAI/OpenKB / _setup_kb

Function _setup_kb

tests/test_chat_slash_commands.py:16–28  ·  view source on GitHub ↗

Create a minimal KB structure and return kb_dir.

(tmp_path: Path)

Source from the content-addressed store, hash-verified

14
15
16def _setup_kb(tmp_path: Path) -> Path:
17 """Create a minimal KB structure and return kb_dir."""
18 kb_dir = tmp_path
19 (kb_dir / "raw").mkdir()
20 (kb_dir / "wiki" / "sources" / "images").mkdir(parents=True)
21 (kb_dir / "wiki" / "summaries").mkdir(parents=True)
22 (kb_dir / "wiki" / "concepts").mkdir(parents=True)
23 (kb_dir / "wiki" / "reports").mkdir(parents=True)
24 openkb_dir = kb_dir / ".openkb"
25 openkb_dir.mkdir()
26 (openkb_dir / "config.yaml").write_text("model: gpt-4o-mini\n")
27 (openkb_dir / "hashes.json").write_text(json.dumps({}))
28 return kb_dir
29
30
31def _make_session(kb_dir: Path) -> ChatSession:

Calls

no outgoing calls

Tested by

no test coverage detected