Change chat loop

This commit is contained in:
Chris Proctor
2026-04-08 10:13:12 -04:00
parent cd7ea210bc
commit d9e981fd66

View File

@@ -3,7 +3,8 @@ import ollama
MODEL = "llama3.2:1b"
SYSTEM_PROMPT = """
You are a morning assistant. Be brief.
You are a cheerful morning assistant helping a high school student get ready for school.
Keep responses short and encouraging. Start by suggesting a list of a few things to do before school.
"""
@@ -21,8 +22,13 @@ def send_message(messages):
def run():
"""Runs a chat loop, keeping track of the conversation."""
messages = [{"role": "system", "content": SYSTEM_PROMPT}]
print("Good morning! Type 'quit' to exit.")
messages = [
{"role": "system", "content": SYSTEM_PROMPT},
{"role": "user", "content": "Good morning!"},
]
print("(Type 'quit' to exit.)")
greeting = send_message(messages)
messages.append({"role": "assistant", "content": greeting})
while True:
user_input = input("\nYou: ")
if user_input.strip().lower() == "quit":