Skip to content

Commit

Permalink
fix: limit notes to last 10 interactions to avoid too much token error
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorentLvr committed May 2, 2024
1 parent 5fbd41f commit 29557de
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,20 @@
"df_init.head(3)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "a491f3af-5e04-4af2-9c71-7283b003beae",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"df_init = pload(os.path.join(entity_dir, \"growth-engine\", \"2024-04-10\"), file_interactions) \n",
"# messaging_options = get_dict_from_df(df_init, \"MESSAGING_OPTIONS\", \"PEOPLE_PROFILE_URL\", \"messaging_options\", output_dir, force_update=True)\n",
"df_init"
]
},
{
"cell_type": "markdown",
"id": "83626bed-3b7a-448f-b932-a127b642067a",
Expand Down Expand Up @@ -362,7 +376,7 @@
" # Loop on people (LinkedIn URL)\n",
" for p in people:\n",
" tmp_df = df.copy()\n",
" tmp_df = tmp_df[tmp_df[\"PROFILE_URL\"] == p].reset_index(drop=True)\n",
" tmp_df = tmp_df[tmp_df[\"PROFILE_URL\"] == p][:10].reset_index(drop=True)\n",
" interactions = []\n",
" for row in tmp_df.itertuples():\n",
" # Append interaction text to create notes\n",
Expand Down

0 comments on commit 29557de

Please sign in to comment.