11 lines
450 B
Python
11 lines
450 B
Python
from buddhagpt.rag import build_prompt
|
|
|
|
def test_build_prompt_includes_passages_and_citation_instruction():
|
|
msgs = build_prompt("What causes suffering?", [
|
|
{"uid": "sn56.11", "title": "Setting the Wheel in Motion", "chunk": "Craving leads to suffering."}
|
|
])
|
|
system = msgs[0]["content"]
|
|
assert "sn56.11" in msgs[1]["content"]
|
|
assert "cite" in system.lower()
|
|
assert msgs[1]["content"].endswith("What causes suffering?")
|