Change chat loop
This commit is contained in:
@@ -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":
|
||||
|
||||
Reference in New Issue
Block a user