Merge pull request #935 from JohnMorrall/JohnMorrall/day4-illusion_of_memory

John morrall/day4 illusion of memory
This commit is contained in:
Ed Donner
2025-11-01 21:12:15 -04:00
committed by GitHub

View File

@@ -0,0 +1,12 @@
# python newbie, just playing around with creating the illusion of memory
from openai import OpenAI
openai=OpenAI()
message=[{"role":"system","content":"you are a sarcastic assistant"}]
while True:
userinput=input("Enter msg: ")
message.append({"role":"user","content":userinput})
response=openai.chat.completions.create(model="gpt-4.1-mini", messages=message)
print(response.choices[0].message.content)
message.append({"role":"assistant","content":response.choices[0].message.content})