Skip to content

Commit

Permalink
feat: test and update plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorentLvr committed Apr 11, 2024
1 parent d786d37 commit 9af24b4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 19 deletions.
12 changes: 10 additions & 2 deletions models/content-engine/__plugin__.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,10 @@
"system_prompt = f\"\"\"\n",
"Act as a Content Assistant who has access to valuable data and insights about the content strategy. \n",
"Your role is to manage and optimize the content, ensuring it reaches the target audience effectively. \n",
"This week '{TW}' the '{entity_name}' published {len(df)} contents and generated and {kpi} {kpi_label}. \n",
"The last 2 weeks '{TW}' & '{LW}' the '{entity_name}' published {len(df)} contents and generated and {kpi} {kpi_label}. \n",
"Here is the list with the post published: {prompt_data}.\n",
"The first message should be about presenting yourself and analyze '{entity_name}' contents published based on best post/topics by {kpi_label}, by date and time with a maximum of 3 bullet points.\n",
"Then, you will display the image inside the markdown of the chat about the evolution of content {kpi_label} over the last 2 weeks: [![Content KPI]({image_url})({image_html})].\n",
"Then, you will display the image inside the markdown of the chat about the evolution of content {kpi_label} over the last 2 weeks: ![Content KPI]({image_url}).\n",
"You must ALWAYS show the image in the first message.\n",
"Be casual, but professional. Wait for the first answer from the user, and then start with the first high-level analysis. \n",
"\"\"\""
Expand Down Expand Up @@ -353,6 +353,14 @@
"print(\"--> Create new chat\")\n",
"Markdown(f\"[Create New Chat](https://naas.ai/chat/use?plugin_url={plugin_url})\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "9adc4d13-42d7-4c82-b7b0-621e1bf1c10e",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
20 changes: 7 additions & 13 deletions models/growth-engine/__plugin__.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@
"entity_index = \"0\"\n",
"entity_dir = pload(os.path.join(naas_data_product.OUTPUTS_PATH, \"entities\", entity_index), \"entity_dir\")\n",
"input_dir = os.path.join(entity_dir, \"growth-engine\", date.today().isoformat())\n",
"input_file = \"people\"\n",
"input_file = \"growth\"\n",
"spreadsheet_url = pload(os.path.join(naas_data_product.OUTPUTS_PATH, \"entities\", entity_index), \"abi_spreadsheet\")\n",
"sheet_name = \"PEOPLE\"\n",
"sheet_name = \"GROWTH\"\n",
"name = \"Growth Assistant\"\n",
"model = \"gpt-4-1106-preview\"\n",
"temperature = 0.5\n",
Expand Down Expand Up @@ -239,7 +239,7 @@
" \n",
"if len(df_content) > 0:\n",
" df_content = df_content[(df_content[\"ENTITY\"] == entity_name) & (df_content[\"SCENARIO\"].isin([TW, LW]))]\n",
" df_content = df_content[[\"TITLE\", \"URL\", \"DATE\"]]\n",
" df_content = df_content[[\"TITLE\", \"URL\", \"DATE\", \"VIEWS\", \"ENGAGEMENTS\"]]\n",
"\n",
"# Transform df to string\n",
"post_data = df_content.to_string()\n",
Expand Down Expand Up @@ -288,23 +288,17 @@
" new_leads = len(df[(df[\"SCENARIO\"] == TW)])\n",
"\n",
" # Filter to not exceed context windowns\n",
" prompt_data = df[(df[\"SCENARIO\"] == TW)]\n",
" columns = [\n",
" 'CREATED_DATE',\n",
" 'FULLNAME',\n",
" 'OCCUPATION',\n",
" 'SENIORITY',\n",
" 'DEPARTMENT',\n",
" 'ORGANIZATION',\n",
" 'INTERACTION_SCORE',\n",
" 'LAST_INTERACTION_DATE',\n",
" 'PROFILE_URL',\n",
" ]\n",
" prompt_data = prompt_data[columns]\n",
" prompt_data = df[columns]\n",
" if len(prompt_data) > 0:\n",
" prompt_data = prompt_data[:100]\n",
" \n",
"print()\n",
"print(f\"- Leads: {total_leads}\")\n",
"print(f\"- New Leads: {new_leads}\")\n",
"print(f\"- Growth data: {len(prompt_data)}\")"
Expand All @@ -330,11 +324,11 @@
"system_prompt = f\"\"\"\n",
"Act as a Growth assistant who has access to a list of interactions from content that enable the user to get marketing qualified contacts.\n",
"Your role is to manage and optimize the list of people who interacted on the content, ensuring to extract only the most qualified contacts to feed the sales representative.\n",
"This week '{TW}' the '{entity_name}' generated {total_leads} leads from them {new_leads} are new thanks to its following posts: {post_data}. \n",
"Here is the list with the highest interaction score: {prompt_data.to_string()}.\n",
"The last 2 weeks '{TW}' & '{LW}' the '{entity_name}' generated {total_leads} new leads ({new_leads} on {TW}) by the following posts published: {post_data}. \n",
"Here is the list of leads with the highest interaction score: {df.to_string()}.\n",
"Please remember the user that you don't have access to all the list due to the limit of the context window.\n",
"The first message should be about presenting yourself and analyze briefly '{entity_name}' new interactions with a maximum of 3 bullet points.\n",
"Then, you will display the image inside the markdown of the chat about the contacts reached over the weeks: [![Contacts Reached]({image_url})({image_html})].\n",
"Then, you will display the image inside the markdown of the chat about the contacts reached over the weeks: ![Contacts Reached]({image_url}).\n",
"You must ALWAYS show the image in the first message.\n",
"Be casual, but professional. Wait for the first answer from the user, and then start with the first high-level analysis. \n",
"\"\"\""
Expand Down
7 changes: 3 additions & 4 deletions models/sales-engine/__plugin__.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,7 @@
" df = df[(df[\"ENTITY\"].str.contains(entity_name)) & (df[\"SCENARIO\"].isin([TW, LW]))]\n",
" \n",
" # Get data\n",
" tmp_df = df[(df[\"SCENARIO\"].isin([TW]))]\n",
" new_deals = len(tmp_df)\n",
" new_deals = len(df)\n",
" if len(df) > 0:\n",
" limit = 0.45\n",
" for row in df.itertuples():\n",
Expand Down Expand Up @@ -281,9 +280,9 @@
"system_prompt = f\"\"\"\n",
"Act as a Sales Assistant who has access to a list of deals generated thanks to your contents published on social media platform. \n",
"Your role is to manage and nurture theses deals, ensuring that they progress through the sales pipeline effectively.\n",
"Begin your conversation by introducing yourself and displaying the image: [![Deals Evolution]({image_url})({image_html})] inside the markdown of the chat that illustrates the evolution of deals over the past two weeks, thanks to the content published by '{entity_name}'. \n",
"Begin your conversation by introducing yourself and displaying the image: ![Deals Evolution]({image_url}) inside the markdown of the chat that illustrates the evolution of deals over the past two weeks, thanks to the content published by '{entity_name}'. \n",
"Next, provide an update on this week's results: \n",
"During this week '{TW}', the content from '{entity_name}' has generated {new_deals} new promising deals.\n",
"The last 2 weeks '{TW}' & '{LW}', the content from '{entity_name}' has generated {new_deals} new promising deals.\n",
"Proceed with a brief analysis of the new deals made this week '{TW}' starting with the deal name and giving details of the people and organization involved in each deal: {sales_data}.\n",
"For the convenience of your sales team, please hyperlink the people fullname and organization name to their respective LinkedIn URL.\n",
"While maintaining a casual yet professional tone, ensure to stick to the requested information and avoid adding unnecessary details.\n",
Expand Down

0 comments on commit 9af24b4

Please sign in to comment.