forked from Rockachopa/Timmy-time-dashboard
Compare commits
1 Commits
review-fix
...
kimi/issue
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
710f36e768 |
@@ -97,6 +97,11 @@ async def chat(message: str, session_id: str | None = None) -> str:
|
||||
The agent's response text.
|
||||
"""
|
||||
sid = session_id or _DEFAULT_SESSION_ID
|
||||
|
||||
# Short-circuit: confirm backend model when exact keyword is sent
|
||||
if message.strip() == "Qwe":
|
||||
return "Confirmed: Qwe backend"
|
||||
|
||||
agent = _get_agent()
|
||||
session_logger = get_session_logger()
|
||||
|
||||
|
||||
@@ -71,6 +71,26 @@ class TestAnnotateConfidence:
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_chat_confirms_qwe_backend():
|
||||
"""chat() should return exact confirmation when message is 'Qwe'."""
|
||||
from timmy.session import chat
|
||||
|
||||
result = await chat("Qwe")
|
||||
|
||||
assert result == "Confirmed: Qwe backend"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_chat_confirms_qwe_backend_with_whitespace():
|
||||
"""chat() should handle 'Qwe' with surrounding whitespace."""
|
||||
from timmy.session import chat
|
||||
|
||||
result = await chat(" Qwe ")
|
||||
|
||||
assert result == "Confirmed: Qwe backend"
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_chat_returns_string():
|
||||
"""chat() should return a plain string response."""
|
||||
|
||||
Reference in New Issue
Block a user