From 3657fe4d893a6e0a4be9cc22d5ec53db4509a5f0 Mon Sep 17 00:00:00 2001 From: gunjansh-lab Date: Thu, 31 Jul 2025 12:04:30 +0530 Subject: [PATCH] Create week1day1.ipynb My week 1 day 1 homework --- week1/community-contributions/week1day1.ipynb | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 week1/community-contributions/week1day1.ipynb diff --git a/week1/community-contributions/week1day1.ipynb b/week1/community-contributions/week1day1.ipynb new file mode 100644 index 0000000..66bdd23 --- /dev/null +++ b/week1/community-contributions/week1day1.ipynb @@ -0,0 +1,23 @@ +import os +import requests +from dotenv import load_dotenv +from bs4 import BeautifulSoup +from IPython.display import Markdown, display +from openai import OpenAI + +load_dotenv(override=True) +api_key = os.getenv('OPENAI_API_KEY') + +openai = OpenAI() + +client = OpenAI(api_key=os.getenv("OPENAI_API_key")) + +system_prompt = "You are an student. Always maintain a polite and professional tone." + +user_prompt = "Write a 500-word essay on the impact of social media on modern society, including the benefits and drawbacks." + +messages =[ + {"role": "system", "content": system_prompt}, + {"role": "user", "content": user_prompt} +] +response = openai.chat.completions.create(m