Added validation-specific LLM configuration options

This commit is contained in:
2026-04-29 20:45:51 -05:00
parent 4c899122d9
commit 54ce3d08c9
13 changed files with 714 additions and 12 deletions

View File

@@ -31,6 +31,7 @@ class FakeStructuredLLMClient:
"stage_name": stage_name,
"messages": list(messages),
"response_model": response_model,
"config": config,
}
)
payload = _pop_llm_response(self._responses, stage_name)
@@ -115,6 +116,63 @@ def test_glossary_module_propose_writes_diagnostics_and_returns_proposals_withou
assert "gestures" in prompt_text
def test_module_propose_uses_primary_llm_config(tmp_path):
transcript = parse_transcript_json(
"""
[
{"id": 1, "speaker": "Eric", "start": 0.0, "end": 1.0, "text": "There were gestures at the temple."}
]
"""
)
section = chunk_transcript(transcript, max_section_tokens=1000)[0]
module = GlossaryModule()
client = FakeStructuredLLMClient(
[
{
"corrections": [
{
"id": 1,
"original_text": "gestures",
"corrected_text": "Jesters",
"confidence": 0.95,
}
]
}
]
)
config = AuditaConfig.from_sources(
env={"OPENROUTER_API_KEY": "primary-key"},
overrides=ConfigOverrides(
model="primary-model",
base_url="http://localhost:8000/v1",
max_retries=7,
llm_timeout_seconds=120,
validation_llm_api_key="validation-key",
validation_model="validation-model",
validation_base_url="http://localhost:9000/v1",
validation_max_retries=2,
validation_llm_timeout_seconds=240,
validation_llm_concurrency=3,
),
)
context = ModuleContext(
run_spec=ModuleRunSpec(instance_name="glossary_primary", module_key="glossary", module=module),
glossary=_glossary(),
config=config,
run_dir=tmp_path,
llm_client=client,
)
module.propose(section, context)
proposal_config = client.calls[0]["config"]
assert proposal_config.api_key == "primary-key"
assert proposal_config.model == "primary-model"
assert proposal_config.base_url == "http://localhost:8000/v1"
assert proposal_config.max_retries == 7
assert proposal_config.llm_timeout_seconds == 120
def test_homophones_prompt_is_explicitly_scoped_to_spoken_form_corrections():
transcript = parse_transcript_json(
"""