new feature: frontend with separated responses
This commit is contained in:
@@ -56,6 +56,9 @@ async def test_secondary_topic_does_not_inherit_primary_transaction_state():
|
||||
assert captured["domain"] == "telecom_contas"
|
||||
assert result.answer.startswith("Você confirma o cancelamento")
|
||||
assert result.answer.endswith("Aqui está a sua segunda via.")
|
||||
assert [item["agent"] for item in result.agent_responses] == ["agent", "faturas_agent"]
|
||||
assert result.agent_responses[0]["primary"] is True
|
||||
assert result.agent_responses[1]["primary"] is False
|
||||
assert result.pending_topics == []
|
||||
assert result.mcp_results == [
|
||||
{"tool_name": "consultar_vas"},
|
||||
|
||||
@@ -17,6 +17,7 @@ def _settings(**overrides):
|
||||
KBDB_NODE_MAX_RELATED=8, KBDB_GRAPH_CROSS_REF=False,
|
||||
KBDB_MAX_CROSS_REF_HOPS=1, KBDB_DOCUMENT_TYPE="customer_safe",
|
||||
KBDB_METADATA_JSON=None, KBDB_MIN_SCORE=None,
|
||||
KBDB_IDENTIFY_DOCUMENT=True, KBDB_STORE_QUERY=True, KBDB_IDENTIFY_TOP_N=3,
|
||||
)
|
||||
data.update(overrides)
|
||||
return SimpleNamespace(**data)
|
||||
@@ -139,12 +140,13 @@ def test_kbdb_discovers_number_flags_and_clob_output(monkeypatch):
|
||||
names = [
|
||||
("P_SEARCH_TYPE", "VARCHAR2"), ("P_QUERY", "VARCHAR2"),
|
||||
("P_TOP_K", "NUMBER"), ("P_NODE_EXPANSION", "NUMBER"),
|
||||
("P_NODE_MAX_RELATED", "NUMBER"), ("P_GRAPH_CROSS_REF", "NUMBER"),
|
||||
("P_MAX_CROSS_REF_HOPS", "NUMBER"), ("P_DOCUMENT_TYPE", "VARCHAR2"),
|
||||
("P_METADATA_JSON", "CLOB"), ("P_RESULT", "CLOB"),
|
||||
("P_NODE_MAX_RELATED", "NUMBER"), ("P_DOCUMENT_TYPE", "VARCHAR2"),
|
||||
("P_METADATA", "CLOB"), ("P_IDENTIFY_DOCUMENT", "NUMBER"),
|
||||
("P_STORE_QUERY", "NUMBER"), ("P_IDENTIFY_TOP_N", "NUMBER"),
|
||||
("P_RESULT", "CLOB"),
|
||||
]
|
||||
return [
|
||||
(name, index, "OUT" if index == 10 else "IN", data_type, None)
|
||||
(name, index, "OUT" if index == 11 else "IN", data_type, None)
|
||||
for index, (name, data_type) in enumerate(names, start=1)
|
||||
]
|
||||
|
||||
@@ -179,5 +181,5 @@ def test_kbdb_discovers_number_flags_and_clob_output(monkeypatch):
|
||||
assert result == {"units": [], "seeds": []}
|
||||
assert captured["procedure"] == "PKG_KB_SERVING.search_knowledge_base"
|
||||
assert captured["binds"][3] == 1
|
||||
assert captured["binds"][5] == 0
|
||||
assert captured["binds"][7:10] == [1, 1, 3]
|
||||
assert captured["out_type"] == "CLOB"
|
||||
|
||||
@@ -70,3 +70,21 @@ def test_templates_and_tuning_expose_rag_results_in_api_and_telemetry():
|
||||
assert '"rag_results": result.get("rag_results")' in path.read_text(encoding="utf-8"), path
|
||||
for path in graphs:
|
||||
assert '"rag_results": state.get("rag_results", [])' in path.read_text(encoding="utf-8"), path
|
||||
|
||||
|
||||
def test_all_tuning_envs_expose_complete_kbdb_configuration():
|
||||
envs = sorted((ROOT / "Tuning-Performance").glob("**/.env.example"))
|
||||
assert envs
|
||||
required = (
|
||||
"RAG_PROVIDER=standard",
|
||||
"KBDB_DB_USER=",
|
||||
"KBDB_DB_DSN=",
|
||||
"KBDB_IDENTIFY_DOCUMENT=true",
|
||||
"KBDB_STORE_QUERY=true",
|
||||
"KBDB_IDENTIFY_TOP_N=3",
|
||||
"KBDB_GROUNDED_ONLY=true",
|
||||
)
|
||||
for path in envs:
|
||||
source = path.read_text(encoding="utf-8")
|
||||
for setting in required:
|
||||
assert setting in source, (path, setting)
|
||||
|
||||
Reference in New Issue
Block a user