From 5725e61d430e284ba7cc18abbd5ce6705c0c8fe4 Mon Sep 17 00:00:00 2001 From: CODEASOBI Date: Sun, 1 Dec 2024 02:44:14 +0000 Subject: [PATCH] feat: week1-day1-exercise --- oryx-build-commands.txt | 2 ++ week1/day1.ipynb | 19 +++++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 oryx-build-commands.txt diff --git a/oryx-build-commands.txt b/oryx-build-commands.txt new file mode 100644 index 0000000..d647bdf --- /dev/null +++ b/oryx-build-commands.txt @@ -0,0 +1,2 @@ +PlatformWithVersion=Python +BuildCommands=conda env create --file environment.yml --prefix ./venv --quiet diff --git a/week1/day1.ipynb b/week1/day1.ipynb index 4688043..ef961b1 100644 --- a/week1/day1.ipynb +++ b/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)" ] }, {