forked from Rockachopa/Timmy-time-dashboard
fix: add real-time data disclaimer to welcome message (#304)
This commit is contained in:
@@ -12,6 +12,7 @@ from timmy.tool_safety import (
|
||||
format_action_description,
|
||||
get_impact_level,
|
||||
)
|
||||
from timmy.welcome import WELCOME_MESSAGE
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -56,7 +57,7 @@ async def get_history(request: Request):
|
||||
return templates.TemplateResponse(
|
||||
request,
|
||||
"partials/history.html",
|
||||
{"messages": message_log.all()},
|
||||
{"messages": message_log.all(), "welcome_message": WELCOME_MESSAGE},
|
||||
)
|
||||
|
||||
|
||||
@@ -66,7 +67,7 @@ async def clear_history(request: Request):
|
||||
return templates.TemplateResponse(
|
||||
request,
|
||||
"partials/history.html",
|
||||
{"messages": []},
|
||||
{"messages": [], "welcome_message": WELCOME_MESSAGE},
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
{% else %}
|
||||
<div class="chat-message agent">
|
||||
<div class="msg-meta">TIMMY // SYSTEM</div>
|
||||
<div class="msg-body">Mission Control initialized. Timmy ready — awaiting input.</div>
|
||||
<div class="msg-body">{{ welcome_message | e }}</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<script>if(typeof scrollChat==='function'){setTimeout(scrollChat,50);}</script>
|
||||
|
||||
7
src/timmy/welcome.py
Normal file
7
src/timmy/welcome.py
Normal file
@@ -0,0 +1,7 @@
|
||||
"""Welcome message shown when the chat panel loads with no history."""
|
||||
|
||||
WELCOME_MESSAGE = (
|
||||
"Mission Control initialized. Timmy ready — awaiting input.\n"
|
||||
"Note: I cannot access real-time data such as weather, live feeds,"
|
||||
" or current news. Please ask about topics I can handle."
|
||||
)
|
||||
14
tests/timmy/test_welcome.py
Normal file
14
tests/timmy/test_welcome.py
Normal file
@@ -0,0 +1,14 @@
|
||||
"""Tests for the welcome message module."""
|
||||
|
||||
from timmy.welcome import WELCOME_MESSAGE
|
||||
|
||||
|
||||
class TestWelcomeMessage:
|
||||
def test_welcome_message_contains_disclaimer(self):
|
||||
assert "real-time" in WELCOME_MESSAGE.lower()
|
||||
|
||||
def test_welcome_message_mentions_weather(self):
|
||||
assert "weather" in WELCOME_MESSAGE.lower()
|
||||
|
||||
def test_welcome_message_contains_greeting(self):
|
||||
assert "Mission Control initialized" in WELCOME_MESSAGE
|
||||
Reference in New Issue
Block a user