generated from coulomb/repo-seed
Wire LLMConnectAdapter behind the existing LLMAdapter seam with config-driven selection, graceful degradation, --offline mode, and bounded session context. Add unit tests, integration docs, and update README/SCOPE/AGENTS.
22 lines
726 B
Python
22 lines
726 B
Python
"""Prompt builder tests."""
|
|
|
|
from cya.llm.adapter import AssistanceRequest
|
|
from cya.llm.prompt import build_assistance_prompt
|
|
|
|
|
|
def test_build_assistance_prompt_includes_context_and_request():
|
|
system, user = build_assistance_prompt(
|
|
AssistanceRequest(
|
|
user_request="list files",
|
|
context={
|
|
"cwd": "/home/user/proj",
|
|
"session_turns": [{"user": "hi", "assistant": "hello"}],
|
|
"memory": {"items": [{"kind": "preference", "key": "style", "value": "concise"}]},
|
|
},
|
|
)
|
|
)
|
|
assert "cya" in system.lower()
|
|
assert "list files" in user
|
|
assert "/home/user/proj" in user
|
|
assert "hi" in user
|
|
assert "concise" in user |