Include approved rows in Leo demo readback (#122)
Some checks are pending
CI / lint-and-test (push) Waiting to run
Some checks are pending
CI / lint-and-test (push) Waiting to run
This commit is contained in:
parent
73f466f899
commit
9a76f480c5
2 changed files with 14 additions and 0 deletions
|
|
@ -1415,6 +1415,9 @@ def context_operational_contracts(args: argparse.Namespace, query: str) -> list[
|
||||||
contract["live_link_audit"] = direct_snapshot.get("source_link_audit") or {}
|
contract["live_link_audit"] = direct_snapshot.get("source_link_audit") or {}
|
||||||
elif contract_id == "demo_capability_readback":
|
elif contract_id == "demo_capability_readback":
|
||||||
contract["applied_proposals"] = [item for item in proposal_rows if item.get("status") == "applied"]
|
contract["applied_proposals"] = [item for item in proposal_rows if item.get("status") == "applied"]
|
||||||
|
contract["applied_and_approved_proposals"] = [
|
||||||
|
item for item in proposal_rows if item.get("status") in {"applied", "approved"}
|
||||||
|
]
|
||||||
elif contract_id in SCHEMA_COMPILED_CONTRACTS:
|
elif contract_id in SCHEMA_COMPILED_CONTRACTS:
|
||||||
contract["current_edge_types"] = enum_values.get("edge_type", [])
|
contract["current_edge_types"] = enum_values.get("edge_type", [])
|
||||||
return contracts
|
return contracts
|
||||||
|
|
|
||||||
|
|
@ -406,6 +406,17 @@ def test_vps_bridge_enriches_and_compiles_all_direct_questions_from_live_rows(mo
|
||||||
contracts = module.context_operational_contracts(SimpleNamespace(), prompt["message"])
|
contracts = module.context_operational_contracts(SimpleNamespace(), prompt["message"])
|
||||||
response = module.compile_operational_response(contracts)
|
response = module.compile_operational_response(contracts)
|
||||||
|
|
||||||
|
demo_contract = next(
|
||||||
|
(contract for contract in contracts if contract["id"] == "demo_capability_readback"),
|
||||||
|
None,
|
||||||
|
)
|
||||||
|
if demo_contract:
|
||||||
|
assert [row["status"] for row in demo_contract["applied_and_approved_proposals"]] == [
|
||||||
|
"approved",
|
||||||
|
"applied",
|
||||||
|
]
|
||||||
|
assert "1/1 approved rows are approved_needs_apply_payload" in response
|
||||||
|
|
||||||
assert response is not None, prompt["id"]
|
assert response is not None, prompt["id"]
|
||||||
assert len(re.findall(r"\b\w+(?:[-']\w+)*\b", response)) <= 200
|
assert len(re.findall(r"\b\w+(?:[-']\w+)*\b", response)) <= 200
|
||||||
score = score_reply(prompt, response)
|
score = score_reply(prompt, response)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue