From 7028fee3b95f8438fcace9a6cfca7a9ab9022c70 Mon Sep 17 00:00:00 2001 From: Mic Neale Date: Wed, 4 Sep 2024 19:18:20 +1000 Subject: [PATCH] show tips of the day --- src/goose/cli/session.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/goose/cli/session.py b/src/goose/cli/session.py index 70ca600c1..33d379bd5 100644 --- a/src/goose/cli/session.py +++ b/src/goose/cli/session.py @@ -133,15 +133,17 @@ def __init__( messages.append(Message.assistant(RESUME_MESSAGE)) self.exchange.messages.extend(messages) - if len(self.exchange.messages) == 0 and plan: - self.setup_plan(plan=plan) + if len(self.exchange.messages) == 0: + # Show tips of the day for new sessions + random_tips = random.sample(TIPS, k=2) + formatted_tips = '\n '.join(random_tips) + print(f"Tips of the day:\n [yellow]{formatted_tips}[/yellow]") + + if plan: + self.setup_plan(plan=plan) self.prompt_session = GoosePromptSession.create_prompt_session() - # Show tip of the day - random_tips = random.sample(TIPS, k=2) - formatted_tips = '\n '.join(random_tips) - print(f"Tips of the day:\n [yellow]{formatted_tips}[/yellow]") def setup_plan(self, plan: dict) -> None: if len(self.exchange.messages):