Create week1day1.ipynb

My week 1 day 1 homework
This commit is contained in:
gunjansh-lab
2025-07-31 12:04:30 +05:30
committed by GitHub
parent 45d44d0352
commit 3657fe4d89

View File

@@ -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