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