From ea36361d692f8c40b1303f8669bb2658776b6d96 Mon Sep 17 00:00:00 2001 From: JohnM Date: Sat, 1 Nov 2025 13:51:19 +0000 Subject: [PATCH 1/2] Add day4-illusion_of_memory.py contribution --- .../day4-illusion_of_memory.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 week1/community-contributions/day4-illusion_of_memory.py diff --git a/week1/community-contributions/day4-illusion_of_memory.py b/week1/community-contributions/day4-illusion_of_memory.py new file mode 100644 index 0000000..0a57e10 --- /dev/null +++ b/week1/community-contributions/day4-illusion_of_memory.py @@ -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}) From 1f3f97d1b05c928bb2aebd25411928fe58335518 Mon Sep 17 00:00:00 2001 From: JohnM Date: Sat, 1 Nov 2025 14:05:17 +0000 Subject: [PATCH 2/2] Add John's basic memory illusion code --- week1/community-contributions/day4-illusion_of_memory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/week1/community-contributions/day4-illusion_of_memory.py b/week1/community-contributions/day4-illusion_of_memory.py index 0a57e10..9753691 100644 --- a/week1/community-contributions/day4-illusion_of_memory.py +++ b/week1/community-contributions/day4-illusion_of_memory.py @@ -1,4 +1,4 @@ -#python newbie, just playing around with creating the illusion of memory +# python newbie, just playing around with creating the illusion of memory from openai import OpenAI openai=OpenAI()