ai: add the /api/ai blueprint, the read-only LLM tool catalog
Lean, flat, LLM-shaped read-only endpoints over the library: global,
video, archive, and doc search; paged captions, archive text, and zim
entries; collections, inventories, and a media-directory text reader.
Links are server-computed; big content is paged, never truncated.
This ports the formatting layer from wrolpi_mcp (untouched for now)
into tested code. First phase of ai.md.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-25 21:03:11 -06:00
|
|
|
# AI module test fixtures. The docs conftest is not star-imported by the root conftest, but the
|
|
|
|
|
# AI endpoints cover docs; import its fixtures so AI tests can use doc_factory.
|
2026-08-25 21:21:34 -06:00
|
|
|
import pytest
|
|
|
|
|
|
|
|
|
|
from modules.ai.config import ai_config_context
|
ai: add the /api/ai blueprint, the read-only LLM tool catalog
Lean, flat, LLM-shaped read-only endpoints over the library: global,
video, archive, and doc search; paged captions, archive text, and zim
entries; collections, inventories, and a media-directory text reader.
Links are server-computed; big content is paged, never truncated.
This ports the formatting layer from wrolpi_mcp (untouched for now)
into tested code. First phase of ai.md.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-25 21:03:11 -06:00
|
|
|
from modules.docs.conftest import * # noqa
|
2026-08-25 21:21:34 -06:00
|
|
|
from wrolpi.api_utils import api_app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
|
def test_ai_config(test_directory, async_client):
|
|
|
|
|
"""An isolated ai.yaml config for one test."""
|
|
|
|
|
(test_directory / 'config').mkdir(exist_ok=True)
|
|
|
|
|
config_path = test_directory / 'config/ai.yaml'
|
|
|
|
|
with ai_config_context() as config:
|
|
|
|
|
config.initialize(api_app.shared_ctx.ai_config)
|
|
|
|
|
yield config_path
|