Browse Source

feat: week1-day1-exercise

pull/25/head
CODEASOBI 5 months ago
parent
commit
5725e61d43
  1. 2
      oryx-build-commands.txt
  2. 19
      week1/day1.ipynb

2
oryx-build-commands.txt

@ -0,0 +1,2 @@
PlatformWithVersion=Python
BuildCommands=conda env create --file environment.yml --prefix ./venv --quiet

19
week1/day1.ipynb

@ -425,23 +425,26 @@
"source": [ "source": [
"# Step 1: Create your prompts\n", "# Step 1: Create your prompts\n",
"\n", "\n",
"system_prompt = \"something here\"\n", "system_prompt = \"You are a professional data analyst and you will be given tasks to find insight of trend of some stocks. Using charts or columns might be easier for your customer for understanding\"\n",
"user_prompt = \"\"\"\n", "user_prompt = \"\"\"\n",
" Lots of text\n", " Please analyze the US stock NVDA and tell me if this is a good target to invest in 2025. \n",
" Can be pasted here\n",
"\"\"\"\n", "\"\"\"\n",
"\n", "\n",
"# Step 2: Make the messages list\n", "# Step 2: Make the messages list\n",
"\n", "\n",
"messages = [] # fill this in\n", "messages =[\n",
"\n", " {\"role\": \"system\", \"content\": system_prompt},\n",
" {\"role\": \"user\", \"content\": user_prompt}\n",
"]\n",
"# Step 3: Call OpenAI\n", "# Step 3: Call OpenAI\n",
"\n", "\n",
"response =\n", "response = openai.chat.completions.create(\n",
"\n", " model = \"gpt-4o-mini\",\n",
" messages = messages\n",
" )\n",
"# Step 4: print the result\n", "# Step 4: print the result\n",
"\n", "\n",
"print(" "print(response.choices[0].message.content)"
] ]
}, },
{ {

Loading…
Cancel
Save