generated from coulomb/repo-seed
Forward instruction schemas to llm-connect
This commit is contained in:
@@ -275,6 +275,46 @@ def test_execute_instruction_forwards_llm_connect_run_config():
|
||||
]
|
||||
|
||||
|
||||
def test_execute_instruction_forwards_output_schema_to_llm_connect(tmp_path, monkeypatch):
|
||||
schema_dir = tmp_path / "schemas"
|
||||
schema_dir.mkdir()
|
||||
schema_path = schema_dir / "daily-triage-report.json"
|
||||
schema = {
|
||||
"type": "object",
|
||||
"required": ["summary", "recommendations"],
|
||||
"properties": {
|
||||
"summary": {"type": "string"},
|
||||
"recommendations": {"type": "array", "items": {"type": "object"}},
|
||||
},
|
||||
}
|
||||
schema_path.write_text(json.dumps(schema), encoding="utf-8")
|
||||
monkeypatch.chdir(tmp_path)
|
||||
|
||||
llm = _CountingLLM([
|
||||
json.dumps({"summary": "Review open work.", "recommendations": []})
|
||||
])
|
||||
instr = _instr(
|
||||
id="daily-triage-report",
|
||||
prompt="Report.",
|
||||
trusted_fields=[],
|
||||
output_schema="schemas/daily-triage-report.json",
|
||||
model_params={"reasoning_effort": "medium"},
|
||||
)
|
||||
|
||||
result = execute_instruction_with_audit(instr, _Event(), {}, llm)
|
||||
|
||||
assert result.output_validated is True
|
||||
assert llm.calls == [
|
||||
{
|
||||
"model_name": "claude-sonnet-4-6",
|
||||
"model_params": {
|
||||
"reasoning_effort": "medium",
|
||||
"json_schema": schema,
|
||||
},
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
def test_execute_instruction_with_audit_accepts_report_payload():
|
||||
report_data = {
|
||||
"summary": "State Hub has loose ends.",
|
||||
|
||||
Reference in New Issue
Block a user