Change chat loop
This commit is contained in:
@@ -3,7 +3,8 @@ import ollama
|
|||||||
MODEL = "llama3.2:1b"
|
MODEL = "llama3.2:1b"
|
||||||
|
|
||||||
SYSTEM_PROMPT = """
|
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():
|
def run():
|
||||||
"""Runs a chat loop, keeping track of the conversation."""
|
"""Runs a chat loop, keeping track of the conversation."""
|
||||||
messages = [{"role": "system", "content": SYSTEM_PROMPT}]
|
messages = [
|
||||||
print("Good morning! Type 'quit' to exit.")
|
{"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:
|
while True:
|
||||||
user_input = input("\nYou: ")
|
user_input = input("\nYou: ")
|
||||||
if user_input.strip().lower() == "quit":
|
if user_input.strip().lower() == "quit":
|
||||||
|
|||||||
Reference in New Issue
Block a user