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": [
"# Step 1: Create your prompts\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",
" Lots of text\n",
" Can be pasted here\n",
" Please analyze the US stock NVDA and tell me if this is a good target to invest in 2025. \n",
"\"\"\"\n",
"\n",
"# Step 2: Make the messages list\n",
"\n",
"messages = [] # fill this in\n",
"\n",
"messages =[\n",
" {\"role\": \"system\", \"content\": system_prompt},\n",
" {\"role\": \"user\", \"content\": user_prompt}\n",
"]\n",
"# Step 3: Call OpenAI\n",
"\n",
"response =\n",
"\n",
"response = openai.chat.completions.create(\n",
" model = \"gpt-4o-mini\",\n",
" messages = messages\n",
" )\n",
"# Step 4: print the result\n",
"\n",
"print("
"print(response.choices[0].message.content)"
]
},
{

Loading…
Cancel
Save