HEHEBOIOG commited on
Commit
6195a3d
1 Parent(s): ce79e0c

Upload 3 files

Browse files
Files changed (3) hide show
  1. email_generator.ipynb +559 -0
  2. my_portfolio.csv +21 -0
  3. requirements.txt +9 -0
email_generator.ipynb ADDED
@@ -0,0 +1,559 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 1,
6
+ "id": "0eccd20e",
7
+ "metadata": {},
8
+ "outputs": [],
9
+ "source": [
10
+ "from langchain_groq import ChatGroq"
11
+ ]
12
+ },
13
+ {
14
+ "cell_type": "code",
15
+ "execution_count": 2,
16
+ "id": "c16ff50e",
17
+ "metadata": {},
18
+ "outputs": [
19
+ {
20
+ "ename": "AuthenticationError",
21
+ "evalue": "Error code: 401 - {'error': {'message': 'Invalid API Key', 'type': 'invalid_request_error', 'code': 'invalid_api_key'}}",
22
+ "output_type": "error",
23
+ "traceback": [
24
+ "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
25
+ "\u001b[1;31mAuthenticationError\u001b[0m Traceback (most recent call last)",
26
+ "Cell \u001b[1;32mIn[2], line 6\u001b[0m\n\u001b[0;32m 1\u001b[0m llm \u001b[38;5;241m=\u001b[39m ChatGroq(\n\u001b[0;32m 2\u001b[0m temperature\u001b[38;5;241m=\u001b[39m\u001b[38;5;241m0\u001b[39m, \n\u001b[0;32m 3\u001b[0m groq_api_key\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m'\u001b[39m\u001b[38;5;124mgsk_nPtJPIAE7Nh3VqfWIpzBWGdyb3FYkVwX3MOTaxY6F1SG9n2rodmy\u001b[39m\u001b[38;5;124m'\u001b[39m, \n\u001b[0;32m 4\u001b[0m model_name\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mllama-3.1-70b-versatile\u001b[39m\u001b[38;5;124m\"\u001b[39m\n\u001b[0;32m 5\u001b[0m )\n\u001b[1;32m----> 6\u001b[0m response \u001b[38;5;241m=\u001b[39m llm\u001b[38;5;241m.\u001b[39minvoke(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mThe first person to land on moon was ...\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[0;32m 7\u001b[0m \u001b[38;5;28mprint\u001b[39m(response\u001b[38;5;241m.\u001b[39mcontent)\n",
27
+ "File \u001b[1;32mc:\\Users\\haris\\anaconda3\\Lib\\site-packages\\langchain_core\\language_models\\chat_models.py:277\u001b[0m, in \u001b[0;36mBaseChatModel.invoke\u001b[1;34m(self, input, config, stop, **kwargs)\u001b[0m\n\u001b[0;32m 266\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21minvoke\u001b[39m(\n\u001b[0;32m 267\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[0;32m 268\u001b[0m \u001b[38;5;28minput\u001b[39m: LanguageModelInput,\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 272\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs: Any,\n\u001b[0;32m 273\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m BaseMessage:\n\u001b[0;32m 274\u001b[0m config \u001b[38;5;241m=\u001b[39m ensure_config(config)\n\u001b[0;32m 275\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m cast(\n\u001b[0;32m 276\u001b[0m ChatGeneration,\n\u001b[1;32m--> 277\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mgenerate_prompt(\n\u001b[0;32m 278\u001b[0m [\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_convert_input(\u001b[38;5;28minput\u001b[39m)],\n\u001b[0;32m 279\u001b[0m stop\u001b[38;5;241m=\u001b[39mstop,\n\u001b[0;32m 280\u001b[0m callbacks\u001b[38;5;241m=\u001b[39mconfig\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mcallbacks\u001b[39m\u001b[38;5;124m\"\u001b[39m),\n\u001b[0;32m 281\u001b[0m tags\u001b[38;5;241m=\u001b[39mconfig\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtags\u001b[39m\u001b[38;5;124m\"\u001b[39m),\n\u001b[0;32m 282\u001b[0m metadata\u001b[38;5;241m=\u001b[39mconfig\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmetadata\u001b[39m\u001b[38;5;124m\"\u001b[39m),\n\u001b[0;32m 283\u001b[0m run_name\u001b[38;5;241m=\u001b[39mconfig\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mrun_name\u001b[39m\u001b[38;5;124m\"\u001b[39m),\n\u001b[0;32m 284\u001b[0m run_id\u001b[38;5;241m=\u001b[39mconfig\u001b[38;5;241m.\u001b[39mpop(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mrun_id\u001b[39m\u001b[38;5;124m\"\u001b[39m, \u001b[38;5;28;01mNone\u001b[39;00m),\n\u001b[0;32m 285\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs,\n\u001b[0;32m 286\u001b[0m )\u001b[38;5;241m.\u001b[39mgenerations[\u001b[38;5;241m0\u001b[39m][\u001b[38;5;241m0\u001b[39m],\n\u001b[0;32m 287\u001b[0m )\u001b[38;5;241m.\u001b[39mmessage\n",
28
+ "File \u001b[1;32mc:\\Users\\haris\\anaconda3\\Lib\\site-packages\\langchain_core\\language_models\\chat_models.py:777\u001b[0m, in \u001b[0;36mBaseChatModel.generate_prompt\u001b[1;34m(self, prompts, stop, callbacks, **kwargs)\u001b[0m\n\u001b[0;32m 769\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mgenerate_prompt\u001b[39m(\n\u001b[0;32m 770\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[0;32m 771\u001b[0m prompts: List[PromptValue],\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 774\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs: Any,\n\u001b[0;32m 775\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m LLMResult:\n\u001b[0;32m 776\u001b[0m prompt_messages \u001b[38;5;241m=\u001b[39m [p\u001b[38;5;241m.\u001b[39mto_messages() \u001b[38;5;28;01mfor\u001b[39;00m p \u001b[38;5;129;01min\u001b[39;00m prompts]\n\u001b[1;32m--> 777\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mgenerate(prompt_messages, stop\u001b[38;5;241m=\u001b[39mstop, callbacks\u001b[38;5;241m=\u001b[39mcallbacks, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n",
29
+ "File \u001b[1;32mc:\\Users\\haris\\anaconda3\\Lib\\site-packages\\langchain_core\\language_models\\chat_models.py:634\u001b[0m, in \u001b[0;36mBaseChatModel.generate\u001b[1;34m(self, messages, stop, callbacks, tags, metadata, run_name, run_id, **kwargs)\u001b[0m\n\u001b[0;32m 632\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m run_managers:\n\u001b[0;32m 633\u001b[0m run_managers[i]\u001b[38;5;241m.\u001b[39mon_llm_error(e, response\u001b[38;5;241m=\u001b[39mLLMResult(generations\u001b[38;5;241m=\u001b[39m[]))\n\u001b[1;32m--> 634\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m e\n\u001b[0;32m 635\u001b[0m flattened_outputs \u001b[38;5;241m=\u001b[39m [\n\u001b[0;32m 636\u001b[0m LLMResult(generations\u001b[38;5;241m=\u001b[39m[res\u001b[38;5;241m.\u001b[39mgenerations], llm_output\u001b[38;5;241m=\u001b[39mres\u001b[38;5;241m.\u001b[39mllm_output) \u001b[38;5;66;03m# type: ignore[list-item]\u001b[39;00m\n\u001b[0;32m 637\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m res \u001b[38;5;129;01min\u001b[39;00m results\n\u001b[0;32m 638\u001b[0m ]\n\u001b[0;32m 639\u001b[0m llm_output \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_combine_llm_outputs([res\u001b[38;5;241m.\u001b[39mllm_output \u001b[38;5;28;01mfor\u001b[39;00m res \u001b[38;5;129;01min\u001b[39;00m results])\n",
30
+ "File \u001b[1;32mc:\\Users\\haris\\anaconda3\\Lib\\site-packages\\langchain_core\\language_models\\chat_models.py:624\u001b[0m, in \u001b[0;36mBaseChatModel.generate\u001b[1;34m(self, messages, stop, callbacks, tags, metadata, run_name, run_id, **kwargs)\u001b[0m\n\u001b[0;32m 621\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m i, m \u001b[38;5;129;01min\u001b[39;00m \u001b[38;5;28menumerate\u001b[39m(messages):\n\u001b[0;32m 622\u001b[0m \u001b[38;5;28;01mtry\u001b[39;00m:\n\u001b[0;32m 623\u001b[0m results\u001b[38;5;241m.\u001b[39mappend(\n\u001b[1;32m--> 624\u001b[0m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_generate_with_cache(\n\u001b[0;32m 625\u001b[0m m,\n\u001b[0;32m 626\u001b[0m stop\u001b[38;5;241m=\u001b[39mstop,\n\u001b[0;32m 627\u001b[0m run_manager\u001b[38;5;241m=\u001b[39mrun_managers[i] \u001b[38;5;28;01mif\u001b[39;00m run_managers \u001b[38;5;28;01melse\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[0;32m 628\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs,\n\u001b[0;32m 629\u001b[0m )\n\u001b[0;32m 630\u001b[0m )\n\u001b[0;32m 631\u001b[0m \u001b[38;5;28;01mexcept\u001b[39;00m \u001b[38;5;167;01mBaseException\u001b[39;00m \u001b[38;5;28;01mas\u001b[39;00m e:\n\u001b[0;32m 632\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m run_managers:\n",
31
+ "File \u001b[1;32mc:\\Users\\haris\\anaconda3\\Lib\\site-packages\\langchain_core\\language_models\\chat_models.py:846\u001b[0m, in \u001b[0;36mBaseChatModel._generate_with_cache\u001b[1;34m(self, messages, stop, run_manager, **kwargs)\u001b[0m\n\u001b[0;32m 844\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m 845\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m inspect\u001b[38;5;241m.\u001b[39msignature(\u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_generate)\u001b[38;5;241m.\u001b[39mparameters\u001b[38;5;241m.\u001b[39mget(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mrun_manager\u001b[39m\u001b[38;5;124m\"\u001b[39m):\n\u001b[1;32m--> 846\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_generate(\n\u001b[0;32m 847\u001b[0m messages, stop\u001b[38;5;241m=\u001b[39mstop, run_manager\u001b[38;5;241m=\u001b[39mrun_manager, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs\n\u001b[0;32m 848\u001b[0m )\n\u001b[0;32m 849\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m 850\u001b[0m result \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_generate(messages, stop\u001b[38;5;241m=\u001b[39mstop, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs)\n",
32
+ "File \u001b[1;32mc:\\Users\\haris\\anaconda3\\Lib\\site-packages\\langchain_groq\\chat_models.py:472\u001b[0m, in \u001b[0;36mChatGroq._generate\u001b[1;34m(self, messages, stop, run_manager, **kwargs)\u001b[0m\n\u001b[0;32m 467\u001b[0m message_dicts, params \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_create_message_dicts(messages, stop)\n\u001b[0;32m 468\u001b[0m params \u001b[38;5;241m=\u001b[39m {\n\u001b[0;32m 469\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mparams,\n\u001b[0;32m 470\u001b[0m \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mkwargs,\n\u001b[0;32m 471\u001b[0m }\n\u001b[1;32m--> 472\u001b[0m response \u001b[38;5;241m=\u001b[39m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mclient\u001b[38;5;241m.\u001b[39mcreate(messages\u001b[38;5;241m=\u001b[39mmessage_dicts, \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39mparams)\n\u001b[0;32m 473\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_create_chat_result(response)\n",
33
+ "File \u001b[1;32mc:\\Users\\haris\\anaconda3\\Lib\\site-packages\\groq\\resources\\chat\\completions.py:298\u001b[0m, in \u001b[0;36mCompletions.create\u001b[1;34m(self, messages, model, frequency_penalty, function_call, functions, logit_bias, logprobs, max_tokens, n, parallel_tool_calls, presence_penalty, response_format, seed, stop, stream, temperature, tool_choice, tools, top_logprobs, top_p, user, extra_headers, extra_query, extra_body, timeout)\u001b[0m\n\u001b[0;32m 157\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mcreate\u001b[39m(\n\u001b[0;32m 158\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[0;32m 159\u001b[0m \u001b[38;5;241m*\u001b[39m,\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 186\u001b[0m timeout: \u001b[38;5;28mfloat\u001b[39m \u001b[38;5;241m|\u001b[39m httpx\u001b[38;5;241m.\u001b[39mTimeout \u001b[38;5;241m|\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;241m|\u001b[39m NotGiven \u001b[38;5;241m=\u001b[39m NOT_GIVEN,\n\u001b[0;32m 187\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m ChatCompletion \u001b[38;5;241m|\u001b[39m Stream[ChatCompletionChunk]:\n\u001b[0;32m 188\u001b[0m \u001b[38;5;250m \u001b[39m\u001b[38;5;124;03m\"\"\"\u001b[39;00m\n\u001b[0;32m 189\u001b[0m \u001b[38;5;124;03m Creates a model response for the given chat conversation.\u001b[39;00m\n\u001b[0;32m 190\u001b[0m \n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 296\u001b[0m \u001b[38;5;124;03m timeout: Override the client-level default timeout for this request, in seconds\u001b[39;00m\n\u001b[0;32m 297\u001b[0m \u001b[38;5;124;03m \"\"\"\u001b[39;00m\n\u001b[1;32m--> 298\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_post(\n\u001b[0;32m 299\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124m/openai/v1/chat/completions\u001b[39m\u001b[38;5;124m\"\u001b[39m,\n\u001b[0;32m 300\u001b[0m body\u001b[38;5;241m=\u001b[39mmaybe_transform(\n\u001b[0;32m 301\u001b[0m {\n\u001b[0;32m 302\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmessages\u001b[39m\u001b[38;5;124m\"\u001b[39m: messages,\n\u001b[0;32m 303\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmodel\u001b[39m\u001b[38;5;124m\"\u001b[39m: model,\n\u001b[0;32m 304\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfrequency_penalty\u001b[39m\u001b[38;5;124m\"\u001b[39m: frequency_penalty,\n\u001b[0;32m 305\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfunction_call\u001b[39m\u001b[38;5;124m\"\u001b[39m: function_call,\n\u001b[0;32m 306\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mfunctions\u001b[39m\u001b[38;5;124m\"\u001b[39m: functions,\n\u001b[0;32m 307\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mlogit_bias\u001b[39m\u001b[38;5;124m\"\u001b[39m: logit_bias,\n\u001b[0;32m 308\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mlogprobs\u001b[39m\u001b[38;5;124m\"\u001b[39m: logprobs,\n\u001b[0;32m 309\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mmax_tokens\u001b[39m\u001b[38;5;124m\"\u001b[39m: max_tokens,\n\u001b[0;32m 310\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mn\u001b[39m\u001b[38;5;124m\"\u001b[39m: n,\n\u001b[0;32m 311\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mparallel_tool_calls\u001b[39m\u001b[38;5;124m\"\u001b[39m: parallel_tool_calls,\n\u001b[0;32m 312\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mpresence_penalty\u001b[39m\u001b[38;5;124m\"\u001b[39m: presence_penalty,\n\u001b[0;32m 313\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mresponse_format\u001b[39m\u001b[38;5;124m\"\u001b[39m: response_format,\n\u001b[0;32m 314\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mseed\u001b[39m\u001b[38;5;124m\"\u001b[39m: seed,\n\u001b[0;32m 315\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mstop\u001b[39m\u001b[38;5;124m\"\u001b[39m: stop,\n\u001b[0;32m 316\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mstream\u001b[39m\u001b[38;5;124m\"\u001b[39m: stream,\n\u001b[0;32m 317\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtemperature\u001b[39m\u001b[38;5;124m\"\u001b[39m: temperature,\n\u001b[0;32m 318\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtool_choice\u001b[39m\u001b[38;5;124m\"\u001b[39m: tool_choice,\n\u001b[0;32m 319\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtools\u001b[39m\u001b[38;5;124m\"\u001b[39m: tools,\n\u001b[0;32m 320\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtop_logprobs\u001b[39m\u001b[38;5;124m\"\u001b[39m: top_logprobs,\n\u001b[0;32m 321\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mtop_p\u001b[39m\u001b[38;5;124m\"\u001b[39m: top_p,\n\u001b[0;32m 322\u001b[0m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124muser\u001b[39m\u001b[38;5;124m\"\u001b[39m: user,\n\u001b[0;32m 323\u001b[0m },\n\u001b[0;32m 324\u001b[0m completion_create_params\u001b[38;5;241m.\u001b[39mCompletionCreateParams,\n\u001b[0;32m 325\u001b[0m ),\n\u001b[0;32m 326\u001b[0m options\u001b[38;5;241m=\u001b[39mmake_request_options(\n\u001b[0;32m 327\u001b[0m extra_headers\u001b[38;5;241m=\u001b[39mextra_headers, extra_query\u001b[38;5;241m=\u001b[39mextra_query, extra_body\u001b[38;5;241m=\u001b[39mextra_body, timeout\u001b[38;5;241m=\u001b[39mtimeout\n\u001b[0;32m 328\u001b[0m ),\n\u001b[0;32m 329\u001b[0m cast_to\u001b[38;5;241m=\u001b[39mChatCompletion,\n\u001b[0;32m 330\u001b[0m stream\u001b[38;5;241m=\u001b[39mstream \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;28;01mFalse\u001b[39;00m,\n\u001b[0;32m 331\u001b[0m stream_cls\u001b[38;5;241m=\u001b[39mStream[ChatCompletionChunk],\n\u001b[0;32m 332\u001b[0m )\n",
34
+ "File \u001b[1;32mc:\\Users\\haris\\anaconda3\\Lib\\site-packages\\groq\\_base_client.py:1263\u001b[0m, in \u001b[0;36mSyncAPIClient.post\u001b[1;34m(self, path, cast_to, body, options, files, stream, stream_cls)\u001b[0m\n\u001b[0;32m 1249\u001b[0m \u001b[38;5;28;01mdef\u001b[39;00m \u001b[38;5;21mpost\u001b[39m(\n\u001b[0;32m 1250\u001b[0m \u001b[38;5;28mself\u001b[39m,\n\u001b[0;32m 1251\u001b[0m path: \u001b[38;5;28mstr\u001b[39m,\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 1258\u001b[0m stream_cls: \u001b[38;5;28mtype\u001b[39m[_StreamT] \u001b[38;5;241m|\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m \u001b[38;5;241m=\u001b[39m \u001b[38;5;28;01mNone\u001b[39;00m,\n\u001b[0;32m 1259\u001b[0m ) \u001b[38;5;241m-\u001b[39m\u001b[38;5;241m>\u001b[39m ResponseT \u001b[38;5;241m|\u001b[39m _StreamT:\n\u001b[0;32m 1260\u001b[0m opts \u001b[38;5;241m=\u001b[39m FinalRequestOptions\u001b[38;5;241m.\u001b[39mconstruct(\n\u001b[0;32m 1261\u001b[0m method\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mpost\u001b[39m\u001b[38;5;124m\"\u001b[39m, url\u001b[38;5;241m=\u001b[39mpath, json_data\u001b[38;5;241m=\u001b[39mbody, files\u001b[38;5;241m=\u001b[39mto_httpx_files(files), \u001b[38;5;241m*\u001b[39m\u001b[38;5;241m*\u001b[39moptions\n\u001b[0;32m 1262\u001b[0m )\n\u001b[1;32m-> 1263\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m cast(ResponseT, \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39mrequest(cast_to, opts, stream\u001b[38;5;241m=\u001b[39mstream, stream_cls\u001b[38;5;241m=\u001b[39mstream_cls))\n",
35
+ "File \u001b[1;32mc:\\Users\\haris\\anaconda3\\Lib\\site-packages\\groq\\_base_client.py:955\u001b[0m, in \u001b[0;36mSyncAPIClient.request\u001b[1;34m(self, cast_to, options, remaining_retries, stream, stream_cls)\u001b[0m\n\u001b[0;32m 952\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[0;32m 953\u001b[0m retries_taken \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m0\u001b[39m\n\u001b[1;32m--> 955\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_request(\n\u001b[0;32m 956\u001b[0m cast_to\u001b[38;5;241m=\u001b[39mcast_to,\n\u001b[0;32m 957\u001b[0m options\u001b[38;5;241m=\u001b[39moptions,\n\u001b[0;32m 958\u001b[0m stream\u001b[38;5;241m=\u001b[39mstream,\n\u001b[0;32m 959\u001b[0m stream_cls\u001b[38;5;241m=\u001b[39mstream_cls,\n\u001b[0;32m 960\u001b[0m retries_taken\u001b[38;5;241m=\u001b[39mretries_taken,\n\u001b[0;32m 961\u001b[0m )\n",
36
+ "File \u001b[1;32mc:\\Users\\haris\\anaconda3\\Lib\\site-packages\\groq\\_base_client.py:1058\u001b[0m, in \u001b[0;36mSyncAPIClient._request\u001b[1;34m(self, cast_to, options, retries_taken, stream, stream_cls)\u001b[0m\n\u001b[0;32m 1055\u001b[0m err\u001b[38;5;241m.\u001b[39mresponse\u001b[38;5;241m.\u001b[39mread()\n\u001b[0;32m 1057\u001b[0m log\u001b[38;5;241m.\u001b[39mdebug(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mRe-raising status error\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m-> 1058\u001b[0m \u001b[38;5;28;01mraise\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_make_status_error_from_response(err\u001b[38;5;241m.\u001b[39mresponse) \u001b[38;5;28;01mfrom\u001b[39;00m \u001b[38;5;28;01mNone\u001b[39;00m\n\u001b[0;32m 1060\u001b[0m \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[38;5;28mself\u001b[39m\u001b[38;5;241m.\u001b[39m_process_response(\n\u001b[0;32m 1061\u001b[0m cast_to\u001b[38;5;241m=\u001b[39mcast_to,\n\u001b[0;32m 1062\u001b[0m options\u001b[38;5;241m=\u001b[39moptions,\n\u001b[1;32m (...)\u001b[0m\n\u001b[0;32m 1066\u001b[0m retries_taken\u001b[38;5;241m=\u001b[39mretries_taken,\n\u001b[0;32m 1067\u001b[0m )\n",
37
+ "\u001b[1;31mAuthenticationError\u001b[0m: Error code: 401 - {'error': {'message': 'Invalid API Key', 'type': 'invalid_request_error', 'code': 'invalid_api_key'}}"
38
+ ]
39
+ }
40
+ ],
41
+ "source": [
42
+ "llm = ChatGroq(\n",
43
+ " temperature=0, \n",
44
+ " groq_api_key='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', \n",
45
+ " model_name=\"llama-3.1-70b-versatile\"\n",
46
+ ")\n",
47
+ "response = llm.invoke(\"The first person to land on moon was ...\")\n",
48
+ "print(response.content)"
49
+ ]
50
+ },
51
+ {
52
+ "cell_type": "code",
53
+ "execution_count": 3,
54
+ "id": "90d33612",
55
+ "metadata": {},
56
+ "outputs": [
57
+ {
58
+ "name": "stderr",
59
+ "output_type": "stream",
60
+ "text": [
61
+ "USER_AGENT environment variable not set, consider setting it to identify your requests.\n"
62
+ ]
63
+ },
64
+ {
65
+ "name": "stdout",
66
+ "output_type": "stream",
67
+ "text": [
68
+ "Apply for Software Engineer II, AI/ML Platforms\n",
69
+ "\n",
70
+ "Search JobsSkip navigationSearch JobsNIKE, INC. JOBSContract JobsJoin The Talent CommunityLife @ NikeOverviewBenefitsBrandsOverviewJordanConverseTeamsOverviewAdministrative SupportAdvanced InnovationAir Manufacturing InnovationAviationCommunicationsCustomer ServiceDesignDigitalFacilitiesFinance & AccountingGovernment & Public AffairsHuman ResourcesInsights & AnalyticsLegalManufacturing & EngineeringMarketingMerchandisingPlanningPrivacyProcurementProduct Creation, Development & ManagementRetail CorporateRetail StoresSalesSocial & Community ImpactSports MarketingStrategic PlanningSupply Chain, Distribution & LogisticsSustainabilityTechnologyLocationsOverviewNike WHQNike New York HQEHQ: Hilversum, The NetherlandsELC: Laakdal, BelgiumGreater China HQDiversity, Equity & InclusionOverviewMilitary InclusionDisability InclusionIndigenous InclusionInternshipsTechnologySoftware Engineer II, AI/ML PlatformsBeaverton, OregonBecome a Part of the NIKE, Inc. TeamNIKE, Inc. does more than outfit the world’s best athletes. It is a place to explore potential, obliterate boundaries and push out the edges of what can be. The company looks for people who can grow, think, dream and create. Its culture thrives by embracing diversity and rewarding imagination. The brand seeks achievers, leaders and visionaries. At NIKE, Inc. it’s about each person bringing skills and passion to a challenging and constantly evolving game.NIKE is a technology company. From our flagship website and five-star mobile apps to developing products, managing big data and providing leading edge engineering and systems support, our teams at NIKE Global Technology exist to revolutionize the future at the confluence of tech and sport. We invest and develop advances in technology and employ the most creative people in the world, and then give them the support to constantly innovate, iterate and serve consumers more directly and personally.  Our teams are innovative, diverse, multidisciplinary and collaborative, taking technology into the future and bringing the world with it.WHO WE ARE LOOKING FORWe are looking for a Software Engineer II to design and implement core components of our data science services and platform and scale it to serve Nike globally. The focus of this engineer will be at the intersection of computer systems and machine learning. You will also work collaboratively with the data science and analytics teams to ship scalable, performant and reliable solutions.WHAT YOU WILL WORK ONAs a Software Engineer in AI/ML Platforms, you will be part of a fast-paced engineering team developing services and platform that drive AI/ML at Nike. AI/ML is used in Nike to accelerate its digital transformation and real-time data-based decision-making capabilities. The focus is to leverage AI/ML technology to improve the user experience by using personalization, recommendation, smart search, digital demand sensing and scheduling techniques. These enhancements will be used to power consumer experiences on nike.com, Nike App, Nike SNKRS App as well as product innovation, supply chain, and logistics.This Software Engineer will develop and/or implement services and paved-path solutions to enable data scientists and ML engineers at Nike. These services will enable and accelerate model training, model serving and model management. Additionally, they will evaluate new AI/ML platform services and capabilities for possible long-term approaches, and work with the user community to anticipate services and platform needs required to support algorithm development, model training, model management, data engineering and model serving. Lastly, they will advance and improve development practices with the engineering team through participation in architecture, technical design and code reviewsWHO YOU WILL WORK WITHYou'll be working with Data Scientists, ML Engineers and Product teams to identify and deliver platform capabilities to accelerate and streamline the delivery and maintenance of ML use cases. Additionally, you’ll work with teams integrating ML capabilities into Nike experiences and business applications. This position reports to the Director of AI/ML Tech Platforms.WHAT YOU BRINGBachelor's degree in Computer Science, Engineering, Information Systems, or similar field or relevant professional experience, education, and training.Strong Computer Science fundamentals2+ years professional software development experienceProgramming experience with at least one modern language such as Java, Python, GolangExperience with Infrastructure as Code / DevOps practices and technologies like TerraformExperience with Cloud services (e.g. AWS Cloud EC2, S3, DynamoDB, Azure Cloud, etc.)Experience developing and using microservicesExcellent written and oral communication skills on both technical and non-technical topicsNIKE, Inc. is a growth company that looks for team members to grow with it. Nike offers a generous total rewards package, casual work environment, a diverse and inclusive culture, and an electric atmosphere for professional development. No matter the location, or the role, every Nike employee shares one galvanizing mission: To bring inspiration and innovation to every athlete* in the world.NIKE, Inc. is committed to employing a diverse workforce. Qualified applicants will receive consideration without regard to race, color, religion, sex, national origin, age, sexual orientation, gender identity, gender expression, veteran status, or disability.How We HireAt NIKE, Inc. we promise to provide a premium, inclusive, compelling and authentic candidate experience. Delivering on this promise means we allow you to be at your best — and to do that, you need to understand how the hiring process works. Transparency is key.\r\n",
71
+ "\r\n",
72
+ "* This overview explains our hiring process for corporate roles. Note there may be different hiring steps involved for non-corporate roles.Start nowBenefitsWhether it’s transportation or financial health, we continually invest in our employees to help them achieve greatness — inside and outside of work. All who work here should be able to realize their full potential.Employee Assistance ProgramEmployee Stock Purchase Plan (ESPP)HolidaysMedical PlanPaid Time Off (PTO)Product DiscountsSabbaticalsLearn moreGIFT CARDSPROMOTIONSFIND A STORESIGN UP FOR EMAILBECOME A MEMBERNIKE JOURNALSEND US FEEDBACKGET HELPGET HELPOrder StatusShipping and DeliveryReturnsPayment OptionsGift Cards BalanceContact UsABOUT NIKEABOUT NIKENewsCareersInvestorsPurposeSustainabilityUnited States© 2024 Nike, Inc. All Rights ReservedGuidesNike AdaptNike Air MaxNike FlyleatherNike ReactSpace HippieNike AirNike FlyEaseNike Free Nike VaporflyNike Air Force 1 Nike FlyknitNike JoyrideNike ZoomXTerms of SaleTerms of UseNike Privacy PolicyYour Privacy ChoicesCA Supply Chain Act\n"
73
+ ]
74
+ }
75
+ ],
76
+ "source": [
77
+ "from langchain_community.document_loaders import WebBaseLoader\n",
78
+ "\n",
79
+ "loader = WebBaseLoader(\"https://jobs.nike.com/job/R-33460\")\n",
80
+ "page_data = loader.load().pop().page_content\n",
81
+ "print(page_data)"
82
+ ]
83
+ },
84
+ {
85
+ "cell_type": "code",
86
+ "execution_count": 5,
87
+ "id": "85c89a57",
88
+ "metadata": {},
89
+ "outputs": [
90
+ {
91
+ "data": {
92
+ "text/plain": [
93
+ "str"
94
+ ]
95
+ },
96
+ "execution_count": 5,
97
+ "metadata": {},
98
+ "output_type": "execute_result"
99
+ }
100
+ ],
101
+ "source": [
102
+ "from langchain_core.prompts import PromptTemplate\n",
103
+ "\n",
104
+ "prompt_extract = PromptTemplate.from_template(\n",
105
+ " \"\"\"\n",
106
+ " ### SCRAPED TEXT FROM WEBSITE:\n",
107
+ " {page_data}\n",
108
+ " ### INSTRUCTION:\n",
109
+ " The scraped text is from the career's page of a website.\n",
110
+ " Your job is to extract the job postings and return them in JSON format containing the \n",
111
+ " following keys: `role`, `experience`, `skills` and `description`.\n",
112
+ " Only return the valid JSON.\n",
113
+ " ### VALID JSON (NO PREAMBLE): \n",
114
+ " \"\"\"\n",
115
+ ")\n",
116
+ "\n",
117
+ "chain_extract = prompt_extract | llm \n",
118
+ "res = chain_extract.invoke(input={'page_data':page_data})\n",
119
+ "type(res.content)"
120
+ ]
121
+ },
122
+ {
123
+ "cell_type": "code",
124
+ "execution_count": 6,
125
+ "id": "5415fd54",
126
+ "metadata": {},
127
+ "outputs": [
128
+ {
129
+ "data": {
130
+ "text/plain": [
131
+ "{'role': 'Software Engineer II, AI/ML Platforms',\n",
132
+ " 'experience': '2+ years professional software development experience',\n",
133
+ " 'skills': ['Strong Computer Science fundamentals',\n",
134
+ " 'Programming experience with at least one modern language such as Java, Python, Golang',\n",
135
+ " 'Experience with Infrastructure as Code / DevOps practices and technologies like Terraform',\n",
136
+ " 'Experience with Cloud services (e.g. AWS Cloud EC2, S3, DynamoDB, Azure Cloud, etc.)',\n",
137
+ " 'Experience developing and using microservices'],\n",
138
+ " 'description': 'We are looking for a Software Engineer II to design and implement core components of our data science services and platform and scale it to serve Nike globally. The focus of this engineer will be at the intersection of computer systems and machine learning. You will also work collaboratively with the data science and analytics teams to ship scalable, performant and reliable solutions.'}"
139
+ ]
140
+ },
141
+ "execution_count": 6,
142
+ "metadata": {},
143
+ "output_type": "execute_result"
144
+ }
145
+ ],
146
+ "source": [
147
+ "from langchain_core.output_parsers import JsonOutputParser\n",
148
+ "\n",
149
+ "json_parser = JsonOutputParser()\n",
150
+ "json_res = json_parser.parse(res.content)\n",
151
+ "json_res"
152
+ ]
153
+ },
154
+ {
155
+ "cell_type": "code",
156
+ "execution_count": 7,
157
+ "id": "39961ed6",
158
+ "metadata": {},
159
+ "outputs": [
160
+ {
161
+ "data": {
162
+ "text/plain": [
163
+ "dict"
164
+ ]
165
+ },
166
+ "execution_count": 7,
167
+ "metadata": {},
168
+ "output_type": "execute_result"
169
+ }
170
+ ],
171
+ "source": [
172
+ "type(json_res)"
173
+ ]
174
+ },
175
+ {
176
+ "cell_type": "code",
177
+ "execution_count": 8,
178
+ "id": "1e8a0f74",
179
+ "metadata": {},
180
+ "outputs": [
181
+ {
182
+ "data": {
183
+ "text/html": [
184
+ "<div>\n",
185
+ "<style scoped>\n",
186
+ " .dataframe tbody tr th:only-of-type {\n",
187
+ " vertical-align: middle;\n",
188
+ " }\n",
189
+ "\n",
190
+ " .dataframe tbody tr th {\n",
191
+ " vertical-align: top;\n",
192
+ " }\n",
193
+ "\n",
194
+ " .dataframe thead th {\n",
195
+ " text-align: right;\n",
196
+ " }\n",
197
+ "</style>\n",
198
+ "<table border=\"1\" class=\"dataframe\">\n",
199
+ " <thead>\n",
200
+ " <tr style=\"text-align: right;\">\n",
201
+ " <th></th>\n",
202
+ " <th>Techstack</th>\n",
203
+ " <th>Links</th>\n",
204
+ " </tr>\n",
205
+ " </thead>\n",
206
+ " <tbody>\n",
207
+ " <tr>\n",
208
+ " <th>0</th>\n",
209
+ " <td>React, Node.js, MongoDB</td>\n",
210
+ " <td>https://example.com/react-portfolio</td>\n",
211
+ " </tr>\n",
212
+ " <tr>\n",
213
+ " <th>1</th>\n",
214
+ " <td>Angular,.NET, SQL Server</td>\n",
215
+ " <td>https://example.com/angular-portfolio</td>\n",
216
+ " </tr>\n",
217
+ " <tr>\n",
218
+ " <th>2</th>\n",
219
+ " <td>Vue.js, Ruby on Rails, PostgreSQL</td>\n",
220
+ " <td>https://example.com/vue-portfolio</td>\n",
221
+ " </tr>\n",
222
+ " <tr>\n",
223
+ " <th>3</th>\n",
224
+ " <td>Python, Django, MySQL</td>\n",
225
+ " <td>https://example.com/python-portfolio</td>\n",
226
+ " </tr>\n",
227
+ " <tr>\n",
228
+ " <th>4</th>\n",
229
+ " <td>Java, Spring Boot, Oracle</td>\n",
230
+ " <td>https://example.com/java-portfolio</td>\n",
231
+ " </tr>\n",
232
+ " <tr>\n",
233
+ " <th>5</th>\n",
234
+ " <td>Flutter, Firebase, GraphQL</td>\n",
235
+ " <td>https://example.com/flutter-portfolio</td>\n",
236
+ " </tr>\n",
237
+ " <tr>\n",
238
+ " <th>6</th>\n",
239
+ " <td>WordPress, PHP, MySQL</td>\n",
240
+ " <td>https://example.com/wordpress-portfolio</td>\n",
241
+ " </tr>\n",
242
+ " <tr>\n",
243
+ " <th>7</th>\n",
244
+ " <td>Magento, PHP, MySQL</td>\n",
245
+ " <td>https://example.com/magento-portfolio</td>\n",
246
+ " </tr>\n",
247
+ " <tr>\n",
248
+ " <th>8</th>\n",
249
+ " <td>React Native, Node.js, MongoDB</td>\n",
250
+ " <td>https://example.com/react-native-portfolio</td>\n",
251
+ " </tr>\n",
252
+ " <tr>\n",
253
+ " <th>9</th>\n",
254
+ " <td>iOS, Swift, Core Data</td>\n",
255
+ " <td>https://example.com/ios-portfolio</td>\n",
256
+ " </tr>\n",
257
+ " <tr>\n",
258
+ " <th>10</th>\n",
259
+ " <td>Android, Java, Room Persistence</td>\n",
260
+ " <td>https://example.com/android-portfolio</td>\n",
261
+ " </tr>\n",
262
+ " <tr>\n",
263
+ " <th>11</th>\n",
264
+ " <td>Kotlin, Android, Firebase</td>\n",
265
+ " <td>https://example.com/kotlin-android-portfolio</td>\n",
266
+ " </tr>\n",
267
+ " <tr>\n",
268
+ " <th>12</th>\n",
269
+ " <td>Android TV, Kotlin, Android NDK</td>\n",
270
+ " <td>https://example.com/android-tv-portfolio</td>\n",
271
+ " </tr>\n",
272
+ " <tr>\n",
273
+ " <th>13</th>\n",
274
+ " <td>iOS, Swift, ARKit</td>\n",
275
+ " <td>https://example.com/ios-ar-portfolio</td>\n",
276
+ " </tr>\n",
277
+ " <tr>\n",
278
+ " <th>14</th>\n",
279
+ " <td>Cross-platform, Xamarin, Azure</td>\n",
280
+ " <td>https://example.com/xamarin-portfolio</td>\n",
281
+ " </tr>\n",
282
+ " <tr>\n",
283
+ " <th>15</th>\n",
284
+ " <td>Backend, Kotlin, Spring Boot</td>\n",
285
+ " <td>https://example.com/kotlin-backend-portfolio</td>\n",
286
+ " </tr>\n",
287
+ " <tr>\n",
288
+ " <th>16</th>\n",
289
+ " <td>Frontend, TypeScript, Angular</td>\n",
290
+ " <td>https://example.com/typescript-frontend-portfolio</td>\n",
291
+ " </tr>\n",
292
+ " <tr>\n",
293
+ " <th>17</th>\n",
294
+ " <td>Full-stack, JavaScript, Express.js</td>\n",
295
+ " <td>https://example.com/full-stack-js-portfolio</td>\n",
296
+ " </tr>\n",
297
+ " <tr>\n",
298
+ " <th>18</th>\n",
299
+ " <td>Machine Learning, Python, TensorFlow</td>\n",
300
+ " <td>https://example.com/ml-python-portfolio</td>\n",
301
+ " </tr>\n",
302
+ " <tr>\n",
303
+ " <th>19</th>\n",
304
+ " <td>DevOps, Jenkins, Docker</td>\n",
305
+ " <td>https://example.com/devops-portfolio</td>\n",
306
+ " </tr>\n",
307
+ " </tbody>\n",
308
+ "</table>\n",
309
+ "</div>"
310
+ ],
311
+ "text/plain": [
312
+ " Techstack \\\n",
313
+ "0 React, Node.js, MongoDB \n",
314
+ "1 Angular,.NET, SQL Server \n",
315
+ "2 Vue.js, Ruby on Rails, PostgreSQL \n",
316
+ "3 Python, Django, MySQL \n",
317
+ "4 Java, Spring Boot, Oracle \n",
318
+ "5 Flutter, Firebase, GraphQL \n",
319
+ "6 WordPress, PHP, MySQL \n",
320
+ "7 Magento, PHP, MySQL \n",
321
+ "8 React Native, Node.js, MongoDB \n",
322
+ "9 iOS, Swift, Core Data \n",
323
+ "10 Android, Java, Room Persistence \n",
324
+ "11 Kotlin, Android, Firebase \n",
325
+ "12 Android TV, Kotlin, Android NDK \n",
326
+ "13 iOS, Swift, ARKit \n",
327
+ "14 Cross-platform, Xamarin, Azure \n",
328
+ "15 Backend, Kotlin, Spring Boot \n",
329
+ "16 Frontend, TypeScript, Angular \n",
330
+ "17 Full-stack, JavaScript, Express.js \n",
331
+ "18 Machine Learning, Python, TensorFlow \n",
332
+ "19 DevOps, Jenkins, Docker \n",
333
+ "\n",
334
+ " Links \n",
335
+ "0 https://example.com/react-portfolio \n",
336
+ "1 https://example.com/angular-portfolio \n",
337
+ "2 https://example.com/vue-portfolio \n",
338
+ "3 https://example.com/python-portfolio \n",
339
+ "4 https://example.com/java-portfolio \n",
340
+ "5 https://example.com/flutter-portfolio \n",
341
+ "6 https://example.com/wordpress-portfolio \n",
342
+ "7 https://example.com/magento-portfolio \n",
343
+ "8 https://example.com/react-native-portfolio \n",
344
+ "9 https://example.com/ios-portfolio \n",
345
+ "10 https://example.com/android-portfolio \n",
346
+ "11 https://example.com/kotlin-android-portfolio \n",
347
+ "12 https://example.com/android-tv-portfolio \n",
348
+ "13 https://example.com/ios-ar-portfolio \n",
349
+ "14 https://example.com/xamarin-portfolio \n",
350
+ "15 https://example.com/kotlin-backend-portfolio \n",
351
+ "16 https://example.com/typescript-frontend-portfolio \n",
352
+ "17 https://example.com/full-stack-js-portfolio \n",
353
+ "18 https://example.com/ml-python-portfolio \n",
354
+ "19 https://example.com/devops-portfolio "
355
+ ]
356
+ },
357
+ "execution_count": 8,
358
+ "metadata": {},
359
+ "output_type": "execute_result"
360
+ }
361
+ ],
362
+ "source": [
363
+ "import pandas as pd\n",
364
+ "\n",
365
+ "df = pd.read_csv(\"my_portfolio.csv\")\n",
366
+ "df"
367
+ ]
368
+ },
369
+ {
370
+ "cell_type": "code",
371
+ "execution_count": 10,
372
+ "id": "f7e888d4",
373
+ "metadata": {},
374
+ "outputs": [],
375
+ "source": [
376
+ "import uuid\n",
377
+ "import chromadb\n",
378
+ "\n",
379
+ "client = chromadb.PersistentClient('vectorstore')\n",
380
+ "collection = client.get_or_create_collection(name=\"portfolio\")\n",
381
+ "\n",
382
+ "if not collection.count():\n",
383
+ " for _, row in df.iterrows():\n",
384
+ " collection.add(documents=row[\"Techstack\"],\n",
385
+ " metadatas={\"links\": row[\"Links\"]},\n",
386
+ " ids=[str(uuid.uuid4())])"
387
+ ]
388
+ },
389
+ {
390
+ "cell_type": "code",
391
+ "execution_count": 14,
392
+ "id": "39ad2fa2",
393
+ "metadata": {},
394
+ "outputs": [
395
+ {
396
+ "data": {
397
+ "text/plain": [
398
+ "[[{'links': 'https://example.com/ml-python-portfolio'},\n",
399
+ " {'links': 'https://example.com/magento-portfolio'}],\n",
400
+ " [{'links': 'https://example.com/ml-python-portfolio'},\n",
401
+ " {'links': 'https://example.com/python-portfolio'}],\n",
402
+ " [{'links': 'https://example.com/devops-portfolio'},\n",
403
+ " {'links': 'https://example.com/xamarin-portfolio'}],\n",
404
+ " [{'links': 'https://example.com/xamarin-portfolio'},\n",
405
+ " {'links': 'https://example.com/wordpress-portfolio'}],\n",
406
+ " [{'links': 'https://example.com/magento-portfolio'},\n",
407
+ " {'links': 'https://example.com/wordpress-portfolio'}]]"
408
+ ]
409
+ },
410
+ "execution_count": 14,
411
+ "metadata": {},
412
+ "output_type": "execute_result"
413
+ }
414
+ ],
415
+ "source": [
416
+ "links = collection.query(query_texts=job['skills'], n_results=2).get('metadatas', [])\n",
417
+ "links"
418
+ ]
419
+ },
420
+ {
421
+ "cell_type": "code",
422
+ "execution_count": 15,
423
+ "id": "8bd36844",
424
+ "metadata": {},
425
+ "outputs": [
426
+ {
427
+ "data": {
428
+ "text/plain": [
429
+ "{'role': 'Software Engineer II, AI/ML Platforms',\n",
430
+ " 'experience': '2+ years professional software development experience',\n",
431
+ " 'skills': ['Strong Computer Science fundamentals',\n",
432
+ " 'Programming experience with at least one modern language such as Java, Python, Golang',\n",
433
+ " 'Experience with Infrastructure as Code / DevOps practices and technologies like Terraform',\n",
434
+ " 'Experience with Cloud services (e.g. AWS Cloud EC2, S3, DynamoDB, Azure Cloud, etc.)',\n",
435
+ " 'Experience developing and using microservices'],\n",
436
+ " 'description': 'We are looking for a Software Engineer II to design and implement core components of our data science services and platform and scale it to serve Nike globally. The focus of this engineer will be at the intersection of computer systems and machine learning. You will also work collaboratively with the data science and analytics teams to ship scalable, performant and reliable solutions.'}"
437
+ ]
438
+ },
439
+ "execution_count": 15,
440
+ "metadata": {},
441
+ "output_type": "execute_result"
442
+ }
443
+ ],
444
+ "source": [
445
+ "job"
446
+ ]
447
+ },
448
+ {
449
+ "cell_type": "code",
450
+ "execution_count": 13,
451
+ "id": "1ccfd720",
452
+ "metadata": {
453
+ "scrolled": false
454
+ },
455
+ "outputs": [
456
+ {
457
+ "data": {
458
+ "text/plain": [
459
+ "['Strong Computer Science fundamentals',\n",
460
+ " 'Programming experience with at least one modern language such as Java, Python, Golang',\n",
461
+ " 'Experience with Infrastructure as Code / DevOps practices and technologies like Terraform',\n",
462
+ " 'Experience with Cloud services (e.g. AWS Cloud EC2, S3, DynamoDB, Azure Cloud, etc.)',\n",
463
+ " 'Experience developing and using microservices']"
464
+ ]
465
+ },
466
+ "execution_count": 13,
467
+ "metadata": {},
468
+ "output_type": "execute_result"
469
+ }
470
+ ],
471
+ "source": [
472
+ "job = json_res\n",
473
+ "job['skills']"
474
+ ]
475
+ },
476
+ {
477
+ "cell_type": "code",
478
+ "execution_count": 16,
479
+ "id": "64a97dd2",
480
+ "metadata": {},
481
+ "outputs": [
482
+ {
483
+ "name": "stdout",
484
+ "output_type": "stream",
485
+ "text": [
486
+ "Subject: Expert AI/ML Solutions for Nike's Data Science Services and Platform\n",
487
+ "\n",
488
+ "Dear Hiring Manager,\n",
489
+ "\n",
490
+ "I came across the job description for a Software Engineer II, AI/ML Platforms at Nike, and I'm excited to introduce AtliQ, a leading AI & Software Consulting company that can help you design and implement core components of your data science services and platform.\n",
491
+ "\n",
492
+ "With our expertise in AI, ML, and software development, we can help you scale your platform to serve Nike globally. Our team of experts has a strong foundation in computer science and experience with modern programming languages such as Java, Python, and Golang. We're well-versed in Infrastructure as Code / DevOps practices and technologies like Terraform, and have hands-on experience with Cloud services like AWS and Azure.\n",
493
+ "\n",
494
+ "Our portfolio showcases our capabilities in developing and deploying scalable, performant, and reliable solutions. I'd like to highlight a few relevant examples:\n",
495
+ "\n",
496
+ "* Our Machine Learning with Python portfolio (https://example.com/ml-python-portfolio) demonstrates our expertise in building predictive models and deploying them on cloud platforms.\n",
497
+ "* Our DevOps portfolio (https://example.com/devops-portfolio) showcases our ability to automate infrastructure provisioning and deployment using Terraform and other tools.\n",
498
+ "\n",
499
+ "At AtliQ, we've empowered numerous enterprises with tailored solutions, fostering scalability, process optimization, cost reduction, and heightened overall efficiency. We're confident that our expertise can help Nike achieve its goals in the AI/ML space.\n",
500
+ "\n",
501
+ "I'd love to schedule a call to discuss how AtliQ can support Nike's data science services and platform. Please let me know if you're available for a quick call this week.\n",
502
+ "\n",
503
+ "Best regards,\n",
504
+ "\n",
505
+ "Mohan\n",
506
+ "Business Development Executive\n",
507
+ "AtliQ\n"
508
+ ]
509
+ }
510
+ ],
511
+ "source": [
512
+ "prompt_email = PromptTemplate.from_template(\n",
513
+ " \"\"\"\n",
514
+ " ### JOB DESCRIPTION:\n",
515
+ " {job_description}\n",
516
+ " \n",
517
+ " ### INSTRUCTION:\n",
518
+ " You are Mohan, a business development executive at AtliQ. AtliQ is an AI & Software Consulting company dedicated to facilitating\n",
519
+ " the seamless integration of business processes through automated tools. \n",
520
+ " Over our experience, we have empowered numerous enterprises with tailored solutions, fostering scalability, \n",
521
+ " process optimization, cost reduction, and heightened overall efficiency. \n",
522
+ " Your job is to write a cold email to the client regarding the job mentioned above describing the capability of AtliQ \n",
523
+ " in fulfilling their needs.\n",
524
+ " Also add the most relevant ones from the following links to showcase Atliq's portfolio: {link_list}\n",
525
+ " Remember you are Mohan, BDE at AtliQ. \n",
526
+ " Do not provide a preamble.\n",
527
+ " ### EMAIL (NO PREAMBLE):\n",
528
+ " \n",
529
+ " \"\"\"\n",
530
+ " )\n",
531
+ "\n",
532
+ "chain_email = prompt_email | llm\n",
533
+ "res = chain_email.invoke({\"job_description\": str(job), \"link_list\": links})\n",
534
+ "print(res.content)"
535
+ ]
536
+ }
537
+ ],
538
+ "metadata": {
539
+ "kernelspec": {
540
+ "display_name": "base",
541
+ "language": "python",
542
+ "name": "python3"
543
+ },
544
+ "language_info": {
545
+ "codemirror_mode": {
546
+ "name": "ipython",
547
+ "version": 3
548
+ },
549
+ "file_extension": ".py",
550
+ "mimetype": "text/x-python",
551
+ "name": "python",
552
+ "nbconvert_exporter": "python",
553
+ "pygments_lexer": "ipython3",
554
+ "version": "3.12.3"
555
+ }
556
+ },
557
+ "nbformat": 4,
558
+ "nbformat_minor": 5
559
+ }
my_portfolio.csv ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "Techstack","Links"
2
+ "React, Node.js, MongoDB","https://example.com/react-portfolio"
3
+ "Angular,.NET, SQL Server","https://example.com/angular-portfolio"
4
+ "Vue.js, Ruby on Rails, PostgreSQL","https://example.com/vue-portfolio"
5
+ "Python, Django, MySQL","https://example.com/python-portfolio"
6
+ "Java, Spring Boot, Oracle","https://example.com/java-portfolio"
7
+ "Flutter, Firebase, GraphQL","https://example.com/flutter-portfolio"
8
+ "WordPress, PHP, MySQL","https://example.com/wordpress-portfolio"
9
+ "Magento, PHP, MySQL","https://example.com/magento-portfolio"
10
+ "React Native, Node.js, MongoDB","https://example.com/react-native-portfolio"
11
+ "iOS, Swift, Core Data","https://example.com/ios-portfolio"
12
+ "Android, Java, Room Persistence","https://example.com/android-portfolio"
13
+ "Kotlin, Android, Firebase","https://example.com/kotlin-android-portfolio"
14
+ "Android TV, Kotlin, Android NDK","https://example.com/android-tv-portfolio"
15
+ "iOS, Swift, ARKit","https://example.com/ios-ar-portfolio"
16
+ "Cross-platform, Xamarin, Azure","https://example.com/xamarin-portfolio"
17
+ "Backend, Kotlin, Spring Boot","https://example.com/kotlin-backend-portfolio"
18
+ "Frontend, TypeScript, Angular","https://example.com/typescript-frontend-portfolio"
19
+ "Full-stack, JavaScript, Express.js","https://example.com/full-stack-js-portfolio"
20
+ "Machine Learning, Python, TensorFlow","https://example.com/ml-python-portfolio"
21
+ "DevOps, Jenkins, Docker","https://example.com/devops-portfolio"
requirements.txt ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ langchain==0.2.14
2
+ langchain-community==0.2.12
3
+ langchain-groq===0.1.9
4
+ unstructured==0.14.6
5
+ selenium==4.21.0
6
+ chromadb==0.5.0
7
+ streamlit==1.35.0
8
+ pandas==2.0.2
9
+ python-dotenv==1.0.0